/* HydroPulse — core styles */

/* Metric-matched fallback for the display serif: a Georgia stand-in tuned to
   Source Serif 4's box metrics so the FOUT swap (fallback -> real) is visually
   imperceptible (no width/height shift). Sits between the real face and bare
   Georgia in --display. */
@font-face {
  font-family: "Source Serif 4 Fallback";
  src: local("Georgia");
  size-adjust: 90.13%;
  ascent-override: 114.80%;
  descent-override: 36.98%;
  line-gap-override: 0%;
}

:root {
  /* Shared layout / typography; colours come from [data-look] on <html> */
  --display-web: "Source Serif 4";
  --display-fallback: "Source Serif 4 Fallback", Georgia, serif;
  --sans-web: "Poppins";
  --sans-fallback: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono-web: "JetBrains Mono";
  --mono-fallback: ui-monospace, Menlo, monospace;
  --display: var(--display-web), var(--display-fallback);
  --sans: var(--sans-web), var(--sans-fallback);
  --mono: var(--mono-web), var(--mono-fallback);

  --max: 1360px;
  --gutter: clamp(20px, 4vw, 56px);

  --dur: 420ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ——— Look 1: original “cold river, warm stone” (green-leaning teal) ——— */
[data-look="1"] {
  --logo-navy: #000547;
  --logo-sky: #25B8F0;
  --ink: #0E2230;
  --ink-2: #16304A;
  --surface: #F2EEE6;
  --paper: #FAF7F0;
  --teal: #3F6E6F;
  --teal-deep: #2A5254;
  --moss: #7A8F6A;
  --stone: #A9A398;
  --rule: rgba(14, 34, 48, 0.14);
  --rule-strong: rgba(14, 34, 48, 0.28);
  --muted: #5A6670;
  --accent: var(--teal);
  --accent-deep: var(--teal-deep);
  --laf-duotone-grad: linear-gradient(180deg, rgba(14, 34, 48, 0.35), rgba(63, 110, 111, 0.25) 60%, rgba(14, 34, 48, 0.55));
  --laf-placeholder-bg: rgba(14, 34, 48, 0.6);
  --laf-hero-scrim: linear-gradient(180deg, rgba(14, 34, 48, 0.55) 0%, rgba(14, 34, 48, 0.12) 38%, rgba(14, 34, 48, 0.55) 68%, rgba(14, 34, 48, 0.92) 100%);
  --laf-tweaks-backdrop: rgba(14, 34, 48, 0.35);
  --laf-launcher-shadow: 0 12px 40px -12px rgba(14, 34, 48, 0.45);
  --laf-panel-shadow: 0 30px 60px -30px rgba(14, 34, 48, 0.4);
  /* Sticky site header (L1: light, scroll glass) */
  --header-bg-top: transparent;
  --header-bg-scrolled: color-mix(in srgb, var(--paper) 92%, transparent);
  --header-backdrop: blur(18px) saturate(1.1);
  --header-border-top: transparent;
  --header-border-scrolled: var(--rule);
}
[data-look="1"][data-primary="teal"]  { --teal: #3F6E6F; --teal-deep: #2A5254; --accent: #3F6E6F; --accent-deep: #2A5254; }
[data-look="1"][data-primary="navy"]  { --teal: #1E3A55; --teal-deep: #102336; --accent: #1E3A55; --accent-deep: #102336; --ink: #0E2230; --ink-2: #1E3A55; }
[data-look="1"][data-primary="slate"] { --teal: #4A5E6E; --teal-deep: #33444F; --accent: #4A5E6E; --accent-deep: #33444F; --ink: #1C2A33; --ink-2: #36505E; }

/* ——— Look 2: logo-aligned (navy family + bluer accent) ——— */
[data-look="2"] {
  --logo-navy: #000547;
  --logo-sky: #25B8F0;
  --ink: #0B1A38;
  --ink-2: #0F2450;
  --surface: #F0EDE5;
  --paper: #FAF7F0;
  --teal: #2E6B7C;
  --teal-deep: #1A4E63;
  --moss: #6F8A6E;
  --stone: #9FA3A0;
  --rule: rgba(0, 5, 40, 0.12);
  --rule-strong: rgba(0, 5, 40, 0.2);
  --muted: #4A5568;
  --accent: var(--teal);
  --accent-deep: var(--teal-deep);
  --laf-duotone-grad: linear-gradient(180deg, rgba(11, 26, 56, 0.38), rgba(46, 107, 124, 0.22) 60%, rgba(11, 26, 56, 0.55));
  --laf-placeholder-bg: rgba(7, 15, 45, 0.62);
  --laf-hero-scrim: linear-gradient(180deg, rgba(7, 15, 45, 0.55) 0%, rgba(11, 26, 56, 0.12) 38%, rgba(7, 15, 45, 0.52) 68%, rgba(0, 5, 40, 0.92) 100%);
  --laf-tweaks-backdrop: rgba(7, 15, 45, 0.38);
  --laf-launcher-shadow: 0 12px 40px -12px rgba(0, 5, 40, 0.42);
  --laf-panel-shadow: 0 30px 60px -30px rgba(0, 5, 40, 0.38);
  --header-bg-top: transparent;
  --header-bg-scrolled: color-mix(in srgb, var(--paper) 92%, transparent);
  --header-backdrop: blur(18px) saturate(1.1);
  --header-border-top: transparent;
  --header-border-scrolled: var(--rule);
}
[data-look="2"][data-primary="teal"]  { --teal: #2E6B7C; --teal-deep: #1A4E63; --accent: #2E6B7C; --accent-deep: #1A4E63; }
[data-look="2"][data-primary="navy"]  { --teal: #1A3A59; --teal-deep: #0F2344; --accent: #1A3A59; --accent-deep: #0F2344; --ink: #07122E; --ink-2: #0E1E46; }
[data-look="2"][data-primary="slate"] { --teal: #3E5C6B; --teal-deep: #2C4452; --accent: #3E5C6B; --accent-deep: #2C4452; --ink: #15242F; --ink-2: #2A4050; }

/* ——— Look 3: “mineral / cool air” — near-white + blue-grey (no warm yellow cast) ——— */
[data-look="3"] {
  --logo-navy: #000547;
  --logo-sky: #25B8F0;
  --ink: #1A222C;
  --ink-2: #2A3640;
  --surface: #E5E9ED;
  --paper: #F4F5F7;
  --teal: #4A6B78;
  --teal-deep: #2F4D5A;
  --moss: #5A6B62;
  --stone: #8D939B;
  --rule: rgba(20, 32, 44, 0.11);
  --rule-strong: rgba(20, 32, 44, 0.2);
  /* Cool grey muted (L3 final) */
  --muted: #4E5662;
  --accent: var(--teal);
  --accent-deep: var(--teal-deep);
  --laf-duotone-grad: linear-gradient(180deg, rgba(20, 32, 44, 0.42), rgba(74, 107, 120, 0.2) 60%, rgba(20, 32, 44, 0.52));
  --laf-placeholder-bg: rgba(18, 28, 38, 0.58);
  --laf-hero-scrim: linear-gradient(180deg, rgba(16, 26, 36, 0.52) 0%, rgba(24, 36, 48, 0.1) 40%, rgba(16, 26, 36, 0.5) 70%, rgba(10, 18, 28, 0.9) 100%);
  --laf-tweaks-backdrop: rgba(12, 22, 32, 0.36);
  --laf-launcher-shadow: 0 12px 40px -12px rgba(12, 24, 36, 0.38);
  --laf-panel-shadow: 0 30px 60px -30px rgba(10, 20, 32, 0.34);
  --header-bg-top: transparent;
  --header-bg-scrolled: color-mix(in srgb, var(--paper) 90%, transparent);
  --header-backdrop: blur(20px) saturate(1.05);
  --header-border-top: transparent;
  --header-border-scrolled: var(--rule);
}
[data-look="3"][data-primary="teal"]  { --teal: #4A6B78; --teal-deep: #2F4D5A; --accent: #4A6B78; --accent-deep: #2F4D5A; }
[data-look="3"][data-primary="navy"]  { --teal: #2C4A5C; --teal-deep: #1A3344; --accent: #2C4A5C; --accent-deep: #1A3344; --ink: #0F1A24; --ink-2: #1E2E3C; }
[data-look="3"][data-primary="slate"] { --teal: #5A6F7A; --teal-deep: #3D4F5C; --accent: #5A6F7A; --accent-deep: #3D4F5C; --ink: #222C34; --ink-2: #38424C; }

/* ——— Look 4: “Atelier” — ink band chrome + light colophon footer (body stays editorial) ——— */
[data-look="4"] {
  --logo-navy: #000547;
  --logo-sky: #25B8F0;
  --ink: #141A22;
  --ink-2: #1E2832;
  --surface: #E6E8EC;
  --paper: #FAFAF8;
  --teal: #3D5A68;
  --teal-deep: #2A4250;
  --moss: #5A655E;
  --stone: #8E9399;
  --rule: rgba(18, 26, 36, 0.12);
  --rule-strong: rgba(18, 26, 36, 0.22);
  --muted: #515A64;
  --accent: var(--teal);
  --accent-deep: var(--teal-deep);
  --laf-duotone-grad: linear-gradient(180deg, rgba(16, 24, 34, 0.4), rgba(61, 90, 104, 0.2) 58%, rgba(16, 24, 34, 0.5));
  --laf-placeholder-bg: rgba(12, 22, 32, 0.58);
  --laf-hero-scrim: linear-gradient(180deg, rgba(10, 18, 28, 0.52) 0%, rgba(20, 30, 42, 0.1) 42%, rgba(10, 18, 28, 0.48) 72%, rgba(6, 12, 20, 0.9) 100%);
  --laf-tweaks-backdrop: rgba(10, 18, 28, 0.36);
  --laf-launcher-shadow: 0 12px 40px -12px rgba(8, 16, 28, 0.4);
  --laf-panel-shadow: 0 30px 60px -30px rgba(6, 14, 24, 0.36);
  --header-bg-top: transparent;
  --header-bg-scrolled: color-mix(in srgb, var(--paper) 91%, transparent);
  --header-backdrop: blur(18px) saturate(1.05);
  --header-border-top: transparent;
  --header-border-scrolled: var(--rule);
  /* Slightly lifted from pure black so lockup + EU line read clean without a paper chip */
  --l4-header-bg: #131d28;
  --l4-header-fg: #F2F0EA;
  --l4-header-muted: rgba(242, 240, 234, 0.58);
  --l4-header-rule: rgba(242, 240, 234, 0.14);
  --l4-overlay-bg: #121B24;
  --l4-overlay-line: rgba(242, 240, 234, 0.12);
  --l4-footer-surface: #EEEDEA;
  --l4-footer-ink: #161C24;
  --l4-footer-muted: #5C6470;
  --l4-footer-rule: rgba(18, 26, 36, 0.14);
}
[data-look="4"][data-primary="teal"]  { --teal: #3D5A68; --teal-deep: #2A4250; --accent: #3D5A68; --accent-deep: #2A4250; }
[data-look="4"][data-primary="navy"]  { --teal: #25455A; --teal-deep: #152E3E; --accent: #25455A; --accent-deep: #152E3E; --ink: #0A1018; --ink-2: #1A2430; }
[data-look="4"][data-primary="slate"] { --teal: #4E6472; --teal-deep: #364A58; --accent: #4E6472; --accent-deep: #364A58; --ink: #131A22; --ink-2: #242E3A; }

/* ——— Site chrome: sticky header (all looks; L4 uses .hp-header--l4 overrides) ——— */
.hp-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg-top);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--header-border-top, transparent);
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    backdrop-filter var(--dur) var(--ease),
    -webkit-backdrop-filter var(--dur) var(--ease);
}
.hp-site-header--scrolled {
  background: var(--header-bg-scrolled);
  backdrop-filter: var(--header-backdrop);
  -webkit-backdrop-filter: var(--header-backdrop);
  border-bottom: 1px solid var(--header-border-scrolled);
}
.hp-header--l4 {
  background: var(--l4-header-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--l4-header-rule) !important;
}
/* Never show the paper chip on L4 dark chrome (logos: transparent / inline fallback). */
.hp-header--l4 .hp-logo.hp-logo--on-ink,
.hp-fullmenu--l4 .hp-logo.hp-logo--on-ink {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.hp-header--l4 .hp-header__inner {
  border-bottom: none;
}
.hp-nav-link--l4 {
  font-family: var(--mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  font-weight: 500 !important;
}
.hp-nav-link--l4 .hp-nav-link__bar {
  background: var(--logo-sky) !important;
  height: 2px !important;
  bottom: -18px !important;
  opacity: 0.9;
}
.hp-header--l4 .hp-nav-more--l4 {
  border-color: var(--l4-header-rule) !important;
  color: var(--l4-header-fg) !important;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Full menu: default = ink + paper text; L4 = softer overlay, single column */
.hp-fullmenu {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--ink);
  color: var(--paper);
  animation: fadeIn 300ms var(--ease) both;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.hp-fullmenu--l4 {
  background: var(--l4-overlay-bg) !important;
  color: var(--l4-header-fg) !important;
}
.hp-fullmenu--l4 .hp-fullmenu__eyebrow {
  color: var(--l4-header-muted) !important;
}
.hp-fullmenu--l4 .hp-fullmenu__note {
  color: var(--l4-header-muted) !important;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hp-fullmenu--l4 a.hp-fullmenu__link,
.hp-fullmenu--l4 a.hp-fullmenu__link:visited {
  color: var(--l4-header-fg) !important;
  font-size: clamp(24px, 3vw, 36px) !important;
  font-weight: 400;
}
.hp-fullmenu--l4 .hp-fullmenu__row {
  border-color: var(--l4-overlay-line) !important;
}
.hp-fullmenu--l4 .hp-fullmenu__close {
  border-color: var(--l4-overlay-line) !important;
  color: var(--l4-header-fg) !important;
}
.hp-fullmenu--l4 .hp-fullmenu__closebar {
  border-color: var(--l4-overlay-line) !important;
}
.hp-fullmenu--l4 p.hp-fullmenu__lede {
  color: color-mix(in srgb, var(--l4-header-fg) 88%, transparent) !important;
}

.hp-fullmenu__grid {
  min-height: calc(100svh - 86px);
  align-items: stretch;
}
.hp-fullmenu__grid > div:last-child {
  align-self: center !important;
}
.hp-fullmenu__grid a {
  padding-top: clamp(16px, 2vh, 22px) !important;
  padding-bottom: clamp(16px, 2vh, 22px) !important;
}
.hp-fullmenu__grid a[style] {
  font-size: clamp(27px, 3.05vw, 42px) !important;
}
.hp-fullmenu__grid p[style] {
  font-size: clamp(19px, 1.55vw, 22px) !important;
}

@media (max-height: 920px) and (min-width: 761px) {
  .hp-fullmenu__grid {
    padding-top: clamp(22px, 4vh, 42px) !important;
    padding-bottom: clamp(22px, 4vh, 42px) !important;
    gap: clamp(28px, 4vw, 64px) !important;
  }
  .hp-fullmenu__grid a {
    padding-top: clamp(13px, 1.55vh, 18px) !important;
    padding-bottom: clamp(13px, 1.55vh, 18px) !important;
  }
  .hp-fullmenu__grid a[style] {
    font-size: clamp(25px, 2.8vw, 38px) !important;
  }
  .hp-fullmenu__grid p[style] {
    font-size: 20px !important;
    line-height: 1.38 !important;
  }
  .hp-fullmenu__grid div[style*="margin-top: 40px"] {
    margin-top: 28px !important;
  }
}

/* Footer: dark (L1–3) default in JSX; L4 = light colophon */
footer.hp-footer--light {
  background: var(--l4-footer-surface) !important;
  color: var(--l4-footer-ink) !important;
  border-top: 1px solid var(--l4-footer-rule);
}
footer.hp-footer--light .hp-footer__eyebrow {
  color: var(--l4-footer-muted) !important;
}
footer.hp-footer--light a {
  color: var(--l4-footer-ink) !important;
}
footer.hp-footer--light .body,
footer.hp-footer--light p {
  color: color-mix(in srgb, var(--l4-footer-ink) 86%, var(--l4-footer-surface)) !important;
}
footer.hp-footer--light .hp-footer__rule {
  border-color: var(--l4-footer-rule) !important;
}
footer.hp-footer--light .hp-footer__funding {
  border-color: var(--l4-footer-rule) !important;
}
footer.hp-footer--light .hp-l4-foot-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.1fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 900px) {
  footer.hp-footer--light .hp-l4-foot-grid {
    grid-template-columns: 1fr;
  }
}

/* Density switch */
[data-density="compact"] {
  --gutter: clamp(16px, 3vw, 40px);
}

/* Font tweak */
[data-display="source"] { --display: var(--display-web), var(--display-fallback); }
[data-display="tiempos"] { --display: "Fraunces", var(--display-web), Georgia, serif; font-variation-settings: "opsz" 144; }
[data-display="grotesk"] { --display: "Poppins", ui-sans-serif, system-ui, sans-serif; }
html.hp-fonts-fallback,
html.hp-fonts-fallback[data-display="source"] {
  --display: var(--display-fallback);
  --sans: var(--sans-fallback);
  --mono: var(--mono-fallback);
}
html.hp-fonts-fallback[data-display="tiempos"] { --display: Georgia, serif; }
html.hp-fonts-fallback[data-display="grotesk"] { --display: var(--sans-fallback); }

/* No-motion */
[data-motion="off"] *,
[data-motion="off"] *::before,
[data-motion="off"] *::after {
  transition-duration: 0s !important;
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--surface);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Brand logo — see assets/brand/HydroPulse_logo_*.svg (keep in line with nav ~13px type + 18px header padding) */
.hp-logo__img {
  display: block;
  height: 22px;
  width: auto;
  max-width: min(220px, 48vw);
}
@media (min-width: 600px) {
  .hp-logo__img { height: 24px; }
}
/* Dark ink UI: logo art is navy on light — sit on a paper chip for contrast */
.hp-logo--on-ink {
  background: var(--paper);
  padding: 6px 10px;
  border-radius: 2px;
  box-sizing: border-box;
}
.hp-logo--on-ink .hp-logo__img {
  height: 20px;
  max-width: min(200px, 46vw);
}
@media (min-width: 600px) {
  .hp-logo--on-ink .hp-logo__img { height: 22px; }
}
/* EU disclaimer included in artwork — allow more height */
.hp-logo--on-ink.hp-logo--with-eu .hp-logo__img {
  height: auto;
  max-height: 48px;
  max-width: min(300px, 88vw);
}
/* EU lockup on dark *without* paper chip (official dark_mode SVG) — menu + footer */
.hp-logo--with-eu:not(.hp-logo--on-ink) .hp-logo__img {
  height: auto;
  max-height: 38px;
  max-width: min(280px, 82vw);
}
@media (min-width: 900px) {
  .hp-logo--with-eu:not(.hp-logo--on-ink) .hp-logo__img {
    max-height: 40px;
  }
}

/* Display sizes — editorial, tight */
.display-xl {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 144px);
  line-height: 0.94;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-feature-settings: "ss01", "ss02";
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}
.display-lg {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.display-md {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 4.2vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.display-sm {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 500;
}

.eyebrow-ink {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink);
  font-weight: 500;
}

.lead {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.42;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.body-lg {
  font-size: 18px;
  line-height: 1.58;
  color: var(--ink);
  font-weight: 400;
}

.body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
}

.body-sm {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Container */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap-tight {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Hairlines */
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-strong { border: 0; border-top: 1px solid var(--rule-strong); margin: 0; }

/* Buttons & links */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  background: var(--ink);
  color: var(--paper);
}
.btn:hover { background: var(--accent-deep, var(--teal-deep)); }
.btn .arrow { transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.link-inline {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: border-color var(--dur) var(--ease);
}
.link-inline:hover { border-color: var(--ink); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color var(--dur) var(--ease);
}
.link-arrow .arrow { transition: transform var(--dur) var(--ease); }
.link-arrow:hover { color: var(--teal-deep); }
.link-arrow:hover .arrow { transform: translateX(4px); }

/* Page transitions */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page { animation: fadeUp 480ms var(--ease) both; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* Image placeholders — duotone treatment */
.img-duotone {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}
.img-duotone img,
.img-duotone .ph {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05) brightness(0.9);
  mix-blend-mode: luminosity;
  opacity: 0.86;
}
.img-duotone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--laf-duotone-grad);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.img-placeholder-label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 247, 240, 0.72);
  z-index: 2;
  padding: 4px 8px;
  background: var(--laf-placeholder-bg);
  backdrop-filter: blur(8px);
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--ink); }

/* Selection */
::selection { background: var(--ink); color: var(--paper); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (max-width: 1200px) { .hp-placeholder-chip { display: none; } }

/* ——— Full-bleed image hero: text always on a dark, readable stack ——— */
.hp-hero-image {
  position: relative;
  isolation: isolate;
  min-height: clamp(500px, 80vh, 900px);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}
.hp-hero-image__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hp-hero-image__poster,
.hp-hero-image__poster img {
  width: 100%;
  height: 100%;
  display: block;
}
.hp-hero-image__poster {
  position: absolute;
  inset: 0;
  animation: hpHeroDrift 22s var(--ease) infinite alternate;
  transform-origin: 50% 54%;
}
.hp-hero-image__poster img {
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(0.88);
  transform: scale(1.04);
}
.hp-hero-image__water {
  position: absolute;
  inset: -12%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 78%, rgba(255, 255, 255, 0.18), transparent 28%),
    radial-gradient(ellipse at 74% 76%, rgba(37, 184, 240, 0.13), transparent 24%),
    linear-gradient(105deg, transparent 16%, rgba(255, 255, 255, 0.09) 24%, transparent 34%, transparent 58%, rgba(255, 255, 255, 0.06) 66%, transparent 76%);
  mix-blend-mode: screen;
  opacity: 0.34;
  transform: translate3d(-2%, 1%, 0) skewY(-2deg);
  animation: hpWaterGlint 12s linear infinite alternate;
}
.hp-hero-image__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--laf-hero-scrim);
}
@keyframes hpHeroDrift {
  0% { transform: scale(1) translate3d(-0.8%, -0.4%, 0); }
  100% { transform: scale(1.055) translate3d(1.2%, 0.9%, 0); }
}
@keyframes hpWaterGlint {
  0% { opacity: 0.18; transform: translate3d(-5%, 2%, 0) skewY(-2deg); }
  50% { opacity: 0.36; }
  100% { opacity: 0.26; transform: translate3d(4%, -1%, 0) skewY(-2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hp-hero-image__poster,
  .hp-hero-image__water {
    animation: none;
  }
  .hp-hero-image__water {
    display: none;
  }
  .page { animation: none; }
  .reveal, .reveal.in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
.hp-hero-image__inner {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-sizing: border-box;
  padding-top: clamp(100px, 20vh, 200px);
  padding-bottom: clamp(48px, 6vw, 80px);
}
.hp-hero-image__block {
  max-width: 920px;
  padding-bottom: 8px;
}
.hp-hero-image__headline {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.hp-hero-image__lead {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.hp-hero-type h1,
.hp-hero-type .display-xl {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

@media (max-width: 760px) {
  .hp-hero-image {
    min-height: max(560px, 78svh);
  }
  .hp-hero-image__inner {
    padding-top: clamp(96px, 18vh, 150px);
    padding-bottom: 42px;
  }
  .hp-hero-image__lead {
    font-size: 17px;
    line-height: 1.55;
  }
  .hp-fullmenu__grid,
  .hp-footer__grid {
    grid-template-columns: 1fr !important;
  }
  .hp-two-col,
  .hp-facts,
  .hp-sites-grid,
  .hp-theme-grid,
  .hp-partner-full,
  .hp-media-grid,
  .hp-news-grid,
  .hp-partner-grid,
  .hp-res-head,
  .hp-res-row {
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
  }
  .hp-two-col > *,
  .hp-facts > *,
  .hp-sites-grid > *,
  .hp-theme-grid > *,
  .hp-partner-full > *,
  .hp-media-grid > *,
  .hp-news-grid > *,
  .hp-partner-grid > *,
  .hp-res-head > *,
  .hp-res-row > * {
    min-width: 0 !important;
  }
  .hp-fullmenu__grid {
    gap: 34px !important;
    min-height: auto;
  }
  .hp-fullmenu__grid a {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
  }
  .hp-fullmenu__grid a[style] {
    font-size: clamp(25px, 9vw, 34px) !important;
  }
  .hp-fullmenu__grid p[style] {
    font-size: 20px !important;
  }
  .hp-footer__grid {
    gap: 32px !important;
  }
}

@media (max-width: 700px) {
  .hp-hero-map .hp-two-col {
    grid-template-columns: 1fr !important;
  }
  .hp-hero-map__copy {
    margin-bottom: 28px;
  }
  .hp-hero-map__viz {
    min-width: 0;
  }
}

/* ——— Design options (client review) ——— */
.tweaks-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--laf-tweaks-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
  backdrop-filter: blur(2px);
}
.tweaks-backdrop.tweaks-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.tweaks-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid rgba(250, 247, 240, 0.2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--laf-launcher-shadow);
  transition: background var(--dur) var(--ease), transform 200ms var(--ease);
}
.tweaks-launcher:hover {
  background: var(--teal-deep);
  transform: translateY(-1px);
}
.tweaks-launcher:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}
.tweaks-launcher[aria-expanded="true"] {
  background: var(--teal-deep);
}
.tweaks-launcher__icon {
  display: flex;
  opacity: 0.9;
}

.tweaks-launcher[hidden] {
  display: none;
}

/* Tweaks panel (sits above the launcher so both stay tappable) */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: min(300px, calc(100vw - 32px));
  max-height: min(70vh, 500px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 18px;
  font-family: var(--sans);
  font-size: 13px;
  z-index: 9999;
  box-shadow: var(--laf-panel-shadow);
  display: none;
  box-sizing: border-box;
}
.tweaks.on { display: block; animation: fadeUp 300ms var(--ease) both; }
.tweaks__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tweaks__header h4 {
  margin: 0;
}
.tweaks__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  transition: background 200ms var(--ease);
}
.tweaks__close:hover { background: var(--paper); }
.tweaks h4 {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 500;
  color: var(--muted);
}
.tweaks .tweaks__hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 400;
}
.tweaks__preset-row {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.tweaks__preset {
  width: 100%;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.tweaks__preset:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
}
.tweaks__preset:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.tweaks__preset-note {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  font-weight: 400;
}
.tweaks .row { margin-bottom: 14px; }
.tweaks label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; }
.tweaks .seg { display: flex; border: 1px solid var(--rule-strong); }
.tweaks .seg button {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--rule-strong);
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--ink);
  cursor: pointer;
  transition: all 200ms var(--ease);
}
.tweaks .seg button:last-child { border-right: 0; }
.tweaks .seg.tweaks__laf {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.tweaks .seg.tweaks__laf button {
  border-bottom: 1px solid var(--rule-strong);
  border-right: 1px solid var(--rule-strong);
  padding: 9px 4px;
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
}
.tweaks .seg.tweaks__laf button:nth-child(2n) { border-right: 0; }
.tweaks .seg.tweaks__laf button:nth-child(3),
.tweaks .seg.tweaks__laf button:nth-child(4) { border-bottom: 0; }
.tweaks .seg[data-key="hero"] {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.tweaks .seg[data-key="hero"] button {
  border-bottom: 1px solid var(--rule-strong);
}
.tweaks .seg[data-key="hero"] button:nth-child(2n) { border-right: 0; }
.tweaks .seg[data-key="hero"] button:nth-child(n+3) { border-bottom: 0; }
.tweaks .seg button.active { background: var(--ink); color: var(--paper); }
.tweaks .seg button:hover:not(.active) { background: var(--surface); }

/* ── Brand page: type scale, motifs, patterns, surfaces ── */
.hp-ts-sample {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}
.hp-surface-grid a.reveal:hover { border-color: var(--accent); }
@media (max-width: 640px) {
  .hp-ts-row { grid-template-columns: 1fr auto !important; gap: 4px 12px !important; }
  .hp-ts-row > .hp-ts-sample { grid-column: 1 / -1; }
}
