/* ============================================================
   SnowEdge — reset, base typography, layout shell
   ============================================================ */

@layer reset, base;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 1rem);
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
  }

  img, svg, video { display: block; max-width: 100%; }
  img { height: auto; }

  button, input, select, textarea { font: inherit; color: inherit; }
  button { background: none; border: 0; cursor: pointer; }

  ul, ol { list-style: none; padding: 0; }

  :focus-visible {
    outline: 2px solid var(--ice);
    outline-offset: 3px;
    border-radius: 3px;
  }
}

@layer base {
  body {
    background: var(--ink);
    color: var(--snow);
    font-family: var(--font-sans);
    font-size: var(--t-body);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }

  /* Chinese sets tighter and needs a touch more leading */
  html[lang="zh"] body { line-height: 1.78; letter-spacing: .01em; }
  html[lang="zh"] .hero__title,
  html[lang="zh"] .section__title { letter-spacing: -.01em; }

  h1, h2, h3, h4 {
    line-height: var(--lh-head);
    font-weight: 620;
    letter-spacing: -.022em;
    text-wrap: balance;
  }
  h1 { font-size: var(--t-h1); line-height: var(--lh-tight); }
  h2 { font-size: var(--t-h2); }
  h3 { font-size: var(--t-h3); }

  p { text-wrap: pretty; }

  a { color: inherit; text-decoration: none; }

  ::selection { background: var(--ice); color: var(--void); }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: .75rem 1.25rem;
    background: var(--ice);
    color: var(--void);
    font-weight: 600;
    border-radius: 0 0 var(--r-sm) 0;
  }
  .skip-link:focus { left: 0; }

  /* ---- shell ---- */
  .wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }
  .wrap--narrow { max-width: var(--wrap-narrow); }

  .section { padding-block: var(--s-section); position: relative; }
  .section--alt { background: var(--surface); }
  .section--alt + .section--alt { padding-top: 0; }

  .section__head { max-width: 62ch; margin-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
  .section__head--center { margin-inline: auto; text-align: center; }
  .section__title { margin-bottom: var(--s-4); }
  .section__lede {
    font-size: var(--t-lede);
    color: var(--mist);
    max-width: 58ch;
  }
  .section__head--center .section__lede { margin-inline: auto; }

  .eyebrow {
    font-family: var(--font-mono);
    font-size: var(--t-micro);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ice);
    margin-bottom: var(--s-4);
  }

  .micro {
    font-size: var(--t-small);
    color: var(--dim);
    line-height: 1.62;
    margin-top: var(--s-5);
    padding-left: var(--s-4);
    border-left: 2px solid var(--line-strong);
  }

  .caption {
    font-size: var(--t-small);
    color: var(--dim);
    text-align: center;
    margin-top: var(--s-6);
    max-width: 60ch;
    margin-inline: auto;
  }

  .grid-split {
    display: grid;
    gap: clamp(2.5rem, 1.5rem + 4vw, 5rem);
    align-items: center;
  }
  @media (min-width: 900px) {
    .grid-split { grid-template-columns: 1fr 1fr; }
    .grid-split--wide { grid-template-columns: 1fr 1.15fr; }
  }

  /* ---- scroll reveal ----
     Scoped to .js: the reveal starts at opacity 0, so without the script that
     adds .is-in the whole page would be blank. Never hide content on a promise
     that JavaScript will show it again. */
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
  }
  .js .reveal.is-in { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1; transform: none; transition: none; }
  }
}
