/* gliquid.fun
   Palette locked by SPEC.md §3, authored in OKLCH. Type per DESIGN.md:
   Archivo display, Manrope body, IBM Plex Mono data. All self-hosted. */

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

/* Fonts --------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  src: url("./assets/fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("./assets/fonts/manrope-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("./assets/fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Mono";
  src: url("./assets/fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Tokens -------------------------------------------------------------- */

:root {
  /* Component parts, so an alpha variant references one source of truth
     instead of retyping the colour. oklch(var(--bg-parts) / 0.9) works
     wherever oklch does, with no relative-colour-syntax dependency. */
  --bg-parts: 12.3% 0.016 265.2;
  --teal-parts: 78.8% 0.116 183.2;

  --mint: oklch(92.2% 0.101 177);
  --mint-bright: oklch(93.7% 0.092 176.1);
  --teal: oklch(var(--teal-parts));
  --bg: oklch(var(--bg-parts));
  --surface: oklch(21% 0.019 228);
  /* Two line weights, because they do two different jobs. --line is
     decoration: panel edges and the footer rule. --line-strong is structure:
     the ledgers and the exit list are separated by nothing else, so those
     rules have to clear 3:1 or the layout loses its bones. Hue 200 sits
     between the base ramp and the mint so both read as palette, not grey. */
  --line: oklch(34% 0.022 200); /* 1.75:1 on bg */
  --line-strong: oklch(50% 0.028 200); /* 3.41:1 on bg */
  --text: oklch(99.1% 0.009 188.1);
  --muted: oklch(70.9% 0.01 204.9);

  --display: "Archivo", "Manrope", sans-serif;
  --body: "Manrope", "Archivo", sans-serif;
  --data: "Plex Mono", "Manrope", monospace;

  --chrome-h: 3.5rem;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --maxw: 78rem;

  /* ease-out-expo: fast commit, long settle. No bounce anywhere. */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 0.22s;
  --slow: 0.45s;
}

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

  :where(body, h1, h2, h3, p, dl, dd, figure) {
    margin: 0;
  }

  :where(img, video) {
    display: block;
    max-inline-size: 100%;
  }

  :where(a) {
    color: inherit;
    text-decoration: none;
  }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
  }
}

@layer base {
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

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

  /* Present to assistive tech, absent from the layout. Used for headings the
     visual design does not want but the document outline requires. */
  .sr-only {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .skip {
    position: absolute;
    inset-inline-start: -9999px;
  }
  .skip:focus {
    inset-inline-start: var(--gutter);
    inset-block-start: 0.75rem;
    z-index: 100;
    padding: 0.5rem 0.875rem;
    background: var(--mint);
    color: var(--bg);
    border-radius: 999px;
    font-weight: 700;
  }

  /* Uppercase mono micro-label. The page's structural voice. */
  .eyebrow {
    font-family: var(--data);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

@layer components {
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8125rem 1.375rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--body);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: border-color var(--fast) var(--ease),
      background var(--fast) var(--ease), transform var(--fast) var(--ease);
  }
  .btn:hover {
    border-color: var(--teal);
    transform: translateY(-1px);
  }
  .btn svg {
    inline-size: 0.9375rem;
    block-size: 0.9375rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--fast) var(--ease);
  }
  .btn:hover svg {
    transform: translateX(3px);
  }

  .btn--primary {
    background: var(--mint);
    border-color: var(--mint);
    color: var(--bg);
  }
  .btn--primary:hover {
    background: var(--mint-bright);
    border-color: var(--mint-bright);
  }

  .btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }

  /* A control with nowhere real to point must not look clickable. Buttons
     dim out; a whole section only loses its affordance, because the reader
     should still learn the token exists and simply is not live yet. */
  .btn[aria-disabled="true"] {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
  }

  .exit[aria-disabled="true"] {
    pointer-events: none;
  }
  .exit[aria-disabled="true"] .exit__cue {
    color: var(--muted);
  }
}

@layer layout {
  .chrome {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    block-size: var(--chrome-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: var(--gutter);
    background: linear-gradient(
      to bottom,
      oklch(var(--bg-parts) / 0.92),
      transparent
    );
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
  }
  .brand__word {
    font-family: var(--display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.045em;
  }

  .chrome__nav {
    display: flex;
    align-items: center;
    gap: 1.125rem;
  }
  /* The glyph is 9px wide. The hit area must not be. 24x24 satisfies
     WCAG 2.5.8 for any input; touch gets the full 44 below. */
  .chrome__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 24px;
    min-block-size: 24px;
    font-family: var(--data);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--muted);
    transition: color var(--fast) var(--ease);
  }
  .chrome__link:hover {
    color: var(--text);
  }

  /* Hero -------------------------------------------------------------- */

  .hero {
    position: relative;
    min-block-size: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-block-start: calc(var(--chrome-h) + 2.5rem);
    padding-inline: var(--gutter);
    overflow: hidden;
  }

  .hero__video,
  .hero__scrim {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
  }

  /* Biased so the subject sits right of the type column. */
  .hero__video {
    object-fit: cover;
    object-position: 58% center;
    z-index: 0;
  }

  .hero__scrim {
    z-index: 1;
    background: linear-gradient(
        100deg,
        oklch(var(--bg-parts) / 0.97) 0%,
        oklch(var(--bg-parts) / 0.9) 32%,
        oklch(var(--bg-parts) / 0.45) 62%,
        oklch(var(--bg-parts) / 0.62) 100%
      ),
      linear-gradient(
        to top,
        oklch(var(--bg-parts) / 0.95) 0%,
        transparent 42%
      );
  }

  .hero__inner,
  .stats {
    position: relative;
    z-index: 2;
    inline-size: 100%;
    max-inline-size: var(--maxw);
    margin-inline: auto;
  }

  .hero__inner {
    padding-block-end: clamp(2rem, 6vh, 4rem);
  }

  .hero__title {
    margin-block-start: 1.125rem;
    font-family: var(--display);
    font-size: clamp(2.3rem, 5.6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.045em;
    max-inline-size: 17ch;
    text-wrap: balance;
  }

  .hero__sub {
    margin-block-start: 1.125rem;
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    color: var(--muted);
    letter-spacing: -0.01em;
  }

  .cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-block-start: 2rem;
  }

  .proof {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    margin-block-start: 1.25rem;
    font-family: var(--data);
    font-size: 0.8125rem;
    color: var(--muted);
  }
  .proof__dot {
    inline-size: 0.4375rem;
    block-size: 0.4375rem;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 0 oklch(var(--teal-parts) / 0.55);
    animation: pulse 2.6s var(--ease) infinite;
  }

  /* Stats: label/value pairs on a hairline, not a metric hero. */
  .stats {
    padding-block: 1.25rem 1.375rem;
    border-block-start: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .stat dt {
    font-family: var(--data);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .stat dd {
    margin-block-start: 0.3125rem;
    font-family: var(--data);
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
  }
  .stat--live dd {
    color: var(--mint);
  }

  .stats__note {
    grid-column: 1 / -1;
    margin-block-start: 0.25rem;
    font-size: 0.6875rem;
    color: var(--muted);
    opacity: 0.72;
  }

  /* What -------------------------------------------------------------- */

  .what {
    max-inline-size: var(--maxw);
    margin-inline: auto;
    padding-block: clamp(4rem, 10vh, 6.5rem) clamp(4.5rem, 12vh, 8rem);
    padding-inline: var(--gutter);
  }

  /* The voice, verbatim from copy/bank.md. One line per rule, nothing
     added, no explanation underneath. */
  .lines {
    list-style: none;
    margin: 0;
    padding: 0;
    border-block-start: 1px solid var(--line-strong);
  }
  .lines li {
    padding-block: clamp(1.125rem, 2.6vh, 1.75rem);
    border-block-end: 1px solid var(--line-strong);
    font-family: var(--display);
    font-size: clamp(1.6rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
  }
  .lines li:nth-child(even) {
    color: var(--muted);
  }

  /* Exits: deliberately unequal. One primary panel, two hairline rows. */
  .exits {
    max-inline-size: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
    padding-block-end: clamp(4.5rem, 12vh, 8rem);
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
    gap: 1rem;
  }

  .exit-main {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 1.75rem 1.625rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    background: var(--surface);
    transition: border-color var(--slow) var(--ease),
      transform var(--slow) var(--ease);
  }
  .exit-main:hover {
    border-color: var(--mint);
    transform: translateY(-3px);
  }
  .exit-main__title {
    margin-block-start: 0.75rem;
    font-family: var(--display);
    font-size: clamp(1.75rem, 3.4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
  }
  .exit-list {
    display: flex;
    flex-direction: column;
  }
  .exit {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-block: 1.25rem;
    border-block-end: 1px solid var(--line-strong);
  }
  .exit:first-child {
    border-block-start: 1px solid var(--line-strong);
  }

  /* Shift the contents, not the row. Animating padding relayouts the whole
     list every frame; a transform composites. The separator has to stay put,
     so the children move rather than the .exit itself. */
  .exit > * {
    transition: transform var(--slow) var(--ease),
      color var(--fast) var(--ease);
  }
  .exit:hover > * {
    transform: translateX(0.5rem);
  }
  .exit__title {
    margin: 0;
    font-family: var(--display);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.035em;
  }
  .exit__cue,
  .exit-main__cue {
    font-family: var(--data);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--mint);
  }
  .exit-main__cue {
    font-size: 0.875rem;
  }

  /* Footer ------------------------------------------------------------ */

  .foot {
    border-block-start: 1px solid var(--line);
    padding-block: 2.125rem 3rem;
    padding-inline: var(--gutter);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    text-align: center;
  }
  .foot__word {
    font-family: var(--display);
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.045em;
  }
  .foot__fine {
    max-inline-size: 48ch;
    font-size: 0.6875rem;
    color: var(--muted);
    opacity: 0.75;
  }
}

@layer utilities {
  /* Touch input: every control gets a 44x44 hit area. Applied by pointer
     type rather than viewport width, since a small window on a desktop is
     still a mouse and does not need the extra bulk. */
  @media (pointer: coarse) {
    .chrome__link,
    .btn,
    .exit__cue,
    .exit-main__cue {
      min-inline-size: 44px;
      min-block-size: 44px;
    }
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .exit {
      padding-block: 1.5rem;
    }
  }

  @keyframes pulse {
    70% {
      box-shadow: 0 0 0 9px oklch(var(--teal-parts) / 0);
    }
    100% {
      box-shadow: 0 0 0 0 oklch(var(--teal-parts) / 0);
    }
  }

  @media (max-width: 56rem) {
    .exits {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 40rem) {
    .hero__video {
      object-position: 66% center;
    }
    .hero__scrim {
      background: linear-gradient(
          180deg,
          oklch(var(--bg-parts) / 0.62) 0%,
          oklch(var(--bg-parts) / 0.5) 38%,
          oklch(var(--bg-parts) / 0.96) 82%
        ),
        linear-gradient(
          90deg,
          oklch(var(--bg-parts) / 0.8) 0%,
          transparent 70%
        );
    }
    .stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1rem;
    }
    .stat--live {
      grid-column: 1 / -1;
    }
    .cta .btn {
      flex: 1 1 100%;
      justify-content: center;
    }
  }

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