/* ==========================================================================
   TradingViewDiscountCode.com — independent TradingView savings guide
   Visual language: black cinematic bands + white content sheets,
   neutral cold-gray scale, market green/red, blue links.
   ========================================================================== */

/* ---------- Tokens (light) ---------- */
:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --surface-3: #f9f9f9;
  --ink: #000000;
  --ink-2: #2b2b2b;
  --muted: #707070;
  --line: #ebebeb;
  --line-strong: #dbdbdb;
  --brand: #2962ff;
  --brand-hover: #1e53e5;
  --brand-soft: #e3ebff;
  --on-brand: #ffffff;
  --cta: #000000;          /* main button: black on light */
  --cta-ink: #ffffff;
  --cta-hover: #2b2b2b;
  --gain: #089981;
  --gain-soft: #e1f5f1;
  --loss: #f23645;
  --amber: #b26a00;
  --amber-soft: #fff3e0;
  --band: #000000;         /* black hero / header bands */

  --font-display: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;

  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-base: 1.0625rem;
  --t-md: 1.25rem;
  --t-lg: 1.75rem;
  --t-xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.25rem);
  --t-2xl: clamp(2.375rem, 1.5rem + 3.4vw, 4rem);

  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-sheet: 32px;
  --r-pill: 999px;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 70ch;

  --shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.04), 0 16px 40px -20px rgba(0, 0, 0, 0.18);
  color-scheme: light;
}

/* ---------- Dark tokens: whole page in dark mode, and every black band ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f0f0f; --surface: #131313; --surface-2: #1f1f1f; --surface-3: #1a1a1a;
    --ink: #ffffff; --ink-2: #dbdbdb; --muted: #8c8c8c;
    --line: #2b2b2b; --line-strong: #464646;
    --brand: #3179f5; --brand-hover: #5b96f7; --brand-soft: #142a52; --on-brand: #ffffff;
    --cta: #ffffff; --cta-ink: #000000; --cta-hover: #dbdbdb;
    --gain: #22ab94; --gain-soft: #0d2b26; --loss: #f7525f;
    --amber: #ffb74d; --amber-soft: #2b2010;
    --shadow-lift: 0 16px 40px -20px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"],
.on-dark, .hero, .page-head, .cta-band, .site-head:not(.is-scrolled) {
  --paper: #0f0f0f; --surface: #131313; --surface-2: #1f1f1f; --surface-3: #1a1a1a;
  --ink: #ffffff; --ink-2: #dbdbdb; --muted: #8c8c8c;
  --line: #2b2b2b; --line-strong: #464646;
  --brand: #3179f5; --brand-hover: #5b96f7; --brand-soft: #142a52; --on-brand: #ffffff;
  --cta: #ffffff; --cta-ink: #000000; --cta-hover: #dbdbdb;
  --gain: #22ab94; --gain-soft: #0d2b26; --loss: #f7525f;
  --amber: #ffb74d; --amber-soft: #2b2010;
  --shadow-lift: 0 16px 40px -20px rgba(0, 0, 0, 0.8);
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--band);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--brand); color: var(--on-brand); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--t-2xl); letter-spacing: -0.02em; line-height: 1.08; }
h2 { font-size: var(--t-xl); letter-spacing: -0.015em; line-height: 1.22; }
h3 { font-size: var(--t-md); letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li + li { margin-top: 0.35em; }
strong { font-weight: 600; color: var(--ink); }
small { font-size: var(--t-xs); }
.num { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-sm);
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
/* Black over the hero band, turns white once the page scrolls under it */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--band);
  border-bottom: 1px solid transparent;
  transition: background-color .2s ease, border-color .2s ease;
}
.site-head.is-scrolled {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom-color: var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); text-decoration: none; }
.logo svg { width: 26px; height: 26px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 600;
  padding: 8px 14px; border-radius: var(--r-sm);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

@media (max-width: 880px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 8px; border-radius: var(--r-sm); font-size: var(--t-base); }
  .head-actions { margin-left: auto; }
  .head-actions .btn { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--r-sm);
  font: inherit; font-weight: 600; font-size: var(--t-sm); text-decoration: none; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--cta); color: var(--cta-ink); }
.btn-primary:hover { background: var(--cta-hover); color: var(--cta-ink); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: var(--t-base); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- Black bands (hero, inner page heads) ---------- */
.hero, .page-head {
  position: relative;
  background:
    radial-gradient(55% 60% at 78% 100%, rgba(41, 98, 255, 0.26), transparent 70%),
    radial-gradient(40% 50% at 12% 0%, rgba(8, 153, 129, 0.12), transparent 70%),
    var(--band);
  color: var(--ink);
}
/* Content sits on a white sheet with rounded top corners, overlapping the band */
.page {
  position: relative; background: var(--paper);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; margin-top: calc(var(--r-sheet) * -1);
}

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 6vw, 88px) 0 calc(clamp(48px, 6vw, 88px) + var(--r-sheet)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.updated {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  font-size: var(--t-xs); font-weight: 600; color: var(--gain);
  background: var(--gain-soft); padding: 6px 12px 6px 10px; border-radius: var(--r-pill);
}
.updated::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero h1 { margin-bottom: 24px; max-width: 14ch; }
.lede { font-size: var(--t-md); line-height: 1.5; color: var(--ink-2); max-width: 46ch; margin-bottom: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.disclose-inline { font-size: var(--t-xs); color: var(--muted); max-width: 52ch; margin: 0; }
.disclose-inline a { color: inherit; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 18ch; }
}

/* ---------- Savings calculator (the signature element) ---------- */
.calc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lift); padding: clamp(18px, 2.4vw, 28px);
}
.calc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.calc-head h2 { font-size: var(--t-md); }
.calc-head span { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.seg {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: var(--r-md); margin: 0 0 18px; border: 0;
}
.seg legend { padding: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  text-align: center; padding: 9px 4px; border-radius: 7px; cursor: pointer;
  font-size: var(--t-sm); font-weight: 600; color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.seg label:hover { color: var(--ink); }
.seg input:checked + label { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 1px; }

.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid text { fill: var(--muted); font-size: 12px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .bar-label { fill: var(--ink-2); font-size: 13.5px; font-weight: 600; font-family: var(--font); }
.chart .bar-value { fill: var(--ink); font-size: 16px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .delta-value { fill: var(--gain); font-size: 15px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .is-narrow .bar-value { font-size: 13.5px; }
.chart .is-narrow .delta-value { font-size: 12.5px; }
.chart .is-narrow .bar-label { font-size: 12.5px; }
.chart .body-full { fill: var(--ink); }
.chart .body-net { fill: var(--brand); }
.chart .body-gain { fill: var(--gain); }
.chart .wick { stroke: var(--line-strong); stroke-width: 1.5; }
.chart .connector { stroke: var(--line-strong); stroke-dasharray: 3 3; stroke-width: 1; }
.chart rect, .chart line.wick, .chart text { transition: all .45s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { .chart rect, .chart line.wick, .chart text { transition: none; } }

.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 16px; }
.readout div { background: var(--surface); padding: 12px 14px; }
.readout dt { font-size: var(--t-xs); color: var(--muted); margin-bottom: 2px; }
.readout dd { margin: 0; font-family: var(--font-display); font-size: 1.1875rem; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.readout .is-gain { color: var(--gain); }
.calc-note { font-size: var(--t-xs); color: var(--muted); margin: 14px 0 0; }
.calc .btn { width: 100%; margin-top: 16px; }
@media (max-width: 480px) {
  .readout { grid-template-columns: 1fr; }
  .readout div { display: flex; justify-content: space-between; align-items: baseline; }
  .seg label { font-size: var(--t-xs); }
}

/* ---------- Article layout with sticky TOC ---------- */
.page { padding: clamp(32px, 5vw, 56px) 0 clamp(56px, 8vw, 96px); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: 88px; }
.toc-box { border-left: 1px solid var(--line); padding-left: 20px; }
.toc h2 { font-size: var(--t-sm); font-weight: 700; margin-bottom: 12px; color: var(--ink); letter-spacing: 0; }
.toc ol { list-style: none; padding: 0; margin: 0 0 28px; }
.toc li + li { margin-top: 2px; }
.toc a {
  display: block; font-size: var(--t-sm); color: var(--muted); text-decoration: none;
  padding: 5px 0 5px 12px; margin-left: -21px; border-left: 2px solid transparent; line-height: 1.35;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--brand); font-weight: 600; }
.offer-mini {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px;
}
.offer-mini p { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: 14px; }
.offer-mini strong { display: block; font-size: var(--t-base); margin-bottom: 4px; }
.offer-mini .btn { width: 100%; }
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); color: var(--ink-2); }
.prose > section { padding-top: clamp(40px, 5vw, 56px); }
.prose > section:first-child { padding-top: 0; }
.prose h2 { margin-bottom: 18px; }
.prose h3 { margin: 28px 0 10px; }
.prose p, .prose li { font-size: var(--t-base); }
.prose .wide { max-width: none; }

.answer {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--r-md); padding: 20px 22px; margin: 0 0 8px;
}
.answer p:last-child { margin-bottom: 0; }
.answer p:first-child { font-size: var(--t-md); line-height: 1.5; color: var(--ink); }

.callout {
  border-radius: var(--r-md); padding: 16px 18px; margin: 20px 0; font-size: var(--t-sm);
  background: var(--amber-soft); color: var(--ink);
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--amber); }

/* Real sequences only */
.steps { list-style: none; padding: 0; margin: 24px 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 22px 52px; margin: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 600; font-family: var(--font-display); font-size: var(--t-sm); color: var(--brand); background: var(--brand-soft);
  font-variant-numeric: tabular-nums;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 16.5px; top: 36px; bottom: 4px; width: 1px; background: var(--line-strong);
}
.steps strong { display: block; margin-bottom: 2px; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 20px 0 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-weight: 700; color: var(--ink); background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yes { color: var(--gain); font-weight: 600; }
.no { color: var(--loss); font-weight: 600; }
.table-note { font-size: var(--t-xs); color: var(--muted); }

/* Comparison list (savings methods) */
.methods { display: grid; gap: 0; margin: 20px 0; border-top: 1px solid var(--line); }
.method { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.method-figure { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.method-figure small { display: block; font-size: var(--t-xs); font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.method h3 { margin: 0 0 6px; font-size: var(--t-base); }
.method p { margin: 0; font-size: var(--t-sm); }
@media (max-width: 560px) { .method { grid-template-columns: 1fr; gap: 6px; } }

/* Plan picker */
.picks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 20px 0; }
.pick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.pick h3 { margin: 0 0 2px; font-size: var(--t-base); }
.pick .price { font-size: var(--t-sm); color: var(--muted); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.pick p { font-size: var(--t-sm); margin: 0; }
@media (max-width: 560px) { .picks { grid-template-columns: 1fr; } }

/* FAQ */
.faq { border-top: 1px solid var(--line); margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative;
  font-weight: 600; color: var(--ink); font-size: var(--t-base);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > div { padding: 0 0 18px; }
.faq details > div p:last-child { margin-bottom: 0; }

/* Final CTA band */
.cta-band {
  margin-top: clamp(48px, 6vw, 72px); background:
    radial-gradient(60% 90% at 100% 100%, rgba(41, 98, 255, 0.3), transparent 70%), var(--band);
  color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(28px, 4vw, 48px);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
}
.cta-band h2 { font-size: var(--t-lg); margin-bottom: 8px; }
.cta-band p { color: var(--ink-2); margin: 0; font-size: var(--t-sm); max-width: 52ch; }
@media (max-width: 720px) { .cta-band { grid-template-columns: 1fr; } .cta-band .btn { width: 100%; } }

/* Related links */
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.related a {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; text-decoration: none; color: var(--ink);
}
.related a:hover { border-color: var(--brand); color: var(--ink); }
.related strong { display: block; margin-bottom: 4px; }
.related span { font-size: var(--t-sm); color: var(--muted); }
@media (max-width: 720px) { .related { grid-template-columns: 1fr; } }

/* Simple page header (inner pages) */
.page-head { padding: clamp(40px, 6vw, 80px) 0 calc(clamp(40px, 5vw, 64px) + var(--r-sheet)); }
.page-head h1 { font-size: clamp(2.125rem, 1.3rem + 2.8vw, 3.5rem); max-width: 20ch; margin-bottom: 18px; }
.page-head .lede { max-width: 60ch; }
.crumbs { font-size: var(--t-xs); color: var(--muted); margin-bottom: 18px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-xs); color: var(--muted); margin-top: 6px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 48px 0 32px; font-size: var(--t-sm); color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.foot-grid h2 { font-size: var(--t-sm); color: var(--ink); margin-bottom: 10px; letter-spacing: 0; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--brand); text-decoration: underline; }
.foot-legal { border-top: 1px solid var(--line); padding-top: 20px; font-size: var(--t-xs); line-height: 1.6; }
.foot-legal p { max-width: 110ch; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Page-load moment: chart draws once ---------- */
@media (prefers-reduced-motion: no-preference) {
  .chart.is-intro rect { transform-box: fill-box; transform-origin: bottom; animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
  .chart.is-intro g.bar:nth-of-type(2) rect { animation-delay: .12s; }
  .chart.is-intro g.bar:nth-of-type(3) rect { animation-delay: .24s; }
  .chart.is-intro g.bar:nth-of-type(4) rect { animation-delay: .36s; }
  .chart.is-intro g.bar:nth-of-type(5) rect { animation-delay: .48s; }
  @keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}

@media print {
  .site-head, .toc, .calc, .cta-band, .site-foot .foot-grid { display: none; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   Conversion components
   ========================================================================== */

/* ---------- Offer button: the one blue, glowing action on the page ---------- */
.btn-offer {
  --glow: rgba(41, 98, 255, 0.55);
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #3d73ff 0%, #2962ff 55%, #1f55ec 100%);
  color: #fff; border-radius: 10px; font-weight: 700; font-family: var(--font-display);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 28px -10px var(--glow);
  padding-right: 10px;
}
.btn-offer:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 16px 34px -10px var(--glow); }
.btn-offer:active { transform: translateY(0); }
.btn-offer .go {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.18); margin-left: 6px; transition: transform .2s ease;
}
.btn-offer:hover .go { transform: translateX(2px); }
.btn-offer .go svg { width: 14px; height: 14px; }
/* Light sweep on hover only (user-triggered) */
.btn-offer::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  transform: translateX(-120%);
}
@media (prefers-reduced-motion: no-preference) {
  .btn-offer:hover::after { transform: translateX(120%); transition: transform .7s ease; }
}
.btn-offer.btn-lg { padding: 10px 10px 10px 24px; min-height: 56px; font-size: 1.0625rem; }
.btn-offer.btn-lg .go { width: 36px; height: 36px; }
.btn-block { width: 100%; justify-content: space-between; }
.btn-offer:focus-visible { outline: 3px solid #9db8ff; outline-offset: 3px; }
.btn-note { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 8px; }

/* ---------- Announcement bar ---------- */
.announce {
  background: #1a1a1a; color: #dbdbdb; font-size: var(--t-sm); text-align: center;
  padding: 9px var(--gutter); border-bottom: 1px solid #2b2b2b;
}
.announce a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.4); }
.announce a:hover { color: #fff; text-decoration-color: #fff; }
.announce .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff9800; margin-right: 8px; vertical-align: 1px; }

/* ---------- Coupon ticket (signature element) ---------- */
.ticket {
  --notch: var(--band);
  --accent: #2962ff;
  position: relative; display: grid; grid-template-columns: 132px 1fr;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  margin: 0 0 18px; max-width: 560px;
}
.ticket-value {
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 18px 12px; border-right: 2px dashed var(--line-strong); position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 80%);
  border-radius: var(--r-md) 0 0 var(--r-md);
}
/* Punched notches where the dashed tear line meets the edges */
.ticket-value::before, .ticket-value::after {
  content: ""; position: absolute; right: -11px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--notch); border: 1px solid var(--line-strong);
}
.ticket-value::before { top: -11px; clip-path: inset(50% 0 0 0); }
.ticket-value::after { bottom: -11px; clip-path: inset(0 0 50% 0); }
.ticket-amount { font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.ticket-unit { font-size: var(--t-xs); color: var(--ink-2); margin-top: 6px; line-height: 1.3; }
.ticket-body { padding: 16px 18px; min-width: 0; }
.ticket-title { font-family: var(--font-display); font-weight: 600; font-size: var(--t-md); color: var(--ink); margin: 0 0 4px; line-height: 1.25; }
.ticket-terms { font-size: var(--t-xs); color: var(--muted); margin: 0 0 12px; }
.ticket-code {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.ticket-chip {
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-2);
  border: 1px dashed var(--line-strong); border-radius: 6px; padding: 7px 10px; white-space: nowrap;
}
.ticket .btn-offer { min-height: 44px; }
.ticket.is-activated .ticket-chip { color: var(--gain); border-color: var(--gain); border-style: solid; }
.ticket-bf { --accent: #ff9800; }
.ticket-bf .btn-offer { --glow: rgba(255, 152, 0, 0.5); background: linear-gradient(180deg, #ffb13b, #ff9800 55%, #f08800); color: #000; }
.ticket-bf .btn-offer:hover { color: #000; }
.ticket-bf .btn-offer .go { background: rgba(0,0,0,.12); }
.ticket-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--amber); }
.ticket-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* Tickets inside the white sheet punch through to the sheet colour */
.page .ticket { --notch: var(--paper); }
@media (max-width: 480px) {
  .ticket { grid-template-columns: 96px 1fr; }
  .ticket-amount { font-size: 1.875rem; }
  .ticket-body { padding: 14px; }
  .ticket .btn-offer { width: 100%; justify-content: space-between; }
}

/* ---------- Plan cards with actions ---------- */
.pick { display: flex; flex-direction: column; }
.pick p:not(.price) { flex: 1; }
.pick .btn { margin-top: 14px; }
.pick.is-popular { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); position: relative; }
.pick .tag { position: absolute; top: -11px; left: 16px; background: var(--brand); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: var(--r-pill); }

/* ---------- Inline offer strip between sections ---------- */
.offer-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; margin: 24px 0 0;
}
.offer-strip p { margin: 0; color: var(--ink); font-weight: 600; font-size: var(--t-sm); }
.offer-strip p span { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-xs); }

/* ---------- Sticky mobile offer bar ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; align-items: center; gap: 12px;
  background: rgba(0, 0, 0, 0.94); color: #fff; border-top: 1px solid #2b2b2b;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transform: translateY(110%); transition: transform .25s ease;
}
.sticky-cta.is-visible { transform: translateY(0); }
.sticky-cta p { margin: 0; flex: 1; font-size: var(--t-xs); line-height: 1.35; color: #dbdbdb; }
.sticky-cta strong { display: block; color: #fff; font-size: var(--t-sm); }
.sticky-cta .btn-offer { min-height: 42px; padding: 6px 6px 6px 14px; font-size: var(--t-sm); }
.sticky-cta .btn-offer .go { width: 28px; height: 28px; }
.sticky-close { background: none; border: 0; color: #8c8c8c; width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.sticky-close:hover { color: #fff; }
.sticky-close svg { width: 16px; height: 16px; }
@media (max-width: 880px) {
  .sticky-cta { display: flex; }
  body.has-sticky { padding-bottom: 72px; }
}

/* Ticket text must win over generic .prose paragraph sizing */
.ticket p.ticket-title { font-size: var(--t-md); color: var(--ink); margin: 0 0 4px; }
.ticket p.ticket-terms { font-size: var(--t-xs); line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.offer-strip p { font-size: var(--t-sm); }

@media print { .announce, .sticky-cta, .ticket .btn { display: none; } }

/* Byline on dark bands, sources list */
.hero .byline, .page-head .byline { display: block; max-width: 60ch; margin-top: 10px; font-size: var(--t-xs); color: var(--muted); }
.byline a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.sources li { font-size: var(--t-sm); }
.sources a { font-weight: 600; }

/* Editorial illustrations */
.figure { margin: 0 0 24px; }
.figure img {
  width: 100%; height: auto; aspect-ratio: 1376 / 768; object-fit: cover;
  border-radius: var(--r-md); border: 1px solid var(--line); background: #000;
}

/* ---------- Hero background image: glowing chart horizon ---------- */
.hero {
  background:
    linear-gradient(90deg, rgba(0,0,0,.94) 0%, rgba(0,0,0,.78) 34%, rgba(0,0,0,.25) 70%, rgba(0,0,0,.05) 100%),
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 30%),
    url("/assets/img/hero-chart-horizon.webp") right bottom / cover no-repeat,
    var(--band);
}
@media (max-width: 960px) {
  /* Stacked layout: keep the horizon as a band behind the headline */
  .hero {
    background:
      linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.65) 32%, #000 62%),
      url("/assets/img/hero-chart-horizon-900.webp") 72% 0 / auto 420px no-repeat,
      var(--band);
  }
}

/* Keep nav labels on one line; drop the header button on mid-width screens */
.nav a { white-space: nowrap; }
@media (min-width: 881px) and (max-width: 1240px) {
  .head-actions .btn { display: none; }
}

/* Author card on the About page */
.author-card { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.author-avatar {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #2962ff, #089981); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; letter-spacing: 0.02em;
}
.prose .author-card p { margin: 0; }
.prose .author-card .author-name { font-family: var(--font-display); font-weight: 600; font-size: var(--t-md); color: var(--ink); }
.prose .author-card .author-role { font-size: var(--t-sm); color: var(--muted); }

/* Domain-style wordmark */
.logo { min-width: 0; }
.logo-text { white-space: nowrap; letter-spacing: -0.015em; }
.logo-tld { color: var(--muted); font-weight: 600; }
@media (max-width: 1180px) { .logo { font-size: 1.0625rem; } }
@media (max-width: 420px) { .logo { font-size: 0.9375rem; gap: 8px; } .logo svg { width: 22px; height: 22px; } }
.site-foot .logo { font-size: 1.0625rem; }

.head-actions .btn { white-space: nowrap; }

/* One attention moment: the hero coupon button glows three times after load */
@media (prefers-reduced-motion: no-preference) {
  .btn-pulse { animation: offer-pulse 1.6s ease-out 1.2s 3; }
  @keyframes offer-pulse {
    0%   { box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 28px -10px rgba(41,98,255,.55), 0 0 0 0 rgba(41,98,255,.65); }
    100% { box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 28px -10px rgba(41,98,255,.55), 0 0 0 16px rgba(41,98,255,0); }
  }
}
/* Sidebar and CTA band offers read as headlines */
.offer-mini strong { font-family: var(--font-display); font-size: var(--t-md); }
.cta-band .btn-offer.btn-lg { min-height: 60px; font-size: 1.125rem; }

/* ==========================================================================
   Black Friday countdown popup (real date: Nov 27, 2026)
   ========================================================================== */
.bf-pop[hidden] { display: none; }
.bf-pop { position: fixed; inset: 0; z-index: 1000; isolation: isolate; display: grid; place-items: center; padding: 16px; }
.bf-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 8, 0.78); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.bf-card {
  position: relative; width: min(100%, 460px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(255, 152, 0, 0.28), transparent 70%),
    radial-gradient(60% 50% at 100% 100%, rgba(242, 54, 69, 0.18), transparent 70%),
    #0f0f0f;
  border: 1px solid rgba(255, 152, 0, 0.35); border-radius: 22px; color: #fff;
  padding: clamp(22px, 4vw, 30px) clamp(18px, 4vw, 26px) 22px; text-align: center;
  box-shadow: 0 32px 90px -22px rgba(0, 0, 0, .85), 0 18px 56px -28px rgba(255, 152, 0, .7), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.bf-close {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: rgba(255,255,255,.06); color: #b8b8b8; cursor: pointer; display: grid; place-items: center;
}
.bf-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.bf-close:focus-visible, .bf-skip:focus-visible { outline: 3px solid #ffb74d; outline-offset: 2px; }
.bf-close svg { width: 16px; height: 16px; }
.bf-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 700;
  color: #ffb74d; background: rgba(255, 152, 0, 0.12); border: 1px solid rgba(255, 152, 0, 0.3);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.bf-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff9800; box-shadow: 0 0 10px #ff9800; }
.bf-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.75rem, 1.3rem + 2vw, 2.25rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 10px; color: #fff; }
.bf-big { display: block; font-size: 1.35em; background: linear-gradient(180deg, #ffd08a, #ff9800 60%, #f57c00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bf-sub { color: #dbdbdb; font-size: var(--t-sm); margin: 0 auto 20px; max-width: 34ch; }
.bf-countdown { margin: 0 0 18px; padding: 12px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; }
.bf-timer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.bf-unit { min-width: 0; background: rgba(255,255,255,.065); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 10px 3px 8px; }
.bf-num { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.875rem; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.bf-lab { display: block; overflow: hidden; font-size: 0.6875rem; color: #aaa; margin-top: 6px; text-overflow: ellipsis; }
.bf-cta { width: 100%; justify-content: space-between; min-height: 56px; font-size: 1.0625rem; }
.bf-pop .btn-offer.bf-cta { --glow: rgba(255, 152, 0, 0.55); background: linear-gradient(180deg, #ffb13b, #ff9800 55%, #f08800); color: #000; }
.bf-pop .btn-offer.bf-cta:hover { color: #000; }
.bf-pop .btn-offer.bf-cta .go { background: rgba(0,0,0,.12); }
.bf-bonus { margin: 14px 0 0; font-size: var(--t-xs); color: #b8b8b8; }
.bf-bonus strong { color: #fff; }
.bf-skip { min-height: 44px; margin-top: 4px; padding: 0 12px; background: none; border: 0; color: #aaa; font: inherit; font-size: var(--t-xs); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bf-skip:hover { color: #fff; }
.bf-fine { margin: 4px auto 0; max-width: 52ch; font-size: 0.6875rem; line-height: 1.45; color: #9a9a9a; }
@media (prefers-reduced-motion: no-preference) {
  .bf-pop:not([hidden]) .bf-card { animation: bf-in .35s cubic-bezier(.2,.8,.2,1) both; }
  .bf-pop:not([hidden]) .bf-backdrop { animation: bf-fade .25s ease both; }
  @keyframes bf-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes bf-fade { from { opacity: 0; } to { opacity: 1; } }
}
/* Phones: a bottom sheet instead of a full-screen interstitial (friendlier for Google's mobile guidelines) */
@media (max-width: 600px) {
  .bf-pop { place-items: end center; padding: 0; }
  .bf-card {
    width: 100%; max-width: none; max-height: calc(100vh - env(safe-area-inset-top)); max-height: calc(100dvh - env(safe-area-inset-top));
    border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 24px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .bf-num { font-size: clamp(1.35rem, 7vw, 1.65rem); }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes bf-in { from { transform: translateY(100%); } to { transform: none; } }
  }
}
body.bf-open { overflow: hidden; }

/* Popup v2: 80% as the hero number, hours-format timer, $15 bonus row */
.bf-title { margin: 0 0 4px; }
.bf-upto { display: block; font-size: 1.125rem; font-weight: 600; color: #dbdbdb; letter-spacing: 0; margin-bottom: 2px; }
.bf-huge {
  display: inline-flex; align-items: flex-start; font-size: clamp(5rem, 3.6rem + 7vw, 7rem); line-height: .9; letter-spacing: -0.05em;
  background: linear-gradient(180deg, #ffe0a8 0%, #ffb13b 45%, #f57c00 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 30px rgba(255, 152, 0, .35));
}
.bf-off { font-size: .32em; letter-spacing: -0.01em; margin: .25em 0 0 .12em; }
.bf-pop .bf-sub { font-size: var(--t-xs); color: #b8b8b8; margin: 0 auto 18px; }
.bf-timer-label { margin: 0 0 9px; font-size: var(--t-xs); font-weight: 700; color: #ffc266; letter-spacing: .01em; }
.bf-plus {
  display: flex; align-items: center; gap: 12px; text-align: left; margin: 0 0 14px;
  background: rgba(41, 98, 255, .12); border: 1px dashed rgba(91, 150, 247, .55); border-radius: 12px; padding: 10px 12px;
}
.bf-plus-amt { flex: none; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: #8fb1ff; letter-spacing: -0.02em; }
.bf-plus-txt { font-size: var(--t-xs); color: #dbdbdb; line-height: 1.4; }
.bf-plus-txt strong { display: block; color: #fff; font-size: var(--t-sm); }
@media (max-width: 600px) { .bf-huge { font-size: clamp(4rem, 22vw, 5.25rem); } }
@media (max-width: 360px) {
  .bf-card { padding-inline: 12px; }
  .bf-countdown { padding: 9px; }
  .bf-timer { gap: 5px; }
  .bf-unit { border-radius: 10px; padding-inline: 2px; }
  .bf-lab { font-size: .625rem; }
}
@media (max-height: 700px) {
  .bf-card { padding-top: 20px; }
  .bf-badge { margin-bottom: 8px; }
  .bf-huge { font-size: clamp(4rem, 14vh, 5.5rem); }
  .bf-pop .bf-sub { margin-bottom: 12px; }
  .bf-countdown { margin-bottom: 12px; padding-block: 9px; }
  .bf-unit { padding-block: 7px 6px; }
  .bf-plus { margin-bottom: 10px; padding-block: 8px; }
}
