/* ==========================================================================
   Apadore Kariéra
   Design system 1:1 z Apadore Brand Studio (apadore-developers/brand-studio,
   src/styles/global.css). Tokeny, reset, base a utilities jsou převzaté beze
   změny. Komponenty níže kopírují vzory z brand-studio (SiteHeader, Section,
   Button, Chip, Callout, ChapterGrid, ContentLists, GradientBlock, SiteFooter).
   ========================================================================== */

@layer reset, base, vendor, components, utilities, overrides;

/* ==========================================================================
   FONTS (v brand-studio přes next/font/local)
   ========================================================================== */

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

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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;
}

/* Registered for the team counter animation (0 -> 7) */
@property --num {
  syntax: "<integer>";
  initial-value: 0;
  inherits: false;
}

/* ==========================================================================
   RESET
   ========================================================================== */

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

  * { margin: 0; }

  html {
    font-size: 62.5%; /* 1rem = 10px */
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-block-start: var(--space-9);
  }

  body {
    min-height: 100svh;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizelegibility;
  }

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

  input, button, textarea, select { font: inherit; color: inherit; }

  button { cursor: pointer; background: none; border: none; padding: 0; }

  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

  :target { scroll-margin-block-start: var(--space-9); }

  :focus-visible {
    outline: var(--border-width-thick) solid var(--color-focus);
    outline-offset: 2px;
  }

  :focus:not(:focus-visible) { outline: none; }

  ::selection {
    background-color: var(--color-action);
    color: var(--color-text-on-accent);
  }

  @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;
    }
  }
}

/* ==========================================================================
   BASE — TOKENS
   ========================================================================== */

@layer base {
  :root {
    /* ---------- PRIMITIVE: NAVY (Figma: Primitives / navy) ---------- */
    --navy-900: oklch(17.3% 0.035 271deg); /* #090E21 */
    --navy-800: oklch(36.8% 0.025 274deg); /* #3A3E4D */
    --navy-600: oklch(56.6% 0.019 275deg); /* #737681 */
    --navy-400: oklch(70.5% 0.012 275deg); /* #9D9FA6 */
    --navy-200: oklch(85.3% 0.006 275deg); /* #CECFD3 */

    /* ---------- PRIMITIVE: GREY (Figma: Primitives / grey) ---------- */
    --grey-0:   oklch(100% 0 0deg);    /* #FFFFFF */
    --grey-25:  oklch(98.5% 0 0deg);   /* #FAFAFA */
    --grey-50:  oklch(95.8% 0 0deg);   /* #F1F1F1 */
    --grey-100: oklch(91.6% 0 0deg);   /* #E4E4E4 */
    --grey-400: oklch(63.4% 0 0deg);   /* #898989 */
    --grey-600: oklch(51.4% 0 0deg);   /* #656565 */
    --grey-900: oklch(18.9% 0 0deg);   /* #131313 */

    /* ---------- PRIMITIVE: GRADIENT (Brand manuál: Přechody) ---------- */
    --gradient-blue:       oklch(64.5% 0.19 259deg);   /* #3F8BFF */
    --gradient-blue-light: oklch(71.7% 0.08 258deg);   /* #7FA3DA */

    /* ---------- PRIMITIVE: STATUS ---------- */
    --green-500: oklch(68% 0.15 152deg);
    --red-500:   oklch(64% 0.21 28deg);

    /* ---------- SEMANTIC: SURFACES ---------- */
    --color-surface:         var(--grey-25);
    --color-surface-raised:  var(--grey-0);
    --color-surface-subtle:  var(--grey-50);
    --color-surface-muted:   var(--grey-100);
    --color-surface-inverse: var(--navy-900);

    /* ---------- SEMANTIC: TEXT ---------- */
    --color-text:           var(--navy-900);
    --color-text-muted:     var(--navy-600);
    --color-text-subtle:    var(--grey-400);
    --color-text-inverse:   var(--grey-0);
    --color-text-accent:    var(--navy-900);
    --color-text-on-accent: var(--grey-0);

    /* ---------- SEMANTIC: BORDERS ---------- */
    --color-border:        var(--grey-100);
    --color-border-strong: var(--navy-200);
    --color-border-accent: var(--navy-900);

    /* ---------- SEMANTIC: ACTIONS ---------- */
    --color-action:        var(--navy-900);
    --color-action-hover:  var(--navy-800);
    --color-action-active: var(--navy-800);
    --color-action-subtle: var(--grey-50);

    /* ---------- SEMANTIC: STATUS ---------- */
    --color-success: var(--green-500);
    --color-danger:  var(--red-500);
    --color-focus:   var(--navy-600);

    /* ---------- BRAND BACKGROUNDS (Brand manuál: Přechody) ---------- */
    --bg-brand-dark:
      linear-gradient(135deg, oklch(from var(--gradient-blue) l c h / 45%), oklch(26% 0.04 268deg / 0%) 70%),
      var(--navy-900);
    --bg-hero: /* Figma: Homepage hero, colours sampled from apadore.cz */
      radial-gradient(70% 75% at 50% 105%, oklch(64% 0.11 266deg) 0%, oklch(46% 0.1 266deg) 30%, oklch(33% 0.09 266deg / 0%) 70%),
      linear-gradient(180deg, oklch(16% 0.03 280deg) 0%, oklch(25% 0.08 266deg) 45%, oklch(33% 0.09 266deg) 100%); /* #0E1020 -> #12224C -> #1F366E */

    --bg-brand-light:
      linear-gradient(225deg, oklch(from var(--gradient-blue-light) l c h / 75%), oklch(84% 0.04 258deg / 35%) 55%, oklch(93.5% 0.008 265deg / 0%)),
      oklch(95.3% 0.006 265deg); /* #EEF0F4 */

    /* ---------- TYPOGRAPHY: FAMILIES ---------- */

    /* Font variables (v brand-studio je nastavuje next/font/local) */
    --font-geist: "Geist";
    --font-plex-mono: "IBM Plex Mono";

    /* Booton (primary, licensed) is not bundled yet: headings fall back to Geist SemiBold. */
    --font-sans:  var(--font-geist), system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono:  var(--font-plex-mono), ui-monospace, "SF Mono", menlo, monospace;
    --font-body:    var(--font-sans);
    --font-heading: "Booton", var(--font-sans);

    /* ---------- TYPOGRAPHY: SIZES (fluid 360 -> 1440) ---------- */
    --text-3xs:  clamp(1.0rem, 0.967rem + 0.093vw, 1.1rem);  /* 10 -> 11 */
    --text-2xs:  clamp(1.1rem, 1.067rem + 0.093vw, 1.2rem);  /* 11 -> 12 */
    --text-xs:   clamp(1.2rem, 1.167rem + 0.093vw, 1.3rem);  /* 12 -> 13 */
    --text-sm:   clamp(1.4rem, 1.367rem + 0.093vw, 1.5rem);  /* 14 -> 15 */
    --text-base: clamp(1.6rem, 1.533rem + 0.185vw, 1.8rem);  /* 16 -> 18 */
    --text-lg:   clamp(1.8rem, 1.733rem + 0.185vw, 2.0rem);  /* 18 -> 20 */
    --text-xl:   clamp(2.0rem, 1.867rem + 0.370vw, 2.4rem);  /* 20 -> 24 */
    --text-2xl:  clamp(2.4rem, 2.200rem + 0.556vw, 3.0rem);  /* 24 -> 30 */
    --text-3xl:  clamp(2.8rem, 2.467rem + 0.926vw, 3.8rem);  /* 28 -> 38 */
    --text-4xl:  clamp(3.2rem, 2.667rem + 1.481vw, 4.8rem);  /* 32 -> 48 */
    --text-5xl:  clamp(3.8rem, 3.000rem + 2.222vw, 6.2rem);  /* 38 -> 62 */
    --text-6xl:  clamp(4.4rem, 3.200rem + 3.333vw, 8.0rem);  /* 44 -> 80 */

    /* ---------- TYPOGRAPHY: OTHER ---------- */
    --leading-none:    1;
    --leading-tight:   1.15;
    --leading-snug:    1.3;
    --leading-normal:  1.5;
    --leading-relaxed: 1.7;
    --tracking-tighter: -0.03em;
    --tracking-tight:   -0.015em;
    --tracking-normal:  0;
    --tracking-wide:    0.02em;
    --tracking-widest:  0.08em;
    --tracking-label:   0.01em; /* Figma: Text/Label, Label S = 1 % */
    --text-label:   1.4rem; /* Figma: Text/Label 14 / 16 */
    --text-label-s: 1.2rem; /* Figma: Text/Label S 12 / 14 */
    --weight-regular:  400;
    --weight-medium:   500;
    --weight-semibold: 600;
    --weight-bold:     700;
    --measure:        65ch;
    --measure-narrow: 45ch;
    --measure-wide:   80ch;

    /* ---------- SPACING ---------- */
    --space-0:  0;
    --space-1:  0.4rem;   /*   4px */
    --space-2:  0.8rem;   /*   8px */
    --space-3:  1.2rem;   /*  12px */
    --space-4:  1.6rem;   /*  16px */
    --space-5:  2.4rem;   /*  24px */
    --space-6:  3.2rem;   /*  32px */
    --space-7:  4.0rem;   /*  40px */
    --space-8:  4.8rem;   /*  48px */
    --space-9:  6.4rem;   /*  64px */
    --space-10: 8.0rem;   /*  80px */
    --space-11: 9.6rem;   /*  96px */
    --space-12: 12.8rem;  /* 128px */

    /* Section spacing is the only fluid spacing */
    --space-section:    clamp(6.4rem, 4.267rem + 5.926vw, 12.8rem);  /*  64 -> 128 */
    --space-section-sm: clamp(4.0rem, 2.667rem + 3.704vw,  8.0rem);  /*  40 ->  80 */
    --space-section-lg: clamp(8.0rem, 5.333rem + 7.407vw, 16.0rem);  /*  80 -> 160 */

    /* ---------- CONTAINERS ---------- */
    --container-xs:   48rem;    /*  480px */
    --container-sm:   64rem;    /*  640px */
    --container-md:   76.8rem;  /*  768px */
    --container-lg:  102.4rem;  /* 1024px */
    --container-xl:  128rem;    /* 1280px */
    --container-2xl: 144rem;    /* 1440px */
    --container-max: 160rem;    /* 1600px */
    --gutter: clamp(1.6rem, 0.533rem + 2.963vw, 4.8rem);  /* 16 -> 48 */

    /* ---------- RADII ---------- */
    --radius-none: 0;
    --radius-xs:   0.2rem;
    --radius-sm:   0.4rem;
    --radius-md:   0.8rem;
    --radius-lg:   1.2rem;
    --radius-xl:   1.6rem;
    --radius-2xl:  2.4rem;
    --radius-full: 9999px;

    /* ---------- BORDERS ---------- */
    --border-width:       1px;
    --border-width-thick: 2px;

    /* ---------- SHADOWS ---------- */
    --shadow-xs: 0 1px 2px oklch(from var(--navy-900) l c h / 5%);
    --shadow-sm: 0 1px 3px oklch(from var(--navy-900) l c h / 8%),
                 0 1px 2px oklch(from var(--navy-900) l c h / 4%);
    --shadow-md: 0 4px 8px oklch(from var(--navy-900) l c h / 8%),
                 0 2px 4px oklch(from var(--navy-900) l c h / 4%);
    --shadow-lg: 0 12px 24px oklch(from var(--navy-900) l c h / 10%),
                 0 4px 8px oklch(from var(--navy-900) l c h / 5%);
    --shadow-xl: 0 24px 48px oklch(from var(--navy-900) l c h / 12%),
                 0 8px 16px oklch(from var(--navy-900) l c h / 6%);

    /* ---------- Z-INDEX ---------- */
    --z-below:    -1;
    --z-base:      0;
    --z-raised:    10;
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-overlay:  300;
    --z-modal:    400;
    --z-popover:  500;
    --z-toast:    600;
    --z-tooltip:  700;
    --z-max:      999;

    /* ---------- MOTION (calm defaults: 300 / 600 / 900 ms) ---------- */
    --duration-instant: 50ms;
    --duration-fast:    150ms;
    --duration-normal:  300ms;
    --duration-slow:    600ms;
    --duration-slower:  900ms;
    --ease-linear: linear;
    --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in:     cubic-bezier(0.64, 0, 0.78, 0);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-colors:
      color var(--duration-normal) var(--ease-out),
      background-color var(--duration-normal) var(--ease-out),
      border-color var(--duration-normal) var(--ease-out);

    color-scheme: light;
  }

  /* ---------- DARK THEME (inverse sections: <section data-theme="dark">) ---------- */
  [data-theme="dark"] {
    --color-surface:         var(--navy-900);
    --color-surface-raised:  oklch(from var(--grey-0) l c h / 6%);
    --color-surface-subtle:  oklch(from var(--grey-0) l c h / 8%);
    --color-surface-muted:   oklch(from var(--grey-0) l c h / 12%);
    --color-surface-inverse: var(--grey-0);
    --color-text:          var(--grey-0);
    --color-text-muted:    var(--navy-200);
    --color-text-subtle:   var(--navy-400);
    --color-text-inverse:  var(--navy-900);
    --color-text-accent:   var(--grey-0);
    --color-border:        oklch(from var(--grey-0) l c h / 14%);
    --color-border-strong: oklch(from var(--grey-0) l c h / 30%);
    --color-action:        var(--grey-0);
    --color-action-hover:  var(--navy-200);
    --color-action-active: var(--navy-200);
    --color-action-subtle: oklch(from var(--grey-0) l c h / 8%);

    color-scheme: dark;
  }
}

/* ==========================================================================
   BASE — ELEMENTS
   ========================================================================== */

@layer base {
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    letter-spacing: -0.04em;
    text-wrap: balance;
  }

  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl); }
  h5 { font-size: var(--text-lg); }
  h6 { font-size: var(--text-base); }

  p, li, dd, figcaption { text-wrap: pretty; }

  strong, b { font-weight: var(--weight-semibold); }

  code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }

  hr {
    border: none;
    border-block-start: var(--border-width) solid var(--color-border);
    margin-block: var(--space-6);
  }
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

@layer components {
  /* ---------- Button (Button.module.css). Attributes: data-variant="solid" | "ghost" ---------- */
  .button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 4.4rem;
    padding: 0 var(--space-5);
    font-family: var(--font-mono);
    font-size: var(--text-label);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    text-decoration: none;
    color: var(--navy-900);
    background: var(--grey-50); /* Figma: Button / Sekundární */
    border-radius: var(--radius-sm); /* 4px */
    transition: var(--transition-colors);

    @media (hover: hover) and (pointer: fine) {
      &:hover { color: var(--grey-0); background: var(--navy-900); }
    }

    &[data-variant="solid"] {
      color: var(--grey-0);
      background: var(--navy-900);

      @media (hover: hover) and (pointer: fine) {
        &:hover { background: var(--navy-800); }
      }
    }

    /* On dark backgrounds: hover goes to white instead of navy */
    [data-theme="dark"] & {
      @media (hover: hover) and (pointer: fine) {
        &:hover { color: var(--navy-900); background: var(--grey-0); }
      }
    }

    [data-theme="dark"] &[data-variant="ghost"] {
      color: var(--color-text);
      background: transparent;
      box-shadow: inset 0 0 0 var(--border-width) var(--color-border-strong);

      @media (hover: hover) and (pointer: fine) {
        &:hover { color: var(--color-text); background: var(--color-surface-muted); }
      }
    }
  }

  .icon {
    width: 1.4rem;
    height: 1.4rem;
    fill: none;
    stroke: currentcolor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* ---------- Chip: small mono label (Chip.module.css). Attributes: data-size="lg" ---------- */
  .chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.3rem var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-label-s);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--color-text-muted);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-full);

    &[data-size="lg"] { padding: var(--space-2) var(--space-3); font-size: var(--text-label); color: var(--color-text); }
  }

  .chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

  /* ---------- Mono label (SiteHeader .eyebrow) ---------- */
  .label {
    font-family: var(--font-mono);
    font-weight: var(--weight-medium);
    font-size: var(--text-label-s);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-text-subtle);
  }

  /* ---------- Glass element on the gradient (GradientBlock .glass) ---------- */
  .glass {
    display: inline-flex;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-lg);
    line-height: 1.2;
    color: var(--grey-0);
    background: linear-gradient(180deg, oklch(100% 0 0deg / 14%), oklch(100% 0 0deg / 6%));
    border: 0.5px solid oklch(100% 0 0deg / 35%);
    border-radius: var(--radius-full);
    box-shadow: 0 14px 36px oklch(0% 0 0deg / 50%);
    backdrop-filter: blur(24px);
  }

  .dot {
    display: inline-block;
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    margin-inline: var(--space-3);
    background: var(--navy-200);
    border-radius: var(--radius-full);
  }

  /* Struck-through word that cycles (ChapterGrid intro cover: ~~agentura~~ • partner).
     The words are swapped by a few lines of JS; the box width follows the word smoothly. */
  .rotator {
    display: inline-flex;
    justify-content: flex-end;
    margin-block: -0.2em;
    padding-block: 0.2em;
    overflow: hidden;
    white-space: nowrap;
    transition: width var(--duration-slow) var(--ease-out);
  }

  .rotator-word {
    position: relative;
    flex: none;
    color: var(--navy-400);
    transition: opacity var(--duration-fast) var(--ease-out), translate var(--duration-fast) var(--ease-out);

    &::after {
      content: "";
      position: absolute;
      inset-inline: 0;
      top: 55%;
      height: 1px;
      background: currentcolor;
      transform-origin: left;
    }

    &[data-state="out"] { opacity: 0; translate: 0 -0.4em; }

    &[data-state="in"] {
      animation: word-in var(--duration-slow) var(--ease-out) backwards;

      &::after { animation: strike var(--duration-slow) var(--ease-out) 400ms backwards; }
    }
  }

  @keyframes word-in {
    from { opacity: 0; translate: 0 0.5em; }
  }

  @keyframes strike {
    from { transform: scaleX(0); }
  }

  /* ---------- Callout (Callout.module.css) ---------- */
  .callout {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-text);
    background: var(--color-surface-subtle);
    border-radius: var(--radius-xs);

    & .heading { margin-block-end: var(--space-1); font-weight: var(--weight-semibold); }
    & .body { color: var(--color-text-muted); }
  }

  /* ---------- Site header: dark gradient hero (SiteHeader.module.css) ---------- */
  .header {
    padding-block: var(--space-6) var(--space-section);
    color: var(--color-text);
    background: var(--bg-brand-dark);
  }

  .bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    text-decoration: none;
  }

  .brand-logo { width: 12rem; }

  .divider {
    width: 1px;
    height: 2.06rem; /* = cap height of the logo (12rem × 233 / 1359) */
    background: var(--color-border-strong);
  }

  .product {
    font-family: var(--font-mono);
    font-weight: var(--weight-medium);
    font-size: var(--text-label-s);
    line-height: 1;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--color-text-muted);
  }

  .nav { display: flex; align-items: center; gap: var(--space-1); }

  .nav-link {
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-text-subtle);
    border-radius: var(--radius-full);
    transition: var(--transition-colors);

    &[data-variant="active"] { color: var(--color-text); background: var(--color-surface-muted); }

    &:not([data-variant]) { display: none; }

    @media (width >= 64rem) {
      &:not([data-variant]) { display: inline-block; }
    }

    @media (hover: hover) and (pointer: fine) {
      &:hover { color: var(--color-text); }
    }
  }

  @media (hover: hover) and (pointer: fine) {
    .brand:hover .product { color: var(--color-text); }
  }

  .hero {
    display: grid;
    justify-items: center;
    margin-block-start: var(--space-12);
    text-align: center;

    /* Calm entrance, one element after another */
    & > * { animation: rise var(--duration-slower) var(--ease-out) backwards; }
    & > :nth-child(2) { animation-delay: 80ms; }
    & > :nth-child(3) { animation-delay: 200ms; }
    & > :nth-child(4) { animation-delay: 320ms; }
    & > :nth-child(5) { animation-delay: 420ms; }
    & > :nth-child(6) { animation-delay: 520ms; }
  }

  @keyframes rise {
    from { opacity: 0; translate: 0 2.4rem; }
  }

  .hero-eyebrow { margin-block-end: var(--space-6); color: var(--color-text-muted); }

  .hero-title {
    max-width: 18ch;
    font-size: var(--text-6xl);
    line-height: 1;
  }

  .hero-glass { margin-block-start: var(--space-7); }

  .hero-subtitle {
    margin-block-start: var(--space-8);
    font-size: var(--text-xl);
  }

  .hero-lead {
    max-width: 58ch;
    margin-block-start: var(--space-3);
    color: var(--color-text-muted);
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-block-start: var(--space-7);
  }

  /* ---------- Section (Section.module.css). Attributes: data-layout="full" ---------- */
  .section {
    display: grid;
    gap: var(--space-6);
    padding-block: var(--space-section-sm);
    border-block-start: var(--border-width) solid var(--color-border);

    @media (width >= 64rem) {
      grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
      gap: var(--space-10);
    }

    &[data-layout="full"] {
      grid-template-columns: minmax(0, 1fr);
      gap: var(--space-8);
    }

    &:first-child { border-block-start: none; }
  }

  .section-text { display: grid; align-content: start; gap: var(--space-4); }

  .section-head {
    display: grid;
    gap: var(--space-4);

    @media (width >= 64rem) {
      grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
      align-items: end;
      gap: var(--space-10);
    }
  }

  .section-title { font-size: var(--text-3xl); }

  .section-body { max-width: var(--measure-narrow); color: var(--color-text-muted); }

  .section-content { display: grid; align-content: start; gap: var(--space-6); min-width: 0; }

  /* ---------- Reveal on scroll (only when JS runs; content stays visible without it) ---------- */
  .js [data-reveal]:not([data-inview]) { opacity: 0; }

  [data-reveal][data-inview] {
    animation: rise var(--duration-slow) var(--ease-out) backwards;
    animation-delay: var(--delay, 0ms);
  }

  /* ---------- Bento grid ---------- */
  .bento {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);

    @media (width >= 48rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    @media (width >= 64rem) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  }

  .tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
    padding: var(--space-5);
    overflow: hidden;
    color: var(--color-text);
    background: var(--color-surface-raised);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-xs);
    transition:
      translate var(--duration-normal) var(--ease-out),
      border-color var(--duration-normal) var(--ease-out),
      box-shadow var(--duration-normal) var(--ease-out);

    @media (width >= 48rem) { padding: var(--space-6); }

    @media (hover: hover) and (pointer: fine) {
      &:hover { translate: 0 -0.4rem; border-color: var(--color-border-strong); box-shadow: var(--shadow-lg); }
    }

    &[data-variant="gradient"] { background: var(--bg-brand-dark); border-color: transparent; }
    &[data-variant="navy"] { background: var(--navy-900); border-color: transparent; }
  }

  .tile-apps, .tile-ai, .tile-stack { @media (width >= 48rem) { grid-column: span 2; } }

  @media (width >= 64rem) {
    .tile-apps { grid-column: span 4; grid-row: span 2; }
    .tile-start, .tile-place, .tile-team { grid-column: span 2; }
    .tile-ai, .tile-stack { grid-column: span 3; }
    .tile-next { grid-column: span 4; }
  }

  .tile-title { font-size: var(--text-2xl); }

  .tile-text { max-width: var(--measure); font-size: var(--text-sm); color: var(--color-text-muted); }

  .tile-big {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: var(--weight-semibold);
    line-height: 1;
    letter-spacing: -0.04em;
  }

  .tile-foot { margin-block-start: auto; padding-block-start: var(--space-4); }

  .tile-start, .tile-place, .tile-team {
    justify-content: space-between;

    @media (width >= 64rem) { min-height: 18rem; }
  }

  /* Two apps in the large tile */
  .apps { display: grid; margin-block-start: var(--space-4); }

  .app {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: var(--space-3);
    padding-block: var(--space-4);
    border-block-start: var(--border-width) solid var(--color-border);
  }

  .app-num { padding-block-start: 0.4rem; }

  .app-title { font-size: var(--text-xl); }

  .app-text { margin-block-start: var(--space-1); font-size: var(--text-sm); color: var(--color-text-muted); }

  /* Remote "live" dot */
  .ping {
    position: relative;
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    margin-inline-end: var(--space-3);
    vertical-align: 0.15em;
    background: var(--navy-900);
    border-radius: var(--radius-full);

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      background: var(--navy-900);
      border-radius: inherit;
      animation: ping 2.4s var(--ease-out) infinite;
    }
  }

  @keyframes ping {
    from { opacity: 0.45; transform: scale(1); }
    70%, to { opacity: 0; transform: scale(2.8); }
  }

  /* Team counter (animates 0 -> 7 when the tile scrolls in) */
  .count {
    --num: 7;

    counter-reset: num var(--num);

    &::after { content: counter(num); }
  }

  .tile-team[data-inview] .count { animation: count 1.4s var(--ease-out) 300ms backwards; }

  @keyframes count {
    from { --num: 0; }
  }

  /* Mini terminal in the AI tile: lines type in when the tile scrolls in */
  .terminal {
    margin-block-end: var(--space-3);
    overflow: hidden;
    background: oklch(from var(--grey-0) l c h / 4%);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-sm);
  }

  .terminal-bar {
    display: flex;
    gap: 0.6rem;
    padding: var(--space-3);
    border-block-end: var(--border-width) solid var(--color-border);

    & span { width: 0.8rem; height: 0.8rem; background: var(--color-border-strong); border-radius: var(--radius-full); }
  }

  .terminal-body {
    display: grid;
    gap: 0.4rem;
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-label-s);
    line-height: 1.5;
    color: var(--color-text);
  }

  .t-line {
    width: calc(var(--n) * 1ch);
    overflow: hidden;
    white-space: pre;

    &[data-kind="out"] { color: var(--color-text-subtle); }
  }

  .t-cursor::after {
    content: "";
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    vertical-align: text-bottom;
    background: currentcolor;
    animation: blink 1s steps(1) infinite;
  }

  .js .tile-ai:not([data-inview]) .t-line { width: 0; }
  .js .tile-ai:not([data-inview]) .t-cursor { opacity: 0; }

  .tile-ai[data-inview] {
    & .t-line { animation: type calc(var(--n) * var(--s, 40ms)) steps(var(--n)) var(--d) backwards; }
    & .t-cursor { animation: show 1ms var(--d) backwards; }
  }

  @keyframes type {
    from { width: 0; }
  }

  @keyframes show {
    from { opacity: 0; }
  }

  @keyframes blink {
    50% { opacity: 0; }
  }

  /* Stack marquee (pauses on hover) */
  .marquee {
    margin-inline: calc(var(--space-5) * -1);
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);

    @media (width >= 48rem) { margin-inline: calc(var(--space-6) * -1); }

    &:hover .marquee-track { animation-play-state: paused; }

    &[data-direction="reverse"] .marquee-track { animation-direction: reverse; animation-duration: 36s; }
  }

  .marquees { display: grid; gap: var(--space-2); margin-block: auto; }

  .tile-stack .tile-foot { margin-block-start: 0; }

  .marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;

    & .chips { flex-wrap: nowrap; padding-inline-end: var(--space-2); }
  }

  @keyframes marquee {
    to { translate: -50% 0; }
  }

  /* ---------- Checklist that ticks itself when it scrolls in ---------- */
  .checklist { display: grid; }

  .check-item {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
    padding-block: var(--space-4);
    font-size: var(--text-lg);
    border-block-start: var(--border-width) solid var(--color-border);

    &:first-child { padding-block-start: 0; border-block-start: none; }
  }

  .check {
    width: 2.4rem;
    height: 2.4rem;
    margin-block-start: 0.1rem;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;

    & rect { stroke: var(--color-border-strong); stroke-width: 1.5; }

    & path {
      stroke: var(--color-text);
      stroke-width: 2;
      stroke-dasharray: 16;
    }
  }

  .js .checklist:not([data-inview]) .check path { stroke-dashoffset: 16; }

  .checklist[data-inview] .check path {
    animation: tick var(--duration-slow) var(--ease-out) backwards;
    animation-delay: calc(var(--i) * 140ms + 300ms);
  }

  @keyframes tick {
    from { stroke-dashoffset: 16; }
  }

  /* ---------- Closing call to action on the dark gradient ---------- */
  .cta {
    display: grid;
    gap: var(--space-8);
    margin-block-end: var(--space-section-sm);
    padding: var(--space-section-sm) var(--space-5);
    color: var(--color-text);
    background: var(--bg-brand-dark);
    border-radius: var(--radius-xs);

    @media (width >= 48rem) { padding-inline: var(--space-10); }
  }

  .cta-head { display: grid; justify-items: start; gap: var(--space-4); }

  .cta-title { max-width: 18ch; font-size: var(--text-5xl); line-height: 1; }

  .cta-body { max-width: var(--measure-narrow); color: var(--color-text-muted); }

  .send {
    display: grid;
    gap: var(--space-4);

    @media (width >= 48rem) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }

  .send-item {
    display: grid;
    align-content: start;
    gap: var(--space-5);
    padding: var(--space-5);
    background: var(--color-surface-raised);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-xs);

    & p { font-size: var(--text-lg); line-height: var(--leading-snug); }
  }

  .cta .actions { justify-content: start; margin-block-start: 0; }

  .timeline {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    padding-block-start: var(--space-5);
    border-block-start: var(--border-width) solid var(--color-border);

    & li { display: flex; align-items: center; gap: var(--space-5); }

    & li + li::before {
      content: "";
      width: 2.4rem;
      height: 1px;
      background: var(--color-border-strong);
    }
  }

  /* ---------- Footer (SiteFooter.module.css) ---------- */
  .footer { padding-block: var(--space-8) var(--space-10); }

  .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block-start: var(--space-6);
    border-block-start: var(--border-width) solid var(--color-border);
  }

  .footer-meta {
    font-size: var(--text-sm);
    color: var(--color-text-muted);

    & a { color: var(--color-text); }
  }

  .footer-logo { display: block; width: 14rem; }

  /* ---------- Reduced motion: final states, no loops ---------- */
  @media (prefers-reduced-motion: reduce) {
    .ping::after { animation: none; opacity: 0; }
    .t-cursor::after { animation: none; }

    .marquee { margin-inline: 0; mask-image: none; }
    .marquee-track { width: auto; animation: none; }
    .marquee-track .chips { flex-wrap: wrap; padding-inline-end: 0; }
    .marquee-track .chips[aria-hidden="true"] { display: none; }
  }
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

@layer utilities {
  .container {
    --container-width: var(--container-xl);

    width: min(100% - var(--gutter) * 2, var(--container-width));
    margin-inline: auto;
  }

  .container[data-width="narrow"] { --container-width: var(--container-md); }
  .container[data-width="wide"]   { --container-width: var(--container-2xl); }
  .container[data-width="full"]   { --container-width: 100%; }

  .visually-hidden:not(:focus, :active) {
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }

  .text-balance { text-wrap: balance; }
  .text-pretty  { text-wrap: pretty; }
  .nowrap       { white-space: nowrap; }
}
