@layer reset, tokens, elements, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: auto; }
  body, h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
  img, svg { display: block; max-width: 100%; }
  button, input, textarea, select { font: inherit; }
}

@layer tokens {
  :root {
    --ink: #182941;
    --slate: #304b70;
    --slate-soft: #dce5f0;
    --surface: #f7f9fc;
    --paper: #eef3f8;
    --accent: #b4df25;
    --accent-ink: #24320a;
    --line: #8da0b8;
    --space-xs: .25rem;
    --space-sm: .5rem;
    --space-md: .75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;
    --space-4xl: 4rem;
    --space-5xl: 6rem;
    --radius-sm: .5rem;
    --radius-lg: 1.25rem;
    --container: 76rem;
    --reading: 70ch;
  }
}

@layer elements {
  html { background: var(--surface); color: var(--ink); }
  body {
    min-width: 20rem;
    padding-top: 2.5rem;
    padding-bottom: 9rem;
    font-family: Baskerville, "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.65;
    background-color: var(--surface);
    background-image:
      linear-gradient(rgba(48,75,112,.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(48,75,112,.045) 1px, transparent 1px);
    background-size: 72px 72px;
  }
  a { color: var(--slate); text-decoration: none; }
  a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
  a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
  }
  h1, h2, h3 { line-height: 1.04; text-wrap: balance; }
  h1 { font-size: clamp(2.85rem, 8vw, 6.8rem); font-weight: 700; letter-spacing: -.055em; }
  h2 { font-size: clamp(2.15rem, 4.5vw, 4.25rem); font-weight: 700; letter-spacing: -.04em; }
  h3 { font-size: clamp(1.35rem, 2vw, 1.8rem); font-weight: 700; letter-spacing: -.02em; }
  p, li { max-width: var(--reading); }
  small { font-size: .82rem; line-height: 1.45; }
}

@layer components {
  .container { width: min(calc(100% - 2rem), var(--container)); margin-inline: auto; }
  .narrow { width: min(calc(100% - 2rem), 52rem); margin-inline: auto; }
  .eyebrow, .badge, .utility-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .eyebrow { display: inline-block; padding-bottom: var(--space-sm); border-bottom: 1px dashed var(--slate); }
  .accent { color: var(--accent-ink); background: var(--accent); padding-inline: .12em; }
  .age-bar {
    position: fixed; inset: 0 0 auto; z-index: 20;
    min-height: 2.5rem; display: flex; align-items: center; justify-content: center;
    padding: .45rem 1rem; background: var(--ink); color: var(--surface);
    font-size: .84rem; text-align: center;
  }
  .age-bar a { color: var(--accent); }
  .site-header {
    background: rgba(247,249,252,.96);
    border-bottom: 1px dashed var(--line);
  }
  .header-inner {
    min-height: 5.25rem; display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-xl);
  }
  .brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 700; font-size: 1.22rem; }
  .brand img { width: 2.45rem; height: 2.45rem; }
  .site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem 1.1rem; font-size: .93rem; }
  .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .22rem; text-underline-offset: .35rem; }
  .button {
    display: inline-flex; min-height: 2.9rem; align-items: center; justify-content: center;
    padding: .65rem 1rem; border: 1px dashed var(--ink); border-radius: 0;
    background: var(--accent); color: var(--accent-ink); font-weight: 700; line-height: 1.1;
  }
  .button:hover, .button:focus-visible { text-decoration: underline; }
  .button-secondary { background: transparent; color: var(--ink); }
  .badge {
    display: inline-block; padding: .4rem .55rem;
    border: 1px dashed var(--line); border-radius: .2rem;
    background: var(--paper); color: var(--ink);
  }
  .section { padding-block: clamp(4rem, 8vw, 7rem); }
  .section-head { display: grid; gap: var(--space-lg); margin-bottom: var(--space-3xl); }
  .section-head p { font-size: 1.18rem; }
  .diamond-break { display: grid; place-items: center; height: 2rem; color: var(--accent-ink); }
  .diamond-break::before { content: ""; width: .72rem; aspect-ratio: 1; background: var(--accent); transform: rotate(45deg); border: 1px dashed var(--ink); }
  .hero {
    position: relative; min-height: 34rem; display: grid; align-items: center;
    background-size: cover; background-position: center;
    border-bottom: 1px dashed var(--line);
  }
  .hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(247,249,252,.96) 0 48%, rgba(247,249,252,.64) 72%, rgba(247,249,252,.38)); }
  .hero-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(18rem, .55fr); gap: clamp(2rem, 7vw, 7rem); padding-block: clamp(4rem, 10vw, 8rem); }
  .hero-copy { display: grid; align-content: center; gap: var(--space-xl); }
  .hero-copy > p { max-width: 58ch; font-size: clamp(1.1rem, 2vw, 1.35rem); }
  .hero-side {
    align-self: start; position: sticky; top: 7rem; display: grid; gap: var(--space-xl);
    padding: var(--space-xl); border: 1px dashed var(--line); border-radius: var(--radius-lg);
    background: rgba(247,249,252,.88);
  }
  .hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-md); }
  .notice-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md); }
  .age-marker {
    display: inline-grid; place-items: center; width: 3.2rem; aspect-ratio: 1;
    border: 1px dashed var(--ink); border-radius: 50%; background: var(--accent); font-weight: 700;
  }
  .credibility {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border-block: 1px dashed var(--line); background: var(--paper);
  }
  .credibility > div { padding: var(--space-xl); border-right: 1px dashed var(--line); }
  .credibility > div:last-child { border-right: 0; }
  .credibility strong { display: block; font-size: 1.6rem; line-height: 1.1; }
  .featured-operator, .operator-row, .scorecard, .resource-card, .content-panel {
    border: 1px dashed var(--line); border-radius: var(--radius-lg); background: rgba(247,249,252,.93);
  }
  .featured-operator { display: grid; grid-template-columns: 1.65fr .7fr; overflow: hidden; }
  .operator-main { display: grid; gap: var(--space-lg); padding: clamp(1.5rem, 4vw, 3rem); }
  .operator-action { display: grid; align-content: center; gap: var(--space-lg); padding: var(--space-xl); border-left: 1px dashed var(--line); background: var(--paper); }
  .operator-title { display: flex; align-items: center; gap: var(--space-lg); }
  .operator-logo {
    display: grid; place-items: center; min-width: 7rem; min-height: 3.5rem;
    padding: .55rem .8rem; border: 1px dashed var(--line); background: var(--surface);
    font-weight: 700; text-align: center;
  }
  img.operator-logo { width: 7rem; height: 3.5rem; object-fit: contain; }
  .operator-list { margin-top: var(--space-xl); border-top: 1px dashed var(--line); }
  .operator-row {
    display: grid; grid-template-columns: minmax(9rem, .55fr) minmax(0, 1.55fr) minmax(12rem, .55fr);
    gap: var(--space-xl); align-items: center; padding: var(--space-xl) 0;
    border-width: 0 0 1px; border-radius: 0; background: transparent;
  }
  .operator-row .operator-logo { justify-self: start; }
  .operator-row__copy { display: grid; gap: var(--space-md); }
  .operator-row__action { display: grid; gap: var(--space-sm); justify-items: start; }
  .badges { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
  .grade { font-size: clamp(3rem, 6vw, 5.4rem); font-weight: 700; line-height: .85; letter-spacing: -.08em; }
  .affiliate-note { margin-top: var(--space-xl); padding: var(--space-xl); border: 1px dashed var(--line); background: var(--paper); }
  .scorecards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl); }
  .scorecard { display: grid; grid-template-columns: 6rem 1fr; overflow: hidden; }
  .scorecard-grade { display: grid; place-items: center; background: var(--accent); border-right: 1px dashed var(--ink); }
  .scorecard-body { padding: var(--space-xl); }
  .scorecard dl { display: grid; grid-template-columns: minmax(8rem, .7fr) 1fr; margin-top: var(--space-lg); border-top: 1px dashed var(--line); }
  .scorecard dt, .scorecard dd { padding: .55rem 0; border-bottom: 1px dashed var(--line); }
  .scorecard dt { font-weight: 700; padding-right: .6rem; }
  .method-grid, .article-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(17rem, .55fr); gap: var(--space-3xl); align-items: start; }
  .prose { display: grid; gap: var(--space-xl); }
  .prose h2 { margin-top: var(--space-xl); }
  .prose h3 { margin-top: var(--space-lg); }
  .prose ul, .prose ol { display: grid; gap: var(--space-md); padding-left: 1.3rem; }
  .content-panel { padding: var(--space-xl); }
  .content-panel img, .article-figure img { width: 100%; border-radius: var(--radius-sm); border: 1px dashed var(--line); }
  .article-figure { display: grid; gap: var(--space-sm); }
  .resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
  .resource-card { display: grid; align-content: space-between; min-height: 14rem; padding: var(--space-xl); color: var(--ink); }
  .resource-card:hover { text-decoration: none; border-color: var(--ink); }
  .resource-card img { max-width: 10rem; max-height: 3rem; object-fit: contain; object-position: left center; }
  .resource-card__name { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
  .faq-list { display: grid; gap: var(--space-xl); }
  .faq-item { padding-block: var(--space-xl); border-block: 1px dashed var(--line); }
  .faq-item + .faq-item { border-top: 0; }
  .faq-item h3 { margin-bottom: var(--space-md); }
  .myth-fact { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .myth-fact article { padding: var(--space-xl); border: 1px dashed var(--line); border-radius: var(--radius-lg); }
  .site-footer { padding-block: var(--space-4xl) 7rem; border-top: 1px dashed var(--line); background: var(--ink); color: var(--surface); }
  .footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: var(--space-3xl); }
  .site-footer a { color: var(--surface); }
  .footer-links { display: grid; align-content: start; gap: .45rem; }
  .footer-brand { display: grid; gap: var(--space-lg); }
  .footer-brand .brand { color: var(--surface); }
  .compact-disclaimer { grid-column: 1 / -1; padding-top: var(--space-xl); border-top: 1px dashed #70839e; color: #dce5f0; }
  .cookie-banner {
    position: fixed; inset: auto 1rem 1rem; z-index: 30;
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-xl);
    max-width: 64rem; margin-inline: auto; padding: var(--space-lg) var(--space-xl);
    border: 1px dashed var(--surface); border-radius: var(--radius-sm);
    background: var(--ink); color: var(--surface);
  }
  .cookie-banner[hidden] { display: none; }
  .cookie-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
  .cookie-banner .button-secondary { color: var(--surface); border-color: var(--surface); }
  .legal-meta { padding-block: var(--space-lg); border-bottom: 1px dashed var(--line); }
}

@layer responsive {
  @media (max-width: 820px) {
    body { padding-bottom: 12rem; }
    .header-inner { align-items: flex-start; flex-direction: column; padding-block: var(--space-lg); }
    .site-nav { justify-content: flex-start; }
    .hero-inner, .method-grid, .article-grid, .footer-grid { grid-template-columns: 1fr; }
    .hero-side { position: static; }
    .featured-operator, .operator-row { grid-template-columns: 1fr; }
    .operator-action { border-left: 0; border-top: 1px dashed var(--line); }
    .operator-row { padding-inline: 0; }
    .scorecards, .resource-grid, .myth-fact { grid-template-columns: 1fr; }
    .cookie-banner { grid-template-columns: 1fr; }
  }
  @media (max-width: 540px) {
    body { font-size: 1rem; padding-top: 3.6rem; }
    .age-bar { min-height: 3.6rem; }
    .credibility { grid-template-columns: 1fr; }
    .credibility > div { border-right: 0; border-bottom: 1px dashed var(--line); }
    .credibility > div:last-child { border-bottom: 0; }
    .scorecard { grid-template-columns: 4.5rem 1fr; }
    .scorecard dl { grid-template-columns: 1fr; }
    .scorecard dt { padding-bottom: 0; border-bottom: 0; }
    .hero-actions, .cookie-actions { align-items: stretch; flex-direction: column; }
    .button { width: 100%; }
  }
}
