/* ==========================================================================
   HYPHA INC. — Global Design System
   Source: "Branding 2026 – 2030 Hypha Inc." (Color 60/30/10, Tipografía,
   Material: Mycelium, Actividad: Creative Expansion) + editorial web language.

   Contents
   01. Tokens — colour (light / dark), type, space, radius, shadow, motion
   02. Theme wiring (clock-driven via [data-theme]; OS preference as fallback)
   03. Reset & base
   04. Typography
   05. Layout — container, grid, sections & rhythm
   06. Signature — crop marks, eyebrow markers, grain, hairlines
   07. Components — buttons, links, tabs, cards, media panels, logo cloud,
       stats, chat widget, theme toggle, nav
   08. Motion — reveal-on-scroll, parallax hooks, marquee
   09. Accessibility utilities
   ========================================================================== */


/* ==========================================================================
   01. TOKENS
   ========================================================================== */

:root {
  /* ---- Brand primitives (from the Pantone sheet) ------------------------ */
  --brand-cloud-dancer: #F0EEE9;   /* Pantone 11-4201 TCX — 60 % dominant   */
  --brand-tactical-green: #3F4F45; /* Pantone 7736C  — 30 % secondary       */
  --brand-ice-green: #88D8C4;      /* Pantone 13-5414 TPG — 10 % accent     */
  --brand-mycelium-gold: #937037;  /* Isotype colour (hypha_color_full.svg) */
  --brand-ink: #141414;            /* Near-black text                        */
  --brand-paper: #FAF8F5;          /* Warm off-white page base               */
  --brand-white: #FFFFFF;
  --brand-night: #141519;          /* Brand-deck background                  */
  --brand-deep-forest: #022922;    /* Brand-deck lower wave                  */

  /* ---- Semantic colour: LIGHT (default) ---------------------------------
     Contrast (WCAG 2.2) measured against --color-bg:
       text 17.4:1 · text-muted 6.5:1 · accent-ink 5.7:1 · olive 8.2:1      */
  --color-bg: var(--brand-paper);
  --color-bg-alt: var(--brand-white);          /* alternating sections      */
  --color-bg-sunk: var(--brand-cloud-dancer);  /* photographic backdrops    */
  --color-surface: var(--brand-white);         /* cards, widget, panels     */
  --color-surface-raised: var(--brand-white);
  --color-inverse-bg: var(--brand-ink);
  --color-inverse-text: var(--brand-paper);

  --color-text: var(--brand-ink);
  --color-text-muted: #5C5A55;
  --color-text-faint: #8A877F;                 /* ≥ 3:1 — large text only   */
  --color-text-on-accent: var(--brand-ink);

  --color-line: rgba(20, 20, 20, 0.12);
  --color-line-strong: rgba(20, 20, 20, 0.28);

  --color-accent: var(--brand-ice-green);      /* decorative only on light  */
  --color-accent-ink: #1E6F5C;                 /* accent used AS text       */
  --color-olive: var(--brand-tactical-green);
  --color-gold: var(--brand-mycelium-gold);

  /* Product signatures — crop marks, markers, tabs */
  --color-mark-digital: var(--brand-ice-green);      /* Product A: Digital   */
  --color-mark-olive: var(--brand-tactical-green);   /* Product B: Military  */
  --color-mark: var(--color-mark-digital);

  --color-focus: #1E6F5C;
  --color-selection: rgba(136, 216, 196, 0.45);

  --btn-primary-bg: var(--brand-ink);
  --btn-primary-text: var(--brand-paper);
  --btn-primary-bg-hover: var(--brand-tactical-green);
  --btn-secondary-border: var(--brand-ink);
  --btn-secondary-text: var(--brand-ink);
  --btn-secondary-bg-hover: rgba(20, 20, 20, 0.05);

  --grain-opacity: 0.05;
  --logo-filter: invert(1) grayscale(1);       /* client logos are white art: invert keeps inner detail */

  /* ---- Typography --------------------------------------------------------
     One family, every device's own: SF Pro on Apple, Roboto on Android,
     Segoe UI on Windows. No web fonts to download.
     Hierarchy comes from WEIGHT, not from mixing faces:
       300 light  — display & headings (the calm, editorial voice)
       600 semi   — the one idea each heading must land (.t-key, <strong>)
       500 medium — leads, card titles, UI
       400        — running text                                         */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               system-ui, Roboto, "Segoe UI", "Helvetica Neue", Arial,
               "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --font-editorial: var(--font-sans);
  --font-label: var(--font-sans);
  /* Legacy aliases, so older rules resolve to the system sans too */
  --font-serif: var(--font-sans);
  --font-script: var(--font-sans);
  --font-mono: var(--font-sans);

  /* Fluid scale — 360px → 1440px. A ~1.25 ratio: big enough to lead,
     small enough that no heading needs more than three lines.            */
  --fs-hero:    clamp(2.75rem, 1.55rem + 5.2vw, 6rem);      /* 44 → 96px    */
  --fs-display: clamp(2.375rem, 1.55rem + 3.6vw, 4.5rem);   /* 38 → 72px    */
  --fs-h1:      clamp(2rem, 1.45rem + 2.3vw, 3.375rem);     /* 32 → 54px    */
  --fs-h2:      clamp(1.75rem, 1.35rem + 1.7vw, 2.75rem);   /* 28 → 44px    */
  --fs-h3:      clamp(1.25rem, 1.12rem + 0.55vw, 1.625rem); /* 20 → 26px    */
  --fs-h4:      clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);    /* 17 → 20px    */
  --fs-lead:    clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);/* 18 → 22px    */
  --fs-body:    clamp(1rem, 0.97rem + 0.12vw, 1.0625rem);   /* 16 → 17px    */
  --fs-small:   0.875rem;                                   /* 14px         */
  --fs-eyebrow: 0.75rem;                                    /* 12px         */
  --fs-closing: clamp(3.25rem, 1rem + 9.6vw, 10rem);        /* oversized    */

  --fw-thin: 200;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.0;
  --lh-snug: 1.08;
  --lh-heading: 1.2;
  --lh-body: 1.65;
  --lh-relaxed: 1.75;

  --ls-display: -0.04em;
  --ls-heading: -0.03em;
  --ls-body: 0;
  --ls-caps: 0.16em;
  --ls-wide: 0.08em;

  --measure: 62ch;
  --measure-narrow: 44ch;

  /* ---- Space (4px base, organic jumps for editorial rhythm) ------------- */
  --space-3xs: 0.25rem;   /*   4 */
  --space-2xs: 0.5rem;    /*   8 */
  --space-xs: 0.75rem;    /*  12 */
  --space-s: 1rem;        /*  16 */
  --space-m: 1.5rem;      /*  24 */
  --space-l: 2rem;        /*  32 */
  --space-xl: 3rem;       /*  48 */
  --space-2xl: 4rem;      /*  64 */
  --space-3xl: 6rem;      /*  96 */
  --space-4xl: 8rem;      /* 128 */

  --gutter: clamp(1rem, 0.6rem + 1.8vw, 2.5rem);            /* 16 → 40px    */
  --section-y-airy: clamp(5rem, 3rem + 9vw, 11rem);
  --section-y: clamp(4rem, 2.6rem + 6vw, 8rem);
  --section-y-dense: clamp(2.5rem, 1.8rem + 3vw, 4.5rem);

  --container-max: 90rem;      /* 1440 */
  --container-wide: 78rem;     /* 1248 */
  --container-text: 46rem;     /*  736 */

  /* ---- Radius ------------------------------------------------------------ */
  --radius-xs: 4px;
  /* Tight radii: printed-matter corners, not app-UI bubbles */
  --radius-s: 3px;
  --radius-m: 5px;
  --radius-l: 8px;
  --radius-xl: 14px;
  --radius-pill: 999px;

  /* ---- Shadow (warm, soft, low — never glossy) --------------------------- */
  --shadow-color: 30 26 20;
  --shadow-xs: 0 1px 2px rgb(var(--shadow-color) / 0.06);
  --shadow-s: 0 2px 6px rgb(var(--shadow-color) / 0.06),
              0 1px 2px rgb(var(--shadow-color) / 0.05);
  --shadow-m: 0 12px 28px -10px rgb(var(--shadow-color) / 0.16),
              0 3px 8px rgb(var(--shadow-color) / 0.05);
  --shadow-l: 0 32px 64px -24px rgb(var(--shadow-color) / 0.24),
              0 8px 18px -6px rgb(var(--shadow-color) / 0.08);
  --shadow-float: 0 20px 48px -16px rgb(var(--shadow-color) / 0.28),
                  0 2px 6px rgb(var(--shadow-color) / 0.06);

  /* ---- Crop marks -------------------------------------------------------- */
  --crop-size: 6px;
  --crop-inset: clamp(0.75rem, 0.4rem + 1.2vw, 1.5rem);

  /* ---- Motion ------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);        /* soft landing        */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-organic: cubic-bezier(0.34, 1.28, 0.64, 1); /* slight overshoot    */
  --dur-instant: 120ms;
  --dur-fast: 220ms;
  --dur-base: 420ms;
  --dur-slow: 800ms;
  --dur-reveal: 1100ms;
  --dur-theme: 600ms;

  /* ---- Layers ------------------------------------------------------------ */
  --z-base: 1;
  --z-raised: 10;
  --z-nav: 100;
  --z-widget: 200;
  --z-overlay: 300;
  --z-skip: 1000;

  color-scheme: light;
}


/* ---- Semantic colour: DARK --------------------------------------------
   Night palette drawn from the brand deck (#141519 + deep forest wave).
   Contrast vs --color-bg: text 15.7:1 · muted 7.6:1 · accent 11:1         */
:root[data-theme="dark"] {
  --color-bg: var(--brand-night);
  --color-bg-alt: #1B1D22;
  --color-bg-sunk: #0F1A17;                    /* forest-tinted backdrop     */
  --color-surface: #1E2126;
  --color-surface-raised: #252930;
  --color-inverse-bg: var(--brand-cloud-dancer);
  --color-inverse-text: var(--brand-ink);

  --color-text: var(--brand-cloud-dancer);
  --color-text-muted: #A9A7A1;
  --color-text-faint: #7D7B76;
  --color-text-on-accent: var(--brand-ink);

  --color-line: rgba(240, 238, 233, 0.12);
  --color-line-strong: rgba(240, 238, 233, 0.28);

  --color-accent: var(--brand-ice-green);
  --color-accent-ink: var(--brand-ice-green);  /* passes as text on night  */
  --color-olive: #8FA597;                      /* lifted olive, 6.9:1       */
  --color-gold: #C9A66B;

  --color-mark-digital: var(--brand-ice-green);
  --color-mark-olive: #7F9686;

  --color-focus: var(--brand-ice-green);
  --color-selection: rgba(136, 216, 196, 0.3);

  --btn-primary-bg: var(--brand-cloud-dancer);
  --btn-primary-text: var(--brand-ink);
  --btn-primary-bg-hover: var(--brand-ice-green);
  --btn-secondary-border: var(--brand-cloud-dancer);
  --btn-secondary-text: var(--brand-cloud-dancer);
  --btn-secondary-bg-hover: rgba(240, 238, 233, 0.08);

  --shadow-color: 0 0 0;
  --grain-opacity: 0.07;
  --logo-filter: none;

  color-scheme: dark;
}


/* ==========================================================================
   02. THEME WIRING
   JS sets <html data-theme="light|dark"> from the device clock
   (light 07:00–18:59, dark otherwise) and remembers a manual override.
   Without JS, fall back to the OS preference.
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: var(--brand-night);
    --color-bg-alt: #1B1D22;
    --color-bg-sunk: #0F1A17;
    --color-surface: #1E2126;
    --color-surface-raised: #252930;
    --color-inverse-bg: var(--brand-cloud-dancer);
    --color-inverse-text: var(--brand-ink);
    --color-text: var(--brand-cloud-dancer);
    --color-text-muted: #A9A7A1;
    --color-text-faint: #7D7B76;
    --color-line: rgba(240, 238, 233, 0.12);
    --color-line-strong: rgba(240, 238, 233, 0.28);
    --color-accent-ink: var(--brand-ice-green);
    --color-olive: #8FA597;
    --color-gold: #C9A66B;
    --color-mark-olive: #7F9686;
    --color-focus: var(--brand-ice-green);
    --btn-primary-bg: var(--brand-cloud-dancer);
    --btn-primary-text: var(--brand-ink);
    --btn-primary-bg-hover: var(--brand-ice-green);
    --btn-secondary-border: var(--brand-cloud-dancer);
    --btn-secondary-text: var(--brand-cloud-dancer);
    --btn-secondary-bg-hover: rgba(240, 238, 233, 0.08);
    --shadow-color: 0 0 0;
    --grain-opacity: 0.07;
    --logo-filter: none;
    color-scheme: dark;
  }
}

/* Smooth cross-fade only while switching (class added briefly by JS),
   so the page never animates colours on first paint. */
html.is-theme-switching,
html.is-theme-switching *,
html.is-theme-switching *::before,
html.is-theme-switching *::after {
  transition:
    background-color var(--dur-theme) var(--ease-in-out),
    color var(--dur-theme) var(--ease-in-out),
    border-color var(--dur-theme) var(--ease-in-out),
    fill var(--dur-theme) var(--ease-in-out) !important;
}

/* Swap logo artwork per theme: <img class="logo-light"> / <img class="logo-dark"> */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: inline-block; }
}


/* ==========================================================================
   03. RESET & BASE
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;             /* clears the sticky nav         */
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
img { font-style: italic; }               /* styled alt text if img fails  */

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

p, h1, h2, h3, h4, h5, h6, li, figcaption, blockquote { overflow-wrap: break-word; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li, blockquote { text-wrap: pretty; }

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

a { color: inherit; }

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

hr {
  border: 0;
  height: 1px;
  background: var(--color-line);
}


/* ==========================================================================
   04. TYPOGRAPHY
   Brand voice: light headings + one semibold keyword — the web echo of
   "CREATIVIDAD **METÓDICA**". Caps only for small labels.
   ========================================================================== */

.t-hero,
.t-display,
h1, .t-h1,
h2, .t-h2,
h3, .t-h3,
h4, .t-h4 {
  font-family: var(--font-display);
  color: var(--color-text);
}

.t-hero {
  font-size: var(--fs-hero);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

.t-display {
  font-size: var(--fs-display);
  font-weight: var(--fw-light);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

h1, .t-h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-heading);
}

h2, .t-h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-heading);
}

h3, .t-h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
  letter-spacing: -0.02em;
}

h4, .t-h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: var(--lh-heading);
}

/* Emphasis inside display type — the brand's thin/bold pairing */
.t-hero strong, .t-display strong,
h1 strong, h2 strong, .t-h1 strong, .t-h2 strong, .t-closing strong {
  font-weight: var(--fw-semibold);
}

/* Muted-word pattern: fade the frame, spotlight the key phrase */
.t-fade { color: var(--color-text-faint); }

/* Keyword — the one idea a heading must land: semibold + accent ink.
   One per heading, max. (.t-script / .t-italic kept as aliases.) */
.t-key,
.t-script,
.t-italic {
  font-style: normal;
  font-weight: var(--fw-semibold);
  color: var(--color-accent-ink);
  letter-spacing: inherit;
}

.t-closing {
  font-size: var(--fs-closing);
  font-weight: var(--fw-light);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.t-lead {
  font-family: var(--font-editorial);
  font-size: var(--fs-lead);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--color-text);
  max-width: var(--measure);
}

.t-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.t-small { font-size: var(--fs-small); line-height: 1.55; }
.t-muted { color: var(--color-text-muted); }
.t-accent { color: var(--color-accent-ink); }
.t-measure { max-width: var(--measure); }
.t-measure-narrow { max-width: var(--measure-narrow); }

.t-caption,
.t-meta {
  font-family: var(--font-label);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.t-numeral {
  font-weight: var(--fw-thin);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.prose > * + * { margin-top: 1em; }
.prose { max-width: var(--measure); color: var(--color-text-muted); }
.prose strong { color: var(--color-text); font-weight: var(--fw-semibold); }


/* ==========================================================================
   05. LAYOUT
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: calc(var(--container-wide) + var(--gutter) * 2); }
.container--text { max-width: calc(var(--container-text) + var(--gutter) * 2); }

/* 12-col editorial grid — use asymmetric spans (5/7, 4/8, 7/5 offset) */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--space-xl);
}
.grid > * { grid-column: 1 / -1; }

@media (min-width: 768px) {
  /* span sets the END only, so .md:start-* can be combined with it */
  .md\:span-4  { grid-column: auto / span 4; }
  .md\:span-5  { grid-column: auto / span 5; }
  .md\:span-6  { grid-column: auto / span 6; }
  .md\:span-7  { grid-column: auto / span 7; }
  .md\:span-8  { grid-column: auto / span 8; }
  .md\:start-2 { grid-column-start: 2; }
  .md\:start-6 { grid-column-start: 6; }
  .md\:start-7 { grid-column-start: 7; }
  .md\:start-8 { grid-column-start: 8; }
}

/* Three-up compact grid */
.grid-3 {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.stack > * + * { margin-top: var(--stack-gap, var(--space-m)); }
.stack--s { --stack-gap: var(--space-s); }
.stack--l { --stack-gap: var(--space-l); }
.stack--xl { --stack-gap: var(--space-xl); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-s));
}

/* Sections & density rhythm --------------------------------------------- */
.section {
  position: relative;
  padding-block: var(--section-y);
  background-color: var(--color-bg);
  isolation: isolate;
}
.section--alt   { background-color: var(--color-bg-alt); }
.section--sunk  { background-color: var(--color-bg-sunk); }
.section--airy  { padding-block: var(--section-y-airy); }
.section--dense { padding-block: var(--section-y-dense); }
.section--inverse {
  background-color: var(--color-inverse-bg);
  color: var(--color-inverse-text);
}
.section--inverse :is(h1, h2, h3, h4, .t-hero, .t-display, .t-closing) {
  color: var(--color-inverse-text);
}

.section__head {
  display: grid;
  gap: var(--space-m);
  margin-bottom: var(--space-2xl);
  max-width: 52rem;
}


/* ==========================================================================
   06. SIGNATURE ELEMENTS
   ========================================================================== */

/* ---- Crop marks --------------------------------------------------------
   Four tiny squares in the corners of a framed section, like printer's
   registration ticks. Drawn with one pseudo-element & 4 gradients.
   Variants: .crop--digital (Ice Green) · .crop--olive (Tactical Green)   */
.crop { position: relative; }
.crop::before {
  content: "";
  position: absolute;
  inset: var(--crop-inset);
  pointer-events: none;
  z-index: var(--z-base);
  --c: linear-gradient(var(--color-mark), var(--color-mark));
  background:
    var(--c) top left     / var(--crop-size) var(--crop-size) no-repeat,
    var(--c) top right    / var(--crop-size) var(--crop-size) no-repeat,
    var(--c) bottom left  / var(--crop-size) var(--crop-size) no-repeat,
    var(--c) bottom right / var(--crop-size) var(--crop-size) no-repeat;
}
.crop--digital { --color-mark: var(--color-mark-digital); }
.crop--olive   { --color-mark: var(--color-mark-olive); }

/* ---- Eyebrow ----------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-label);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--color-mark);
}
.eyebrow--digital { --color-mark: var(--color-mark-digital); }
.eyebrow--olive   { --color-mark: var(--color-mark-olive); }
.eyebrow--gold    { --color-mark: var(--color-gold); }

/* Standalone square marker (lists, stats, tabs) */
.marker {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--color-mark);
  vertical-align: middle;
}

/* ---- Paper grain — the hand-crafted, printed texture -------------------
   Apply .grain to any section/backdrop. Pure SVG noise, no image request. */
.grain { position: relative; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain::after { mix-blend-mode: screen; }
.grain > * { position: relative; z-index: 1; }

/* ---- Hairlines & rules ------------------------------------------------- */
.rule {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  font-family: var(--font-label);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-line-strong);
}

/* Hand-drawn line illustration (inline SVG strokes, never filled clip-art).
   Stroke weights: .d0 trunk · .d1 branch · .d2 twig · .d3 hair · .dash route */
.ink {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: var(--color-text);
}
.ink :is(path, circle) {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ink .d0 { stroke-width: 1.6; }
.ink .d2 { stroke-width: 0.8; opacity: 0.85; }
.ink .d3 { stroke-width: 0.6; opacity: 0.7; }
.ink .dash { stroke-dasharray: 0.006 0.012; opacity: 0.7; }
.ink :is(.spore, .pin) { fill: currentColor; stroke: none; }
.ink text {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.06em;
  fill: var(--color-text-muted);
}
.ink text.big { font-size: 13px; font-weight: 600; }
.ink--accent .spore, .ink--accent .pin { fill: var(--color-accent-ink); }

/* Draw-on: every path carries pathLength="1", so one dash covers any length.
   Stagger with style="--i" on the <svg>; JS adds .is-visible. */
.js .ink--draw :is(path, circle):not(.dash) {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.6s var(--ease-out);
}
.js .ink--draw :is(path, circle):nth-child(3n+1) { transition-delay: 0.15s; }
.js .ink--draw :is(path, circle):nth-child(3n+2) { transition-delay: 0.45s; }
.js .ink--draw :is(.spore, .pin) { opacity: 0; transition: opacity 1s var(--ease-out) 1.8s; }
.js .ink--draw.is-visible :is(path, circle):not(.dash) { stroke-dashoffset: 0; }
.js .ink--draw.is-visible :is(.spore, .pin) { opacity: 1; }
/* Scroll-scrubbed variant: JS writes --draw (0 → 1) */
.js .ink--scrub :is(path, circle):not(.dash) {
  stroke-dasharray: 1 1;
  stroke-dashoffset: calc(1 - var(--draw, 0));
}


/* ==========================================================================
   07. COMPONENTS
   ========================================================================== */

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  --btn-pad-y: 0.875rem;
  --btn-pad-x: 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 48px;                      /* WCAG 2.5.8 target size          */
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn--primary:hover { background: var(--btn-primary-bg-hover); }
:root[data-theme="dark"] .btn--primary:hover { color: var(--brand-ink); }

.btn--secondary {
  background: transparent;
  color: var(--btn-secondary-text);
  border-color: var(--btn-secondary-border);
}
.btn--secondary:hover { background: var(--btn-secondary-bg-hover); }

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  padding-inline: 0.75rem;
}
.btn--ghost:hover { color: var(--color-accent-ink); }

.btn--small { --btn-pad-y: 0.625rem; --btn-pad-x: 1.125rem; min-height: 40px; font-size: 0.875rem; }
.btn--large { --btn-pad-y: 1.125rem; --btn-pad-x: 2rem; font-size: 1rem; }

/* Arrow that nudges on hover */
.btn__arrow { transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---- Links -------------------------------------------------------------- */
.link {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--color-line-strong);
  transition: text-decoration-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.link:hover { color: var(--color-accent-ink); text-decoration-color: currentColor; }

/* Nav-style link: underline draws in from the left */
.link-draw {
  position: relative;
  color: var(--color-text);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--dur-base) var(--ease-out);
}
.link-draw:hover,
.link-draw[aria-current="page"] { background-size: 100% 1px; }

/* ---- Navigation --------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.nav.is-scrolled { border-bottom-color: var(--color-line); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: 4.5rem;
}
.nav__logo { height: 28px; width: auto; }
.nav__links {
  display: none;
  gap: var(--space-l);
  font-size: 0.9375rem;
}
@media (min-width: 960px) { .nav__links { display: flex; } }

/* ---- Tabs (testimonials / service panels) ------------------------------ */
.tabs__list {
  display: flex;
  gap: var(--space-2xs);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--color-line);
}
.tabs__list::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 48px;
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}
.tab::before {                         /* square tab marker               */
  content: "";
  width: 7px;
  height: 7px;
  background: var(--color-line-strong);
  transition: background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-base) var(--ease-organic);
}
.tab::after {                          /* active underline                */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.tab:hover { color: var(--color-text); }
.tab[aria-selected="true"] { color: var(--color-text); }
.tab[aria-selected="true"]::before { background: var(--color-mark); transform: rotate(45deg); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }

.tabs__panel { padding-top: var(--space-xl); }
.tabs__panel[hidden] { display: none; }
.tabs__panel.is-entering { animation: panel-in var(--dur-slow) var(--ease-out) both; }

@keyframes panel-in {              /* opacity + transform only: GPU-composited */
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to   { opacity: 1; transform: none; }
}

/* ---- Cards ------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card:hover { background: var(--color-bg-sunk); border-color: var(--color-line-strong); }
.card__index {
  font-family: var(--font-label);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-wide);
  color: var(--color-text-muted);   /* small text: must clear 4.5:1 */
}

/* Single feature card (the "pricing"-style engagement card) */
.card--feature {
  padding: clamp(2rem, 1.2rem + 3vw, 4rem);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-l);
  border-color: transparent;
}
.card--feature:hover { transform: none; }

/* Check list inside cards */
.checklist { list-style: none; padding: 0; display: grid; gap: var(--space-xs); }
.checklist li {
  display: grid;
  grid-template-columns: 7px 1fr;
  align-items: baseline;
  gap: var(--space-s);
}
.checklist li::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--color-mark);
  transform: translateY(-1px);
}

/* ---- Media panels — the hero imagery ----------------------------------
   Large, slightly overlapping photos inside a warm textured backdrop.   */
.stage {
  position: relative;
  padding: clamp(1.5rem, 0.5rem + 5vw, 5rem);
  border-radius: var(--radius-xl);
  background-color: var(--color-bg-sunk);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  isolation: isolate;
}

.panel {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-l);
}
.panel img { width: 100%; height: 100%; object-fit: cover; }

.panel-stack {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto;
  align-items: start;
}
.panel-stack > .panel:nth-child(1) { grid-column: 1 / 9;  grid-row: 1; z-index: 1; }
.panel-stack > .panel:nth-child(2) { grid-column: 6 / 13; grid-row: 1; z-index: 2; margin-top: 18%; }
.panel-stack > .panel:nth-child(3) { grid-column: 2 / 6;  grid-row: 1; z-index: 3; margin-top: 46%; }
@media (max-width: 639px) {
  .panel-stack > .panel:nth-child(3) { display: none; }
}

/* ---- Logo cloud (dense) ------------------------------------------------ */
.logo-cloud {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9rem, 40%), 1fr));
  border-top: 1px solid var(--color-line);
  border-left: 1px solid var(--color-line);
}
.logo-cloud__item {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  padding: var(--space-m);
  border-right: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}
.logo-cloud__item img {
  max-height: 2.25rem;
  width: auto;
  object-fit: contain;
  filter: var(--logo-filter);
  opacity: 0.62;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.logo-cloud__item:hover img { opacity: 1; }

/* Marquee variant — pauses on hover, disabled with reduced motion */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track {
  display: flex;
  gap: var(--space-3xl);
  width: max-content;
  animation: marquee var(--marquee-dur, 48s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Stats / testimonial highlights ------------------------------------ */
.stat { display: grid; gap: var(--space-2xs); }
.stat__value {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: var(--fw-light);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}
.stat__value .marker { margin-right: 0.35em; vertical-align: 0.6em; }
.stat__label { font-size: var(--fs-small); color: var(--color-text-muted); max-width: 22ch; }

.quote {
  font-family: var(--font-editorial);
  font-size: var(--fs-h3);
  font-weight: var(--fw-regular);
  line-height: 1.3;
  letter-spacing: -0.005em;
  max-width: 36ch;
}
.quote__cite {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-top: var(--space-l);
  font-style: normal;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}
.quote__cite img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

/* ---- Floating chat / contact widget ------------------------------------ */
.chat-card {
  width: min(20rem, calc(100vw - var(--gutter) * 2));
  padding: var(--space-m);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-float);
  font-size: var(--fs-small);
  /* bob runs 3 times then rests (WCAG 2.2.2: no endless motion) */
  animation: float-in var(--dur-reveal) var(--ease-out) both, bob 7s var(--ease-in-out) 1.2s 3;
}
.chat-card__head { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-s); }
.chat-card__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--color-olive); display: grid; place-items: center; }
.chat-card__bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-m) var(--radius-m) var(--radius-m) var(--radius-xs);
  background: var(--color-bg-sunk);
  line-height: 1.5;
}
.chat-card__status::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  vertical-align: middle;
}

.chat-launcher {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: var(--z-widget);
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-float);
  transition: transform var(--dur-base) var(--ease-organic);
}
.chat-launcher:hover { transform: scale(1.06) rotate(-6deg); }

@keyframes float-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -6px; }
}

/* ---- Theme toggle ------------------------------------------------------ */
.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-line-strong);
  color: var(--color-text);
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover { background: var(--btn-secondary-bg-hover); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  grid-area: 1 / 1;
  transition: transform var(--dur-slow) var(--ease-organic), opacity var(--dur-base) var(--ease-out);
}
.theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.theme-toggle .icon-moon { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }

/* ---- Footer ------------------------------------------------------------- */
.footer {
  padding-block: var(--space-3xl) var(--space-xl);
  border-top: 1px solid var(--color-line);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}
.footer a { color: inherit; }
.footer a:hover { color: var(--color-text); }


/* ==========================================================================
   08. MOTION
   Transform & opacity only (GPU-friendly). JS toggles .is-visible via
   IntersectionObserver; stagger children with style="--i: n".
   ========================================================================== */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal="fade"]  { transform: none; }
.js [data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(32px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(0.96); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Line-by-line headline reveal: wrap each line in .line > span */
/* Padding + negative margin give descenders & script swashes room inside the mask */
.split .line { display: block; overflow: hidden; padding: 0.02em 0.1em 0.12em 0; margin: 0 -0.1em -0.12em 0; }
.split .line > span { display: inline-block; }
.js .split .line > span {
  transform: translate3d(0, 105%, 0);
  transition: transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 110ms);
}
.js .split.is-visible .line > span { transform: none; }

/* Image mask reveal — a curtain lifts off the photo */
.js .reveal-mask { clip-path: inset(100% 0 0 0 round var(--radius-m)); transition: clip-path 1.4s var(--ease-out); }
.js .reveal-mask.is-visible { clip-path: inset(0 0 0 0 round var(--radius-m)); }

/* Parallax hook — JS writes --parallax (px) with rAF; transform only */
[data-parallax] { transform: translate3d(0, var(--parallax, 0px), 0); will-change: transform; }

/* Native scroll-driven progress bar where supported */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: var(--z-overlay);
  background: var(--color-accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .scroll-progress { animation: grow-x linear both; animation-timeline: scroll(root); }
}
@keyframes grow-x { to { transform: scaleX(1); } }


/* ==========================================================================
   09. ACCESSIBILITY
   ========================================================================== */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
.btn:focus-visible, .theme-toggle:focus-visible, .chat-launcher:focus-visible {
  border-radius: var(--radius-pill);
}

.skip-link {
  position: absolute;
  top: var(--space-s);
  left: var(--space-s);
  z-index: var(--z-skip);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus { transform: none; }

.visually-hidden:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Honour reduced-motion: show everything, stop loops, no smooth scroll */
@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;
    transition-delay: 0ms !important;
  }
  .js [data-reveal], .js .split .line > span { opacity: 1; transform: none; }
  .js .reveal-mask { clip-path: none; }
  [data-parallax] { transform: none !important; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; }
  .js .ink--draw :is(path, circle), .js .ink--scrub :is(path, circle) { stroke-dashoffset: 0 !important; stroke-dasharray: none !important; }
  .js .ink--draw :is(.spore, .pin) { opacity: 1; }
}

/* Windows High Contrast / forced colours */
@media (forced-colors: active) {
  .crop::before, .grain::after { display: none; }
  .eyebrow::before, .marker, .tab::before, .checklist li::before { background: CanvasText; }
  .btn { border: 1px solid ButtonText; }
}

/* Print — keeps the editorial feel on paper */
@media print {
  .nav, .chat-launcher, .chat-card, .theme-toggle, .scroll-progress { display: none !important; }
  [data-reveal], .split .line > span { opacity: 1 !important; transform: none !important; }
  body { background: #fff; color: #000; }
}


/* ==========================================================================
   10. CRAFT LAYER
   The hand in the machine: paper, tape, ink strokes and small signs of life.
   Every effect is transform/opacity-only, pointer-fine only where it
   follows the cursor, and switched off for reduced motion.
   ========================================================================== */

/* ---- Paper: one fixed grain sheet over the whole page ------------------ */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: var(--z-overlay);
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { opacity: 0.09; filter: invert(1); }

/* ---- Masking tape on printed plates ----------------------------------- */
.tape { position: relative; }
.tape::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 26px;
  z-index: 2;
  translate: -50% 0;
  rotate: var(--tape-rot, -3deg);
  background: rgba(214, 203, 178, 0.62);
  box-shadow: 0 1px 2px rgba(30, 26, 20, 0.08);
  /* torn ends */
  clip-path: polygon(2% 8%, 8% 0, 16% 10%, 24% 2%, 100% 4%, 97% 30%, 100% 55%, 96% 78%, 100% 100%, 12% 96%, 5% 100%, 0 70%, 3% 42%, 0 18%);
}
:root[data-theme="dark"] .tape::before { background: rgba(240, 238, 233, 0.16); }

/* ---- Hand-drawn underline that inks itself in ------------------------- */
.scribble { position: relative; white-space: nowrap; }
.scribble__line {
  position: absolute;
  left: -2%;
  bottom: -0.12em;
  width: 104%;
  height: 0.36em;
  overflow: visible;
  pointer-events: none;
}
.scribble__line path {
  fill: none;
  stroke: var(--color-accent-ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;   /* no pathLength dash on this one: see below */
}
.js .scribble__line { clip-path: inset(0 100% 0 0); transition: clip-path 1.2s var(--ease-out) 0.5s; }
.js .is-visible .scribble__line,
.js .scribble.is-visible .scribble__line { clip-path: inset(0 0 0 0); }

/* ---- Living spores: the hyphae breathe once drawn --------------------- */
.ink--alive .spore {
  transform-box: fill-box;
  transform-origin: center;
  animation: spore 5.5s var(--ease-in-out) infinite;
}
.ink--alive .spore:nth-of-type(3n)   { animation-delay: -1.8s; animation-duration: 6.5s; }
.ink--alive .spore:nth-of-type(3n+1) { animation-delay: -3.4s; animation-duration: 4.8s; }
@keyframes spore {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.9); opacity: 0.35; }
}

/* ---- Cursor companion (fine pointers only) ----------------------------- */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .js .cursor {
    display: block;
    position: fixed;
    top: 0; left: 0;
    z-index: var(--z-skip);
    pointer-events: none;
  }
  .cursor__ring, .cursor__dot {
    position: absolute;
    top: 0; left: 0;
    border-radius: 50%;
    translate: var(--cx, -100px) var(--cy, -100px);
    will-change: translate;
  }
  .cursor__dot {
    width: 6px; height: 6px;
    margin: -3px 0 0 -3px;
    background: var(--color-accent-ink);
  }
  .cursor__ring {
    width: 34px; height: 34px;
    margin: -17px 0 0 -17px;
    border: 1px solid var(--color-accent-ink);
    opacity: 0.45;
    translate: var(--rx, -100px) var(--ry, -100px);
    transition: scale var(--dur-base) var(--ease-organic), opacity var(--dur-base) var(--ease-out),
                background-color var(--dur-base) var(--ease-out);
  }
  .cursor.is-hover .cursor__ring { scale: 1.7; opacity: 0.9; background: color-mix(in srgb, var(--brand-ice-green) 18%, transparent); }
  .cursor.is-down .cursor__ring { scale: 0.8; }
  .cursor.is-hidden { opacity: 0; }
}

/* ---- Magnetic controls: JS writes --mx/--my (px) ----------------------- */
[data-magnetic] {
  translate: var(--mx, 0) var(--my, 0);
  transition: translate 0.5s var(--ease-organic), background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

/* ---- Band: the scrolling word ticker ---------------------------------- */
.band {
  overflow: hidden;
  padding-block: clamp(1rem, 0.6rem + 1.4vw, 1.75rem);
  border-block: 1px solid var(--color-line);
  background: var(--color-bg);
}
.band__track { display: flex; width: max-content; will-change: transform; }
.band__group { display: flex; align-items: center; flex: none; }
.band__item {
  font-weight: var(--fw-light);
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  padding-inline: clamp(1rem, 0.6rem + 1.4vw, 2rem);
}
.band__item:nth-of-type(2n) { font-weight: var(--fw-semibold); }
.band__spark { width: 1.35rem; height: 1.35rem; color: var(--color-gold); flex: none; }

@media (prefers-reduced-motion: reduce) {
  .ink--alive .spore { animation: none; }
  .cursor { display: none !important; }
  [data-magnetic] { translate: none; }
  .js .scribble__line { clip-path: none; }
}
