/* ============================================================
   andBeyond.digital — single stylesheet
   Brand: blue crane identity. Crane blue (#85C0D0) is a DARK
   THEME accent only — on light surfaces the accent role is
   petrol (#15597C). No gold. No inline styles (CSP).
   ============================================================ */

/* ---------- Fonts (self-hosted, variable) ---------- */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/assets/fonts/figtree-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Metric-tuned fallback to keep CLS at zero while Figtree loads */
@font-face {
  font-family: 'Figtree Fallback';
  src: local('Helvetica Neue'), local('Arial');
  size-adjust: 101%;
  ascent-override: 94%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* ---------- Design tokens ----------
   Dark is the default theme (:root). html.theme-light overrides
   the colour tokens; components only ever consume tokens.
   Crane blue (#85C0D0) carries meaning on dark ONLY — the light
   theme swaps the accent role to petrol (#15597C). */
:root {
  color-scheme: dark;

  --bg: #08080D;            /* page */
  --surface: #1D1E2C;       /* cards, banners */
  --surface-raised: #262838;
  --band: #1D1E2C;          /* full-width section bands */
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.74);
  --subtle: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --accent: #85C0D0;        /* crane blue */
  --accent-strong: #A5D4E1; /* link hover */
  --accent-soft: rgba(133, 192, 208, 0.14);
  --accent-border: rgba(133, 192, 208, 0.35);

  --cta: #0E7C6B;           /* teal — 5.1:1 with white text, both themes */
  --cta-hover: #0A6B59;

  --chip-bg: rgba(8, 8, 13, 0.55);
  --promise-bg: rgba(255, 255, 255, 0.03);
  --header-bg: rgba(8, 8, 13, 0.82);
  --menu-bg: rgba(8, 8, 13, 0.94); /* denser than the bar: nested backdrop blurs composite unreliably */
  --crane-stroke: #85C0D0;
  --device-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);

  --hero-glow-1: rgba(133, 192, 208, 0.13); /* crane blue wash */
  --hero-glow-2: rgba(14, 124, 107, 0.11);  /* teal undertone */
  --hero-glow-3: rgba(21, 89, 124, 0.18);   /* petrol depth */

  --font: 'Figtree', 'Figtree Fallback', system-ui, -apple-system, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;

  --max-w: 1100px;
  --pad-x: clamp(20px, 5vw, 48px);
  --section-py: clamp(72px, 9vw, 128px);

  --focus-ring: var(--accent);
}

html.theme-light {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-raised: #E9ECF2;
  --band: #F2F4F8;
  --text: #1D1E2C;
  --muted: rgba(29, 30, 44, 0.78);
  --subtle: rgba(29, 30, 44, 0.60);
  --border: rgba(29, 30, 44, 0.14);
  --border-strong: rgba(29, 30, 44, 0.28);

  --accent: #15597C;        /* petrol — crane blue fails on light */
  --accent-strong: #0F4A68;
  --accent-soft: rgba(21, 89, 124, 0.10);
  --accent-border: rgba(21, 89, 124, 0.38);

  --chip-bg: #ffffff;
  --promise-bg: rgba(29, 30, 44, 0.04);
  --header-bg: rgba(255, 255, 255, 0.86);
  --menu-bg: rgba(255, 255, 255, 0.95);
  --crane-stroke: #558F9F;
  --device-shadow: 0 24px 60px rgba(29, 30, 44, 0.20);

  /* Decorative only on light (crane blue carries no meaning here) */
  --hero-glow-1: rgba(133, 192, 208, 0.16);
  --hero-glow-2: rgba(14, 124, 107, 0.07);
  --hero-glow-3: rgba(21, 89, 124, 0.08);

  --focus-ring: var(--accent);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4, p { margin: 0 0 0.6em; overflow-wrap: break-word; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

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

::selection { background: var(--cta); color: #fff; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--cta);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus-visible { left: 0; }

/* ---------- Type scale ---------- */
.t-hero {
  font-size: clamp(2.5rem, 6.5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin-bottom: 0.45em;
}
.t-h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.t-h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.4em;
}
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1em;
}
.lead { font-size: clamp(1.0625rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 42em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; color: var(--subtle); }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}
.section { padding-block: var(--section-py); }
.section-head { max-width: 46em; margin-bottom: clamp(36px, 5vw, 56px); }

/* ---------- Header / nav ----------
   Drawer header: hidden on load so the hero owns the fold, slides
   down once the visitor scrolls. The hidden state requires .js so
   no-JS visitors get a normal sticky header. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: background 250ms ease, border-color 250ms ease;
  border-bottom: 1px solid transparent;
}
.js .site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
}
/* Mobile only: the drawer (hidden at top, slides in on scroll) */
@media (max-width: 960px) {
  .js .site-header {
    transform: translateY(-100%);
    visibility: hidden;
  }
  .js .site-header.scrolled,
  .js .site-header.nav-open {
    transform: none;
    visibility: visible;
  }
}
.site-header.scrolled,
.site-header.nav-open {
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}
/* Desktop: full-width bar; logo left, links truly centred, toggle + CTA right.
   The CTA keeps its grid space and fades via opacity only, so nothing
   shifts when it appears. */
@media (min-width: 961px) {
  .site-header .container { max-width: none; }
  .nav-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
  .nav-row .brand { justify-self: start; }
  .nav-row .nav-links { justify-self: center; }
  .nav-row .nav-right { justify-self: end; }
  .nav-right { display: inline-flex; align-items: center; gap: 14px; }
  .nav-cta-desktop { opacity: 0; pointer-events: none; }
  .site-header.show-cta .nav-cta-desktop { opacity: 1; pointer-events: auto; }
}
/* Tablet: tighter bar so the CTA never wraps */
@media (min-width: 961px) and (max-width: 1120px) {
  .nav-row { gap: 14px; }
  .nav-right { gap: 8px; }
  .nav-links { gap: clamp(10px, 1.8vw, 22px); }
  .nav-links a { font-size: 0.92rem; }
  .nav-cta-desktop { padding: 10px 18px; min-height: 44px; font-size: 0.95rem; }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding-block: 5px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}
.brand img { height: 44px; width: auto; }
.legal-header .brand img { height: 40px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 30px);
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 12px 2px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-cta {
  margin-left: 8px;
  padding: 12px 24px;
  color: #fff;
}
/* Theme toggle — lives quietly in the footer */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
html.theme-light .theme-toggle .icon-moon { display: block; }
html.theme-light .theme-toggle .icon-sun { display: none; }

/* The header CTA pair: desktop button in the row, mobile button in the panel */
@media (min-width: 961px) {
  .nav-links .nav-cta-mobile { display: none !important; }
}
@media (max-width: 960px) {
  /* The whole right cluster (toggle + CTA) is desktop chrome; the mobile
     menu carries its own CTA and Appearance toggle */
  .nav-row .nav-right { display: none !important; }
}

/* Mobile menu — icon only, no chrome. The button lives OUTSIDE the
   header in the DOM (a fixed child of a transformed header would ride
   the drawer), pinned where it sits when the header is open. At the
   top of the page it floats at 80% opacity; when the header draws in
   it is already in place and eases to 100%. */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  opacity: 0.8;
}
.js.header-shown .menu-toggle,
.menu-toggle[aria-expanded="true"] { opacity: 1; }
.menu-toggle svg { width: 24px; height: 24px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
@media (max-width: 960px) {
  .menu-toggle {
    position: fixed;
    top: 14px;
    right: clamp(14px, 4vw, 20px);
    z-index: 60;
  }
}
@media (min-width: 961px) {
  .menu-toggle { display: none; }
}

@media (max-width: 960px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px var(--pad-x) 20px;
    background: var(--menu-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
  }
  .site-header.nav-open .nav-links { display: flex; }
  .site-header.nav-open {
    background: var(--menu-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: transparent;
  }
  .nav-links a {
    font-size: 1.05rem;
    padding: 14px 4px;
  }
  .nav-links a.nav-cta {
    margin: 10px 0 0;
    justify-content: center;
  }
  .menu-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--subtle);
    font-size: 0.9rem;
  }
}
@media (min-width: 961px) {
  .nav-links .menu-extra { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  background: var(--cta);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.btn:hover, .btn:focus-visible {
  background: var(--cta-hover);
  color: #fff;
}
.btn-quiet {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-quiet:hover, .btn-quiet:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.cta-stack { display: inline-flex; flex-direction: column; align-items: center; }
.cta-note { margin-top: 14px; }

/* ---------- Hero ---------- */
/* Gradient centres as registered properties so the keyframes can
   interpolate them — browsers without @property keep a static glow. */
@property --hero-x1 { syntax: '<percentage>'; inherits: false; initial-value: 22%; }
@property --hero-y1 { syntax: '<percentage>'; inherits: false; initial-value: 18%; }
@property --hero-x2 { syntax: '<percentage>'; inherits: false; initial-value: 82%; }
@property --hero-y2 { syntax: '<percentage>'; inherits: false; initial-value: 34%; }
@property --hero-x3 { syntax: '<percentage>'; inherits: false; initial-value: 55%; }
@property --hero-y3 { syntax: '<percentage>'; inherits: false; initial-value: 78%; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: clamp(88px, 12vh, 140px) clamp(110px, 14vh, 160px);
  overflow: clip;
}
.hero > .container { width: 100%; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(48% 44% at var(--hero-x1) var(--hero-y1), var(--hero-glow-1), transparent 70%),
    radial-gradient(52% 46% at var(--hero-x2) var(--hero-y2), var(--hero-glow-2), transparent 72%),
    radial-gradient(64% 56% at var(--hero-x3) var(--hero-y3), var(--hero-glow-3), transparent 74%);
  /* Fade out before the section edge so the hero dissolves into the
     solid page background that section 2 sits on. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 96%);
}
/* Scroll cue: a quiet chevron that pulses toward section 2.
   Static chevron without motion preference or JS. */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 4vh, 36px);
  transform: translateX(-50%);
  display: inline-flex;
  padding: 12px; /* comfortable touch target around a small icon */
  color: var(--subtle);
  transition: color 200ms ease;
}
.scroll-cue:hover, .scroll-cue:focus-visible { color: var(--text); }
.scroll-cue svg {
  width: 26px;
  height: 26px;
}
@media (max-height: 540px) {
  .scroll-cue { display: none; }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
@media (max-width: 860px) {
  /* The mobile header is hidden at the top of the page, so the hero
     needs no header clearance; tighter padding keeps the cue in view. */
  .hero { padding-block: clamp(48px, 7vh, 80px) clamp(100px, 13vh, 140px); }
  .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 28px; }
  .hero-art { order: -1; max-width: 168px; }
  .hero .t-hero { font-size: clamp(3rem, 9.5vw, 4.25rem); }
  .hero .lead { margin-inline: auto; }
  .section-head { text-align: center; margin-inline: auto; }
  .section-head .lead, .after-cards { margin-inline: auto; text-align: center; }
}
.hero-art { position: relative; }
.hero-art svg, .hero-art img { width: min(380px, 100%); height: auto; margin-inline: auto; }
.hero .lead { margin-bottom: 1.8em; }

/* ---------- Cards (What we do) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 3.5vw, 36px);
  transition: border-color 200ms ease, background 200ms ease;
}
.card:hover { border-color: var(--accent-border); }
.card .t-h3 { display: flex; align-items: center; gap: 12px; }
.card-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon svg { width: 20px; height: 20px; }
.after-cards { margin-top: 28px; max-width: 46em; }
.promise {
  margin-top: 36px;
  padding: 22px 26px;
  border-left: 2px solid var(--accent);
  background: var(--promise-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  max-width: 52em;
}
.promise p { margin: 0; color: var(--muted); }
.promise strong { color: var(--text); }

/* ---------- C3NTR showcase ---------- */
.showcase { background: var(--band); }
.showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
@media (max-width: 860px) {
  .showcase-grid { grid-template-columns: 1fr; }
}
.chips { display: grid; gap: 12px; margin: 28px 0 32px; padding: 0; list-style: none; }
.chip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.chip svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--accent); }
.chip p { margin: 0; font-size: 0.97rem; }
.chip strong { color: var(--text); }
.chip span { color: var(--muted); }

/* Device mock (CSS-drawn frame; swap inner img for real screenshots) */
.device-duo { position: relative; display: grid; justify-items: center; }
.device-phone {
  width: min(270px, 70%);
  aspect-ratio: 9 / 19;
  border-radius: 38px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  box-shadow: var(--device-shadow);
  padding: 12px;
  position: relative;
  z-index: 2;
}
.device-screen {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: #08080D;
}
.device-screen picture,
.device-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.showcase-cta-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
@media (max-width: 860px) {
  .showcase-close { text-align: center; }
  .showcase-cta-row { justify-content: center; }
}

/* ---------- Selected work ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 560px) {
  .work-grid { grid-template-columns: 1fr; }
}
.work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 200ms ease;
}
.work-card:hover { border-color: var(--accent-border); }
.work-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 18px;
}
.work-card h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 0.35em; }
.work-card p { color: var(--muted); font-size: 0.97rem; margin-bottom: 0.9em; }
.work-domain {
  display: inline-block;
  padding-block: 13px;
  margin-block: -8px;
  font-size: 0.85rem;
  color: var(--subtle);
  text-decoration: none;
}
.work-domain:hover { color: var(--accent); text-decoration: underline; }

/* ---------- How we work ---------- */
.steps { display: grid; gap: clamp(28px, 4vw, 44px); counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 560px) {
  .step { grid-template-columns: 1fr; gap: 8px; }
}
.step p.step-no {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  padding-top: 2px;
}
.step h3 { margin-bottom: 0.3em; }
.step p { color: var(--muted); max-width: 46em; margin: 0; }
.name-story {
  margin-top: clamp(48px, 6vw, 72px);
  padding: clamp(26px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 56em;
}
.name-story p { margin: 0; font-size: clamp(1.0625rem, 1.5vw, 1.15rem); color: var(--muted); }
.name-story strong { color: var(--text); }
.name-story em { color: var(--accent); font-style: italic; }

/* ---------- Contact ---------- */
.contact { background: var(--band); text-align: center; }
.contact .section-head { margin-inline: auto; }
.contact .lead { margin-inline: auto; }
.contact .btn { margin-top: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 44px 36px;
  background: var(--bg);
}
.footer-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.footer-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); }
.footer-brand img { height: 52px; width: auto; }
.footer-home { display: inline-flex; padding: 4px 0; }
.crane-on-light { display: none; }
.theme-light .crane-on-light { display: block; }
.theme-light .crane-on-dark { display: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 10px 0;
}
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-legal { margin-top: 22px; text-align: center; }
.footer-legal p { margin: 0 0 4px; }
.footer-c3ntr,
.footer-legal p.footer-c3ntr { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.c3ntr-link {
  display: inline-flex;
  align-items: center;
  padding-block: 12px;
  margin-block: -12px;
  opacity: 0.75;
  transition: opacity 150ms ease;
}
.c3ntr-link:hover, .c3ntr-link:focus-visible { opacity: 1; }
.c3ntr-link img { height: 16px; width: auto; }

.footer-links { justify-content: center; flex-wrap: wrap; gap: 4px 22px; }
.footer-legal { margin-top: 26px; }
.footer-legal p { margin-bottom: 8px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 90;
  margin-inline: auto;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.cookie-banner p { margin: 0 0 14px; font-size: 0.95rem; color: var(--muted); }
.cookie-actions { display: flex; gap: 12px; justify-content: flex-end; }
.cookie-btn {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.cookie-btn-reject {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.cookie-btn-accept {
  background: var(--cta);
  border: 0;
  color: #fff;
}
.cookie-btn:hover { background: var(--surface-raised); }
.cookie-btn-accept:hover { background: var(--cta-hover); }

/* ============================================================
   Legal pages — themed by the same tokens as everything else.
   Dark by default, light when html.theme-light is set.
   ============================================================ */
.legal-header {
  border-bottom: 1px solid var(--border);
  padding-block: 14px;
}
.legal-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.legal-header .brand { color: var(--text); }
.legal-main { padding-block: clamp(40px, 6vw, 72px); max-width: 760px; }
.legal-main h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.015em; }
.legal-main h2 { font-size: 1.35rem; margin-top: 1.8em; }
.legal-main p, .legal-main li { color: var(--muted); }
.legal-updated { color: var(--subtle); font-size: 0.9rem; }

/* ============================================================
   Motion — every rule lives inside prefers-reduced-motion:
   no-preference. Base CSS never hides content; the hidden
   initial states for reveals additionally require the .js
   class set by script.js, so no-JS users see everything.
   ============================================================ */
.scroll-progress { display: none; }
.crane-anim .crane-lines { display: none; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Hero gradient: glow centres drift slowly, back and forth */
  .hero::before {
    animation: hero-morph 30s ease-in-out infinite alternate;
  }
  @keyframes hero-morph {
    0% {
      --hero-x1: 22%; --hero-y1: 18%;
      --hero-x2: 82%; --hero-y2: 34%;
      --hero-x3: 55%; --hero-y3: 78%;
    }
    33% {
      --hero-x1: 34%; --hero-y1: 30%;
      --hero-x2: 70%; --hero-y2: 16%;
      --hero-x3: 38%; --hero-y3: 64%;
    }
    66% {
      --hero-x1: 14%; --hero-y1: 42%;
      --hero-x2: 88%; --hero-y2: 48%;
      --hero-x3: 66%; --hero-y3: 56%;
    }
    100% {
      --hero-x1: 28%; --hero-y1: 12%;
      --hero-x2: 64%; --hero-y2: 28%;
      --hero-x3: 46%; --hero-y3: 80%;
    }
  }

  /* Hero crane: fold lines draw in, colour fades through */
  .crane-anim .crane-lines { display: block; stroke: var(--crane-stroke); }
  .crane-line {
    stroke-dashoffset: 0;
    animation: crane-draw 1s cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  .crane-line:nth-of-type(1) { stroke-dasharray: 159; --len: 159; animation-delay: 0.05s; }
  .crane-line:nth-of-type(2) { stroke-dasharray: 173; --len: 173; animation-delay: 0.22s; }
  .crane-line:nth-of-type(3) { stroke-dasharray: 176; --len: 176; animation-delay: 0.40s; }
  .crane-line:nth-of-type(4) { stroke-dasharray: 97;  --len: 97;  animation-delay: 0.58s; }
  .crane-line:nth-of-type(5) { stroke-dasharray: 39;  --len: 39;  animation-delay: 0.72s; }
  .crane-anim .crane-fill {
    opacity: 0;
    animation: crane-fade 0.7s ease 1.15s forwards;
  }
  @keyframes crane-draw {
    from { stroke-dashoffset: var(--len); }
    to { stroke-dashoffset: 0; }
  }
  @keyframes crane-fade {
    to { opacity: 1; }
  }
  /* Lines hand over to the fill */
  .crane-anim .crane-lines {
    animation: crane-lines-out 0.6s ease 1.45s forwards;
  }
  @keyframes crane-lines-out {
    to { opacity: 0; }
  }

  /* Scroll cue: the chevron breathes downward, rests, repeats */
  .scroll-cue svg {
    animation: cue-pulse 3s ease-in-out infinite;
  }
  @keyframes cue-pulse {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(7px); opacity: 1; }
  }

  /* Scroll reveals — only when JS is present (.js on <html>) */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 450ms ease, transform 450ms ease;
  }
  .js [data-reveal].in-view {
    opacity: 1;
    transform: none;
  }
  .js .card-grid [data-reveal]:nth-child(2),
  .js .chips [data-reveal]:nth-child(2),
  .js .work-grid [data-reveal]:nth-child(2) { transition-delay: 60ms; }
  .js .chips [data-reveal]:nth-child(3),
  .js .work-grid [data-reveal]:nth-child(3) { transition-delay: 120ms; }
  .js .chips [data-reveal]:nth-child(4),
  .js .work-grid [data-reveal]:nth-child(4) { transition-delay: 180ms; }

  /* CTA lift */
  .btn:hover, .btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(14, 124, 107, 0.30);
  }

  /* Header CTA fades in when the hero CTA leaves view */
  @media (min-width: 961px) {
    .nav-cta-desktop { transition: opacity 280ms ease, background 150ms ease, transform 150ms ease; }
  }

  /* Header drawer slides down on scroll */
  .js .site-header {
    transition: transform 380ms cubic-bezier(0.33, 1, 0.36, 1),
                visibility 380ms,
                background 250ms ease, border-color 250ms ease;
  }

  /* Mobile menu panel slides open */
  @media (max-width: 960px) {
    .site-header.nav-open .nav-links {
      animation: menu-in 220ms ease both;
    }
    @keyframes menu-in {
      from { opacity: 0; transform: translateY(-8px); }
      to { opacity: 1; transform: none; }
    }
  }

  /* Scroll progress hairline — driven by script.js with a smoothing
     lerp and clamped to [0,1], so macOS rubber-band overscroll never
     makes it jump forward and snap back. */
  .js .scroll-progress {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform-origin: 0 50%;
    transform: scaleX(0);
    will-change: transform;
  }
}

/* ---------- 404 ---------- */
.notfound {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
}
.notfound img { width: 84px; margin: 0 auto 18px; }
