:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --ink: #1c1c19;
  --muted: #67645d;
  --line: #c9c3b7;
  --red: #d7462b;
  --red-dark: #ad321e;
  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "IBM Plex Sans", Arial, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, select { font: inherit; }
button, a { color: inherit; -webkit-tap-highlight-color: transparent; }
.page-width { width: min(940px, calc(100% - 40px)); margin-inline: auto; }

.site-header { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink); }
.brand { font: italic 16px/1 var(--serif); text-decoration: none; }
.plain-button { border: 0; border-bottom: 1px solid currentColor; padding: 2px 0; background: transparent; font-size: 12px; cursor: pointer; }
.plain-button:hover { color: var(--red); }

.hero { padding: 76px 0 92px; }
.kicker { margin: 0 0 18px; color: var(--red); font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
h1 { max-width: 820px; margin: 0; font: 400 clamp(52px, 9vw, 94px)/.98 var(--serif); letter-spacing: -.055em; }
.intro { max-width: 570px; margin: 26px 0 40px; color: var(--muted); font-size: 17px; line-height: 1.6; }

.decoder { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px 18px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 24px 0 20px; }
.decoder label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
.decoder label span { color: var(--muted); font-weight: 400; }
.number-field input, .context-field select { width: 100%; height: 64px; border: 1px solid var(--ink); border-radius: 0; outline: none; background: #faf8f2; color: var(--ink); }
.number-field input { padding: 8px 16px; font: 500 31px/1 var(--mono); letter-spacing: .04em; }
.context-field select { appearance: none; padding: 0 42px 0 14px; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 28px, calc(100% - 12px) 28px; background-size: 6px 6px; background-repeat: no-repeat; font-size: 14px; }
.number-field input:focus, .context-field select:focus { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--red); }
.number-field input[aria-invalid="true"] { border-color: var(--red); }
.field-hint { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.decode-button { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-height: 56px; border: 0; padding: 0 18px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; }
.decode-button:hover { background: var(--red-dark); }
.decode-button span { font-size: 22px; font-weight: 400; }
.examples { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 11px; }
.examples button { border: 0; border-bottom: 1px solid var(--line); padding: 1px 0; background: transparent; cursor: pointer; font: 400 11px/1.4 var(--mono); }
.examples button:hover { border-color: var(--red); color: var(--red); }

.results { border-top: 1px solid var(--ink); background: #faf8f2; }
.result-wrap { width: min(940px, calc(100% - 40px)); margin-inline: auto; padding: 70px 0 86px; animation: reveal .35s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
.result-top { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 58px; }
.result-number { font: 400 clamp(58px, 10vw, 108px)/.85 var(--serif); letter-spacing: -.07em; overflow-wrap: anywhere; }
.result-type { display: block; margin-top: 20px; color: var(--red); font: 500 10px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.answer-label { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.result-answer h2 { margin: 0 0 18px; font: 400 clamp(32px, 5vw, 52px)/1.08 var(--serif); letter-spacing: -.035em; }
.result-summary { max-width: 620px; margin: 0; font-size: 17px; line-height: 1.65; }
.calculation { margin: 20px 0 0; color: var(--muted); font: 400 11px/1.6 var(--mono); }

.guidance { display: grid; grid-template-columns: 1fr 1fr; margin: 48px 0 0 278px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.guidance > div { padding: 22px 24px 24px 0; }
.guidance > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
.guidance span { display: block; margin-bottom: 10px; color: var(--red); font: 500 10px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.guidance p { margin: 0; font-size: 14px; line-height: 1.65; }

.takeaway { display: grid; grid-template-columns: 170px 1fr; column-gap: 50px; margin: 28px 0 0 278px; border-bottom: 1px solid var(--line); padding: 0 0 24px; }
.takeaway h3 { grid-row: 1 / 3; margin: 0; font-size: 12px; }
.takeaway > p { margin: 0; color: #45433e; font-size: 14px; line-height: 1.7; }
.takeaway .context-question { margin-top: 14px; border-left: 3px solid var(--red); padding-left: 14px; color: var(--ink); font: italic 17px/1.55 var(--serif); }

.deeper { margin: 52px 0 0 278px; }
.deeper > h3 { margin: 0 0 8px; font: 400 26px/1.2 var(--serif); }
.deeper > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.lens { border-top: 1px solid var(--line); }
.lens:last-child { border-bottom: 1px solid var(--line); }
.lens summary { display: grid; grid-template-columns: 180px 1fr 20px; gap: 20px; align-items: baseline; padding: 18px 0; list-style: none; cursor: pointer; }
.lens summary::-webkit-details-marker { display: none; }
.lens summary::after { content: "+"; justify-self: end; color: var(--red); font: 500 16px/1 var(--mono); }
.lens[open] summary::after { content: "−"; }
.lens-name { font-size: 12px; font-weight: 600; }
.lens-title { color: var(--muted); font: 400 15px/1.35 var(--serif); }
.lens-content { max-width: 610px; margin: -3px 0 0 200px; padding: 0 0 22px; }
.lens-content p { margin: 0; color: #45433e; font-size: 13px; line-height: 1.7; }
.lens-note { margin-top: 10px !important; color: var(--muted) !important; font-size: 11px !important; }
.result-note { max-width: 610px; margin: 28px 0 0 278px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.short-note { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; padding: 52px 0; border-bottom: 1px solid var(--ink); }
.short-note p { margin: 0; font: 400 20px/1.5 var(--serif); }
.site-footer { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 30px; font-size: 11px; }
.site-footer p { margin: 0; font: italic 14px/1 var(--serif); }

dialog { width: min(650px, calc(100% - 28px)); max-height: 86vh; overflow: auto; border: 1px solid var(--ink); border-radius: 0; padding: 0; background: var(--paper); color: var(--ink); box-shadow: 10px 10px 0 rgba(28, 28, 25, .18); }
dialog::backdrop { background: rgba(28, 28, 25, .55); }
.dialog-inner { position: relative; padding: 46px; }
.dialog-close { position: absolute; top: 20px; right: 22px; border: 0; border-bottom: 1px solid currentColor; padding: 1px 0; background: transparent; font-size: 11px; cursor: pointer; }
.dialog-inner h2 { max-width: 500px; margin: 0 0 24px; font: 400 36px/1.16 var(--serif); letter-spacing: -.025em; }
.dialog-inner h3 { margin: 30px 0 10px; font-size: 13px; }
.dialog-inner p, .dialog-inner li { font-size: 13px; line-height: 1.65; }
.dialog-inner ul { padding-left: 20px; }
.dialog-inner li + li { margin-top: 7px; }
.history-note { border-left: 3px solid var(--red); padding-left: 16px; }
.source-list a { text-underline-offset: 3px; }
.source-list a:hover { color: var(--red); }

@media (max-width: 760px) {
  .hero { padding: 54px 0 64px; }
  .decoder { grid-template-columns: 1fr; }
  .decode-button, .examples { grid-column: auto; }
  .result-wrap { padding-block: 54px 66px; }
  .result-top { grid-template-columns: 1fr; gap: 32px; }
  .result-number { font-size: clamp(60px, 22vw, 92px); }
  .result-type { margin-top: 12px; }
  .guidance, .takeaway, .deeper, .result-note { margin-left: 0; }
}

@media (max-width: 520px) {
  .page-width, .result-wrap { width: min(100% - 28px, 940px); }
  .site-header { height: 62px; }
  .brand { font-size: 14px; }
  .site-header .plain-button { font-size: 10px; }
  h1 { font-size: clamp(47px, 14vw, 68px); }
  .intro { font-size: 15px; }
  .guidance { grid-template-columns: 1fr; }
  .guidance > div { padding-right: 0; }
  .guidance > div + div { border-top: 1px solid var(--line); border-left: 0; padding-left: 0; }
  .takeaway { grid-template-columns: 1fr; gap: 10px; }
  .takeaway h3 { grid-row: auto; }
  .lens summary { grid-template-columns: 1fr 20px; gap: 8px; }
  .lens-title { grid-column: 1; }
  .lens summary::after { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .lens-content { margin-left: 0; }
  .short-note { grid-template-columns: 1fr; gap: 18px; padding-block: 38px; }
  .short-note p { font-size: 17px; }
  .dialog-inner { padding: 40px 24px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
