/* AUTOFOMO · below the fold. A merchant's ledger on the lagoon flood: hairline rules instead of boxes,
 * Roman numerals, Cardo numerals for every figure, one parchment band for the contract. */

.sec { position: relative; border-top: 1px solid var(--hairline); padding-block: clamp(72px, 9vw, 128px); }
.sec__in { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { display: flex; align-items: baseline; gap: 12px; margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-75); }
.eyebrow b { font-family: var(--font-display); font-weight: 400; font-size: 17px; letter-spacing: 0; color: var(--ink); }
.h2 { margin: 18px 0 0; max-width: 17ch; font-family: var(--font-display); font-weight: 400; font-size: clamp(2.3rem, 4.6vw, 4.25rem); line-height: 1.02; letter-spacing: -0.015em; }
.h2 em { font-style: italic; color: var(--ink-92); }
.note { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-75); }
.note a { color: var(--ink-75); text-decoration: underline; text-underline-offset: 3px; }
.note--wide { margin-top: 28px; max-width: 52rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease-out, transform 700ms ease-out; }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- I. the machine ---------- */
.machine { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.rules { list-style: none; margin: 40px 0 0; padding: 0; }
.rule { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 20px 0; border-top: 1px solid var(--hairline); opacity: 0.5; transition: opacity 400ms ease-out; }
.rule:last-child { border-bottom: 1px solid var(--hairline); }
.rule.is-on { opacity: 1; }
.rule__num { font-family: var(--font-display); font-size: 38px; line-height: 0.9; }
.rule h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.rule p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-75); }
.machine__stage { margin: 0; position: sticky; top: 88px; }

.inst { overflow: hidden; border-radius: 20px; background: var(--surface); color: var(--dark); box-shadow: var(--shadow-float); }
.inst__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--slate-hairline); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dark-muted); }
.inst__dots { display: inline-flex; gap: 6px; }
.inst__dots i { width: 9px; height: 9px; border-radius: 999px; background: var(--slate-hairline); }
.inst__live { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); }
.inst__live::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.inst__stage { display: grid; gap: 16px; padding: 18px; }
.inst__stage > * { min-width: 0; }
.m-label { margin: 0 0 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dark-muted); }

.m-thesis { padding: 14px; border-radius: 14px; background: var(--slate-fill); }
.m-thesis__head { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; font-size: 13px; white-space: nowrap; }
.m-thesis__head strong { font-weight: 600; }
.m-thesis__where { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--dark-muted); }
.m-thesis__text { min-height: 44px; margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--dark-80); }
.m-thesis__text code { padding: 1px 6px; border-radius: 6px; background: rgba(67, 83, 255, 0.1); color: var(--fomo-blue); font-family: var(--font-mono); font-size: 12.5px; }
.m-caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--dark-60); animation: blink 1s steps(1) infinite; }

.m-gates { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.m-gate { display: grid; justify-items: center; gap: 4px; padding: 10px 2px 8px; border: 1px solid var(--slate-hairline); border-radius: 12px; color: var(--dark-muted); text-align: center; transition: background-color 200ms, color 200ms, border-color 200ms, opacity 200ms; }
.m-gate__num { font-family: var(--font-display); font-size: 18px; line-height: 1; }
.m-gate__label { font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; }
.m-gate.is-check { border-color: var(--brand); color: var(--brand); }
.m-gate.is-pass { background: rgba(15, 122, 79, 0.08); border-color: rgba(15, 122, 79, 0.35); color: var(--up); }
.m-gate.is-stop { background: rgba(180, 50, 42, 0.1); border-color: rgba(180, 50, 42, 0.5); color: var(--down); animation: shake 400ms ease-out; }
.m-gate.is-skip { opacity: 0.35; }
@keyframes shake { 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }

.m-trade { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; transition: opacity 400ms ease-out; }
.m-trade.is-idle { opacity: 0.4; }
.m-buy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--dark-60); }
.m-buy strong { font-family: var(--font-display); font-size: 22px; font-weight: 400; color: var(--dark); }
.m-chart { position: relative; height: 170px; border-radius: 12px; background: linear-gradient(var(--slate-fill), transparent); }
.m-chart canvas { display: block; width: 100%; height: 100%; }
.m-result { display: grid; gap: 10px; min-height: 64px; }
.m-verdict { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: 14px; font-weight: 600; }
.m-verdict b { font-family: var(--font-display); font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums; }
.m-verdict--won b { color: var(--up); }
.m-verdict--lost b, .m-verdict--stop { color: var(--down); }
.m-split { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 4px; }
.m-split div { padding: 8px 10px; border-radius: 10px; font-size: 11px; line-height: 1.3; transform-origin: left; animation: grow 600ms ease-out both; }
.m-split div:nth-child(2) { animation-delay: 150ms; }
.m-split div:nth-child(3) { animation-delay: 300ms; }
.m-split strong { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 400; }
.m-split .you { background: var(--brand); color: var(--ink); }
.m-split .bb { background: rgba(var(--brand-rgb) / 0.14); color: var(--brand-deep); }
.m-split .fd { background: var(--slate-fill); color: var(--dark-80); }
@keyframes grow { from { transform: scaleX(0.2); opacity: 0; } }
.m-quiet { margin: 0; font-size: 12.5px; color: var(--dark-60); }

/* ---------- II. the gates ---------- */
.gates__head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; }
.bignum { display: flex; align-items: baseline; gap: 6px; margin: 0; font-family: var(--font-display); font-size: clamp(4.5rem, 9vw, 8.5rem); line-height: 0.85; letter-spacing: -0.03em; }
.bignum small { font-size: 0.42em; color: var(--ink-75); letter-spacing: 0; }
.gates__caption { max-width: 26rem; margin: 14px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-75); }
.gates__caption span { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-75); }
.gates { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; margin-top: 48px; align-items: start; }
.census__grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.tile { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; border-radius: 10px; font-size: 10px; font-weight: 600; transition: opacity 200ms, transform 200ms, box-shadow 200ms; }
.tile span { max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile--ok { background: var(--ink); color: var(--brand); }
.tile--stop { border: 1px solid rgba(255, 255, 255, 0.5); color: var(--ink); font-family: var(--font-display); font-size: 15px; font-weight: 400; }
.tile--none { border: 1px dashed rgba(255, 255, 255, 0.28); }
.census__grid.is-focus .tile { opacity: 0.18; }
.census__grid.is-focus .tile.is-hot { opacity: 1; transform: scale(1.06); box-shadow: 0 0 0 2px var(--ink); }
.census__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 16px 0 0; font-size: 12px; color: var(--ink-75); }
.census__legend span { display: inline-flex; align-items: center; gap: 7px; }
.key { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 4px; }
.key--ok { background: var(--ink); }
.key--stop { border: 1px solid rgba(255, 255, 255, 0.5); }
.key--none { border: 1px dashed rgba(255, 255, 255, 0.35); }
.gatelist { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--hairline); }
.gate-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 64px; gap: 12px; align-items: center; padding: 13px 8px; border-top: 1px solid var(--hairline); border-radius: 4px; cursor: default; transition: background-color 200ms; }
.gate-row:hover, .gate-row:focus-visible { background: rgba(255, 255, 255, 0.06); }
.gate-row__num { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.gate-row h3 { margin: 0; font-size: 14px; font-weight: 600; }
.gate-row p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-75); }
.gate-row__count { display: grid; justify-items: end; gap: 5px; font-family: var(--font-display); font-size: 22px; line-height: 1; }
.gate-row__count i { display: block; height: 3px; border-radius: 3px; background: var(--ink); }
.gate-row--zero .gate-row__count { color: var(--ink-55); }

/* ---------- Venice: the merchant painting under the same shader, with the commenda story ---------- */
.perch { position: relative; isolation: isolate; display: flex; align-items: center; min-height: min(88vh, 800px); overflow: hidden; border-top: 1px solid var(--hairline); background: var(--brand); }
.perch__field { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.perch__vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(var(--brand-rgb) / 0.88) 0%, rgba(var(--brand-rgb) / 0.55) 32%, rgba(var(--brand-rgb) / 0) 55%); }
.perch__in { position: relative; z-index: 2; width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.perch__line { max-width: 17ch; margin: 18px 0 0; font-family: var(--font-display); font-size: clamp(2.2rem, 4.2vw, 3.9rem); line-height: 1.04; letter-spacing: -0.015em; }
.perch__line em { font-style: italic; color: var(--ink-92); }
.perch__sub { max-width: 30rem; margin: 22px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink-75); }

/* ---------- III. the token ---------- */
.token { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: center; margin-top: 12px; }
.wheel svg { display: block; width: 100%; max-width: 520px; height: auto; margin-inline: auto; overflow: visible; }
.wheel__ring { fill: none; stroke: var(--hairline); stroke-width: 1; stroke-dasharray: 1 5; }
.wheel__track { fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.5; stroke-dasharray: 2 7; }
.wheel__arrows path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wheel__dots circle { fill: var(--ink); }
.wheel__node circle { fill: var(--brand); stroke: var(--ink); stroke-width: 2; }
.wheel__node text { fill: var(--ink); font-family: var(--font-display); font-size: 21px; }
.wheel__node .wheel__sub { font-family: var(--font-sans); font-size: 11px; font-weight: 500; fill: var(--ink-75); }
.reasons { margin: 36px 0 0; padding: 0; list-style: none; }
.reasons li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 20px 0; border-top: 1px solid var(--hairline); }
.reasons li:last-child { border-bottom: 1px solid var(--hairline); }
.reasons__n { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--ink-75); }
.reasons h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.reasons p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-75); }
.split { display: grid; grid-template-columns: 1fr 2fr 1fr; margin-top: clamp(48px, 7vw, 96px); border-top: 1px solid var(--ink); }
.split__col { display: grid; align-content: start; gap: 8px; padding: 22px 20px 0 0; }
.split__col + .split__col { padding-left: 20px; border-left: 1px solid var(--hairline); }
.split__col strong { font-family: var(--font-display); font-size: clamp(3.5rem, 7vw, 6.5rem); font-weight: 400; line-height: 0.9; letter-spacing: -0.03em; }
.split__col:nth-child(2) strong { color: var(--ink); }
.split__col:not(:nth-child(2)) strong { color: var(--ink-92); }
.split__col span { font-size: 13px; color: var(--ink-75); }
.split__example { grid-column: 1 / -1; max-width: 46rem; margin: 32px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink-75); }
.split__example b { color: var(--ink); font-weight: 600; }

/* ---------- IV. the book ---------- */
.book__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.book__state { margin: 0; font-size: 13px; color: var(--ink-75); }
.sheet { margin-top: 40px; padding: clamp(18px, 3vw, 32px); border-radius: 22px; background: var(--surface); color: var(--dark); box-shadow: var(--shadow-float); }
.sheet__stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 28px; }
.sheet__stats .stat { padding: 0 18px; border-left: 1px solid var(--slate-hairline); }
.sheet__stats .stat:first-child { padding-left: 0; border-left: 0; }
.sheet__stats dd { margin-top: 6px; font-family: var(--font-display); font-size: clamp(1.7rem, 2.8vw, 2.5rem); font-weight: 400; line-height: 1; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--slate-hairline); }
.tab { padding: 10px 0; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500; color: var(--dark-muted); }
.tab[aria-selected="true"] { border-color: var(--brand); color: var(--dark); }
.sheet__table { min-height: 180px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th { padding: 12px 10px 8px 0; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; color: var(--dark-muted); }
.tbl td { padding: 12px 10px 12px 0; border-top: 1px solid var(--slate-hairline); vertical-align: top; }
.tbl .r { text-align: right; padding-right: 0; }
.tbl .muted { color: var(--dark-muted); }
.tbl .up { color: var(--up); }
.tbl .down { color: var(--down); }
.tbl strong { font-weight: 600; }
.empty { display: grid; justify-items: start; gap: 6px; padding: 36px 0 20px; }
.empty strong { font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.empty span { max-width: 34rem; font-size: 14px; color: var(--dark-60); }
.sheet__note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--slate-hairline); font-size: 12px; color: var(--dark-muted); }

/* ---------- V. questions ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.faq > :first-child { position: sticky; top: 96px; }
.faq__list details { border-top: 1px solid var(--hairline); }
.faq__list details:last-child { border-bottom: 1px solid var(--hairline); }
.faq__list summary { display: grid; grid-template-columns: 48px minmax(0, 1fr) 20px; gap: 12px; align-items: baseline; padding: 20px 0; font-size: 16.5px; font-weight: 500; cursor: pointer; list-style: none; }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list .n { font-family: var(--font-display); font-size: 18px; color: var(--ink-55); }
.faq__list summary i { position: relative; width: 14px; height: 14px; align-self: center; }
.faq__list summary i::before, .faq__list summary i::after { content: ""; position: absolute; top: 6px; left: 0; width: 14px; height: 1.5px; background: var(--ink); transition: transform 250ms ease-out; }
.faq__list summary i::after { transform: rotate(90deg); }
.faq__list details[open] summary i::after { transform: rotate(0deg); }
.faq__list details p { max-width: 44rem; margin: 0 0 22px 60px; font-size: 15px; line-height: 1.65; color: var(--ink-75); }

/* ---------- colophon ---------- */
.colophon { border-top: 1px solid var(--hairline); padding-block: clamp(56px, 8vw, 96px) 32px; }
.colophon__in { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.colophon__word { display: flex; align-items: center; gap: 0.22em; margin: 0; font-size: clamp(2.8rem, 10.5vw, 10rem); font-weight: 600; letter-spacing: 0.08em; line-height: 0.9; }
.colophon__word .logo { width: 0.9em; height: 0.9em; flex: none; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }
.colophon__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hairline); }
.colophon__links { display: flex; flex-wrap: wrap; gap: 24px; }
.colophon__links a, .colophon__note { margin: 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-75); }
.colophon__links a:hover { color: var(--ink); }
.colophon__ca { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 12px; color: var(--ink-75); }
.colophon__ca code { font-family: var(--font-mono); color: var(--ink); overflow-wrap: anywhere; }
.colophon__ca button { padding: 4px 10px; border: 1px solid var(--hairline); border-radius: 8px; font-size: 11px; }

@media (max-width: 1100px) {
  .sheet__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 0; }
  .sheet__stats .stat:nth-child(4) { padding-left: 0; border-left: 0; }
}
@media (max-width: 900px) {
  .machine, .gates__head, .gates, .token, .faq { grid-template-columns: minmax(0, 1fr); }
  .machine__stage, .faq > :first-child { position: static; }
  .rule { opacity: 1; }                 /* the instrument sits below the rules here, so no step highlight */
  .perch { flex-direction: column; align-items: stretch; min-height: 0; }
  .perch__field { position: relative; inset: auto; height: min(92vw, 400px); -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
  .perch__vignette { display: none; }
  .rules { margin-top: 28px; }
  .gates__head { gap: 24px; }
  .census__grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .wheel { order: 2; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split__col + .split__col { padding-left: 0; border-left: 0; border-top: 1px solid var(--hairline); padding-top: 18px; margin-top: 18px; }
  .book__head { flex-direction: column; align-items: start; }
  .perch__in { margin-top: -40px; padding-bottom: 64px; }
  .faq__list details p { margin-left: 0; }
}
@media (max-width: 560px) {
  .wheel__node text { font-size: 25px; }
  .wheel__node .wheel__sub { font-size: 14px; }
  .m-gates { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .census__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sheet__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet__stats .stat { padding: 0 12px; }
  .sheet__stats .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .sheet__stats .stat:nth-child(4) { padding-left: 12px; border-left: 1px solid var(--slate-hairline); }
  .tbl .hide-sm { display: none; }
  .colophon__row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
