:root {
  color-scheme: light;
  /* color — hex/rgba 리터럴은 이 파일에만 존재 */
  --accent: #3B468C;
  --ink: #1A1A1A;
  --muted: #5B6170;
  --grid: #E6E8F0;
  --surface: #F5F6FA;
  --bg: #FFFFFF;
  --shadow-card: 0 1px 2px rgba(26, 26, 26, 0.06), 0 8px 24px rgba(59, 70, 140, 0.08);
  /* type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-hero: clamp(2rem, 1.2rem + 3.2vw, 3rem);
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.6;
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
  /* space (4px 기준) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  /* shape */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --bw: 1px;
  --bw-strong: 1.5px;
  /* layout */
  --container: 1120px;
  --measure: 68ch;
  --gutter: 16px;
  --cell-w: 40px;
  --cell-h: 20px;
  /* motion */
  --dur: 120ms;
}

/* base.css — element defaults, page frame and responsive layout (FE 6, FE 13). Values come from tokens.css only. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
}

h1 {
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--fs-xl);
}

h3 {
  font-size: var(--fs-lg);
}

p,
ul,
ol,
dl,
figure,
table {
  margin: 0;
}

p,
li {
  max-width: var(--measure);
}

ul,
ol {
  padding-inline-start: var(--sp-5);
}

li + li {
  margin-top: var(--sp-2);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a,
code {
  overflow-wrap: anywhere;
}

th code {
  white-space: nowrap;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: var(--bw);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: var(--bw-strong);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9375em;
}

var {
  font-style: italic;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

caption {
  padding-bottom: var(--sp-3);
  color: var(--muted);
  text-align: start;
}

th,
td {
  padding: var(--sp-2) var(--sp-3);
  border: var(--bw) solid var(--grid);
  text-align: start;
  vertical-align: top;
}

thead th,
th[scope="col"] {
  background: var(--surface);
  font-weight: var(--fw-semibold);
}

/* page frame: every direct child of main spans the page and centres its content in the 1120px container */
main {
  display: block;
  padding-bottom: var(--sp-7);
}

main > *,
.site-header,
.site-footer {
  padding-inline: max(var(--gutter), calc((100% - var(--container)) / 2));
}

main > * + * {
  margin-top: var(--sp-7);
}

main > header {
  padding-top: var(--sp-7);
}

main > header > * + *,
main > section > * + * {
  margin-top: var(--sp-4);
}

main > header p {
  color: var(--muted);
  font-size: var(--fs-md);
}

@media (min-width: 768px) {
  main > *,
  .site-header,
  .site-footer {
    padding-inline: max(var(--sp-5), calc((100% - var(--container)) / 2));
  }
}

@media (min-width: 1024px) {
  main {
    padding-bottom: var(--sp-9);
  }

  main > *,
  .site-header,
  .site-footer {
    padding-inline: max(var(--sp-6), calc((100% - var(--container)) / 2));
  }

  main > * + * {
    margin-top: var(--sp-9);
  }

  main > header {
    padding-top: var(--sp-8);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}

/* components.css — FE 7 component catalogue CP-01..CP-20. Class names are the catalogue's; values come from tokens.css. */

/* CP-01 Skip link */
.skip {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur) ease-out;
}

.skip:focus {
  transform: none;
}

/* CP-02 Site header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: var(--sp-5);
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: var(--bw) solid var(--grid);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  color: var(--ink);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li + li {
  margin-top: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--sp-2);
  color: var(--ink);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: var(--bw-strong);
  text-underline-offset: 0.3em;
}

.nav a[aria-current="page"] {
  color: var(--accent);
}

/* base width: navigation wraps to its own row under the brand (FE 6) */
.nav {
  flex-basis: 100%;
}

.nav ul {
  margin-inline-start: calc(-1 * var(--sp-2));
}

@media (min-width: 768px) {
  .nav {
    flex-basis: auto;
  }

  .nav ul {
    margin-inline-start: 0;
  }
}

/* CP-03 Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--sp-5);
  border: var(--bw-strong) solid transparent;
  border-radius: var(--r-md);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  text-align: center;
  text-decoration: none;
  transition: background-color var(--dur) ease-out, transform var(--dur) ease-out;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--ink);
  text-decoration: none;
}

.btn--secondary {
  border-color: var(--accent);
  background: var(--bg);
  color: var(--accent);
}

.btn--secondary:hover {
  background: var(--grid);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--lg {
  min-height: 52px;
  padding: 0 var(--sp-6);
  font-size: var(--fs-md);
}

/* CP-04 Hero — grid texture is the 40x20 spreadsheet cell drawn in Lattice */
.hero {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-8);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) var(--bw), transparent var(--bw)),
    linear-gradient(90deg, var(--grid) var(--bw), transparent var(--bw));
  background-size: var(--cell-w) var(--cell-h);
  background-position: center top;
  border-bottom: var(--bw) solid var(--grid);
  text-align: center;
}

.hero > * {
  margin-inline: auto;
}

.hero > * + * {
  margin-top: var(--sp-5);
}

.eyebrow {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
}

.hero__line {
  display: block;
}

.accent {
  color: var(--accent);
}

.hero h1 + p {
  max-width: 34rem;
  font-size: var(--fs-md);
}

.hero p:has(.btn) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
}

.hero > p:last-child {
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* the sheet card sits close under the hero at every width */
main > .hero + * {
  margin-top: var(--sp-7);
}

@media (min-width: 1024px) {
  .hero {
    padding-top: var(--sp-9);
    padding-bottom: var(--sp-9);
  }
}

/* CP-05 Sheet card — an HTML table dressed as one tab of a spreadsheet */
.sheet-card {
  max-width: 44rem;
  margin-inline: auto;
}

.sheet-card figcaption {
  display: inline-block;
  padding: var(--sp-1) var(--sp-4);
  border: var(--bw) solid var(--grid);
  border-bottom: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--bg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.sheet-card table {
  border: var(--bw) solid var(--grid);
  box-shadow: var(--shadow-card);
  background: var(--bg);
}

.sheet-card caption {
  caption-side: bottom;
  padding-top: var(--sp-3);
  padding-bottom: 0;
  font-size: var(--fs-sm);
}

.sheet-card th,
.sheet-card td {
  padding-inline: var(--sp-2);
}

.sheet-card td:nth-child(-n+3) {
  white-space: nowrap;
}

.sheet-card th:nth-child(2),
.sheet-card td:nth-child(2) {
  display: none;
}

.sheet-card th:nth-child(3),
.sheet-card td:nth-child(3) {
  text-align: end;
}

.sheet-card tfoot td {
  background: var(--surface);
  font-weight: var(--fw-semibold);
}

@media (min-width: 480px) {
  .sheet-card th,
  .sheet-card td {
    padding-inline: var(--sp-3);
  }

  .sheet-card th:nth-child(2),
  .sheet-card td:nth-child(2) {
    display: table-cell;
  }
}

/* #templates — left title and intro, right product cards */
#templates {
  display: grid;
  gap: var(--sp-5);
}

#templates > div + div {
  margin-top: 0;
}

#templates > div:last-child {
  display: grid;
  gap: var(--sp-5);
  align-items: start;
}

@media (min-width: 768px) {
  #templates > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #templates {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--sp-7);
  }
}

/* CP-06 Product card */
.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: var(--bw) solid var(--grid);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}

.product-card--free {
  border: var(--bw-strong) dashed var(--muted);
  box-shadow: none;
}

.product-card > p:first-of-type {
  color: var(--muted);
}

.product-card strong {
  display: block;
  color: var(--ink);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.product-card strong + * {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.product-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* "Your data stays in your spreadsheet" — three short items */
#your-data > div {
  display: grid;
  gap: var(--sp-5);
}

#your-data > div > div > * + * {
  margin-top: var(--sp-2);
}

@media (min-width: 768px) {
  #your-data > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--sp-6);
  }
}

/* CP-07 Buy box — product page: 7-column body + 5-column sticky box from lg (DOM order = visual order) */
.buybox {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  padding-bottom: var(--sp-5);
  border-block: var(--bw) solid var(--grid);
}

.buybox > p:first-child strong {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.buybox > p:first-child {
  color: var(--muted);
}

.buybox > p:last-child {
  color: var(--muted);
  font-size: var(--fs-sm);
}

@media (min-width: 1024px) {
  main:has(> .buybox) {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--sp-8);
    align-items: start;
    padding-inline: max(var(--sp-6), calc((100% - var(--container)) / 2));
  }

  main:has(> .buybox) > * {
    grid-column: 1;
    padding-inline: 0;
  }

  main:has(> .buybox) > .buybox {
    position: sticky;
    top: var(--sp-5);
    grid-column: 2;
    grid-row: 1 / span 12;
    margin-top: var(--sp-8);
    padding: var(--sp-5);
    border: var(--bw) solid var(--grid);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
  }
}

/* CP-08 Checklist — the tick is a CSS border drawing, not a glyph */
.checklist {
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-inline-start: var(--sp-6);
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 0.35em;
  left: var(--sp-1);
  width: 0.4em;
  height: 0.75em;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

/* CP-09 Steps */
.steps {
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 2rem;
  padding-inline-start: calc(2rem + var(--sp-3));
  counter-increment: step;
}

.steps li + li {
  margin-top: var(--sp-3);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: var(--bw-strong) solid var(--accent);
  border-radius: var(--r-pill);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  line-height: 1;
}

/* CP-10 Tab table */
.tab-table th[scope="row"] {
  width: 30%;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

/* CP-11 FAQ */
.faq {
  border-top: var(--bw) solid var(--grid);
}

.faq details {
  border-bottom: var(--bw) solid var(--grid);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 44px;
  padding: var(--sp-3) 0;
  font-weight: var(--fw-semibold);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-size: var(--fs-xl);
  font-weight: var(--fw-regular);
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > :not(summary) {
  padding-bottom: var(--sp-4);
}

/* CP-12 Notice */
.notice {
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

/* CP-13 Figure */
.shot img {
  border: var(--bw) solid var(--grid);
}

.shot figcaption {
  margin-top: var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* CP-14 Breadcrumb */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}

.crumbs li + li {
  margin-top: 0;
}

.crumbs li + li::before {
  content: "\203A";
  margin-inline-end: var(--sp-2);
  color: var(--muted);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.crumbs [aria-current="page"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
}

/* CP-15 Formula block */
.formula {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--surface);
  white-space: pre-wrap;
  user-select: all;
}

/* CP-16 Legal layout — H1 and version line, contents, sections, change history. Text stays at 68ch; tables may use the container */
.legal {
  padding-top: var(--sp-7);
}

.legal > * + * {
  margin-top: var(--sp-6);
}

.legal > header > * + * {
  margin-top: var(--sp-3);
}

.legal > header p {
  color: var(--muted);
}

.legal > .toc {
  max-width: var(--measure);
}

.legal caption {
  color: var(--ink);
}

@media (min-width: 1024px) {
  .legal {
    padding-top: var(--sp-8);
  }
}

.legal h2 {
  padding: var(--sp-1) var(--sp-2);
  margin-inline: calc(-1 * var(--sp-2));
  border-radius: var(--r-sm);
  scroll-margin-top: var(--sp-5);
}

.legal section:target h2,
.legal h2:target {
  background: var(--surface);
}

.legal section > * + * {
  margin-top: var(--sp-3);
}

.legal table {
  margin-top: var(--sp-3);
}

/* a wide legal table scrolls inside its own region, never the page (FE-LAY-01); the region is keyboard-focusable */
.legal [role="region"] {
  overflow-x: auto;
}

.legal [role="region"] table {
  min-width: 40rem;
}

.toc {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--surface);
}

.toc > p {
  font-weight: var(--fw-semibold);
}

.toc ol {
  margin-top: var(--sp-2);
}

.toc li + li {
  margin-top: 0;
}

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* CP-17 Facts list */
.facts {
  display: grid;
  border-top: var(--bw) solid var(--grid);
}

.facts > div {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-3) 0;
  border-bottom: var(--bw) solid var(--grid);
}

.facts dt {
  font-weight: var(--fw-semibold);
}

.facts dd {
  margin: 0;
}

@media (min-width: 768px) {
  .facts > div {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    column-gap: var(--sp-5);
  }
}

/* CP-18 Site footer */
.site-footer {
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-7);
  border-top: var(--bw) solid var(--grid);
  background: var(--surface);
  font-size: var(--fs-sm);
}

.site-footer > * + * {
  margin-top: var(--sp-4);
}

.site-footer nav {
  display: grid;
  gap: var(--sp-5);
}

.site-footer h2 {
  font-size: var(--fs-base);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-4);
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  font-size: var(--fs-base);
}

.site-footer p {
  color: var(--muted);
}

@media (min-width: 768px) {
  .site-footer nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* CP-19 Status pill — the word itself carries the state; only Overdue uses the accent fill */
.pill {
  display: inline-block;
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--grid);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.pill--overdue {
  background: var(--accent);
  color: var(--bg);
}

/* CP-20 Article layout */
.article {
  max-width: var(--measure);
}

.article > * + * {
  margin-top: var(--sp-5);
}

.answer {
  padding: var(--sp-4) var(--sp-5);
  border: var(--bw) solid var(--grid);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: var(--fs-md);
}
