@charset "utf-8";

/* =========================================================================
   WebClicks — static site stylesheet
   Layers keep specificity predictable and overrides cheap.
   ========================================================================= */
@layer reset, tokens, base, layout, components, utilities;

/* ---------- self-hosted Inter (variable, SIL OFL 1.1) -------------------
   Self-hosted rather than pulled from a font CDN: one fewer third-party
   origin, no cross-site request, and a tighter Content-Security-Policy.
   Licence text ships alongside at /assets/fonts/Inter-LICENSE.txt        */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- reset ------------------------------------------------------ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; }
  body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  img, svg, video, canvas { display: block; max-inline-size: 100%; height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  p, h1, h2, h3, h4 { overflow-wrap: break-word; }
  ul[class] { list-style: none; padding: 0; }
  :target { scroll-margin-block-start: 6rem; }
}

/* ---------- design tokens --------------------------------------------- */
@layer tokens {
  :root {
    color-scheme: light dark;

    /* brand — sampled from the WebClicks logo */
    --ink-900: #071c22;
    --ink-800: #0a252d;
    --ink-700: #0e2f37;
    --ink-600: #0f343e;
    --ink-500: #174653;
    --orange:  #ff5800;
    --orange-600: #e64f00;
    --orange-200: #ffd9c4;

    /* neutrals */
    --white: #ffffff;
    --grey-50:  #f7f9fa;
    --grey-100: #eef2f4;
    --grey-200: #dfe6e9;
    --grey-400: #93a6ad;
    --grey-600: #4f6570;
    --grey-800: #21343c;

    /* semantic surfaces — light-dark() resolves against color-scheme */
    --bg:          light-dark(var(--white),    #08181e);
    --bg-subtle:   light-dark(var(--grey-50),  #0d2029);
    --bg-raised:   light-dark(var(--white),    #102730);
    --bg-invert:   light-dark(var(--ink-700),  #061419);
    --text:        light-dark(var(--ink-700),  #e6eef0);
    --text-muted:  light-dark(var(--grey-600), #9db1b9);
    --text-invert: light-dark(#ffffff,         #f2f7f8);
    --line:        light-dark(var(--grey-200), #1d3a45);
    --line-strong: light-dark(#c9d6db,         #27505f);
    --accent:      light-dark(var(--orange),   #ff7a33);
    /* Brand orange is only ~3.1:1 on white, so small bold text uses a darkened
       variant. Large text, fills and graphics keep the exact brand orange. */
    --accent-text: light-dark(#c24200,         #ff9a5e);
    --accent-ink:  light-dark(#071c22,         #0a1a20);
    --focus:       light-dark(#0b5cff,         #7fb2ff);
    --error:       light-dark(#b3261e,         #ff9b93);
    --error-line:  light-dark(#e9a19c,         #7d3630);
    --error-bg:    light-dark(#fdf3f2,         #2a1614);

    /* type */
    --font-sans: "Inter", "Inter var", -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.9rem);
    --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
    --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
    --step-2:  clamp(1.45rem, 1.3rem + 0.75vw, 1.85rem);
    --step-3:  clamp(1.8rem, 1.5rem + 1.4vw, 2.6rem);
    --step-4:  clamp(2.2rem, 1.6rem + 2.7vw, 3.9rem);

    /* space + shape */
    --gutter: clamp(1.15rem, 4vw, 2.5rem);
    --measure: 68ch;
    --wrap: 1160px;
    --wrap-narrow: 780px;
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-pill: 999px;

    --shadow-sm: 0 1px 2px rgb(7 28 34 / 6%), 0 2px 8px rgb(7 28 34 / 4%);
    --shadow-md: 0 2px 4px rgb(7 28 34 / 5%), 0 12px 32px rgb(7 28 34 / 8%);
    --shadow-lg: 0 24px 64px rgb(7 28 34 / 14%);

    --ease: cubic-bezier(0.22, 0.75, 0.3, 1);
  }

  /* explicit user choice beats the OS preference */
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"]  { color-scheme: dark; }

  @media (prefers-reduced-motion: reduce) {
    :root { --ease: linear; }
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ---------- base ------------------------------------------------------- */
@layer base {
  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--step-0);
    line-height: 1.65;
    font-synthesis-weight: none;
    display: flex;
    flex-direction: column;
    min-block-size: 100svb;
  }

  main { flex: 1 0 auto; }

  h1, h2, h3, h4 {
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.022em;
    text-wrap: balance;
  }
  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-1); letter-spacing: -0.012em; }
  h4 { font-size: var(--step-0); letter-spacing: -0.005em; }

  p { text-wrap: pretty; }

  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
  a:hover { text-decoration-color: var(--accent); }

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

  ::selection { background: var(--accent); color: var(--accent-ink); }

  hr { border: 0; border-block-start: 1px solid var(--line); }
}

/* ---------- layout ----------------------------------------------------- */
@layer layout {
  .wrap {
    inline-size: min(100% - (var(--gutter) * 2), var(--wrap));
    margin-inline: auto;
  }
  .wrap--narrow { --wrap: var(--wrap-narrow); }

  .section { padding-block: clamp(3.25rem, 8vw, 6.5rem); }
  .section--tight { padding-block: clamp(2.25rem, 5vw, 4rem); }
  .section--subtle { background: var(--bg-subtle); }

  .stack > * + * { margin-block-start: var(--flow, 1rem); }

  .grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
  .grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
  .grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
  /* cap at three so a six-card set reads as 3 + 3 rather than 4 + 2 */
  @media (width >= 62rem) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
  .grid--split {
    grid-template-columns: 1fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 4.5rem);
  }
  @media (width >= 62rem) {
    .grid--split { grid-template-columns: 1.05fr 0.95fr; }
    .grid--split.is-reversed > :first-child { order: 2; }
  }
}

/* ---------- components ------------------------------------------------- */
@layer components {

  /* skip link ---------------------------------------------------------- */
  .skip {
    position: absolute;
    inset-block-start: 0.5rem;
    inset-inline-start: 0.5rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-sm);
    font-weight: 600;
    translate: 0 -160%;
    transition: translate 0.18s var(--ease);
  }
  .skip:focus-visible { translate: 0 0; }

  /* header ------------------------------------------------------------- */
  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    border-block-end: 1px solid transparent;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
  }
  .site-header[data-stuck="true"] {
    border-block-end-color: var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
  }
  @supports not (backdrop-filter: blur(1px)) {
    .site-header { background: var(--bg); }
  }

  .nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-block-size: 4.5rem;
  }

  .brand { flex: none; display: inline-flex; align-items: center; text-decoration: none; }
  .brand img { inline-size: auto; block-size: 30px; }
  /* two versions of the supplied logo — ink on light surfaces, white on dark.
     Swapped for both the OS preference and the explicit theme toggle. */
  .brand__dark { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .brand__light { display: none; }
    :root:not([data-theme="light"]) .brand__dark  { display: block; }
  }
  :root[data-theme="dark"] .brand__light { display: none; }
  :root[data-theme="dark"] .brand__dark  { display: block; }
  :root[data-theme="light"] .brand__light { display: block; }
  :root[data-theme="light"] .brand__dark  { display: none; }
  .site-footer .brand img { block-size: 32px; }

  .nav__links {
    display: none;
    align-items: center;
    gap: clamp(0.5rem, 1.6vw, 1.6rem);
    margin-inline-start: auto;
    list-style: none;
  }
  .nav__links a {
    text-decoration: none;
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-muted);
    padding: 0.4rem 0.1rem;
    position: relative;
    transition: color 0.18s var(--ease);
  }
  .nav__links a:hover { color: var(--text); }
  .nav__links a[aria-current="page"] { color: var(--text); }
  .nav__links a[aria-current="page"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -0.15rem;
    block-size: 2px;
    background: var(--accent);
    border-radius: 2px;
  }

  .nav__actions { display: none; gap: 0.6rem; margin-inline-start: 0.6rem; }

  .nav__toggle {
    margin-inline-start: auto;
    display: inline-grid;
    place-items: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    cursor: pointer;
  }
  .nav__toggle span {
    inline-size: 1.15rem;
    block-size: 2px;
    background: currentColor;
    border-radius: 2px;
    position: relative;
    transition: background 0.18s var(--ease);
  }
  .nav__toggle span::before,
  .nav__toggle span::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    block-size: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: translate 0.22s var(--ease), rotate 0.22s var(--ease);
  }
  .nav__toggle span::before { translate: 0 -6px; }
  .nav__toggle span::after  { translate: 0 6px; }
  .nav__toggle[aria-expanded="true"] span { background: transparent; }
  .nav__toggle[aria-expanded="true"] span::before { translate: 0 0; rotate: 45deg; }
  .nav__toggle[aria-expanded="true"] span::after  { translate: 0 0; rotate: -45deg; }

  .nav__drawer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s var(--ease);
    border-block-start: 1px solid transparent;
  }
  .nav__drawer[data-open="true"] {
    grid-template-rows: 1fr;
    border-block-start-color: var(--line);
  }
  .nav__drawer > div { overflow: hidden; }
  .nav__drawer ul { list-style: none; padding: 0.75rem 0 1.25rem; display: grid; gap: 0.15rem; }
  .nav__drawer a {
    display: block;
    padding: 0.7rem 0.25rem;
    text-decoration: none;
    font-weight: 600;
  }
  .nav__drawer .btn { margin-block-start: 0.5rem; justify-content: center; }

  /* desktop layout — declared after the mobile rules so it wins on order */
  @media (width >= 60rem) {
    .nav__links, .nav__actions { display: flex; }
    .nav__toggle, .nav__drawer { display: none; }
  }

  /* buttons ------------------------------------------------------------ */
  .btn {
    --btn-bg: var(--accent);
    --btn-fg: var(--accent-ink);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.72rem 1.35rem;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.005em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: translate 0.18s var(--ease), box-shadow 0.18s var(--ease),
                background 0.18s var(--ease), border-color 0.18s var(--ease);
  }
  .btn:hover { translate: 0 -2px; box-shadow: 0 8px 22px rgb(255 88 0 / 26%); }
  .btn:active { translate: 0; }
  .btn svg { inline-size: 1em; block-size: 1em; flex: none; }

  .btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--text);
    border-color: var(--line-strong);
  }
  .btn--ghost:hover {
    box-shadow: none;
    border-color: var(--text);
    background: color-mix(in srgb, var(--text) 5%, transparent);
  }
  .btn--on-dark {
    --btn-bg: rgb(255 255 255 / 10%);
    --btn-fg: #fff;
    border-color: rgb(255 255 255 / 25%);
  }
  .btn--on-dark:hover { box-shadow: none; background: rgb(255 255 255 / 18%); }
  .btn--lg { padding: 0.95rem 1.8rem; font-size: var(--step-0); }

  .btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

  /* hero --------------------------------------------------------------- */
  .hero {
    position: relative;
    isolation: isolate;
    overflow: clip;
    background:
      radial-gradient(120% 90% at 85% 0%, #1a4f5e 0%, transparent 55%),
      radial-gradient(80% 70% at 5% 100%, #12313b 0%, transparent 60%),
      linear-gradient(168deg, var(--ink-800), var(--ink-900));
    color: var(--text-invert);
    padding-block: clamp(3.5rem, 9vw, 7rem);
  }
  .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
      linear-gradient(rgb(255 255 255 / 4%) 1px, transparent 1px),
      linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(120% 100% at 50% 0%, #000 20%, transparent 78%);
  }
  .hero::after {
    content: "";
    position: absolute;
    inline-size: 34rem;
    aspect-ratio: 1;
    inset-block-start: -14rem;
    inset-inline-end: -10rem;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(255 88 0 / 26%), transparent 66%);
    filter: blur(10px);
  }
  .hero h1 { color: #fff; }
  .hero p { color: rgb(232 242 245 / 88%); }
  .hero .lede { font-size: var(--step-1); max-inline-size: 34ch; }
  .hero__sub { max-inline-size: 52ch; margin-block-start: 1.1rem; }

  .hero--page { padding-block: clamp(3rem, 6vw, 5rem); }
  .hero--page h1 { font-size: var(--step-3); }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-block-end: 1rem;
  }
  .eyebrow::before {
    content: "";
    inline-size: 1.6rem;
    block-size: 2px;
    background: currentColor;
    border-radius: 2px;
  }
  .hero .eyebrow { color: #ff8a4d; }

  /* stats -------------------------------------------------------------- */
  .stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    margin-block-start: clamp(2.5rem, 6vw, 4rem);
    padding-block-start: clamp(1.75rem, 4vw, 2.5rem);
    border-block-start: 1px solid rgb(255 255 255 / 14%);
  }
  .stat__num {
    font-size: var(--step-3);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #fff;
  }
  .stat__num span { color: var(--accent); }
  .stat__label {
    font-size: var(--step--1);
    color: rgb(226 238 241 / 70%);
    margin-block-start: 0.45rem;
  }

  /* cards -------------------------------------------------------------- */
  .card {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: clamp(1.4rem, 3vw, 2rem);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease),
                translate 0.25s var(--ease);
    block-size: 100%;
  }
  .card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
    translate: 0 -3px;
  }
  .card h3 { margin-block-end: 0.5rem; }
  .card p { color: var(--text-muted); font-size: var(--step--1); line-height: 1.6; }

  .card__icon {
    display: grid;
    place-items: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    border-radius: 10px;
    margin-block-end: 1.1rem;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
  }
  .card__icon svg { inline-size: 1.4rem; block-size: 1.4rem; }

  /* audience split cards ----------------------------------------------- */
  .audience {
    position: relative;
    overflow: clip;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: clamp(1.6rem, 3.5vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-raised);
    box-shadow: var(--shadow-sm);
  }
  .audience::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    block-size: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
  }
  .audience__figure { border-radius: var(--r-md); overflow: hidden; background: var(--bg-subtle); }
  .audience h2 { font-size: var(--step-2); }
  .audience > p { color: var(--text-muted); }
  .audience .btn-row { margin-block-start: auto; padding-block-start: 0.5rem; }

  /* tick list ---------------------------------------------------------- */
  .ticks { display: grid; gap: 0.6rem; list-style: none; padding: 0; }
  .ticks li {
    display: grid;
    grid-template-columns: 1.35rem 1fr;
    gap: 0.65rem;
    align-items: start;
    font-size: var(--step--1);
    font-weight: 600;
  }
  .ticks svg { inline-size: 1.35rem; block-size: 1.35rem; color: var(--accent); margin-block-start: 0.1rem; }

  /* feature rows ------------------------------------------------------- */
  .feature + .feature { margin-block-start: clamp(3rem, 7vw, 5.5rem); }
  .feature__figure {
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-subtle);
  }
  .feature h2 { font-size: var(--step-2); margin-block-end: 0.9rem; }
  .feature p { color: var(--text-muted); max-inline-size: var(--measure); }
  .feature p + p { margin-block-start: 0.9rem; }

  /* steps -------------------------------------------------------------- */
  .steps { counter-reset: step; display: grid; gap: 1.5rem; list-style: none; padding: 0; }
  .steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 2.4rem 1fr;
    gap: 1rem;
    align-items: start;
  }
  .steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    inline-size: 2.4rem;
    block-size: 2.4rem;
    border-radius: 50%;
    background: var(--ink-700);
    color: #fff;
    font-weight: 800;
    font-size: var(--step--1);
  }
  .steps h3 { font-size: var(--step-0); margin-block-end: 0.2rem; }
  .steps p { color: var(--text-muted); font-size: var(--step--1); }

  /* pill list (payment methods etc.) ----------------------------------- */
  .pills { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
  .pills li {
    font-size: var(--step--1);
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--bg-raised);
    color: var(--text-muted);
  }

  /* CTA band ----------------------------------------------------------- */
  .cta {
    position: relative;
    isolation: isolate;
    overflow: clip;
    border-radius: var(--r-lg);
    padding: clamp(2.25rem, 6vw, 4rem);
    background: linear-gradient(150deg, var(--ink-700), var(--ink-900));
    color: var(--text-invert);
    text-align: center;
  }
  .cta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(60% 120% at 50% 0%, rgb(255 88 0 / 22%), transparent 65%);
  }
  .cta h2 { color: #fff; font-size: var(--step-3); }
  .cta p {
    color: rgb(230 241 244 / 82%);
    max-inline-size: 52ch;
    margin: 0.9rem auto 0;
  }
  .cta .btn-row { justify-content: center; margin-block-start: 1.75rem; }

  /* contact ------------------------------------------------------------ */
  .contact-card {
    display: grid;
    gap: 1.5rem;
    padding: clamp(1.6rem, 4vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-raised);
    box-shadow: var(--shadow-sm);
  }
  .contact-card dt {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-block-end: 0.35rem;
  }
  .contact-card dd { margin: 0; font-size: var(--step-0); color: var(--text-muted); }
  .contact-card dd a { text-decoration-color: var(--accent); }
  .contact-card dd.is-lead {
    font-size: var(--step-1);
    font-weight: 700;
    color: var(--text);
  }
  .contact-card dd.is-links { font-weight: 600; color: var(--text); }

  /* auth form ---------------------------------------------------------- */
  .auth {
    inline-size: min(100%, 26rem);
    margin-inline: auto;
    padding: clamp(1.6rem, 4vw, 2.4rem);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-raised);
    box-shadow: var(--shadow-md);
  }
  .auth h1 { font-size: var(--step-2); }
  .auth > p { color: var(--text-muted); font-size: var(--step--1); margin-block-start: 0.5rem; }

  .field { display: grid; gap: 0.4rem; margin-block-start: 1.25rem; }
  .field label { font-size: var(--step--1); font-weight: 700; }
  .field input {
    inline-size: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  }
  .field input::placeholder { color: var(--grey-400); }
  .field input:hover { border-color: var(--text-muted); }
  .field input:focus-visible {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
    outline: none;
  }
  .auth .btn { inline-size: 100%; justify-content: center; margin-block-start: 1.5rem; }

  .form-error {
    display: none;
    gap: 0.6rem;
    align-items: start;
    margin-block-start: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--error-line);
    border-radius: var(--r-sm);
    background: var(--error-bg);
    font-size: var(--step--1);
    line-height: 1.5;
  }
  .form-error[data-shown="true"] { display: flex; }
  .form-error svg {
    inline-size: 1.15rem; block-size: 1.15rem;
    flex: none; margin-block-start: 0.12rem; color: var(--error);
  }
  .form-error strong { display: block; color: var(--error); }
  .form-error > span { color: var(--text); }
  .form-error a { color: inherit; text-decoration-color: var(--error); }

  .field input[aria-invalid="true"] { border-color: var(--error-line); }

  .auth__foot {
    margin-block-start: 1.5rem;
    padding-block-start: 1.25rem;
    border-block-start: 1px solid var(--line);
    font-size: var(--step--1);
    color: var(--text-muted);
  }
  .auth__foot a { font-weight: 600; text-decoration-color: var(--accent); }

  .auth__note {
    margin-block-start: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-subtle);
    font-size: var(--step--1);
    color: var(--text-muted);
  }

  /* prose (legal pages) ------------------------------------------------ */
  .prose { max-inline-size: var(--measure); }
  .prose h2 {
    font-size: var(--step-1);
    margin-block: 2.5rem 0.75rem;
    scroll-margin-block-start: 6rem;
  }
  .prose h2:first-child { margin-block-start: 0; }
  .prose p + p { margin-block-start: 1rem; }
  .prose p { color: var(--text-muted); }
  .prose ul { margin-block: 1rem; padding-inline-start: 1.25rem; color: var(--text-muted); }
  .prose li + li { margin-block-start: 0.4rem; }

  .toc {
    position: sticky;
    inset-block-start: 6rem;
    align-self: start;
    font-size: var(--step--1);
  }
  .toc h2 {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-block-end: 0.75rem;
  }
  .toc ol { list-style: none; padding: 0; display: grid; gap: 0.3rem; counter-reset: toc; }
  .toc a { color: var(--text-muted); text-decoration: none; }
  .toc a:hover { color: var(--accent-text); }
  .legal-layout { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
  @media (width >= 64rem) { .legal-layout { grid-template-columns: 15rem 1fr; } }
  @media (width < 64rem) { .toc { position: static; } }

  /* footer ------------------------------------------------------------- */
  .site-footer {
    background: var(--bg-invert);
    color: rgb(226 238 241 / 78%);
    padding-block: clamp(2.75rem, 6vw, 4.5rem) 2rem;
    margin-block-start: auto;
  }
  .site-footer h2 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgb(255 255 255 / 55%);
    margin-block-end: 0.9rem;
  }
  .footer-grid {
    display: grid;
    gap: clamp(2rem, 5vw, 3rem);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  }
  .footer-grid > :first-child { grid-column: 1 / -1; max-inline-size: 26rem; }
  @media (width >= 56rem) { .footer-grid > :first-child { grid-column: auto; } }
  .site-footer ul { display: grid; gap: 0.55rem; list-style: none; padding: 0; }
  .site-footer a { text-decoration: none; font-size: var(--step--1); transition: color 0.18s var(--ease); }
  .site-footer a:hover { color: var(--accent); }
  .site-footer p { font-size: var(--step--1); line-height: 1.6; }

  .social { display: flex; gap: 0.5rem; margin-block-start: 1.25rem; }
  .social a {
    display: grid;
    place-items: center;
    inline-size: 2.35rem;
    block-size: 2.35rem;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 50%;
    transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
  }
  .social a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
  .social svg { inline-size: 1.05rem; block-size: 1.05rem; }

  .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-block-start: clamp(2rem, 5vw, 3rem);
    padding-block-start: 1.5rem;
    border-block-start: 1px solid rgb(255 255 255 / 12%);
    font-size: var(--step--1);
    color: rgb(226 238 241 / 60%);
  }

  /* theme toggle ------------------------------------------------------- */
  .theme-toggle {
    display: grid;
    place-items: center;
    inline-size: 2.35rem;
    block-size: 2.35rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
  }
  .theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
  .theme-toggle svg { inline-size: 1.05rem; block-size: 1.05rem; }
  .theme-toggle .icon-moon { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
  }
  :root[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
  :root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
  :root[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
  :root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

  /* 404 ---------------------------------------------------------------- */
  .notfound { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
  .notfound__code {
    font-size: clamp(4rem, 18vw, 9rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.05em;
    background: linear-gradient(120deg, var(--accent), var(--ink-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* ---------- utilities -------------------------------------------------- */
@layer utilities {
  .visually-hidden:not(:focus):not(:active) {
    clip-path: inset(50%);
    block-size: 1px;
    inline-size: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }
  .lede { font-size: var(--step-1); color: var(--text-muted); max-inline-size: 46ch; }
  /* the hero is always dark, so muted body colours would fail contrast there */
  .hero .lede, .cta .lede { color: rgb(232 242 245 / 88%); }
  .muted { color: var(--text-muted); }
  .center { text-align: center; margin-inline: auto; }
  .measure { max-inline-size: var(--measure); }
  .mt-0 { margin-block-start: 0; }
  .mt-1 { margin-block-start: 1rem; }
  .mt-2 { margin-block-start: 1.75rem; }
  .mt-3 { margin-block-start: 2.5rem; }
  .flow-lg { --flow: 1.5rem; }

  /* Scroll-driven reveal, progressively enhanced.
     Deliberately animates position only — never opacity — so that content is
     legible at every point of the timeline, in print, and in any browser that
     half-supports the API. Nothing on this site depends on animation to be read. */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .reveal {
        animation: reveal-in linear both;
        animation-timeline: view();
        animation-range: entry 8% cover 30%;
      }
    }
  }
  @keyframes reveal-in {
    from { translate: 0 1.75rem; }
    to   { translate: 0 0; }
  }
}

/* cross-document view transitions (no-op where unsupported) ------------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

@media print {
  .site-header, .site-footer, .cta, .btn, .toc, .skip { display: none !important; }
  body { color: #000; background: #fff; }
}
