/* =========================================================================
   hlousek.me – shared design system
   -------------------------------------------------------------------------
   One set of tokens, type, chrome (nav, menu, footer, progress, FAB) and
   motion for every public page: index, manifesto, cv, privacy, terms, id.
   Page files keep only their own layout/components in an inline <style>.
   Field Notes (mh-*.html), case studies and the archive have their own
   systems on purpose and do not load this file.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces & ink (dark is the default) */
  --bg: #0a0b0e;
  --surface: #111319;
  --card: #161922;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f7fa;
  --text-2: #a3adbd;
  --text-3: #7c879a;

  /* Brand */
  --accent: #4f8cff;
  --accent-ink: #ffffff;
  --accent-fill: #2f6fed;
  --accent-hover: #2a63d6;
  --accent-soft: rgba(79, 140, 255, 0.12);
  --accent-glow: rgba(79, 140, 255, 0.12);
  --accent-ring: rgba(79, 140, 255, 0.45);
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #22c55e;
  --gradient-brand: linear-gradient(90deg, var(--accent), var(--violet) 60%, var(--cyan));

  /* Type */
  --font-sans: 'Plus Jakarta Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-hand: 'Caveat', cursive;
  --fs-hero: clamp(2.35rem, 5.2vw, 3.9rem);
  --fs-h2: clamp(1.85rem, 3.6vw, 2.7rem);
  --fs-h3: 1.2rem;
  --fs-lead: clamp(1.05rem, 1.3vw, 1.18rem);
  --fs-body: 1rem;
  --fs-small: 0.9rem;
  --fs-label: 0.86rem;
  --track-tight: -0.03em;
  --track-label: 0.005em;

  /* Layout */
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 72px);
  --nav-h: 76px;
  --section-y: clamp(72px, 11vh, 128px);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.25s;

  /* Chrome */
  --nav-glass: rgba(10, 11, 14, 0.72);
  --overlay-bg: rgba(10, 11, 14, 0.96);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  --aurora-opacity: 0.14;
  --grain-opacity: 0.045;
  color-scheme: dark;
}

/* Light theme – system preference, unless the visitor picked dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f8fa; --surface: #ffffff; --card: #ffffff;
    --line: rgba(15, 23, 42, 0.09); --line-strong: rgba(15, 23, 42, 0.2);
    --text: #0b1220; --text-2: #4a5568; --text-3: #5f6b7e;
    --accent: #2563eb; --accent-fill: #2563eb; --accent-hover: #1d4fd8; --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-glow: rgba(37, 99, 235, 0.1); --accent-ring: rgba(37, 99, 235, 0.35);
    --violet: #7c3aed; --cyan: #0891b2;
    --nav-glass: rgba(247, 248, 250, 0.78); --overlay-bg: rgba(247, 248, 250, 0.97);
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 32px -20px rgba(15, 23, 42, 0.18);
    --shadow-pop: 0 18px 40px -18px rgba(15, 23, 42, 0.25);
    --aurora-opacity: 0.07; --grain-opacity: 0.02;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f8fa; --surface: #ffffff; --card: #ffffff;
  --line: rgba(15, 23, 42, 0.09); --line-strong: rgba(15, 23, 42, 0.2);
  --text: #0b1220; --text-2: #4a5568; --text-3: #5f6b7e;
  --accent: #2563eb; --accent-fill: #2563eb; --accent-hover: #1d4fd8; --accent-soft: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.1); --accent-ring: rgba(37, 99, 235, 0.35);
  --violet: #7c3aed; --cyan: #0891b2;
  --nav-glass: rgba(247, 248, 250, 0.78); --overlay-bg: rgba(247, 248, 250, 0.97);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 32px -20px rgba(15, 23, 42, 0.18);
  --shadow-pop: 0 18px 40px -18px rgba(15, 23, 42, 0.25);
  --aurora-opacity: 0.07; --grain-opacity: 0.02;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, h4 { line-height: 1.12; text-wrap: balance; font-weight: 700; }
p, li, dd, figcaption, blockquote { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
::selection { background: var(--accent-fill); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
section, header[id] { scroll-margin-top: calc(var(--nav-h) + 8px); }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 400;
  background: var(--accent-fill); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ---------- Ambient background ---------- */
.bg-aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; view-transition-name: site-aurora; }
.bg-aurora span { position: absolute; border-radius: 50%; filter: blur(110px); opacity: var(--aurora-opacity); will-change: transform; }
.bg-aurora span:nth-child(1) { width: 52vw; height: 52vw; background: var(--accent); top: -18%; left: -12%; animation: drift-a 26s ease-in-out infinite alternate; }
.bg-aurora span:nth-child(2) { width: 46vw; height: 46vw; background: var(--violet); top: 32%; right: -16%; animation: drift-b 30s ease-in-out infinite alternate; }
.bg-aurora span:nth-child(3) { width: 40vw; height: 40vw; background: var(--cyan); bottom: -18%; left: 18%; opacity: calc(var(--aurora-opacity) * 0.6); animation: drift-c 34s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(7vw, 9vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-8vw, 6vh) scale(1.1); } }
@keyframes drift-c { to { transform: translate(5vw, -7vh) scale(1.12); } }
/* Phones: a still, lighter background keeps scrolling and the hero animation smooth */
@media (max-width: 700px) { .bg-aurora span { animation: none; filter: blur(60px); } }
.bg-grain {
  position: fixed; inset: 0; z-index: -1; opacity: var(--grain-opacity); pointer-events: none; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Scroll progress ----------
   CSS scroll-driven animation where supported; site.js drives the same
   transform elsewhere. */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 300;
  background: var(--gradient-brand); transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none; view-transition-name: site-progress;
}
@supports (animation-timeline: scroll()) {
  .scroll-progress { animation: progress-grow linear both; animation-timeline: scroll(root block); }
  @keyframes progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h); display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) ease, border-color var(--dur) ease, height 0.3s var(--ease-out), transform 0.4s var(--ease-out);
  view-transition-name: site-nav;
}
.nav.is-scrolled {
  height: 62px; background: var(--nav-glass);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; color: var(--text); }
.nav-name svg { height: 22px; width: auto; transition: transform 0.4s var(--ease-out); }
.nav-name:hover svg { transform: translateY(-1px) rotate(-4deg); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 500; color: var(--text-2); margin-right: 6px; }
.nav-links a:not(.nav-cta) { position: relative; padding: 8px 12px; border-radius: var(--radius-sm); transition: color var(--dur), background var(--dur); }
.nav-links a:not(.nav-cta):hover { color: var(--text); background: var(--accent-soft); }
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"]::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--gradient-brand);
}
.nav-cta, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  font-weight: 600; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: background var(--dur), border-color var(--dur), color var(--dur), transform 0.2s var(--ease-out), box-shadow 0.3s;
}
.nav-cta { padding: 9px 18px; font-size: 0.86rem; background: var(--accent-fill); color: var(--accent-ink); }
.nav-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--text-2);
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; }
/* the icon shows where a click takes you: sun on dark, moon on light */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: block; }
}
.nav-toggle { display: none; color: var(--text); }
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 250; background: var(--overlay-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; flex-direction: column; padding: 96px var(--gutter) 40px; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out), visibility 0s linear 0.4s;
}
.mobile-menu.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mobile-menu .close { position: absolute; top: 18px; right: var(--gutter); color: var(--text); }
.mobile-menu .menu-label { font-weight: 600; font-family: var(--font-sans); font-size: var(--fs-label); letter-spacing: 0.005em; color: var(--text-3); margin: 8px 0 6px; }
.mobile-menu .menu-label:not(:first-of-type) { margin-top: 28px; }
.mobile-menu a { display: flex; align-items: center; justify-content: space-between; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.mobile-menu a[aria-current="page"], .mobile-menu a.is-active { color: var(--accent); }
.mobile-menu .menu-sections a { font-size: 1.05rem; font-weight: 600; color: var(--text-2); padding: 10px 0; }
.mobile-menu .menu-cta { margin-top: 28px; border: 0; justify-content: center; font-size: 1rem; padding: 14px 20px; border-radius: var(--radius); background: var(--accent-fill); color: var(--accent-ink); }

/* ---------- Section rail (desktop "on this page") ---------- */
.section-rail {
  position: fixed; right: max(16px, calc((100vw - var(--maxw)) / 2 - 92px)); top: 50%; transform: translateY(-50%);
  z-index: 90; display: none; flex-direction: column; gap: 4px;
  opacity: 0; transition: opacity 0.4s var(--ease-out);
}
.section-rail.is-ready { opacity: 1; }
@media (min-width: 1180px) { .section-rail { display: flex; } }
.section-rail a { font-weight: 600;
  position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 10px; height: 22px;
  font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.005em; color: var(--text-3);
}
.section-rail a span {
  opacity: 0; transform: translateX(6px); white-space: nowrap; pointer-events: none;
  transition: opacity 0.25s, transform 0.3s var(--ease-out), color 0.25s;
}
.section-rail a i { display: block; width: 14px; height: 2px; border-radius: 2px; background: var(--line-strong); transition: width 0.35s var(--ease-out), background 0.25s; }
.section-rail:hover a span, .section-rail a:focus-visible span, .section-rail a.is-active span { opacity: 1; transform: none; }
.section-rail a.is-active { color: var(--text); }
.section-rail a.is-active i { width: 28px; background: var(--gradient-brand); }
.section-rail a:hover { color: var(--text); }
.section-rail a:hover i { background: var(--text-2); }

/* ---------- Type primitives ---------- */
.eyebrow, .section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: 0.005em; color: var(--text-2);
}
.eyebrow::before, .section-label::before { content: ''; width: 22px; height: 1px; background: var(--gradient-brand); flex-shrink: 0; }
.eyebrow-row { display: inline-flex; align-items: center; gap: 12px; }
.eyebrow-row .eyebrow::before { display: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse-dot 2.6s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse-dot { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); } 50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } }

.display {
  font-size: var(--fs-hero); font-weight: 800; line-height: 1.04; letter-spacing: var(--track-tight);
}
.section-title { margin-top: 16px; font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; max-width: 22ch; }
.lead, .section-lead { color: var(--text-2); font-size: var(--fs-lead); line-height: 1.6; font-weight: 400; max-width: 58ch; }
.section-lead { margin-top: 16px; }
.muted { color: var(--text-2); }
.grad-text {
  background: var(--gradient-brand); background-size: 260% auto; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: grad-shift 9s linear infinite;
}
@keyframes grad-shift { to { background-position: 260% center; } }
.text-link { color: var(--accent); font-weight: 600; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.35s var(--ease-out); padding-bottom: 1px; }
.text-link:hover { background-size: 100% 1px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn { padding: 13px 24px; font-size: 0.95rem; line-height: 1.2; letter-spacing: -0.005em; }
.btn-primary .arrow { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -4px -10px -4px 2px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); font-size: 0.85em; }
.btn-primary { background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0)); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn .arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--accent-fill); color: var(--accent-ink); box-shadow: 0 8px 22px -12px var(--accent-ring); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 14px 30px -12px var(--accent-ring); }
.btn-secondary { border-color: var(--line-strong); color: var(--text); background: color-mix(in srgb, var(--surface) 40%, transparent); }
.btn-secondary:hover { border-color: var(--text-3); transform: translateY(-1px); background: var(--accent-soft); }
.btn:active { transform: translateY(0) scale(0.98); }
.cta-row { margin-top: 32px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Sections & surfaces ---------- */
.block { padding-block: var(--section-y); border-top: 1px solid var(--line); position: relative; }
.block-head { position: relative; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.hero { padding-top: calc(var(--nav-h) + clamp(48px, 11vh, 112px)); padding-bottom: clamp(56px, 9vh, 96px); }
.hero h1 { margin-top: 22px; }
.hero .lead { margin-top: 22px; }

/* Closing call to action – identical on every long page */
.final-cta { text-align: center; }
.final-cta .section-label { justify-content: center; }
.final-cta .section-title { margin-inline: auto; max-width: 20ch; }
.final-cta .section-lead { margin-inline: auto; }
.final-cta .cta-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 56px 40px; font-size: var(--fs-small); }
.footer-top { display: flex; justify-content: space-between; gap: 32px 48px; flex-wrap: wrap; }
.footer-brand .nav-name { font-size: 1rem; }
.footer-brand p { margin-top: 10px; color: var(--text-3); max-width: 34ch; }
.footer-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col h2 { font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.005em; color: var(--text-3); font-weight: 500; }
.footer-col ul { list-style: none; margin-top: 14px; display: grid; gap: 8px; }
.footer-col a { color: var(--text-2); transition: color var(--dur); }
.footer-col a:hover, .footer-col a[aria-current="page"] { color: var(--text); }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; color: var(--text-3); font-size: 0.82rem; }
.footer-bottom a { color: var(--text-2); }
.footer-bottom a:hover { color: var(--text); }
.footer-legal { display: flex; gap: 18px; }
.to-top { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Floating save-contact ---------- */
.fab-contact {
  position: fixed; bottom: 24px; right: 24px; z-index: 120;
  height: 52px; min-width: 52px; padding: 0 15px; border-radius: 999px;
  background: var(--accent-fill); color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 0;
  box-shadow: 0 12px 30px -10px var(--accent-ring), 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s var(--ease-out), opacity 0.3s, gap 0.35s var(--ease-out), background var(--dur);
}
.fab-contact svg { width: 22px; height: 22px; flex-shrink: 0; }
.fab-contact .fab-label { max-width: 0; overflow: hidden; white-space: nowrap; font-size: 0.88rem; font-weight: 600; transition: max-width 0.4s var(--ease-out); }
.fab-contact:hover, .fab-contact:focus-visible { background: var(--accent-hover); gap: 8px; transform: translateY(-2px); }
.fab-contact:hover .fab-label, .fab-contact:focus-visible .fab-label { max-width: 140px; }
.fab-contact.is-tucked { opacity: 0; transform: translateY(16px); pointer-events: none; }
@media (max-width: 480px) { .fab-contact { bottom: 16px; right: 16px; } }

/* ---------- Reveal on scroll ---------- */
.has-js .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.has-js .reveal.in { opacity: 1; transform: none; }

/* ---------- Page-to-page transitions (cross-document View Transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.22s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vt-in 0.42s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
::view-transition-group(site-nav), ::view-transition-group(site-progress), ::view-transition-group(site-aurora) { animation-duration: 0.3s; }

/* Theme switch: circular reveal from the toggle (site.js sets .theme-vt) */
.theme-vt .nav, .theme-vt .scroll-progress, .theme-vt .bg-aurora { view-transition-name: none; }
.theme-vt::view-transition-old(root), .theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-vt::view-transition-new(root) { z-index: 1; }


/* =========================================================================
   Components – the homepage funnel language, shared by every page
   ========================================================================= */
.hero-meta { margin-top: 44px; display: flex; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: 0.86rem; color: var(--text-2); }
.pill b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* =========================== FUNNEL =========================== */
.f-layout { margin-top: 64px; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 6vw, 96px); }
.f-panel { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; padding: 28px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-card); }
.f-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.f-panel-head .big { font-size: 3.4rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.f-panel-head .big small { font-size: 1rem; color: var(--text-3); font-weight: 500; letter-spacing: 0; }
.f-panel-head .name { font-weight: 600; font-family: var(--font-sans); font-size: 0.82rem; letter-spacing: 0.005em; color: var(--accent); text-align: right; }
.bars { margin-top: 26px; display: grid; gap: 5px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.18)); }
.bar { font-weight: 600; position: relative; height: 52px; width: var(--w); margin-inline: auto; display: flex; align-items: center; justify-content: center;
  clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 18px 100%); background: var(--line); color: var(--text-3);
  font-family: var(--font-sans); font-size: 0.82rem; letter-spacing: 0.005em; cursor: pointer; transition: color 0.4s, background 0.5s; }
.bar::before { content: ''; position: absolute; inset: 0; background: var(--gradient-brand); opacity: 0; transition: opacity 0.5s var(--ease-out); }
.bar:hover { color: var(--text); }
.bar span { position: relative; }
.bar.past { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); color: var(--text-2); }
.bar.on { color: #fff; }
.bar.on::before { opacity: 1; }
.bar .drip { position: absolute; right: 24px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0; }
.bar.on .drip { animation: drip 1.4s var(--ease-in-out) infinite; }
@keyframes drip { 0% { opacity: 0; transform: translate(0, -50%); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(16px, 70%); } }
.f-panel-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--text-2); min-height: 3.4em; }
.f-panel-foot b { color: var(--text); }

.f-stage { min-height: 86svh; display: flex; flex-direction: column; justify-content: center; padding-block: 40px; }
.f-stage + .f-stage { border-top: 1px dashed var(--line); }
.f-kicker { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-family: var(--font-sans); font-size: var(--fs-label); letter-spacing: 0.005em; color: var(--accent); }
.mini { display: none; gap: 3px; }
.mini i { display: block; height: 6px; border-radius: 3px; background: var(--line-strong); }
.mini i.on { background: var(--gradient-brand); }
.mini i.past { background: var(--accent-ring); }
.f-stage h3 { margin-top: 14px; font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 700; letter-spacing: -0.03em; max-width: 19ch; }
.f-cards { margin-top: 26px; display: grid; gap: 12px; }
.f-card { border-radius: 18px; padding: 20px 22px; border: 1px solid var(--line); background: var(--surface); }
.f-card .k { font-weight: 600; font-family: var(--font-sans); font-size: 0.8rem; letter-spacing: 0.005em; color: var(--text-3); }
.f-card p { margin-top: 6px; color: var(--text-2); }
.f-card.mine { border-color: var(--accent-ring); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.f-card.mine .k { color: var(--accent); }
.signals { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.signals span { font-size: 0.8rem; padding: 5px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--text-2); }
.f-do { margin-top: 14px; font-size: 1.08rem; color: var(--text-2); max-width: 44ch; }
.f-stage > .signals { margin-top: 18px; }
@media (max-width: 700px) { .f-stage > .signals { display: none; } }
.nw { white-space: nowrap; }
.f-list { list-style: none; margin-top: 16px; display: grid; gap: 8px; max-width: 52ch; }
.f-list li { display: flex; gap: 10px; color: var(--text-2); }
.f-list li::before { content: ''; flex: none; width: 6px; height: 6px; margin-top: 0.62em; border-radius: 50%; background: var(--accent); }
.f-proof { margin-top: 18px; padding-left: 14px; border-left: 2px solid var(--accent-ring); font-size: 0.92rem; color: var(--text-2); max-width: 48ch; }
.f-proof b { color: var(--accent); font-weight: 600; }
.js-stages .f-stage { opacity: 0.28; transition: opacity 0.6s var(--ease-out); }
.js-stages .f-stage.on { opacity: 1; }
@media (max-width: 1000px) {
  .f-layout { grid-template-columns: 1fr; margin-top: 32px; }
  .f-panel { display: none; }
  .f-stage { min-height: 0; padding-block: 44px; }
  .js-stages .f-stage { opacity: 1; }
  .mini { display: grid; grid-auto-flow: column; grid-auto-columns: 18px; }
}

/* =========================== PRINCIPLE =========================== */
.hem { margin-top: 52px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; position: relative; }
.hem::before { content: ''; position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: var(--gradient-brand); opacity: 0.55; }
.hem-step { position: relative; padding: 0 28px 0 0; }
.hem-n { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--surface); border: 1px solid var(--accent-ring); font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem; color: var(--accent); position: relative; box-shadow: 0 0 0 6px var(--bg); }
.hem-step h3 { margin-top: 22px; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.hem-step:nth-child(1) h3 { color: var(--accent); }
.hem-step:nth-child(2) h3 { color: var(--violet); }
.hem-step:nth-child(3) h3 { color: var(--cyan); }
.hem-step p { margin-top: 12px; color: var(--text-2); max-width: 32ch; }
@media (max-width: 760px) {
  .hem { grid-template-columns: 1fr; gap: 32px; }
  .hem::before { left: 33px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(var(--accent), var(--violet), var(--cyan)); }
  .hem-step { padding: 0 0 0 92px; min-height: 68px; }
  .hem-n { position: absolute; left: 0; top: 0; }
  .hem-step h3 { margin-top: 6px; }
}

/* =========================== PROOF =========================== */
.proof { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
@media (max-width: 860px) { .proof { grid-template-columns: repeat(2, 1fr); } }
.proof > div { background: var(--surface); padding: 28px 24px; }
.proof .n { font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 800; letter-spacing: -0.05em; line-height: 1; padding-bottom: 0.14em; margin-bottom: -0.14em; font-variant-numeric: tabular-nums; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.proof .l { margin-top: 10px; font-weight: 600; font-size: 0.95rem; }
.proof .c { margin-top: 6px; font-size: 0.84rem; color: var(--text-2); }
.ships { margin-top: 28px; display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ships-row { display: flex; gap: 44px; padding-right: 44px; flex-shrink: 0; animation: ships 36s linear infinite; }
.ships-row span { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-3); white-space: nowrap; }
.ships-row span em { font-style: normal; font-family: var(--font-sans); font-size: 0.78rem; font-weight: 600; letter-spacing: 0; margin-left: 8px; vertical-align: 4px; }
@keyframes ships { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ships-row { animation: none; } }

/* =========================== CONTACT =========================== */
.reach { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.email-copy { margin-top: 18px; display: inline-flex; align-items: center; gap: 10px; max-width: 100%; font-family: var(--font-mono); font-size: 0.88rem; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 16px; }
.email-copy a:hover { color: var(--text); }
.email-copy button { background: var(--accent-soft); border: 0; border-radius: 999px; color: var(--accent); cursor: pointer; font-family: var(--font-sans); font-weight: 600; font-size: 0.8rem; padding: 6px 12px; }
@media (max-width: 380px) { .email-copy { font-size: 0.74rem; gap: 6px; } }
.composer { margin: 40px auto 0; max-width: 640px; text-align: left; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-pop); overflow: hidden; }
.composer .row { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.composer .row span { color: var(--text-3); width: 64px; flex-shrink: 0; }
.composer .body { padding: 20px; }
.composer .body p { color: var(--text-2); }
.choice { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.choice button { border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: 600 0.86rem var(--font-sans); padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: all 0.2s; }
.choice button[aria-pressed="true"] { background: var(--accent-fill); border-color: transparent; color: #fff; }
.composer .send { padding: 0 20px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.composer .send small { color: var(--text-3); }

/* f-card lists, used by the manifesto and CV */
.f-card ul { list-style: none; margin-top: 8px; display: grid; gap: 7px; }
.f-card li { position: relative; padding-left: 18px; color: var(--text-2); font-size: 0.97rem; }
.f-card li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 8px; height: 1px; background: var(--accent); }
.f-card a { color: var(--accent); font-weight: 600; }
.card-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .card-grid, .card-grid.three { grid-template-columns: 1fr; } }
.card-grid .f-card { padding: 26px; }
.card-grid .f-card h3 { margin-top: 10px; font-size: 1.2rem; letter-spacing: -0.015em; }
.hem.five { grid-template-columns: repeat(5, 1fr); }
.hem.five .hem-step h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.hem.five .hem-step:nth-child(4) h3 { color: var(--violet); }
.hem.five .hem-step:nth-child(5) h3 { color: var(--accent); }
@media (max-width: 1000px) { .hem.five { grid-template-columns: 1fr; gap: 28px; } .hem.five::before { left: 33px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(var(--accent), var(--violet), var(--cyan)); } .hem.five .hem-step { padding: 0 0 0 92px; min-height: 68px; } .hem.five .hem-n { position: absolute; left: 0; top: 0; } .hem.five .hem-step h3 { margin-top: 6px; } }
.statement { margin-top: 24px; max-width: 30ch; font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.statement .muted { color: var(--text-3); }


/* Step rows light up with the scroll: the line draws, each circle fills with its colour */
.hem { isolation: isolate; --c1: var(--accent); --c2: var(--violet); --c3: var(--cyan); --c4: var(--violet); --c5: var(--accent); }
.hem::after { content: ''; position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: var(--line); z-index: -1; }
.has-js .hem::before { transform-origin: 0 50%; transform: scaleX(var(--hem-p, 0)); opacity: 1; }
/* only the words fade and rise – the circles stay solid and centred on the line, which runs behind them */
.has-js .hem .hem-step { opacity: 1; transform: none; }
.has-js .hem .hem-step > :not(.hem-n) { transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.has-js .hem .hem-step:not(.on) > :not(.hem-n) { opacity: 0.38; transform: translateY(8px); }
.has-js .hem .hem-step:not(.on) .hem-n { color: var(--text-3); border-color: var(--line-strong); }
.hem-n { z-index: 1; }
.hem-n { transition: background 0.5s var(--ease-out), color 0.5s, border-color 0.5s, box-shadow 0.5s; }
.has-js .hem-step.on .hem-n { color: #fff; border-color: transparent; }
.has-js .hem-step:nth-child(1).on .hem-n { background: var(--c1); box-shadow: 0 0 0 6px var(--bg), 0 12px 30px -8px var(--c1); }
.has-js .hem-step:nth-child(2).on .hem-n { background: var(--c2); box-shadow: 0 0 0 6px var(--bg), 0 12px 30px -8px var(--c2); }
.has-js .hem-step:nth-child(3).on .hem-n { background: var(--c3); box-shadow: 0 0 0 6px var(--bg), 0 12px 30px -8px var(--c3); }
.has-js .hem-step:nth-child(4).on .hem-n { background: var(--c4); box-shadow: 0 0 0 6px var(--bg), 0 12px 30px -8px var(--c4); }
.has-js .hem-step:nth-child(5).on .hem-n { background: var(--c5); box-shadow: 0 0 0 6px var(--bg), 0 12px 30px -8px var(--c5); }
@media (max-width: 760px) {
  .hem::after { left: 33px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .has-js .hem::before { transform-origin: 50% 0; transform: scaleY(var(--hem-p, 0)); }
}
@media (max-width: 1000px) {
  .hem.five::after { left: 33px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .has-js .hem.five::before { transform-origin: 50% 0; transform: scaleY(var(--hem-p, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  .has-js .hem::before { transform: none; }
  .has-js .hem .hem-step:not(.on) > :not(.hem-n) { opacity: 1; transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .has-js .reveal { opacity: 1; transform: none; transition: none; }
  .bg-aurora span, .grad-text, .status-dot { animation: none; }
  .nav, .mobile-menu, .fab-contact { transition: none; }
  .nav.is-hidden { transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .nav, .mobile-menu, .scroll-progress, .bg-aurora, .bg-grain, .fab-contact, .section-rail, .skip-link { display: none !important; }
  html, body { background: #fff !important; color: #111 !important; }
  .has-js .reveal { opacity: 1 !important; transform: none !important; }
}

/* =========================== CONTACT PANEL (built by site.js) =========================== */
.contact-card { margin: 36px auto 0; max-width: 560px; text-align: left; padding: 22px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-card); }
.cc-email { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 14px; border: 1px solid var(--accent-ring); background: var(--accent-soft); }
.cc-email a { font-weight: 700; font-size: clamp(0.92rem, 2.6vw, 1.12rem); color: var(--text); overflow-wrap: anywhere; }
.cc-email button { flex: none; border: 0; border-radius: 10px; background: var(--accent-fill); color: var(--accent-ink); font: 600 0.88rem var(--font-sans); padding: 10px 16px; cursor: pointer; transition: background 0.2s; }
.cc-email button:hover { background: var(--accent-hover); }
.cc-label { display: block; margin-top: 18px; font-size: 0.86rem; font-weight: 600; color: var(--text-2); }
.cc-label span { color: var(--text-3); font-weight: 500; }
.contact-card textarea { display: block; margin-top: 8px; width: 100%; min-height: 84px; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font: inherit; }
.contact-card textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.cc-send { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cc-send > span { font-size: 0.86rem; font-weight: 600; color: var(--text-2); margin-right: 4px; }
.cc-send .btn { padding: 10px 18px; font-size: 0.9rem; }
.cc-note { margin-top: 14px; font-size: 0.84rem; color: var(--text-3); }
.cc-note a { color: var(--accent); font-weight: 600; }
.contact-dialog { margin: auto; width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 28px 24px 24px; border-radius: 28px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); box-shadow: var(--shadow-pop); }
.contact-dialog::backdrop { background: rgba(4, 6, 10, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.contact-dialog h2 { font-size: 1.6rem; letter-spacing: -0.03em; }
.contact-dialog .cd-lead { margin-top: 6px; color: var(--text-2); padding-right: 40px; }
.contact-dialog .contact-card { margin-top: 20px; max-width: none; padding: 0; border: 0; background: none; box-shadow: none; }
.contact-dialog .cd-close { position: absolute; top: 14px; right: 14px; }
@media print { .contact-dialog { display: none; } }
