/* Shared styles for every page (home, contact). Served from /_c/, a prefix the
   newsletter's site never uses, so one route in wrangler.jsonc covers it. */
*{margin:0;padding:0;box-sizing:border-box}
:root{--bg:#000;--fg:#fff;--muted:rgba(255,255,255,.65);--line:rgba(255,255,255,.35);--accent:#0f0}
html,body{background:var(--bg);color:var(--fg);font-family:'DM Sans',system-ui,sans-serif}
body{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
#rain{position:fixed;inset:0;width:100%;height:100%;z-index:0;filter:saturate(1.35) brightness(1.08)} /* a little extra punch on the green */
.header,.content{position:relative;z-index:1}
/* Faint CRT texture on the rain only: fine scanlines plus a little dark film
   grain (dark, not white, so it never washes out the green). It sits between
   the rain (z-index 0, earlier in the page) and the content (z-index 1), so
   text stays crisp. Purely visual (no clicks). */
body::after{content:"";position:fixed;inset:0;z-index:0;pointer-events:none;opacity:.5;
  background:repeating-linear-gradient(to bottom,rgba(0,0,0,.14) 0 1px,transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
/* Header: just the logo, centered. */
.header{display:flex;justify-content:center;align-items:center;padding:20px;min-height:92px}
.logo{color:var(--fg);text-decoration:none;font-weight:600;font-size:1.7em;letter-spacing:-1px;text-shadow:0 0 14px #000,0 0 6px #000,0 0 2px #000}
/* A soft dark fade along the top so the logo reads clearly over the rain; no
   visible edge. */
.header::before{content:"";position:absolute;z-index:-1;inset:0 0 -40px;background:linear-gradient(to bottom,rgba(0,0,0,.7),rgba(0,0,0,.35) 60%,transparent);pointer-events:none}
.button{display:inline-block;font:inherit;font-weight:600;font-size:1rem;cursor:pointer;border:2px solid var(--fg);color:var(--fg);background:rgba(0,0,0,.5);text-decoration:none;padding:12px 24px;transition:background-color .4s,color .4s,box-shadow .4s}
/* Hover: fills white with a green glow. */
.button:hover,.button:focus-visible{background:var(--fg);color:var(--bg);box-shadow:0 0 28px rgba(0,255,65,.45),0 0 3px rgba(0,255,65,.9)}
.button:disabled{opacity:.6;cursor:wait}
.content{flex:1;overflow-x:clip;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:0 16px 10vh;text-align:center}
/* A soft dark patch behind the main text: dims the rain in the middle only,
   no visible edges. Centered on the text, which sits 5vh above the middle
   because of .content's bottom padding. */
.content::before{content:"";position:absolute;z-index:-1;left:50%;top:calc(50% - 5vh);width:min(1200px,130%);height:min(620px,90%);transform:translate(-50%,-50%);background:radial-gradient(closest-side,rgba(0,0,0,.72),rgba(0,0,0,.45) 55%,transparent);pointer-events:none}
h1{max-width:10em;font-weight:700;letter-spacing:-1px;font-size:clamp(2rem,8vw,6.5rem);line-height:1.05;text-wrap:balance}
.sub{max-width:34em;text-wrap:balance;margin-bottom:12px;font-size:clamp(1.05rem,1.9vw,1.45rem);line-height:1.5;color:rgba(255,255,255,.88);text-shadow:0 0 12px #000,0 0 4px #000}
/* Letters still decoding (headlines and logo): rain-green with a soft glow. */
.scr{color:var(--accent);text-shadow:0 0 14px rgba(0,255,65,.55)}

/* Home: rotating ending. Every phrase sits invisibly in the same grid cell, so
   the box is as wide as the longest one and "We" never moves. The live text
   (.rot-live, not .live: that class belongs to the results page's record)
   doesn't count toward that width (contain), so scrambled letters can't widen
   it either. */
h1 .rot{display:inline-grid;text-align:left}
h1 .rot>*{grid-area:1/1}
h1 .sizer{visibility:hidden}
h1 .rot-live{contain:inline-size;white-space:nowrap}
/* Home: hidden for one frame, then fades in. The fade's timing lives on the
   "typed" state (the one the page switches to), or the browser would skip the
   animation. The button follows a beat later; its hover effects keep no delay. */
.typing-hero .sub,.typing-hero .content>.button{opacity:0;transform:translateY(14px)}
.typed-hero .sub,.typed-hero .content>.button{transition:opacity 1s ease-out,transform 1.1s cubic-bezier(.2,.9,.1,1),background-color .4s,color .4s,box-shadow .4s}
.typed-hero .content>.button{transition-delay:.25s,.25s,0s,0s,0s}

/* Contact page: plain black (no rain), a calm, left-aligned column (heading,
   a line of text, the form) centered on the page. */
.contact{text-align:left}
.contact>*{width:min(560px,100%)}
.contact h1{max-width:none;font-size:clamp(2.4rem,7vw,4.5rem)}
.contact .sub{max-width:none;margin-bottom:12px;text-wrap:pretty}
.form-wrap>*{animation:rise .6s cubic-bezier(.2,.9,.1,1) both}
.contact form .button{justify-self:start;padding:12px 32px}
@keyframes rise{from{opacity:0;transform:translateY(12px)}}
form{display:grid;gap:14px}
.field{display:grid;gap:6px}
label{font-size:.9rem;color:rgba(255,255,255,.8)}
input,textarea{font:inherit;font-size:1rem;color:var(--fg);background:rgba(255,255,255,.03);border:1px solid var(--line);padding:12px 14px;border-radius:0;transition:border-color .25s,background-color .25s}
input:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:-1px;border-color:transparent}
/* Validation: an error slides open under the field (grid rows 0fr -> 1fr) with
   a red outline; it clears as soon as the value is fixed. Fields filled in
   correctly get a faint green outline. A wrong field shakes once on Send. */
:root{--err:#ff6b6b}
.err{display:grid;grid-template-rows:0fr;opacity:0;color:var(--err);font-size:.85rem;transition:grid-template-rows .25s ease,opacity .25s ease}
.err>span{overflow:hidden;display:flex;gap:6px;align-items:center}
.err>span::before{content:"!";flex:none;display:grid;place-items:center;width:15px;height:15px;border-radius:50%;background:var(--err);color:#000;font-size:.7rem;font-weight:700}
.field.invalid .err{grid-template-rows:1fr;opacity:1}
.field.invalid input,.field.invalid textarea{border-color:var(--err);background:rgba(255,107,107,.06)}
.field.invalid input:focus,.field.invalid textarea:focus{outline-color:var(--err)}
.field.valid input,.field.valid textarea{border-color:rgba(0,255,65,.45)}
.field.shake{animation:shake .35s ease}
@keyframes shake{20%{translate:-6px 0}40%{translate:5px 0}60%{translate:-3px 0}80%{translate:2px 0}}
textarea{min-height:150px;resize:vertical}
.hp{position:absolute;left:-9999px}
.turnstile:empty{display:none} /* Cloudflare check: takes space only when shown */
/* Under the Send button; takes no space until there's something to say. */
.status{font-size:.95rem}
.status:empty{display:none}
.status.error{color:#ff6b6b}

@media (max-width:480px){
  .header{padding:16px;min-height:76px}
  /* Home on phones: a bigger headline (10.5vw keeps the widest phrase, "We
     Drive Results.", on one line down to 320px screens), a slightly smaller
     logo, and a smaller, softer subheadline, so the headline leads. */
  .logo{font-size:1.5em}
  h1{font-size:10.5vw}
  .sub{font-size:1rem;color:rgba(255,255,255,.78);padding:0 14px} /* narrower column than the headline */
  .contact h1{font-size:clamp(2.4rem,11vw,3rem)}
  .contact .sub{font-size:1.05rem;color:rgba(255,255,255,.88)}
  /* Contact on phones: heading and text centered under the centered logo,
     more room below the logo, and a full-width Send button. */
  .contact{text-align:center;justify-content:flex-start;padding-top:28px}
  .contact form{text-align:left}
  .contact form .button{justify-self:stretch}
}
@media (prefers-reduced-motion:reduce){.form-wrap>*,.field.shake{animation:none}.err{transition:none}}

/* Results page (/results): a trade-alerts sales page for cold traffic. Hero
   with a direct-response headline and an email waitlist form, a proof strip,
   "how it works", the full backtest explorer (market toggle, stat tiles,
   yearly bar chart and table), FAQ, a second form and the disclosures. Plain
   black like contact. Green is the signal, grey is buy and hold. */
.results{text-align:left;justify-content:flex-start;gap:28px;padding-top:12px}
.results>*{width:min(880px,100%)}
.results h1{max-width:none;font-size:clamp(2.4rem,7vw,4.8rem)}
.results .sub{max-width:40em;margin-bottom:0;text-wrap:pretty}
.results .sub strong{color:var(--accent);font-weight:700}
.results h2{font-size:clamp(1.4rem,3vw,1.9rem);font-weight:700;letter-spacing:-.5px;margin-bottom:14px;text-wrap:balance}
.results h3{font-size:1.1rem;font-weight:600;margin-bottom:14px}
.hero{display:grid;gap:16px}
.eyebrow{color:var(--accent);font-weight:600;font-size:.9rem;letter-spacing:.08em;text-transform:uppercase}
.waitlist{display:grid;grid-template-columns:1fr auto;gap:10px;max-width:560px;margin-top:6px}
.waitlist .button{padding:12px 28px;white-space:nowrap}
.waitlist input{min-width:0}
.waitlist.done input,.waitlist.done .button{display:none}
.wl-status{grid-column:1/-1;font-size:.95rem}
.wl-status:empty{display:none}
.wl-status.error{color:var(--err)}
.wl-status.ok{color:var(--accent);font-weight:600}
.micro{font-size:.85rem;color:var(--muted)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.proof{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--line);border:1px solid var(--line)}
.proof>div{background:var(--bg);padding:18px}
.pv{font-size:clamp(1.6rem,3.4vw,2.2rem);font-weight:700;letter-spacing:-.5px;color:var(--accent);font-variant-numeric:tabular-nums}
.pl{font-size:.88rem;color:var(--muted);margin-top:2px}
.proof-note{font-size:.8rem;color:var(--muted);margin-top:-18px}
.steps ol{list-style:none;counter-reset:s;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.steps li{counter-increment:s;border:1px solid var(--line);padding:18px;color:rgba(255,255,255,.8);line-height:1.55}
.steps li::before{content:counter(s);display:grid;place-items:center;width:28px;height:28px;margin-bottom:10px;border-radius:50%;background:var(--accent);color:#000;font-weight:700}
.steps li strong{display:block;color:var(--fg);margin-bottom:4px}
.steps-note{margin-top:14px;color:var(--muted);font-size:.95rem}
.live{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.live h2{margin-bottom:0}
.live .lede{margin-top:-8px}
.live-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);border:1px solid var(--line)}
.lc{background:var(--bg);padding:16px 18px;display:grid;gap:4px;align-content:start}
.lm{font-size:.9rem;color:var(--muted)}
.lm strong{color:var(--fg);margin-right:4px}
.lt{font-size:1.9rem;font-weight:700;letter-spacing:-.5px;font-variant-numeric:tabular-nums}
.lt.p,.lc .p{color:var(--accent)}
.lt.n,.lc .n{color:var(--err)}
.ls,.lo{font-size:.85rem;color:var(--muted);line-height:1.45}
.live table td.empty{text-align:left;color:var(--muted);white-space:normal}
.proof-full{display:grid;grid-template-columns:minmax(0,1fr);gap:20px} /* minmax: never wider than the page */
.proof-full h2{margin-bottom:0}
.lede{color:var(--muted);margin-top:-12px}
.faq details{border-bottom:1px solid rgba(255,255,255,.15);padding:14px 0}
.faq summary{cursor:pointer;font-weight:600;list-style:none;display:flex;justify-content:space-between;gap:12px}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";color:var(--accent);font-weight:700}
.faq details[open] summary::after{content:"\2212"}
.faq details p{margin-top:10px;color:rgba(255,255,255,.8);line-height:1.6}
.final-cta{border:1px solid var(--accent);padding:24px;box-shadow:0 0 28px rgba(0,255,65,.12)}
.final-cta h2{margin-bottom:6px}
.controls{display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between}
.seg{display:inline-flex;border:1px solid var(--line)}
.seg button{font:inherit;font-size:.95rem;font-weight:600;color:var(--muted);background:none;border:0;padding:10px 16px;cursor:pointer;transition:background-color .25s,color .25s}
.seg button+button{border-left:1px solid var(--line)}
.seg button:hover{color:var(--fg)}
.seg button[aria-pressed=true]{background:var(--fg);color:var(--bg)}
.seg button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.market-name{color:var(--muted);font-size:.95rem}
.tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);border:1px solid var(--line)}
.tile{background:var(--bg);padding:16px 18px}
.tl{font-size:.85rem;color:var(--muted)}
.tv{font-size:1.8rem;font-weight:700;letter-spacing:-.5px;margin:4px 0 2px;font-variant-numeric:tabular-nums}
.tv.win{color:var(--accent)}
.tb{font-size:.85rem;color:var(--muted);font-variant-numeric:tabular-nums}
.panel{border:1px solid var(--line);padding:20px}
.legend{display:flex;align-items:center;gap:8px;font-size:.85rem;color:var(--muted);margin:-6px 0 10px}
.legend .k{width:12px;height:12px;display:inline-block}
.legend .k.bh{margin-left:10px}
.k.ibs,.chart .ibs{background:var(--accent);fill:var(--accent)}
.k.bh,.chart .bh{background:rgba(255,255,255,.45);fill:rgba(255,255,255,.45)}
.chart svg{display:block;width:100%;height:auto}
.chart .grid{stroke:rgba(255,255,255,.12)}
.chart .zero{stroke:rgba(255,255,255,.6)}
.chart .ax{fill:var(--muted);font-size:12px;font-family:inherit}
.chart .foot{font-size:.8rem;color:var(--muted);margin-top:6px}
.table-wrap{overflow-x:auto}
.results table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:.95rem}
.results th,.results td{padding:9px 10px;text-align:right;border-bottom:1px solid rgba(255,255,255,.15);white-space:nowrap}
.results th:first-child{text-align:left}
.results thead th{color:var(--muted);font-weight:600;font-size:.85rem}
.results tbody th{font-weight:600}
.results td.p{color:var(--accent)}
.results td.n{color:var(--err)}
.results tr.sum th,.results tr.sum td{border-bottom:0;border-top:1px solid var(--line);font-weight:700}
.notes ul{padding-left:1.2em;display:grid;gap:8px;color:rgba(255,255,255,.8);line-height:1.55}
.disclaimer{margin-top:18px;font-size:.85rem;line-height:1.55;color:var(--muted)}
@media (max-width:640px){
  .proof{grid-template-columns:repeat(2,1fr)}
  .live-grid{grid-template-columns:1fr}
  .steps ol{grid-template-columns:1fr}
  .waitlist{grid-template-columns:1fr}
  .final-cta{padding:18px}
  .tiles{grid-template-columns:repeat(2,1fr)}
  .tv{font-size:1.45rem}
  .panel{padding:14px}
  .results th,.results td{padding:8px 6px;font-size:.88rem}
}
@media (max-width:480px){
  .results{padding-top:20px}
  .results .sub{padding:0}
  .results h1{font-size:clamp(2.2rem,11vw,3rem)}
  .controls{flex-direction:column}
  /* Seven markets: two rows of four, 1px lines drawn by the gap. */
  .seg{display:grid;grid-template-columns:repeat(4,1fr);gap:1px;background:var(--line)}
  .seg button{padding:11px 8px;background:var(--bg)}
  .seg button+button{border-left:0}
}

/* Results layout v2 (2026-11-17): roomier sections split by hairlines, a
   small green kicker above each heading, and long content (trade list,
   year-by-year table, method notes) folded into <details> rows. */
.results{gap:0;padding-top:12px;padding-bottom:72px}
.results .hero{display:grid;gap:18px;padding-bottom:64px}
.proof-wrap{margin-top:28px;display:grid;gap:10px}
.proof-note{margin-top:0}
.block{display:grid;grid-template-columns:minmax(0,1fr);gap:22px;padding:64px 0;border-top:1px solid rgba(255,255,255,.12)}
.block h2{margin:0}
.kicker{color:var(--accent);font-weight:600;font-size:.78rem;letter-spacing:.12em;text-transform:uppercase;margin-bottom:-14px}
.lede,.live .lede,.proof-full .lede{margin-top:-6px;max-width:44em;line-height:1.6}
.note{color:var(--muted);font-size:.9rem;line-height:1.55;max-width:48em}
.steps ol{margin-top:6px}
.steps li{padding:22px}
.market-name{margin-top:-4px}
.fold{border:1px solid var(--line)}
.fold>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px;padding:16px 20px;font-weight:600;transition:background-color .2s}
.fold>summary::-webkit-details-marker{display:none}
.fold>summary::after{content:"";margin-left:auto;width:8px;height:8px;border-right:2px solid var(--accent);border-bottom:2px solid var(--accent);transform:translateY(-2px) rotate(45deg);transition:transform .2s}
.fold[open]>summary::after{transform:translateY(2px) rotate(-135deg)}
.fold>summary:hover{background:rgba(255,255,255,.04)}
.fold>summary:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.fold .count{color:var(--muted);font-weight:400}
.fold-body{padding:6px 20px 18px;border-top:1px solid rgba(255,255,255,.12)}
.fold + .fold{margin-top:-10px}
.method{padding:14px 0 0 1.2em;display:grid;gap:12px;color:rgba(255,255,255,.8);line-height:1.6}
.faq-list{border-top:1px solid rgba(255,255,255,.15)}
.faq details{padding:20px 0}
.faq details p{max-width:48em}
.final-cta.block{border:1px solid var(--accent);padding:40px 32px;margin-top:8px;gap:16px}
.final-cta .lede{margin-top:-8px}
.notes.block{border-top:0;padding:48px 0 0;gap:14px}
.notes .disclaimer{margin-top:0}
@media (max-width:640px){
  .results .hero{padding-bottom:48px}
  .block{padding:48px 0;gap:18px}
  .fold>summary{padding:14px 16px}
  .fold-body{padding:4px 12px 14px}
  .final-cta.block{padding:28px 18px}
}

/* Paid offer (2026-11-17): $1 trial CTA in the hero, two plan cards, and the
   renewal terms always next to the buttons. */
.offer{display:flex;flex-wrap:wrap;align-items:center;gap:14px 22px;margin-top:6px}
.button.cta{background:var(--accent);color:#000;border-color:var(--accent);padding:14px 34px;font-size:1.05rem}
.button.cta:hover,.button.cta:focus-visible{background:var(--fg);border-color:var(--fg);color:#000}
.offer-alt{color:var(--fg);font-weight:600;text-decoration:underline;text-underline-offset:4px;text-decoration-color:var(--line)}
.offer-alt:hover{text-decoration-color:var(--accent)}
.terms{font-size:.9rem;color:var(--muted);max-width:40em}
.terms strong{color:var(--fg)}
.plans{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.plan{border:1px solid var(--line);padding:28px;display:grid;gap:10px;align-content:start}
.plan.featured{border-color:var(--accent);box-shadow:0 0 28px rgba(0,255,65,.12)}
.plan-name{font-size:.8rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--accent)}
.plan-price{font-size:1.1rem;color:var(--muted)}
.plan-price span{font-size:2.6rem;font-weight:700;letter-spacing:-1px;color:var(--fg);margin-right:4px}
.plan-then{color:var(--muted);font-size:.95rem;margin-top:-6px}
.plan ul{list-style:none;display:grid;gap:8px;margin:8px 0 12px;color:rgba(255,255,255,.85);line-height:1.5}
.plan li{padding-left:22px;position:relative}
.plan li::before{content:"";position:absolute;left:2px;top:.45em;width:9px;height:5px;border-left:2px solid var(--accent);border-bottom:2px solid var(--accent);transform:rotate(-45deg)}
.plan .button{justify-self:start;text-align:center}
.final-cta .offer{margin-top:4px}
@media (max-width:640px){
  .plans{grid-template-columns:1fr}
  .plan{padding:22px}
  .offer .button.cta{flex:1 1 100%;text-align:center}
  .plan .button{justify-self:stretch}
}
