/* MT Paradox homepage. Loaded after site.css, on the homepage only.
   Red means missed. Green means answered. Nothing else uses those two colors up here. */

/* ---------------------------------------------------------------- hero */
.night { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(90% 70% at 72% 40%, #1B2350 0%, #0D1224 58%, #090D17 100%); --tone: var(--red); }
.night[data-mode="on"] { --tone: var(--green); }
.night-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0; transition: opacity 1.1s ease; touch-action: pan-y; }
.night.ready .night-canvas { opacity: 1; }
.night-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #090D17 0, rgba(9, 13, 23, .9) 210px, rgba(9, 13, 23, 0) 350px); }
.night-grid { position: relative; display: grid; grid-template-rows: auto minmax(318px, 1fr) auto; padding-block: 1.5rem 1.75rem; pointer-events: none; }
.night-copy, .board { pointer-events: auto; }
.night-copy { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.night h1 { font-size: clamp(2.2rem, 1.15rem + 4.5vw, 4.1rem); font-weight: 800; line-height: 1.02; letter-spacing: -.04em; margin: 0; }
.night h1 > span { display: block; }
.swap { display: grid !important; }
.swap > span { grid-area: 1 / 1; transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .4s ease; }
.swap-a { color: var(--red); }
.swap-b { color: var(--green); opacity: 0; transform: translateY(.55em) rotateX(-50deg); }
.night[data-mode="on"] .swap-a { opacity: 0; transform: translateY(-.55em) rotateX(50deg); }
.night[data-mode="on"] .swap-b { opacity: 1; transform: none; }
.night .lede { color: #C5CCE0; font-size: clamp(1.02rem, .96rem + .35vw, 1.22rem); line-height: 1.5; max-width: 50ch; text-wrap: pretty; }
.night .hero-actions { gap: .7rem; padding-top: .2rem; }
.night .btn-ghost { background: rgba(9, 13, 23, .62); }
.night-proof { color: #C5CCE0; font-size: .92rem; font-weight: 600; margin: 0; display: none; }

.trades { display: none; flex-wrap: wrap; align-items: center; gap: .5rem; }
.trades-label { font-weight: 700; color: var(--fg); margin-right: .15rem; }
.trade { font: 700 .95rem/1 var(--font-body); color: var(--fg); background: rgba(9, 13, 23, .62); border: 1.5px solid var(--line-2); border-radius: 999px; padding: .72rem 1rem; min-height: 44px; cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.trade:hover { border-color: var(--fg); }
.trade[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: #171003; }
.trade-link { display: none; color: #D9D0FF; font-weight: 700; text-underline-offset: .25em; width: fit-content; }
.trade-link:hover { color: #fff; }

.board { grid-row: 3; display: grid; gap: .8rem; padding: 1rem; border-radius: 20px; background: rgba(9, 13, 23, .88); border: 1px solid rgba(160, 172, 214, .24); box-shadow: 0 30px 80px -30px #000; }
.board p { margin: 0; }
.board-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.board-q { font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }
.sim-pause { width: 44px; height: 44px; margin: -.45rem -.5rem -.45rem 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.sim-pause:hover { color: var(--fg); background: rgba(255, 255, 255, .06); }
.sim-pause svg { width: 18px; height: 18px; fill: currentColor; }
.sim-pause .i-play, .sim-pause[aria-pressed="true"] .i-pause { display: none; }
.sim-pause[aria-pressed="true"] .i-play { display: block; }
.switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 999px; background: #05070E; border: 1px solid rgba(160, 172, 214, .2); }
.switch::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px; background: #C9353D; box-shadow: 0 0 34px -6px var(--red); transition: transform .5s cubic-bezier(.3, 1.35, .45, 1), background .35s, box-shadow .35s; }
.night[data-mode="on"] .switch::before { transform: translateX(100%); background: #0E8A5B; box-shadow: 0 0 44px -2px var(--green); }
.switch button { position: relative; font: 800 1rem/1 var(--font-body); color: #B4BCD3; background: none; border: 0; border-radius: 999px; min-height: 48px; cursor: pointer; transition: color .25s; }
.switch button[aria-pressed="true"] { color: #fff; }
.switch button:hover { color: #fff; }
.ev { min-height: 5.4em; padding-left: .9rem; position: relative; display: grid; align-content: start; gap: .2rem; line-height: 1.38; }
.ev::before { content: ""; position: absolute; left: 0; top: .25em; bottom: .25em; width: 3px; border-radius: 3px; background: var(--ev, var(--red)); transition: background .3s; }
.ev[data-tone="good"] { --ev: var(--green); }
.ev[data-tone="calm"] { --ev: var(--brand-hi); }
.ev[data-tone="bad"] { --ev: #7C86A3; }
.ev-time { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.ev-issue { font-weight: 800; }
.ev-result { color: #C5CCE0; font-size: .95rem; }
.ev.tick .ev-result { animation: evIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes evIn { from { opacity: 0; transform: translateY(8px); } }
.tally { display: grid; grid-template-columns: auto auto 1fr; align-items: end; gap: 1.1rem; }
.tally p { display: grid; font-size: .82rem; color: var(--muted); line-height: 1.25; }
.tally b { font-size: 1.75rem; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--green); }
.tally .t-lost b { color: var(--red); }
.sim-ring { justify-self: end; font: 700 .9rem/1 var(--font-body); color: var(--fg); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 1rem; min-height: 44px; cursor: pointer; }
.sim-ring:hover { border-color: var(--fg); }
.board-note { font-size: .82rem; color: var(--muted); }
.night.still .sim-pause, .night.still .sim-ring { display: none; }
.night :is(button, a):focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (max-width: 959px) {
  .night { background: #090D17; }
  .night h1 { font-size: min(9.4vw, 4.1rem); }
  .night-canvas { inset: 170px 0 auto; height: 640px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 150px, #000 520px, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 150px, #000 520px, transparent 100%); }
  .board-trades { display: flex; flex-wrap: wrap; gap: .4rem; }
  .board-trades .trade { padding: .6rem .8rem; font-size: .9rem; }
  .night .btn-ghost { display: none; }
}
@media (min-width: 960px) {
  .board-trades { display: none; }
  .night-shade { background: linear-gradient(90deg, rgba(9, 13, 23, .32) 0, rgba(9, 13, 23, .14) 38%, rgba(9, 13, 23, 0) 56%), linear-gradient(180deg, rgba(9, 13, 23, .35) 0, rgba(9, 13, 23, 0) 18%, rgba(9, 13, 23, 0) 84%, #090D17 100%); }
  .night-grid { grid-template: 1fr auto / minmax(0, 620px) 1fr; min-height: clamp(600px, calc(100svh - 72px), 900px); padding-block: 1.4rem 1.4rem; gap: 1.2rem 2rem; }
  /* Wide screens: the header and hero use more of the width, so the words start near the left edge and the street fills the rest. */
  .site-header .header-inner, .night-grid.wrap { max-width: 1680px; padding-left: max(clamp(28px, 7vw - 44px, 96px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(28px, 7vw - 44px, 96px), env(safe-area-inset-right, 0px)); }
  .night-copy { align-content: center; gap: 1.15rem; grid-area: 1 / 1; }
  .night h1 { font-size: clamp(3rem, 1.1rem + 3.15vw, 4.35rem); }
  .night-proof { display: block; }
  /* A soft dark glow sits behind the words themselves, so the street can show everywhere else. */
  .night-copy { position: relative; }
  .night-copy::before { content: ""; position: absolute; inset: -28px -48px -28px -40px; z-index: -1; pointer-events: none; border-radius: 80px; background: rgba(9, 13, 23, .7); filter: blur(44px); }
  .night-copy :is(h1, .lede, .night-proof, .trades-label, .trade-link) { text-shadow: 0 1px 2px rgba(9, 13, 23, .7), 0 0 28px rgba(9, 13, 23, .9); }
  .trades { display: flex; padding-top: .3rem; }
  .trade-link { display: block; }
  /* One slim console, so the street stays in full view */
  .board { grid-area: 2 / 1 / 3 / 3; grid-template: "q ev tally" auto "sw ev note" auto / 310px minmax(0, 1fr) auto; gap: .7rem 1.9rem; align-items: center; padding: .95rem 1.25rem; }
  .board-top { grid-area: q; }
  .switch { grid-area: sw; }
  .ev { grid-area: ev; min-height: 4.6em; align-content: center; }
  .tally { grid-area: tally; gap: 1.5rem; }
  .board-note { grid-area: note; align-self: end; }
}

/* ---------------------------------------------------- content reveals */
/* Text stays fully readable while it moves. No faded, half-loaded sections. */
html.motion .rv { opacity: 1; transform: translateY(30px); }
html.motion .rv.in { transform: none; }

/* ---------------------------------------------------- one call, followed */
.story-grid { display: grid; gap: 2rem; }
.story-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.8rem; }
.story-step { display: grid; gap: .5rem; align-content: center; }
.story-step h3 { font-size: clamp(1.4rem, 1.15rem + 1vw, 2.1rem); line-height: 1.12; letter-spacing: -.025em; font-weight: 800; margin: 0; }
.story-step p { color: var(--muted); font-size: 1.08rem; line-height: 1.55; max-width: 44ch; margin: 0; }
.story-stage { position: relative; display: grid; justify-items: center; gap: .9rem; align-content: center; }
.story-stage .phone { width: min(332px, 100%); }
.story-stage .phone-screen { position: relative; min-height: 560px; }
.story-stage .thread { transition: opacity .5s ease; }
.story-stage[data-step="4"].live .thread { opacity: .16; }
.story-tag { font-size: .9rem; color: var(--muted); margin: 0; }
.story-stage.live [data-at] { opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .4s ease, transform .55s cubic-bezier(.2, 1.1, .3, 1); transition-delay: 0s; }
.story-stage.live [data-at].show { opacity: 1; transform: none; transition-delay: calc(var(--dl, 0) * 1s); }
.story-stage .phone { transition: box-shadow .8s ease; }
.story-stage[data-step="1"] .phone { box-shadow: 0 0 0 1px #5B3340, 0 40px 100px -30px #000, 0 0 130px -30px rgba(255, 90, 96, .75); }
.story-stage[data-step="3"] .phone { box-shadow: 0 0 0 1px #2B5C4D, 0 40px 100px -30px #000, 0 0 150px -30px rgba(43, 226, 158, .85); }
.story-stage[data-step="4"] .phone { box-shadow: 0 0 0 1px #5E5238, 0 40px 100px -30px #000, 0 0 140px -30px rgba(201, 164, 92, .8); }
.story-stage[data-step="1"] .call-ico { animation: ringing .9s ease-in-out infinite; }
@keyframes ringing { 0%, 55%, 100% { transform: none; } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
.learn { position: absolute; inset: auto 12px 14px; padding: 16px; border-radius: 22px; background: #171C2E; border: 1px solid rgba(201, 164, 92, .55); box-shadow: 0 -20px 60px 10px rgba(5, 7, 12, .9); display: grid; gap: .7rem; }
.learn > b { font-size: .95rem; line-height: 1.3; }
.learn-row { display: grid; gap: .3rem; font-size: .8rem; font-weight: 600; color: #C5CCE0; }
.learn-row i { display: block; height: 10px; border-radius: 6px; background: #6C7592; width: 100%; transform-origin: left; transform: scaleX(.34); transition: transform 1.1s cubic-bezier(.2, .9, .2, 1) .55s; }
.learn-row:nth-child(2) i { background: var(--green); }
.story-stage[data-step="4"] .learn-row:nth-child(2) i { transform: scaleX(.96); }
.story-stage[data-step="4"] .learn-row:nth-child(3) i { transform: scaleX(.22); }
.story-stage[data-step="4"] .learn-row:nth-child(4) i { transform: scaleX(.07); }
@media (max-width: 959px) { .story-stage { order: -1; } }
@media (min-width: 960px) {
  .story-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 4rem; }
  /* Extra room at the end keeps the phone pinned while the last step is read */
  html.motion .story-steps { gap: 0; padding-bottom: 19vh; }
  html.motion .story-step { min-height: 64vh; transition: opacity .45s ease; opacity: .45; }
  html.motion .story-step.now { opacity: 1; }
  html.motion .story-stage { position: sticky; top: 84px; height: calc(100vh - 100px); max-height: 760px; }
  .story-stage .phone-screen { min-height: min(560px, calc(100vh - 236px)); }
}

/* ------------------------------------------------ calculator: see the leak */
.leak-view { display: grid; gap: .6rem; }
.leak-dots { display: block; width: 100%; height: 168px; }
.leak-key { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .84rem; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.leak-key li { display: flex; align-items: center; gap: .45rem; }
.leak-key i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-hi); }
.leak-key .k-late { background: var(--amber); }
.leak-key .k-miss { background: var(--red); }

/* ------------------------------------------------- small working diagrams */
.flow { display: block; width: 100%; height: auto; margin-bottom: .2rem; overflow: visible; }
.flow path { fill: none; stroke: #36405F; stroke-width: 1.5; }
.flow .node { fill: #1A2238; stroke: #47537A; stroke-width: 1.5; }
.flow .node-win { fill: #20194A; stroke: var(--brand-hi); }
.flow .node-dead { fill: #171B29; stroke: #5A6380; stroke-dasharray: 4 4; }
.flow text { font: 700 12px var(--font-body); fill: #B4BCD3; text-anchor: middle; }
.flow .dot { opacity: 0; }

/* ------------------------------------------------------ one or many sites */
.scale { display: grid; gap: 2.5rem; align-items: center; }
.scale-copy { display: grid; gap: 1.1rem; }
.scale-list { margin: .4rem 0 0; padding: 0; list-style: none; display: grid; gap: 1.1rem; }
.scale-list li { display: grid; gap: .2rem; }
.scale-list b { font-size: 1.1rem; }
.scale-list span { color: var(--muted); line-height: 1.5; max-width: 52ch; }
@media (min-width: 960px) { .scale { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; } }

/* Laptop windows that are short: size the hero by height, so the words sit centred with even space and the call console stays on screen. */
@media (min-width: 960px) and (max-height: 860px) {
  .night-grid { min-height: calc(100svh - 72px); padding-block: clamp(1.1rem, 4.6svh, 2.2rem) clamp(.9rem, 3svh, 1.6rem); row-gap: clamp(.75rem, 2.8svh, 1.4rem); }
  .night-copy { gap: clamp(.6rem, 1.75svh, 1.1rem); }
  .night h1 { font-size: max(2.5rem, min(1.1rem + 3.15vw, 7.3svh, 4.35rem)); }
  .night .lede { font-size: clamp(1rem, 2.75svh, 1.18rem); max-width: 36em; }
  .night .hero-actions, .trades { padding-top: 0; }
  .board { padding-block: clamp(.6rem, 1.6svh, .95rem); row-gap: clamp(.4rem, 1.2svh, .7rem); }
  .switch button { min-height: clamp(40px, 6svh, 48px); }
}

/* ------------------------------------------ phones: swipe, don't stack */
@media (max-width: 699px) {
  .leak-big small { display: block; margin-top: .35rem; font-size: 1rem; }
  .compare, .engine, .proof-side { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 84%; gap: .8rem; align-items: stretch;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); padding-block: .4rem 1rem; }
  .compare::-webkit-scrollbar, .engine::-webkit-scrollbar, .proof-side::-webkit-scrollbar { display: none; }
  .compare > *, .engine > *, .proof-side > * { scroll-snap-align: start; min-width: 0; }
  .compare .cmp.win { order: -1; box-shadow: none; }
  .engine::before, .engine::after { display: none !important; }
  .badges { grid-template-columns: 1fr 1fr !important; }
  .badges .stat-card { padding: 1rem; }
  html.motion :is(.compare, .engine, .proof-side) .rv { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .night-canvas, .swap > span, .switch::before, .learn-row i { transition: none; }
  .story-stage .call-ico, .ev.tick .ev-result { animation: none !important; }
}
