/* The site's UI kit (office ADR 0040). Every color, font size, spacing value, and radius on the site
   is a token here, and every button, link, and input is a class here. Pages add layout only, from tokens.
   Colors and type: office repo, docs/identity.md. /kit/ shows every component in every state.
   The .is-hover, .is-focus, and .is-active classes force a state for the kit page and nothing else. */

/* ---------- Tokens ---------- */
:root {
  --chartreuse: #C4E538;
  --ink: #1F2126;
  --paper: #F3F3F0;
  --mute: #6B6E76;
  --line: #D8D8D3;
  --white: #FFFFFF;

  --font: Archivo, system-ui, sans-serif;
  --mono: ui-monospace, Menlo, monospace;
  --text-xs: 13px;
  --text-sm: 15px;
  --text-md: 17px;
  --text-lg: 20px;
  --text-xl: 24px;
  --display-sm: clamp(30px, 3.4vw, 48px);
  --display-md: clamp(36px, 5.5vw, 76px);
  --display-lg: clamp(44px, 9vw, 112px);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --gutter: clamp(var(--space-4), 5vw, var(--space-8));

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --stroke: 3px;
  --stroke-thin: 2px;
  --hairline: 1px;
  --lift: 4px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font: 400 var(--text-md)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font-family: inherit; }
h1, h2, h3 { margin: 0; }
p { text-wrap: pretty; }
::selection { background: var(--chartreuse); color: var(--ink); }
:focus-visible { outline: var(--stroke) solid var(--ink); outline-offset: var(--stroke); }
.is-focus { outline: var(--stroke) solid var(--ink); outline-offset: var(--stroke); }
code {
  font: 500 .92em var(--mono); background: var(--white);
  border: var(--hairline) solid var(--line); border-radius: var(--radius-sm); padding: 0 var(--space-1);
}

/* Type. Headlines are 800 weight at 88% width (identity.md). */
.display-lg, .display-md, .display-sm {
  font-weight: 800; font-stretch: 88%; letter-spacing: -.025em; line-height: .98;
}
.display-lg { font-size: var(--display-lg); }
.display-md { font-size: var(--display-md); }
.display-sm { font-size: var(--display-sm); }
.title { font-size: var(--text-xl); font-weight: 700; font-stretch: 94%; line-height: 1.2; }
.title-sm { font-size: var(--text-lg); font-weight: 800; font-stretch: 88%; line-height: 1.2; }
.kicker { font-size: var(--text-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.muted { color: var(--mute); }

/* ---------- Spinner, shared by the busy button and the busy note ---------- */
@keyframes kit-spin { to { transform: rotate(360deg); } }
.btn[data-state="busy"]::before, .note[data-state="busy"]::before {
  content: ""; display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: -.15em;
  margin-right: var(--space-2); border-radius: 50%;
  border: var(--stroke) solid currentColor; border-right-color: transparent;
  animation: kit-spin .7s linear infinite;
}

/* ---------- Link ----------
   Every <a> is a link. Hover lays chartreuse under the words, pressed turns them over. */
a {
  color: var(--ink); border-radius: var(--radius-sm);
  text-decoration: underline var(--stroke) var(--chartreuse); text-underline-offset: var(--space-1);
  transition: background-color .15s, color .15s;
}
a:hover, a.is-hover { background: var(--chartreuse); text-decoration-color: var(--ink); }
a:active, a.is-active { background: var(--ink); color: var(--paper); text-decoration-color: var(--chartreuse); }
a[aria-disabled="true"] { color: var(--mute); text-decoration: none; background: none; pointer-events: none; }
/* Quiet links sit in headers and footers: gray until touched. */
.link-quiet { color: var(--mute); text-decoration-color: transparent; }
.link-quiet:hover, .link-quiet.is-hover { color: var(--ink); background: none; text-decoration-color: var(--chartreuse); }
.link-quiet:active, .link-quiet.is-active { color: var(--paper); background: var(--ink); }

/* The wordmark as a home link tips over on hover and sinks when pressed. */
a.mark-link { display: inline-block; background: none; transition: transform .25s var(--spring); }
a.mark-link:hover, a.mark-link.is-hover { transform: rotate(-3deg); }
a.mark-link:active, a.mark-link.is-active { transform: rotate(-3deg) scale(.94); }

/* ---------- Button ----------
   .btn is the white button, .btn-primary the one main action on a screen, .btn-sm the small one.
   data-state="busy" while it waits (set it with disabled), "success" when that worked.
   aria-pressed="true" marks a toggle that is on. */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font: 800 var(--text-md)/1 var(--font); white-space: nowrap; cursor: pointer;
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-pill);
  border: var(--stroke) solid var(--ink); background: var(--white); color: var(--ink);
  box-shadow: var(--lift) var(--lift) 0 var(--ink);
  transition: transform .15s, box-shadow .15s, background-color .2s, color .2s;
}
.btn > span { display: block; margin-top: var(--space-1); font-size: var(--text-xs); font-weight: 700; }
.btn-primary { background: var(--chartreuse); }
.btn-sm { font-size: var(--text-sm); padding: var(--space-2) var(--space-4); --lift: 3px; }
.btn:hover:enabled, .btn.is-hover { transform: translate(-2px, -2px); box-shadow: calc(var(--lift) + 2px) calc(var(--lift) + 2px) 0 var(--ink); }
.btn:active:enabled, .btn.is-active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn:disabled { cursor: not-allowed; background: var(--paper); color: var(--mute); border-color: var(--mute); box-shadow: none; }
/* Busy keeps its look, so the button reads as working, not as off. Busy and success put a mark
   beside the label, which stays stacked, so the button barely changes width. */
.btn[data-state] { display: inline-grid; grid-template-columns: auto auto; column-gap: var(--space-2); justify-items: center; }
.btn[data-state]::before { align-self: center; margin: 0; }
.btn[data-state]:has(> span)::before { grid-row: span 2; }
.btn[data-state="busy"] { cursor: progress; background: var(--white); color: var(--ink); border-color: var(--ink); box-shadow: var(--lift) var(--lift) 0 var(--ink); }
.btn-primary[data-state="busy"] { background: var(--chartreuse); }
/* Success and on are ink with paper words. Chartreuse marks only the check, never the words (identity.md). */
.btn[data-state="success"] { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: none; }
.btn[data-state="success"]::before { content: "✓"; color: var(--chartreuse); }

/* ---------- Input ----------
   aria-invalid="true" after a wrong value: the border breaks into dashes until the next keystroke. */
.input {
  min-width: 0; font: 800 var(--text-xl)/1 var(--font); font-stretch: 88%; letter-spacing: .14em;
  text-transform: uppercase; text-align: center; color: var(--ink); background: var(--white);
  padding: var(--space-4) var(--space-3); border: var(--stroke) solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--lift) var(--lift) 0 var(--ink); transition: box-shadow .15s, transform .15s;
}
.input::placeholder { color: var(--line); }
.input:disabled { cursor: not-allowed; color: var(--mute); background: var(--paper); border-color: var(--mute); box-shadow: none; }
.input:hover:enabled:not(:focus), .input.is-hover { transform: translate(-2px, -2px); box-shadow: calc(var(--lift) + 2px) calc(var(--lift) + 2px) 0 var(--ink); }
.input:focus, .input.is-focus { outline: var(--stroke) solid var(--ink); outline-offset: calc(var(--lift) + var(--stroke)); }
.input:active:enabled, .input.is-active { transform: translate(1px, 1px); }
.input[aria-invalid="true"] { border-style: dashed; }

/* ---------- Note ----------
   One line under a form that says what happened. A second <span> carries the other language. */
.note { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; color: var(--ink); text-align: left; }
.note > * > span { display: block; color: var(--mute); }
.note::before { flex: none; }
.note[data-state="busy"] { color: var(--mute); }
.note[data-state="busy"]::before { margin: .25em 0 0; }
.note[data-state="error"]::before, .note[data-state="success"]::before {
  display: grid; place-items: center; width: 1.4em; height: 1.4em; margin-top: .05em; border-radius: 50%;
  font-weight: 900; font-size: var(--text-sm); border: var(--stroke-thin) solid var(--ink);
}
.note[data-state="error"]::before { content: "!"; background: var(--ink); color: var(--paper); }
.note[data-state="success"]::before { content: "✓"; background: var(--chartreuse); color: var(--ink); }

/* ---------- Chip ----------
   A small round tab, used for the onboarding map. aria-current marks where you are. */
.chip {
  font: 700 var(--text-xs)/1 var(--font); letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill);
  color: var(--mute); background: none; border: var(--stroke-thin) solid transparent;
  transition: color .2s, background-color .2s, border-color .2s, transform .1s;
}
.chip:hover:enabled, .chip.is-hover { color: var(--ink); background: var(--white); border-color: var(--line); }
.chip:active:enabled, .chip.is-active { transform: translateY(1px); background: var(--line); }
.chip[aria-current] { color: var(--ink); background: var(--chartreuse); border-color: var(--ink); }
.chip:disabled { cursor: not-allowed; color: var(--line); border-color: var(--line); border-style: dashed; }

/* ---------- Card ----------
   A white box with the ink shadow. .is-done turns it chartreuse. */
.card {
  background: var(--white); border: var(--stroke) solid var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--lift) var(--lift) 0 var(--ink); padding: var(--space-4);
  transition: background-color .3s;
}
.card.is-done { background: var(--chartreuse); }
.card.is-done a:not(:hover) { text-decoration-color: var(--ink); }

/* ---------- Page shell for the plain pages: header, main, footer ---------- */
.shell {
  margin: 0 auto; max-width: 1080px; min-height: 100svh; display: flex; flex-direction: column;
  padding: clamp(var(--space-5), 4vw, var(--space-6)) var(--gutter);
}
.shell-header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.shell-header img { display: block; height: clamp(40px, 6vw, 56px); width: auto; }
.shell-header a { font-size: var(--text-sm); }
.shell-footer { color: var(--mute); font-size: var(--text-xs); }
