@layer reset, base, layout, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, ol, ul, figure { margin: 0; }
  ol, ul { padding: 0; }
  img { display: block; max-width: 100%; }
  a { color: inherit; }
  button { color: inherit; font: inherit; }
}

@layer base {
  :root {
    color-scheme: dark;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --page: min(100% - 48px, 1220px);
  }
  body {
    min-width: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
  }
  h1 {
    color: var(--heading);
    font-size: clamp(2.75rem, 5.2vw, 4.75rem);
    font-weight: 650;
    line-height: 1;
    letter-spacing: -.042em;
    text-wrap: balance;
  }
  h2 {
    color: var(--heading);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.035em;
    text-wrap: balance;
  }
  h3 {
    color: var(--heading);
    font-size: clamp(1.35rem, 2vw, 1.875rem);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -.022em;
    text-wrap: balance;
  }
  p { max-width: 68ch; }
  ::selection { background: var(--accent); color: var(--accent-foreground); }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
  .skip-link {
    position: fixed;
    z-index: 20;
    top: 10px;
    left: 12px;
    padding: 10px 14px;
    transform: translateY(-160%);
    background: var(--accent);
    color: var(--accent-foreground);
    font-weight: 700;
  }
  .skip-link:focus { transform: translateY(0); }
  .eyebrow, .step-label, .panel-kicker, .item-number, .platform-name {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1.25;
    text-transform: uppercase;
  }
  .eyebrow { color: var(--accent); }
  .step-label, .platform-name { color: var(--secondary-accent); }
}

@layer layout {
  .site-header {
    width: var(--page);
    min-height: 72px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line);
  }
  .wordmark { display: flex; align-items: baseline; gap: 11px; text-decoration: none; }
  .wordmark span { color: var(--heading); font-size: 1.08rem; font-weight: 700; letter-spacing: -.025em; }
  .wordmark small { color: var(--muted); font-size: .78rem; }
  [data-logo-treatment="accent"] .wordmark span { color: var(--accent); }
  [data-logo-treatment="dark"] .wordmark { padding: 5px 8px; background: var(--heading); color: var(--background); }
  [data-logo-treatment="dark"] .wordmark span, [data-logo-treatment="dark"] .wordmark small { color: var(--background); }
  .site-header nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); }
  .site-header nav a { font-size: .75rem; font-weight: 650; text-underline-offset: 5px; }
  .site-header nav > a:not(.open-link):hover { color: var(--heading); }
  .age-mark { padding: 5px 7px; border: 1px solid var(--line); color: var(--muted); font-size: .68rem; font-weight: 700; }
  .open-link { min-height: 42px; padding: 9px 12px; display: inline-flex; align-items: center; gap: 7px; background: var(--heading); color: var(--background); text-decoration: none; }
  .open-link:hover { background: var(--accent); }

  .hero {
    width: var(--page);
    margin-inline: auto;
    padding: clamp(68px, 7vw, 92px) 0;
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(390px, 1fr);
    align-items: start;
    gap: clamp(44px, 6vw, 76px);
  }
  .hero-copy, .chooser-panel, .platform-grid > *, .audience-grid > * { min-width: 0; }
  .hero-copy { padding-top: 8px; }
  .hero-copy .eyebrow { margin-bottom: 18px; }
  .hero-copy h1 { max-width: 12ch; }
  .hero-copy .dek { max-width: 56ch; margin-top: 24px; color: var(--muted); font-size: 1.05rem; }
  .hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }

  .chooser-panel {
    padding: clamp(24px, 3vw, 34px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  .panel-kicker { display: flex; justify-content: space-between; gap: 14px; color: var(--secondary-accent); }
  .chooser-panel h2 { margin: 20px 0 10px; font-size: clamp(1.75rem, 3vw, 2.5rem); }
  .chooser-panel > p { color: var(--muted); }
  .choice-grid { margin-top: 19px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .choice-button {
    min-height: 54px;
    padding: 10px;
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 6px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 650;
    line-height: 1.25;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
  }
  .choice-button span { color: var(--secondary-accent); font-size: .63rem; letter-spacing: .08em; }
  .choice-button:hover { border-color: var(--accent); }
  .choice-button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); }
  .choice-button[aria-pressed="true"] span { color: var(--accent-foreground); }
  .recommendation { margin-top: 8px; padding: 13px 14px; display: grid; gap: 4px; background: var(--background); border-left: 3px solid var(--accent); transition: opacity 160ms ease, transform 160ms ease; }
  .recommendation > span { color: var(--muted); font-size: .68rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
  .recommendation strong { color: var(--heading); font-size: .9rem; }
  .recommendation p { color: var(--muted); font-size: .82rem; line-height: 1.45; }
  .recommendation a { color: var(--accent); font-size: .8rem; font-weight: 650; text-underline-offset: 5px; }
  .recommendation.is-updating { opacity: .5; transform: translateY(2px); }
  .noscript-options { margin: 16px 0 0 18px; color: var(--muted); font-size: .84rem; }
  .noscript-options a { color: var(--heading); }

  .fact-strip { border-block: 1px solid var(--line); background: var(--surface); }
  .fact-strip ul { width: var(--page); margin-inline: auto; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
  .fact-strip li { min-width: 0; padding: 19px 22px; border-left: 1px solid var(--line); color: var(--muted); font-size: .76rem; font-weight: 650; line-height: 1.45; }
  .fact-strip li:last-child { border-right: 1px solid var(--line); }
  .fact-strip li > span { display: block; margin-bottom: 11px; color: var(--accent); }

  .signal-panel, .text-panel, .detail-panel, .audience-section, .platform-section, .guidance-section {
    width: var(--page);
    margin: 72px auto 0;
  }
  .section-heading { display: grid; grid-template-columns: .38fr 1fr .74fr; gap: clamp(22px, 4vw, 52px); align-items: start; }
  .section-heading > * { min-width: 0; }
  .section-heading > p:last-child { color: var(--muted); }

  .signal-panel { padding: 20px 22px; display: grid; grid-template-columns: 1fr minmax(260px, 440px); align-items: center; gap: 32px; border: 1px solid var(--line); border-radius: 14px; }
  .signal-panel .section-heading { grid-template-columns: 1fr; gap: 10px; }
  .signal-panel h2 { max-width: 16ch; font-size: clamp(1.6rem, 3vw, 2.4rem); }
  .signal-panel img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; }

  .text-panel, .detail-panel { padding-top: 30px; display: grid; grid-template-columns: .42fr .72fr 1fr; gap: clamp(22px, 4vw, 48px); border-top: 1px solid var(--line); }
  .text-panel .section-heading, .detail-panel .section-heading { display: contents; }
  .text-panel .section-heading > p:last-child, .detail-panel .section-heading > p:last-child { display: none; }
  .paragraphs { display: grid; gap: 18px; color: var(--muted); }
  .detail-panel .section-action { grid-column: 3; }

  .audience-section { padding: clamp(36px, 5vw, 54px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
  .audience-grid { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .audience-grid > a { min-height: 250px; padding: 20px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--elevated); text-decoration: none; transition: filter 160ms ease; }
  .audience-grid > a:last-child { border-right: 0; }
  .audience-grid > a:hover { filter: brightness(1.12); }
  .audience-grid h3 { margin-top: 22px; }
  .audience-grid p { margin: 12px 0 18px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
  .audience-grid strong { margin-top: auto; color: var(--heading); font-size: .8rem; font-weight: 650; text-decoration: underline; text-underline-offset: 5px; }
  .section-action { margin-top: 20px; display: flex; justify-content: flex-end; }

  .cta-band { width: var(--page); margin: 40px auto 0; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid var(--line); border-left: 3px solid var(--secondary-accent); border-radius: 12px; }
  .cta-band .section-heading { flex: 1; grid-template-columns: .42fr .72fr 1fr; }
  .cta-band h2 { font-size: clamp(1.65rem, 3vw, 2.4rem); }
  .cta-band .button { flex: 0 0 auto; }

  .platform-grid { margin-top: 38px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .platform-grid article { min-height: 320px; padding: clamp(26px, 3.5vw, 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--secondary-accent); border-radius: 12px; }
  .platform-grid article:nth-child(even) { border-top-color: var(--accent); }
  .platform-grid h3 { margin: 12px 0 16px; }
  .platform-grid article > p:not(.platform-name) { color: var(--muted); }
  .platform-grid .text-link { margin-top: auto; padding-top: 22px; }

  .guidance-section { display: grid; grid-template-columns: .58fr 1.42fr; gap: clamp(40px, 7vw, 86px); }
  .guidance-section .section-heading { grid-template-columns: 1fr; gap: 16px; }
  .guidance-list { border-top: 1px solid var(--line); }
  .guidance-list article { display: grid; grid-template-columns: 40px minmax(180px, .72fr) 1fr; gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--line); }
  .guidance-list article p { color: var(--muted); }

  .faq-section { margin-top: 72px; padding: 72px max(24px, calc((100% - 1220px) / 2)); display: grid; grid-template-columns: .5fr 1.5fr; gap: clamp(44px, 8vw, 96px); background: var(--surface); }
  .faq-section .section-heading { grid-template-columns: 1fr; gap: 16px; }
  .faq-list { border-top: 1px solid var(--line); }
  details { border-bottom: 1px solid var(--line); }
  summary { padding: 22px 30px 22px 0; display: grid; grid-template-columns: 40px 1fr; gap: 10px; cursor: pointer; color: var(--heading); font-weight: 650; line-height: 1.4; }
  summary::marker { color: var(--accent); }
  summary span { color: var(--accent); font-size: .65rem; letter-spacing: .08em; line-height: 2; }
  details p { padding: 0 28px 24px 50px; color: var(--muted); }

  .final-cta { padding: 64px max(24px, calc((100% - 1220px) / 2)); display: flex; align-items: end; justify-content: space-between; gap: 44px; background: var(--elevated); border-top: 1px solid var(--line); }
  .final-cta h2 { max-width: 14ch; margin: 14px 0 16px; }
  .final-cta p:not(.eyebrow) { color: var(--muted); }
  .final-cta .button { flex: 0 0 auto; }

  .site-footer { padding: 36px max(24px, calc((100% - 1220px) / 2)); display: flex; justify-content: space-between; gap: 30px; }
  .adult-notice, .copyright { max-width: 58ch; color: var(--muted); font-size: .78rem; }
  .adult-notice strong { margin-right: 8px; color: var(--accent); }
  .copyright { margin-top: 8px; }
  .site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
}

@layer components {
  .button { min-height: 46px; padding: 11px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid currentColor; border-radius: 8px; font-size: .82rem; font-weight: 650; line-height: 1.2; text-decoration: none; transition: transform 160ms ease, background-color 160ms ease, color 160ms ease; }
  .button:hover { transform: translateY(-1px); }
  .button-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-foreground); }
  .button-primary:hover { background: var(--heading); border-color: var(--heading); }
  .button-secondary { min-height: 44px; padding-inline: 0; border-color: transparent; color: var(--heading); text-decoration: underline; text-underline-offset: 5px; }
  .button-secondary:hover { color: var(--accent); }
  .button-outline { color: var(--heading); }
  .button-outline:hover { background: var(--heading); color: var(--background); }
  .text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--heading); font-size: .82rem; font-weight: 650; line-height: 1.35; text-underline-offset: 5px; }
  .text-link span { transition: transform 160ms ease; }
  .text-link:hover { color: var(--accent); }
  .text-link:hover span { transform: translate(2px, -1px); }
  .item-number { color: var(--accent); }
}

@layer responsive {
  @media (max-width: 980px) {
    :root { --page: min(100% - 36px, 900px); }
    .hero { grid-template-columns: 1.08fr .92fr; gap: 34px; }
    .audience-grid { grid-template-columns: repeat(2, 1fr); }
    .audience-grid > a { min-height: 230px; }
    .audience-grid > a:nth-child(2) { border-right: 0; }
    .audience-grid > a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .guidance-list article { grid-template-columns: 34px 1fr; }
    .guidance-list article p { grid-column: 2; }
    .cta-band .section-heading { grid-template-columns: 1fr 1fr; }
    .cta-band .section-heading > p:last-child { grid-column: 1 / -1; }
  }
  @media (max-width: 780px) {
    :root { --page: calc(100% - 28px); }
    html { scroll-behavior: auto; }
    .site-header { min-height: 64px; }
    .wordmark small, .site-header nav > a:not(.open-link) { display: none; }
    .site-header nav { gap: 8px; }
    .open-link { min-height: 40px; padding: 8px 9px; }
    .hero { padding: 40px 0 52px; grid-template-columns: 1fr; gap: 30px; }
    .hero-copy { padding-top: 0; }
    .hero-copy h1 { max-width: 10.8ch; }
    .hero-copy .dek { margin-top: 18px; font-size: 1rem; }
    .hero-actions { margin-top: 22px; gap: 8px 16px; }
    .chooser-panel { padding: 22px 18px; border-radius: 12px; }
    .chooser-panel h2 { margin-top: 16px; font-size: clamp(1.75rem, 8vw, 2rem); }
    .choice-grid { margin-top: 16px; }
    .choice-button { min-height: 54px; padding: 8px 9px; grid-template-columns: 20px 1fr; font-size: .76rem; }
    .fact-strip ul { grid-template-columns: 1fr; }
    .fact-strip li { display: grid; grid-template-columns: 30px 1fr; gap: 7px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); }
    .fact-strip li:last-child { border-right: 0; border-bottom: 0; }
    .fact-strip li > span { margin: 1px 0 0; }
    .signal-panel { margin-top: 56px; padding: 20px; grid-template-columns: 1fr; gap: 22px; }
    .signal-panel img { max-height: 180px; }
    .section-heading, .text-panel, .detail-panel { grid-template-columns: 1fr; gap: 16px; }
    .text-panel .section-heading, .detail-panel .section-heading { display: grid; }
    .text-panel .section-heading > p:last-child, .detail-panel .section-heading > p:last-child { display: block; }
    .detail-panel .section-action { grid-column: 1; justify-content: stretch; }
    .detail-panel .button { width: 100%; }
    .audience-section { margin-top: 56px; padding: 30px 18px; }
    .audience-grid { margin-top: 28px; grid-template-columns: 1fr; }
    .audience-grid > a { min-height: 0; padding: 22px; border-right: 0; border-bottom: 1px solid var(--line); }
    .audience-grid > a:last-child { border-bottom: 0; }
    .audience-grid h3 { margin-top: 20px; }
    .section-action .button { width: 100%; }
    .cta-band { margin-top: 40px; padding: 24px 20px; align-items: stretch; flex-direction: column; }
    .cta-band .section-heading { grid-template-columns: 1fr; }
    .cta-band .button { width: 100%; }
    .platform-section { margin-top: 56px; }
    .platform-grid { margin-top: 28px; grid-template-columns: 1fr; }
    .platform-grid article { min-height: 240px; }
    .guidance-section { margin-top: 56px; grid-template-columns: 1fr; gap: 30px; }
    .guidance-list article { grid-template-columns: 30px 1fr; padding: 22px 0; }
    .faq-section { margin-top: 56px; padding: 56px 14px; grid-template-columns: 1fr; gap: 30px; }
    summary { grid-template-columns: 30px 1fr; padding-right: 8px; }
    details p { padding-left: 40px; }
    .final-cta { padding: 56px 14px; align-items: stretch; flex-direction: column; }
    .final-cta .button { width: 100%; }
    .site-footer { padding: 34px 14px; flex-direction: column; }
    .site-footer nav { align-items: flex-start; flex-direction: column; }
  }
  @media (max-width: 360px) {
    :root { --page: calc(100% - 22px); }
    .wordmark span { font-size: 1rem; }
    .open-link { padding-inline: 7px; font-size: .72rem; }
    .choice-grid { grid-template-columns: 1fr; }
    .choice-button { min-height: 48px; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
  }
}
