@font-face {
  font-family: Archivo;
  src: url("assets/archivo-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: #edf0e8;
  --ink: #192f26;
  --body: #384d40;
  --muted: #4b5f54;
  --line: #cbd5c9;
  --paper: #fcfbf4;
  --desk: #e1e8dc;
  --fir: #203e32;
  --fir-hover: #2b5041;
  --on-fir: #f4f6e9;
  --on-fir-muted: #c6d6c9;
  --on-fir-line: #587367;
  --highlight: #d9eaa3;
  --alert-ground: #f3e4c6;
  --alert-ink: #634114;
  --focus: #456e43;
  --gutter: clamp(1rem, 4.4vw, 4rem);
  --measure: 75rem;
  --radius: 0.65rem;
  --fast: 160ms ease-out;
  font-family: Archivo, "Segoe UI", sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, h4, h5, p, ol, ul, dl, dd { margin: 0; }
h1, h2, h3, h4, h5 { line-height: 1.15; }
a { color: inherit; text-underline-offset: 0.24em; }
button { color: inherit; font: inherit; }
img, svg { display: block; flex-shrink: 0; }
svg:not([fill]) { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
::selection { color: var(--ink); background: var(--highlight); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.wrap {
  width: min(var(--measure), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1;
  inset: 0.75rem auto auto 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--paper);
  border-radius: var(--radius);
  translate: 0 -180%;
}

.skip-link:focus { translate: 0; }

.masthead { border-bottom: 1px solid var(--line); }

.masthead-inner, .masthead nav, .wordmark, .repo-link {
  display: flex;
  align-items: center;
}

.masthead-inner {
  justify-content: space-between;
  min-height: 4.5rem;
  gap: 0.75rem;
}

.wordmark {
  gap: 0.65rem;
  font-size: 1.625rem;
  font-weight: 740;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.masthead nav { gap: clamp(0.75rem, 2.4vw, 2rem); }

.masthead a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.masthead nav a {
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.masthead nav a:hover { text-decoration: underline; }
.repo-link { gap: 0.25rem; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
  align-items: end;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding-block: clamp(2.75rem, 4.8vw, 4.5rem) clamp(2.75rem, 4.3vw, 4rem);
}

.intro h1 {
  font-size: clamp(2.5rem, 6.4vw, 5.65rem);
  font-weight: 730;
  letter-spacing: -0.04em;
  line-height: 0.99;
}

.intro-action { padding-bottom: 0.25rem; }

.intro-action p {
  max-width: 34ch;
  font-size: clamp(1rem, 1.55vw, 1.25rem);
  line-height: 1.5;
  color: var(--body);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding: 0.65rem 0.95rem;
  background: var(--fir);
  color: var(--on-fir);
  border-radius: var(--radius);
  font-weight: 650;
  text-decoration: none;
  transition: background var(--fast), transform var(--fast);
}

.primary-action:hover { background: var(--fir-hover); transform: translateY(-2px); }
.primary-action:active { transform: translateY(1px); }
.primary-action svg { color: var(--highlight); }

.demo, .workflow, .sample { scroll-margin-top: 1rem; }
.demo { padding-bottom: clamp(3rem, 7vw, 6rem); }
.noscript-note { margin-bottom: 1rem; color: var(--muted); }

.demo-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.demo-heading h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); letter-spacing: -0.025em; }

.demo-heading p {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.demo-dot {
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid var(--focus);
  border-radius: 50%;
  background: var(--highlight);
}

.sample-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sample-picker button {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}

.sample-picker button:hover { background: var(--desk); }

.sample-picker button[aria-pressed="true"] {
  background: var(--paper);
  border-color: var(--focus);
  box-shadow: inset 0 0 0 1px var(--focus);
}

.sample-picker strong, .sample-picker small { display: block; }
.sample-picker strong { font-weight: 700; }
.sample-picker small { color: var(--muted); font-size: 0.875rem; }

.sample-picker svg {
  flex-shrink: 0;
  color: var(--muted);
}

.sample-picker [aria-pressed="true"] svg { color: var(--ink); }

.sample {
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1.15rem 2.5rem -1.6rem #192f2650;
}

.sample + .sample { margin-top: 1rem; }
.sample-picker:not([hidden]) ~ .sample { margin-top: 0; }

.sample-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 1rem clamp(1rem, 2.7vw, 2rem);
}

.sample-header h3 { font-size: 1.25rem; font-weight: 700; }
.sample-header p { color: var(--muted); font-size: 0.875rem; overflow-wrap: anywhere; }

.review-state {
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  background: var(--desk);
  font-size: 0.8125rem;
  font-weight: 650;
}

.review-state.is-blocked { background: var(--alert-ground); color: var(--alert-ink); }

.comparison {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "source amount" "source review";
  border-top: 1px solid var(--line);
}

.source-pane, .record-summary, .record-details { padding: clamp(1rem, 2.7vw, 2rem); }
.source-pane { grid-area: source; background: var(--desk); }
.pane-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.65rem; min-height: 3.2rem; }
.comparison h4 { font-size: 1.125rem; font-weight: 650; }

.language-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.language-switch button {
  min-height: 2.75rem;
  padding: 0.3rem 0.7rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

.language-switch button:hover, .language-switch [aria-pressed="true"] {
  color: var(--ink);
  background: var(--paper);
}

.language-switch [aria-pressed="true"] { box-shadow: 0 1px 2px #192f2633; }

.paper {
  margin-top: 0.85rem;
  padding: clamp(1rem, 2.7vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 0.65rem 0.8rem -0.8rem #192f2690;
}

.transcript {
  display: grid;
  gap: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.transcript p:first-child {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 750;
}

.transcript p:nth-child(2) { font-weight: 650; }
.transcript p:last-child { margin-top: 0.4rem; color: var(--muted); font-size: 0.875rem; }
.transcript p[id] { scroll-margin-block: 2rem; }
.transcript p:target { background: var(--highlight); box-shadow: 0 0 0 4px var(--highlight); }
.source-note { margin-top: 0.75rem; color: var(--muted); font-size: 0.875rem; }

.record-summary, .record-details {
  --focus: var(--highlight);
  background: var(--fir);
  color: var(--on-fir);
  font-variant-numeric: tabular-nums;
}

.record-summary { grid-area: amount; padding-bottom: 0; }
.record-details { grid-area: review; padding-top: 0.65rem; }

.amount-display { position: relative; margin-top: 1rem; }

.amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.65rem, 3vw, 2.25rem);
  padding-block: 0.85rem;
  border-block: 1px solid var(--on-fir-line);
}

.amount-display svg {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  color: var(--on-fir-muted);
}

.amounts dt, .record-fields dt, .rate-note { color: var(--on-fir-muted); font-size: 0.875rem; }

.amounts dd {
  margin-top: 0.25rem;
  font-size: clamp(1.15rem, 2.3vw, 2.05rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.result-amount { color: var(--highlight); }
.rate-note { margin-top: 0.55rem; }
.amount-source { font-size: 0.875rem; color: var(--highlight); }
.record-fields > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.45rem;
  border-bottom: 1px solid var(--on-fir-line);
}

.record-fields dd { font-weight: 600; overflow-wrap: anywhere; }
.review-note { margin-top: 1.1rem; line-height: 1.5; }
.review-note strong { color: var(--highlight); }

.evidence { margin-top: 1rem; }
.evidence h4 { font-size: 0.875rem; color: var(--on-fir-muted); }

.evidence ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
  padding: 0;
  list-style: none;
}

.evidence a, .underlined {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
  text-decoration-thickness: 1px;
}

.evidence a { font-size: 0.875rem; color: var(--highlight); }
.evidence a:hover, .underlined:hover { text-decoration-thickness: 2px; }

.workflow {
  padding-block: clamp(2.5rem, 6vw, 5rem);
  border-block: 1px solid var(--line);
  background: var(--desk);
}

.workflow-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 6vw, 6rem);
}

.workflow-intro h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  letter-spacing: -0.035em;
}

.workflow-intro p { max-width: 39ch; margin-top: 0.85rem; color: var(--body); }
.workflow-intro a { margin-top: 0.65rem; }

.workflow-steps {
  display: grid;
  list-style: none;
  padding: 0;
  counter-reset: workflow;
  border-top: 1px solid var(--line);
}

.workflow-steps li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
  counter-increment: workflow;
}

.workflow-steps li::before {
  content: counter(workflow, decimal-leading-zero);
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.workflow-steps h3 { font-size: 1.125rem; }
.workflow-steps p { margin-top: 0.35rem; color: var(--body); }

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem 2rem;
}

.footer-note { color: var(--muted); font-size: 0.875rem; }
.site-footer > a { align-self: start; }

@media (max-width: 51rem) {
  .intro, .workflow-inner { grid-template-columns: 1fr; }
  .intro h1 { font-size: clamp(2.5rem, 9.3vw, 4.75rem); }
  .intro-action p { max-width: 45ch; }
  .sample-picker button { gap: 0.35rem; padding-inline: 0.6rem; }
}

@media (max-width: 43rem) {
  .intro { padding-block: 2rem 2.25rem; gap: 1.1rem; }
  .intro-action { padding-bottom: 0; }
  .comparison { grid-template: "amount" "source" "review" / minmax(0, 1fr); }
  .record-summary { padding-bottom: 1rem; }
  .masthead-inner { min-height: 3.75rem; }
  .sample-picker button { min-height: 3.5rem; font-size: 0.875rem; }
  .sample-picker svg, .sample-picker small { display: none; }
  .sample-header { padding-block: 0.8rem; }
  .amounts dd { font-size: clamp(1.15rem, 5vw, 1.8rem); }
}

@media (max-width: 23rem) {
  .masthead nav a { font-size: 0.875rem; }
  .wordmark { font-size: 1.35rem; }
  .wordmark img { width: 29px; height: 29px; }
  .intro { padding-block: 1.2rem 1.4rem; gap: 0.85rem; }
  .intro h1 { font-size: 2.2rem; }
  .intro .primary-action { margin-top: 0.9rem; }
  .sample-picker { gap: 0.25rem; }
  .sample-header { gap: 0.35rem; padding-block: 0.65rem; }
  .amounts { gap: 1.25rem; }
  .amounts dd { font-size: 1.0625rem; }
  .amount-display svg { width: 1rem; height: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  [data-enter] { animation: arrive 420ms cubic-bezier(0.2, 0.75, 0.35, 1) both; }
  .sample-picker:not([hidden]) ~ .sample:not([hidden]) { animation: arrive 220ms ease-out both; }

  @keyframes arrive {
    from { opacity: 0.78; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-action, .sample-picker button { transition: none; }
  .primary-action:hover, .primary-action:active { transform: none; }
}
