/* ==========================================================================
   SITE BUILD SYSTEM — system.css  v1.0
   One token set + one component vocabulary for landing pages and blog posts.

   The source library ran three unrelated design systems: a dark purple hub
   (#6c63ff) for the landing pages, a light lime/blue set (#b9d82d / #1677c8)
   for the blog wireframes, and a Tailwind CDN sky/amber theme for the blog
   demos. Nothing shared a token, so a page moved between the two libraries
   had to be restyled by hand. This file is the merge.

   Two deliberate carry-overs from the blog wireframe CSS, because they were
   the best decisions in the source set:
     1. --accent (brand) and --cta (action) are SEPARATE tokens. When brand
        colour doubles as button colour, every branded element competes with
        the button for the click.
     2. Sidebar offer cards are a first-class component, not an afterthought.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Ink & surface */
  --ink:          #1a1d27;
  --ink-soft:     #3f4553;
  --muted:        #6c7280;
  --surface:      #ffffff;
  --surface-alt:  #f4f6f8;
  --surface-deep: #0f1117;
  --line:         #dfe3e8;

  /* Brand vs action — keep these different */
  --accent:       #6c63ff;   /* brand / eyebrows / accents */
  --accent-dark:  #554ddb;
  --accent-wash:  #f0efff;
  --cta:          #1677c8;   /* buttons only */
  --cta-dark:     #0f5f9f;

  /* Semantic */
  --good:         #16a34a;
  --warn:         #f59e0b;
  --bad:          #dc2626;
  --good-wash:    #e8f5e9;
  --warn-wash:    #fff8e6;
  --bad-wash:     #fdeaea;

  /* Type */
  --font-body:    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head:    var(--font-body);
  --step--1:      clamp(.83rem, .8rem + .15vw, .9rem);
  --step-0:       clamp(1rem, .96rem + .2vw, 1.06rem);
  --step-1:       clamp(1.2rem, 1.1rem + .5vw, 1.4rem);
  --step-2:       clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3:       clamp(1.9rem, 1.5rem + 2vw, 2.9rem);
  --step-4:       clamp(2.2rem, 1.6rem + 3vw, 3.4rem);

  /* Space & shape */
  --max:          1160px;
  --measure:      68ch;
  --radius:       14px;
  --radius-sm:    9px;
  --shadow:       0 16px 40px rgba(26, 33, 43, .08);
  --shadow-lift:  0 22px 48px rgba(26, 33, 43, .14);
  --gap:          clamp(1rem, .6rem + 1.6vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --ink: #e8eaf6; --ink-soft: #c3c7da; --muted: #8b8fa8;
    --surface: #1a1d27; --surface-alt: #0f1117; --line: #2e3250;
    --accent-wash: #23213f;
  }
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface-alt);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--cta); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: var(--step-2); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 700; }
p  { text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   3. LAYOUT
   -------------------------------------------------------------------------- */
.shell   { max-width: var(--max); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 1.5rem); }
.shell--narrow { max-width: 760px; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tint { background: var(--surface); }

/* Article + sidebar. The blog templates all use this; landing pages usually
   drop the sidebar (a sidebar on a squeeze page is a leak, not a feature). */
.content-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .sidebar { position: sticky; top: 1.5rem; }
}
.article { max-width: var(--measure); }
.article > * + * { margin-top: 1.15em; }
.article h2 { margin-top: 2.2em; }
.article h3 { margin-top: 1.8em; }

/* --------------------------------------------------------------------------
   4. COMPONENTS
   -------------------------------------------------------------------------- */

/* Eyebrow / badge */
.eyebrow {
  display: inline-block; font-size: var(--step--1); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.badge {
  display: inline-block; padding: .3rem .8rem; border-radius: 99px;
  font-size: var(--step--1); font-weight: 700; letter-spacing: .04em;
  background: var(--accent-wash); color: var(--accent-dark);
}
.badge--good { background: var(--good-wash); color: var(--good); }
.badge--warn { background: var(--warn-wash); color: #92400e; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.6rem; border: 2px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--cta); color: #fff;
  transition: transform .18s, box-shadow .18s, background .18s;
  min-height: 48px; /* touch target */
}
.btn:hover { background: var(--cta-dark); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn:active { transform: translateY(0); }
.btn--lg    { padding: 1.15rem 2.2rem; font-size: var(--step-1); width: 100%; max-width: 460px; }
.btn--ghost { background: transparent; color: var(--cta); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); border-color: var(--cta); }
.btn--quiet { background: transparent; color: var(--muted); font-weight: 600; box-shadow: none; }
.btn--quiet:hover { background: transparent; color: var(--ink); transform: none; box-shadow: none; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; }
.card-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* Sidebar offer card — lead magnet on top, tripwire below. Order matters:
   the free offer earns the email, the paid offer monetises the ones ready now. */
.offer-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.offer-card + .offer-card { margin-top: var(--gap); }
.offer-card__head {
  background: var(--accent); color: #fff; padding: .9rem 1.1rem;
  font-weight: 800; font-size: var(--step--1); letter-spacing: .06em; text-transform: uppercase;
}
.offer-card--tripwire .offer-card__head { background: var(--ink); }
.offer-card__body { padding: 1.1rem; display: grid; gap: .8rem; }

/* Forms */
.field {
  width: 100%; padding: .85rem 1.05rem; border: 2px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; color: var(--ink);
  background: var(--surface); min-height: 48px;
}
.field:focus { border-color: var(--cta); outline: none; }
.form-stack { display: grid; gap: .85rem; }
.form-note  { font-size: var(--step--1); color: var(--muted); }
.form-success {
  display: none; background: var(--good-wash); border: 1px solid var(--good);
  border-radius: var(--radius-sm); padding: .9rem 1rem; color: #14532d; font-weight: 600;
}
.form-success.visible { display: block; }

/* Callouts */
.callout {
  border-left: 4px solid var(--accent); background: var(--accent-wash);
  padding: 1.1rem 1.3rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout--warn { border-color: var(--warn); background: var(--warn-wash); }
.callout--good { border-color: var(--good); background: var(--good-wash); }

/* Disclosure — legally required above the first affiliate link, not in the footer */
.disclosure {
  font-size: var(--step--1); color: var(--muted); background: var(--surface-alt);
  border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem;
}

/* Media placeholder — swap for a real <img> or <iframe> */
.media {
  aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--surface-alt), var(--accent-wash));
  border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: var(--step--1);
}
.media--square { aspect-ratio: 1; }
.figcaption { font-size: var(--step--1); color: var(--muted); margin-top: .5rem; }

/* Steps (how-to, YouTube cut-up, steps landing page) */
.step { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.step + .step { margin-top: 2rem; }
.step__num {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--cta); color: #fff; font-weight: 800;
}

/* Quote / expert card (quote post, crowdsourced, interview, testimonials) */
.quote-card { display: grid; gap: .9rem; }
.quote-card__person { display: flex; align-items: center; gap: .85rem; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-wash); border: 2px solid var(--line);
  display: grid; place-items: center; color: var(--accent-dark); font-weight: 800;
}
.quote-card__name { font-weight: 700; line-height: 1.3; }
.quote-card__title { font-size: var(--step--1); color: var(--muted); }
.pull-quote {
  border-left: 4px solid var(--accent); padding-left: 1.1rem;
  font-size: var(--step-1); font-style: italic; color: var(--ink-soft);
}

/* Stat card (stat round-up) */
.stat-card { display: grid; gap: .45rem; }
.stat-card__num { font-size: var(--step-3); font-weight: 800; color: var(--accent); line-height: 1; }
.stat-card__src { font-size: var(--step--1); color: var(--muted); }

/* Comparison table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.compare { width: 100%; border-collapse: collapse; min-width: 600px; background: var(--surface); }
table.compare th, table.compare td { padding: .9rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
table.compare thead th { background: var(--surface-alt); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .05em; }
table.compare tr.is-winner { background: var(--good-wash); }

/* Pros / cons */
.proscons { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.proscons ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.proscons li { display: flex; gap: .55rem; }
.proscons--pro li::before { content: "✓"; color: var(--good); font-weight: 800; }
.proscons--con li::before { content: "✕"; color: var(--bad); font-weight: 800; }

/* Checklist bullets */
.checks { list-style: none; padding: 0; display: grid; gap: .6rem; }
.checks li { display: flex; gap: .6rem; }
.checks li::before { content: "✓"; color: var(--cta); font-weight: 800; flex-shrink: 0; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .shell { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.site-footer { background: var(--surface-deep); color: #9ba0b8; padding-block: 2.5rem; font-size: var(--step--1); }
.site-footer a { color: #c3c7da; }

/* Post meta */
.post-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: var(--step--1); color: var(--muted); }

/* Print — resource pages and comparison tables get printed more than you'd think */
@media print {
  .site-header, .site-footer, .sidebar, .btn { display: none !important; }
  body { background: #fff; }
}
