/* StockBuddy AI — site styles.
   Direction: oversized edge-to-edge type with the product standing IN FRONT
   of it. Rules: the app's flat palette only — no gradients, no glows, no pill
   badges. Depth comes from layering and scale, not effects. */
:root {
  --bg: #111214;  --s1: #1a1c1f;  --s2: #202327;
  --line: #2a2d32; --line2: #363a40;
  --text: #f0e6c8; --text2: #a59d89; --muted: #7a7060;
  --gold: #c9a84c; --bronze: #5a4f3c; --ghost: #1c1e21;
  --buy: #00d4aa; --sell: #ff4060;
  --sf: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1240px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }   /* nav links glide to their section */
body { background: var(--bg); color: var(--text); font-family: var(--sf); -webkit-font-smoothing: antialiased; line-height: 1.5; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ── Header ─────────────────────────────────────────────────── */
.top { position: fixed; inset: 0 0 auto 0; z-index: 60; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.top.solid { background: var(--bg); border-bottom-color: var(--line); }
main [id] { scroll-margin-top: 68px; }   /* anchor jumps land below the fixed header */
.top .wrap { display: flex; align-items: center; height: 68px; gap: 36px; max-width: none; padding: 0 40px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: auto; }
.brand b { color: var(--gold); font-weight: 650; }
.nav { display: flex; gap: 30px; margin-left: auto; font-size: 14px; color: var(--text2); }
.nav a:hover { color: var(--text); }
/* Mobile menu button: an outlined square the height of the Download button,
   with two bars that cross into an X when open. */
.menu { display: none; width: 43px; height: 43px; flex: none; background: none; border: 1px solid var(--line2); border-radius: 6px; cursor: pointer; position: relative; transition: border-color .2s; }
.menu:hover, .top.open .menu { border-color: var(--muted); }
.menu span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .3s var(--ease), top .3s var(--ease); }
.menu span:nth-child(1) { top: 16px; }
.menu span:nth-child(2) { top: 23px; }
.top.open .menu span { top: 19.5px; }
.top.open .menu span:nth-child(1) { transform: rotate(45deg); }
.top.open .menu span:nth-child(2) { transform: rotate(-45deg); }
.btn { display: inline-flex; align-items: center; gap: 10px; background: var(--gold); color: var(--bg); font-weight: 700; font-size: 14px; letter-spacing: -0.005em; padding: 11px 18px; border-radius: 6px; transition: background .2s; }
.btn:hover { background: #d8b95c; }
.btn svg { width: 15px; height: 15px; }
.btn.big { font-size: 17px; padding: 17px 26px; }

/* ── Type ───────────────────────────────────────────────────── */
.label { font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
h2 { font-size: clamp(36px, 4.8vw, 64px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 750; }
h3 { font-size: 20px; letter-spacing: -0.015em; font-weight: 650; }
.gold { color: var(--gold); }
p { color: var(--text2); }
.fine { font-size: 13px; color: var(--muted); }

/* Giant words are sized by JS (fitText) to span their container exactly. */
.giant { display: block; font-weight: 800; letter-spacing: -0.045em; line-height: .82; text-transform: uppercase; white-space: nowrap; }

/* ── Device: real iPhone frame (rendered from the 3D model) over the screen ─ */
/* media/iphone-frame.webp is the model rendered straight-on with the screen
   keyed out; the recording sits underneath in the measured screen rect. */
.device { --w: 300px; position: relative; width: var(--w); aspect-ratio: 940 / 1930;
  filter: drop-shadow(0 50px 70px rgba(0, 0, 0, .6));
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); will-change: transform; }
.device > video, .device > img:not(.frame) { position: absolute; left: 4.15%; top: 1.71%; width: 91.7%; height: 96.58%;
  object-fit: cover; border-radius: 12.5% / 5.9%; background: var(--bg); }
.device > .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tilt-stage { perspective: 1400px; }

/* ── HERO: headline over a studio-lit 3D phone ────────────────── */
/* One screen tall; the phone (src/phone.js) holds still while you scroll. */
.hero5 { position: relative; height: 100vh; height: 100svh; }
.hero5-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero5-in { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, 92vw); text-align: center; will-change: transform; }
.hero5-in h1 { font-size: clamp(46px, 6vw, 92px); line-height: .98; letter-spacing: -0.05em; font-weight: 800; margin: 16px 0 16px; }
.hero5-in .sub { color: var(--text2); font-size: clamp(15px, 1.2vw, 18px); max-width: 500px; margin: 0 auto 24px; }
.hero5-in > * { opacity: 0; transform: translateY(16px); animation: up .9s var(--ease) forwards; }
.hero5-in > :nth-child(2) { animation-delay: .1s; } .hero5-in > :nth-child(3) { animation-delay: .2s; } .hero5-in > :nth-child(4) { animation-delay: .3s; }
@keyframes up { to { opacity: 1; transform: none; } }
/* no WebGL: a still phone at the side instead of the 3D one */
.fallback { display: none; position: absolute; right: 8vw; bottom: -10vh; transform: rotate(-6deg); }
.nogl .hero5-in { transform: translate(calc(-50% - 20vw), -50%) !important; }
.fallback .device { --w: clamp(220px, 20vw, 300px); }
.nogl .fallback { display: block; } .nogl .stage { display: none; }

/* ── FEATURES: ghost word behind each phone ─────────────────── */
.feature { position: relative; border-top: 1px solid var(--line); padding: 140px 0; overflow: hidden; }
.feature .ghost { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); padding: 0 2.2vw; pointer-events: none; }
.feature .ghost .giant { color: var(--ghost); text-align: center; }
/* Alternating section tones: .tone sections sit one small step above --bg,
   just enough to separate them without a hard edge. */
.tone { background: #151618; }

/* Ticker tape between the features and "Your style" */
.ticker { display: flex; align-items: center; border-top: 1px solid var(--line); background: var(--bg); height: 58px; overflow: hidden; }
.ticker-view { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.ticker-track { display: flex; width: max-content; animation: tape 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk { display: inline-flex; align-items: baseline; gap: 10px; padding: 0 30px; border-right: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk b { font-weight: 700; letter-spacing: .02em; }
.tk i { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tk i.buy { color: var(--buy); } .tk i.sell { color: var(--sell); } .tk i.hold { color: var(--gold); }
.tk em { font-style: normal; font-size: 13px; color: var(--muted); }
@keyframes tape { to { transform: translateX(-50%); } }
.feature .grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; gap: 64px; align-items: center; }
.feature .ftext h2 { margin: 18px 0 18px; }
.feature .ftext p { font-size: 18px; }
.feature .side { align-self: end; }
.feature .device { --w: clamp(240px, 22vw, 320px); }

.spec { border: 1px solid var(--line); border-radius: 8px; background: var(--s1); }
.spec-head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.spec-head .t { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.spec-head .v { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--buy); }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.row:last-child { border-bottom: 0; }
.row span:first-child { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.row span:last-child { font-weight: 650; }

.list { border-top: 1px solid var(--line); }
.list li { list-style: none; display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text2); font-size: 16px; }
.list li::before { content: "—"; color: var(--gold); }

/* Trading styles — a full-width spec row */
.styles-sec { border-top: 1px solid var(--line); padding: 120px 0; }
.styles { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line2); margin-top: 56px; }
.style { padding: 28px 24px 0 0; }
.style + .style { padding-left: 24px; border-left: 1px solid var(--line); }
.style .big { font-size: clamp(30px, 3vw, 44px); font-weight: 750; letter-spacing: -0.035em; line-height: 1; }
.style .rec { display: block; margin-top: 12px; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--gold); }
.style p { font-size: 15px; margin-top: 12px; }

/* ── Pricing / FAQ ──────────────────────────────────────────── */
.sec { border-top: 1px solid var(--line); padding: 130px 0; }
.sec-head { max-width: 700px; margin-bottom: 60px; }
.sec-head h2 { margin-top: 18px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.plan { padding: 40px; background: var(--s1); }
.plan + .plan { border-left: 1px solid var(--line); }
.plan.pro { background: var(--s2); }
.plan .name { font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.plan.pro .name { color: var(--gold); }
.plan .price { font-size: clamp(54px, 6vw, 84px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; margin-top: 18px; }
.plan .price small { font-size: 18px; font-weight: 500; color: var(--text2); letter-spacing: 0; }
.plan .alt { margin: 10px 0 28px; font-size: 15px; }
.faq { border-top: 1px solid var(--line); max-width: 900px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; padding: 26px 0; font-size: clamp(19px, 1.8vw, 24px); font-weight: 650; letter-spacing: -0.02em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 28px; line-height: 1; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 28px; font-size: 17px; max-width: 720px; }

/* ── Closing call to action ─────────────────────────────────── */
.closing { position: relative; border-top: 1px solid var(--line); padding: 140px 0; overflow: hidden; }
.closing .lead { text-align: center; }
.closing .lead h2 { font-size: clamp(40px, 5.6vw, 78px); }
.closing .lead .btn { margin-top: 36px; }

footer { border-top: 1px solid var(--line); padding: 44px 0 56px; }
footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; max-width: none; padding: 0 40px; }
.flinks { display: flex; gap: 28px; font-size: 14px; color: var(--text2); flex-wrap: wrap; }
.flinks a:hover { color: var(--text); }
.disclaimer { grid-column: 1 / -1; font-size: 13px; color: var(--muted); max-width: 860px; }

/* ── Legal pages ────────────────────────────────────────────── */
.legal { max-width: 760px; padding: 150px 32px 120px; margin: 0 auto; }
.legal .eyebrow, .legal .label { font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.legal h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.04em; line-height: 1; font-weight: 800; }
.legal .meta { margin: 16px 0 44px; }
.legal h3 { margin: 36px 0 10px; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.legal p, .legal li { font-size: 17px; color: var(--text2); }
.legal ul { padding-left: 20px; margin-top: 6px; }
.legal li { margin: 6px 0; }

/* ── Scroll-in animation ─────────────────────────────────────────
   A .reveal container stays put; its CHILDREN come in, staggered by --i
   (set in main.js). Uses the individual translate/rotate/scale properties so
   it composes with the cursor-tilt `transform` on devices. */
.reveal > * { opacity: 0; translate: 0 34px; filter: blur(8px);
  transition: opacity .9s var(--ease), translate 1.1s var(--ease), filter .9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in > * { opacity: 1; translate: 0 0; filter: none; }

/* Devices: rise out of depth, tipped back, and settle; alternate sections
   swing in from opposite sides. */
.tilt-stage.reveal > .device { filter: drop-shadow(0 50px 70px rgba(0, 0, 0, .6)); translate: 0 180px; rotate: 1 -0.7 0 32deg; scale: .8;
  transition: opacity 1s var(--ease), translate 1.5s var(--ease), rotate 1.6s var(--ease), scale 1.5s var(--ease); }
.feature.alt .tilt-stage.reveal > .device { rotate: 1 0.7 0 32deg; }
/* settled state — must out-rank the .alt starting angle above */
.tilt-stage.reveal.in > .device, .feature.alt .tilt-stage.reveal.in > .device { translate: 0 0; rotate: 1 0 0 0deg; scale: 1; }

/* Spec rows deal in one by one after their card lands */
.spec .row { opacity: 0; translate: 26px 0; transition: opacity .6s var(--ease), translate .8s var(--ease); transition-delay: calc(.35s + var(--r, 0) * 110ms); }
.reveal.in .spec .row { opacity: 1; translate: 0 0; }

/* Ghost words drift sideways with scroll (main.js sets --gx) */
.feature .ghost .giant { translate: var(--gx, 0) 0; }


@media (prefers-reduced-motion: reduce) {
  .reveal > *, .tilt-stage.reveal > .device, .spec .row { opacity: 1 !important; translate: none !important; rotate: none !important; scale: none !important; transition: none !important; }
  .stage { opacity: 1 !important; animation: none !important; }
  .ticker-track { animation: none; }
  .hero5-in > * { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* ── Small screens ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .top .wrap { gap: 14px; }
  .top .btn { margin-left: auto; }
  .menu { display: block; }
  /* The menu: a frosted card that unfolds down from the header. Always laid
     out so it can animate; hidden by clip + fade until .open. */
  .nav { display: flex; flex-direction: column; gap: 0; position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 4px 20px 8px;
    background: rgba(26, 28, 31, .62); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
    border-bottom: 1px solid var(--line); box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
    color: var(--text); counter-reset: nav; overflow: hidden; transform-origin: top;
    visibility: hidden; opacity: 0; transform: translateY(-6px); clip-path: inset(0 0 100% 0);
    transition: clip-path .5s var(--ease), opacity .3s, transform .5s var(--ease), visibility 0s .5s; }
  .top.open .nav { visibility: visible; opacity: 1; transform: none; clip-path: inset(0 0 -60px 0); transition: clip-path .55s var(--ease), opacity .25s, transform .55s var(--ease), visibility 0s; }
  .nav > a:last-child { border-bottom: 0; }
  .nav > a { counter-increment: nav; position: relative; display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 26px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1;
    opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
  .top.open .nav > a { opacity: 1; transform: none; transition: opacity .45s var(--ease), transform .45s var(--ease); transition-delay: calc(var(--n, 0) * 55ms + 90ms); }
  .nav > a::before { content: counter(nav, decimal-leading-zero); font-size: 12px; font-weight: 600; letter-spacing: .2em; color: var(--gold); min-width: 24px; }
  .nav > a::after { content: "→"; margin-left: auto; font-size: 18px; font-weight: 400; color: var(--muted); transition: color .2s, transform .25s var(--ease); }
  .nav > a:active::after, .nav > a:hover::after { color: var(--gold); transform: translateX(4px); }
  .nav > a:nth-child(2) { --n: 1; } .nav > a:nth-child(3) { --n: 2; }
  .top .wrap, footer .wrap { padding: 0 20px; }
  .hero { height: 100svh; min-height: 640px; }
  .hero-left { display: none; }
  .hero5-in h1 { font-size: 44px; }
  .nogl .hero5-in { transform: translate(-50%, -50%) !important; }
  .fallback { right: 50%; bottom: auto; top: 50%; transform: translate(50%, -50%) rotate(-6deg); opacity: .3; }
  .feature { padding: 90px 0; }
  .feature .grid { grid-template-columns: 1fr; gap: 44px; }
  /* stacked: heading, then phone, then details, whatever the desktop column order */
  .feature .ftext { order: -1; }
  .feature .side { order: 1; }
  .feature .device { margin: 0 auto; --w: 62vw; }
  .styles { grid-template-columns: 1fr 1fr; }
  .style:nth-child(3) { border-left: 0; padding-left: 0; }
  .style { padding-bottom: 26px; }
  .plans { grid-template-columns: 1fr; }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--line); }
  .sec, .styles-sec { padding: 90px 0; }
  .ticker { height: 50px; }
  .tk { padding: 0 20px; font-size: 14px; }
  footer .wrap { grid-template-columns: 1fr; }
  .wrap { padding: 0 20px; }
}

