/* =========================================================
   Angelo Torrevillas — portfolio (V2.3)
   One stylesheet. Tokens first, then layout, then components.
   Dark is the default theme; [data-theme="light"] is the alternate.
   ========================================================= */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallback so the swap to Inter doesn't shift layout */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22.4%;
  line-gap-override: 0%;
}

/* ---------- Tokens: dark (default) ---------- */
:root {
  color-scheme: dark;

  --bg: #131211;
  --bg-band: #171514;
  --surface: #1C1A18;
  --surface-2: #24211F;
  --text: #F2EEE9;
  --muted: #A9A199;
  --line: #34302C;
  --line-strong: #4A4540;

  --accent: #FF6240;          /* brand coral */
  --accent-text: #FF8566;     /* coral for small text on dark (≈6:1) */
  --accent-soft: #2E1B15;
  --btn-bg: #FF6240;
  --btn-text: #131211;        /* ≈5.7:1 on coral */

  --ok: #8CCBA9;   --ok-soft: #17271E;
  --warn: #E9BC6B; --warn-soft: #2B2213;
  --info: #9FB9DB; --info-soft: #182230;

  --font: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-display: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);
  --fs-h2: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  --fs-h3: 1.125rem;
  --fs-body: 1.125rem;
  --fs-body-sm: 0.9375rem;
  --fs-label: 0.8125rem;
  --fs-caption: 0.75rem;
  --fs-ui: 0.9375rem;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.25rem;
  --s6: 1.5rem; --s8: 2rem; --s10: 2.5rem; --s12: 3rem; --s16: 4rem;
  --section: clamp(4.5rem, 3rem + 5.5vw, 7.5rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --max: 76rem;
  --measure: 38rem;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-press: 100ms;
  --t-hover: 150ms;
  --t-reveal: 500ms;

  /* hero diagram */
  --d-node: #1F1D1B;
  --d-edge: #3E3935;
  --d-text: #CFC8C0;
  --d-lit-fill: #2E1B15;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, 0.157 4.1%, 0.477 10.4%, 0.721 17%, 0.861 23.3%, 0.94 30%, 0.978 37.5%, 0.995 47%, 1); }
}

/* ---------- Tokens: light (alternate) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAF8F6;
  --bg-band: #F3F0EC;
  --surface: #FFFFFF;
  --surface-2: #F3F0EC;
  --text: #1F1D1B;
  --muted: #5E5A56;
  --line: #E6E0DA;
  --line-strong: #D0C8C0;
  --accent-text: #B53A12;
  --accent-soft: #FFF1EC;
  --btn-bg: #C8421A;
  --btn-text: #FFFFFF;
  --ok: #2F6B4F;   --ok-soft: #E8F2EC;
  --warn: #8A5A0B; --warn-soft: #FBF1DE;
  --info: #3D5A80; --info-soft: #EAF0F7;
  --d-node: #FFFFFF;
  --d-edge: #D0C8C0;
  --d-text: #3A3632;
  --d-lit-fill: #FFF1EC;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
html.dialog-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
strong, b { font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; padding: 0.1em 0.35em; border-radius: 5px; background: var(--surface-2); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  padding: var(--s3) var(--s4); background: var(--text); color: var(--bg);
  border-radius: var(--r-sm); font-size: var(--fs-ui); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s4); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Type roles ---------- */
.display { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.035em; font-weight: 650; }
h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -0.025em; font-weight: 650; }
h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-size: var(--fs-label); line-height: 1.4; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--accent-text);
}
.eyebrow::before { content: ""; width: 1.25rem; height: 1px; background: currentColor; }
.lede { font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem); line-height: 1.55; letter-spacing: -0.01em; color: var(--muted); max-width: var(--measure); }
figcaption, .caption { font-size: var(--fs-caption); line-height: 1.5; letter-spacing: 0.01em; color: var(--muted); }
p + p { margin-top: var(--s4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5);
  border-radius: var(--r-md); border: 1px solid transparent;
  font-size: var(--fs-ui); font-weight: 600; letter-spacing: -0.005em; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-press) var(--ease), background-color var(--t-hover) var(--ease), border-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--btn-bg); color: var(--btn-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--btn-bg) 88%, var(--text)); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }
.btn svg { width: 1em; height: 1em; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-hover) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
@media (prefers-reduced-transparency: reduce) { .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.3em; font-weight: 650; letter-spacing: -0.015em; text-decoration: none; font-size: 1rem; min-height: 44px; white-space: nowrap; color: var(--text); }
/* Two-tone name (navbar + footer): first name in the accent, surname in the text colour.
   Light theme uses the deeper coral, as .hero-accent does, so small text keeps AA contrast. */
.brand-first { color: var(--accent); }
:root[data-theme="light"] .brand-first { color: var(--btn-bg); }
.nav-right { display: flex; align-items: center; gap: var(--s2); }
.nav-links { display: flex; align-items: center; gap: var(--s1); }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3); font-size: var(--fs-ui); color: var(--muted); text-decoration: none; border-radius: var(--r-sm); transition: color var(--t-hover) var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-cta { margin-left: var(--s2); color: var(--btn-text); padding: 0 var(--s5); border-radius: var(--r-md); }
/* Labels stay on one line; between the mobile menu and wide screens the links tighten to fit */
.nav-links a { white-space: nowrap; }
@media (min-width: 48rem) and (max-width: 59.99rem) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 0 var(--s2); }
  .nav-links a.nav-cta { margin-left: var(--s1); padding: 0 var(--s4); }
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: transparent; cursor: pointer; color: var(--text);
  transition: border-color var(--t-hover) var(--ease), transform var(--t-press) var(--ease);
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle { display: none; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.nav-toggle { display: none; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-open { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

@media (max-width: 47.99rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .nav-links {
    position: absolute; top: 100%; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter));
    flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--s2) var(--gutter) var(--s6);
    background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-6px); visibility: hidden;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s linear 180ms;
  }
  .js .nav-links.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s; }
  .js .nav-links a { min-height: 52px; font-size: 1.0625rem; color: var(--text); border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; }
  .js .nav-links a.nav-cta { margin: var(--s5) 0 0; border-bottom: 0; border-radius: var(--r-md); justify-content: center; color: var(--btn-text); min-height: 48px; }
  html:not(.js) .nav { flex-wrap: wrap; padding-block: var(--s2); }
  html:not(.js) .nav-links { flex-wrap: wrap; }
}

/* ---------- Sections ---------- */
section { padding-block: var(--section); }
.band { background: var(--bg-band); border-block: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: var(--s10); }
.section-head h2 { margin-top: var(--s4); }
.section-head .lede { margin-top: var(--s4); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 1.5rem + 5vw, 6rem) clamp(3.5rem, 2rem + 5vw, 6rem); }
.hero-grid { display: grid; gap: var(--s10); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 60rem) { .hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: var(--s12); } }
.hero h1 { margin-top: var(--s5); }
.hero h1.display { font-size: clamp(2.125rem, 1.1rem + 3.7vw, 3.875rem); }
@media (min-width: 60rem) { .hero h1.display { font-size: min(3.875rem, 4.6vw); } }   /* two columns: keep each sentence on one line */
.hero-line { display: block; text-wrap: balance; }
/* The one accented word: brand coral, italic (synthesized from the upright variable font) */
.hero-accent { font-style: italic; color: var(--accent); padding-right: 0.06em; }
:root[data-theme="light"] .hero-accent { color: var(--btn-bg); }
.hero .lede { margin-top: var(--s6); color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s8); }
.stack-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s8); }
.stack-chips li { font-size: var(--fs-caption); letter-spacing: 0.02em; padding: 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); }
.hero-figure { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: clamp(1rem, 0.5rem + 1.5vw, 1.5rem); }
.hero-figure figcaption { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.hero-figure figcaption strong { color: var(--text); font-weight: 600; }

/* Hero workflow diagram (inline SVG process map)
   Default = the complete map, lit and static (no JS, reduced motion, or JS failure).
   .is-live (set by js/site.js) dims it; .is-on lights each step as the loop reaches it and
   .is-current marks the step in progress. The No branch is dashed and labelled, so the
   two decision paths never rely on colour alone. */
.wf { width: 100%; height: auto; font-family: var(--font); }
.wf .edge { fill: none; stroke: var(--d-edge); stroke-width: 1.5; }
.wf .edge-lit { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-dasharray: 1; stroke-dashoffset: 0; }
.wf .dash { stroke-dasharray: 5 4; }
.wf .arrow { fill: var(--accent); }
.wf .node rect, .wf .node polygon { fill: var(--d-lit-fill); stroke: var(--accent); stroke-width: 1.25; }
.wf .node.alt rect { stroke-dasharray: 5 4; }
.wf .node text { fill: var(--text); font-size: 15px; font-weight: 500; text-anchor: middle; dominant-baseline: central; }
.wf .lbl { fill: var(--accent-text); font-size: 12.5px; font-weight: 600; text-anchor: middle; }

.wf.is-live .node rect, .wf.is-live .node polygon { fill: var(--d-node); stroke: var(--d-edge); transition: fill 600ms var(--ease), stroke 600ms var(--ease), stroke-width 300ms var(--ease); }
.wf.is-live .node text { fill: var(--d-text); transition: fill 600ms var(--ease); }
.wf.is-live .arrow { fill: var(--d-edge); transition: fill 600ms var(--ease); }
.wf.is-live .lbl { fill: var(--muted); transition: fill 600ms var(--ease); }
/* switching off fades the line out, then resets the draw, so the loop never "rewinds" */
.wf.is-live .edge-lit { opacity: 0; stroke-dashoffset: 1; transition: opacity 600ms var(--ease), stroke-dashoffset 0s 600ms; }
.wf.is-live .edge-lit.dash { stroke-dashoffset: 0; transition: opacity 600ms var(--ease); }
.wf.is-live .node.is-on rect, .wf.is-live .node.is-on polygon { fill: var(--d-lit-fill); stroke: var(--accent); transition-duration: 350ms; }
.wf.is-live .node.is-on text { fill: var(--text); transition-duration: 350ms; }
.wf.is-live .node.is-current rect, .wf.is-live .node.is-current polygon { fill: color-mix(in srgb, var(--accent) 20%, var(--d-node)); stroke-width: 2; }
.wf.is-live .edge-lit.is-on { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 450ms linear, opacity 0s; }
.wf.is-live .edge-lit.dash.is-on { transition: opacity 450ms var(--ease); }
.wf.is-live .arrow.is-on { fill: var(--accent); transition: fill 150ms linear 380ms; }
.wf.is-live .lbl.is-on { fill: var(--accent-text); transition-duration: 350ms; }
/* ---------- Ticker: warm band under the hero, drifting left to right ----------
   Two identical lists; the track moves by exactly one list width (-50% → 0), so the
   loop point is invisible. Each list is at least one viewport wide, so no gap opens
   on wide screens. The copy is aria-hidden; reduced motion gets one static list. */
.ticker {
  overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, var(--bg)), color-mix(in srgb, var(--accent) 26%, var(--bg)));
  border-block: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
}
.ticker-track { display: flex; width: max-content; }
.ticker-list { display: flex; flex: none; align-items: center; justify-content: space-around; min-width: 100vw; padding-block: var(--s4); }
.ticker-list li {
  display: inline-flex; align-items: center; gap: var(--s6); padding-right: var(--s6); white-space: nowrap;
  font-size: var(--fs-label); font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.4; color: var(--text);
}
.ticker-list li::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .ticker-track { animation: ticker-ltr 70s linear infinite; }
  .ticker:hover .ticker-track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-copy { display: none; }
  .ticker-track { width: auto; }
  .ticker-list { flex-wrap: wrap; justify-content: center; min-width: 0; width: 100%; row-gap: var(--s2); padding-inline: var(--gutter); }
}
@keyframes ticker-ltr { from { transform: translateX(-50%); } to { transform: translateX(0); } }


/* ---------- Chips / pills ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; gap: 0.45em; min-height: 1.625rem; padding: 0 0.6rem; border-radius: 999px; font-size: var(--fs-caption); font-weight: 600; line-height: 1; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.plain::before { display: none; }
.chip.final { background: var(--ok-soft); color: var(--ok); }
.chip.dev { background: var(--warn-soft); color: var(--warn); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.client { background: var(--accent-soft); color: var(--accent-text); }
.pills { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.pills li { font-size: 0.75rem; line-height: 1.3; padding: 0.2rem 0.5rem; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); }

/* ---------- Card system (one anatomy everywhere) ---------- */
.grid { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: border-color var(--t-hover) var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.card-media { aspect-ratio: 16 / 10; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card-media .privacy { position: absolute; left: var(--s3); bottom: var(--s3); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; padding: 0.25rem 0.5rem; border-radius: var(--r-sm); background: rgb(19 18 17 / 0.82); color: #F2EEE9; }
.card-body { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); flex: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.card-cat { font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.card-desc { font-size: var(--fs-body-sm); line-height: 1.55; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-more { margin-top: auto; padding-top: var(--s2); font-size: var(--fs-body-sm); font-weight: 600; color: var(--accent-text); }
.card-more span { display: inline-block; transition: transform var(--t-hover) var(--ease); }
.card:hover .card-more span { transform: translateX(3px); }
.card[hidden] { display: none; }
/* Secondary external link on a card: sits above the card's stretched case-study link */
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); margin-top: auto; }
.card-foot .card-more { margin-top: 0; }
.card-visit {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.4em; min-height: 44px; padding-top: var(--s2);
  font-size: var(--fs-body-sm); font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong);
}
.card-visit:hover { text-decoration-color: var(--accent); }
.card-visit svg, .case-actions svg { width: 0.95em; height: 0.95em; flex: none; }
.case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-top: var(--s5); }
.case-actions span:not(.visually-hidden) { font-size: var(--fs-caption); color: var(--muted); max-width: 26rem; line-height: 1.5; }

/* Featured (wide) card */
@media (min-width: 56rem) {
  .card.wide { flex-direction: row; }
  .card.wide .card-media { flex: 0 0 55%; aspect-ratio: auto; min-height: 20rem; border-bottom: 0; border-right: 1px solid var(--line); }
  .card.wide .card-body { padding: var(--s8); justify-content: center; }
  .card.wide h3 { font-size: 1.5rem; }
  .card.wide .card-desc { -webkit-line-clamp: 5; font-size: 1rem; }
}

/* Filters + show all */
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s6); }
.filters[hidden], .show-more[hidden] { display: none; }
.filter {
  min-height: 40px; padding: 0 var(--s4); border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-size: var(--fs-body-sm); font-weight: 550; cursor: pointer;
  transition: border-color var(--t-hover) var(--ease), background-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease), transform var(--t-press) var(--ease);
}
.filter:hover { border-color: var(--line-strong); color: var(--text); }
.filter:active { transform: scale(0.97); }
.filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.builds-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s6); }
.builds-count { font-size: var(--fs-body-sm); color: var(--muted); }

/* ---------- Case library (no-JS) + dialog ---------- */
.case-library .case-full { padding-block: var(--s10); border-top: 1px solid var(--line); }
.js .case-library { display: none; }
.case-dialog {
  width: min(58rem, calc(100% - 2 * var(--gutter))); max-height: min(90vh, 60rem);
  margin: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: var(--text); overflow: hidden;
}
.case-dialog[open] { display: flex; flex-direction: column; }
.case-dialog::backdrop { background: rgb(8 7 7 / 0.66); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@media (prefers-reduced-transparency: reduce) { .case-dialog::backdrop { background: rgb(8 7 7 / 0.9); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.dialog-bar { display: flex; justify-content: flex-end; padding: var(--s3) var(--s3) 0; flex: none; }
.dialog-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 clamp(1.25rem, 0.5rem + 3vw, 2.75rem) clamp(1.5rem, 1rem + 2vw, 2.75rem); }
.dialog-body:focus-visible { outline-offset: -3px; }
@media (prefers-reduced-motion: no-preference) {
  .case-dialog[open] { animation: dlg-in 260ms var(--ease-spring) both; }
  .case-dialog[open]::backdrop { animation: fade 200ms linear both; }
}
@media (prefers-reduced-motion: reduce) { .case-dialog[open] { animation: fade 150ms linear both; } }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 39.99rem) {
  .case-dialog { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; border-bottom: 0; }
  @media (prefers-reduced-motion: no-preference) { .case-dialog[open] { animation: sheet-in 300ms var(--ease-spring) both; } }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Case content (same markup inline and in the dialog) */
.case-full .case-title { font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem); margin-top: var(--s3); }
.case-full .chips { margin-top: var(--s4); }
.case-summary { margin-top: var(--s4); font-size: 1.125rem; line-height: 1.5; color: var(--muted); max-width: 46rem; }
.kicker { font-size: var(--fs-caption); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: var(--s2); line-height: 1.4; }
.case-intro { display: grid; gap: var(--s6); margin-top: var(--s8); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .case-intro { grid-template-columns: 1fr 1fr; gap: var(--s8); } }
.case-intro p { font-size: 1rem; }
.flow-wrap { margin-top: var(--s8); }
.flow { counter-reset: step; display: grid; margin-top: var(--s3); border-top: 1px solid var(--line); }
.flow li { display: grid; grid-template-columns: 2.25rem 1fr; gap: var(--s3); padding: var(--s3) var(--s2) var(--s3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-body-sm); line-height: 1.5; }
.flow li::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-size: var(--fs-caption); font-weight: 600; color: var(--muted); padding-top: 0.2em; padding-left: var(--s2); font-variant-numeric: tabular-nums; }
.flow strong { display: block; font-weight: 600; }
.flow span { color: var(--muted); }
.flow .human { background: linear-gradient(90deg, var(--accent-soft), transparent 85%); }
.flow .human::before { color: var(--accent-text); }
.flow .human em { font-style: normal; margin-left: var(--s2); font-size: var(--fs-caption); font-weight: 650; color: var(--accent-text); white-space: nowrap; }
.layers { display: grid; border-top: 1px solid var(--line); margin-top: var(--s3); }
.layers li { display: grid; gap: var(--s1) var(--s5); padding: var(--s3) 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr; font-size: var(--fs-body-sm); line-height: 1.5; }
@media (min-width: 48rem) { .layers li { grid-template-columns: 11rem minmax(0, 1fr) 11rem; align-items: baseline; } .layers .chip { justify-self: end; } }
.layers b { font-weight: 600; }
.layers span { color: var(--muted); }
.layers .chip { justify-self: start; }
.case-body { display: grid; gap: var(--s8); grid-template-columns: 1fr; margin-top: var(--s10); }
@media (min-width: 48rem) { .case-body { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s8); } }
.case-body .span { grid-column: 1 / -1; }
.ticks li { position: relative; padding-left: 1.1rem; font-size: var(--fs-body-sm); line-height: 1.55; }
.ticks li + li { margin-top: var(--s2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 5px; height: 5px; border-radius: 2px; background: var(--muted); opacity: 0.6; }
.case-stack { margin-top: var(--s6); font-size: var(--fs-body-sm); color: var(--muted); }
.case-stack b { color: var(--text); }
.case-note { margin-top: var(--s6); font-size: var(--fs-body-sm); color: var(--muted); max-width: 46rem; }
.figs { display: grid; gap: var(--s6); grid-template-columns: 1fr; margin-top: var(--s8); }
@media (min-width: 48rem) { .figs.two { grid-template-columns: 1fr 1fr; } .figs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
figure { display: grid; gap: var(--s3); align-content: start; }
.frame { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.frame img { width: 100%; }
.frame.tall { max-height: 34rem; overflow-y: auto; overscroll-behavior: contain; }
.frame.graph { background: #FAF8F6; padding: var(--s4); }
.frame.graph img { width: auto; max-width: 100%; margin-inline: auto; }
figcaption strong { color: var(--text); font-weight: 600; }
.metrics { display: grid; gap: var(--s3); margin-top: var(--s6); grid-template-columns: 1fr; }
@media (min-width: 30rem) { .metrics { grid-template-columns: 1fr 1fr; } }
.metric { padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2); }
.metric b { display: block; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.03em; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: var(--s2); font-size: var(--fs-caption); color: var(--muted); line-height: 1.45; }
.progression { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--fs-label); font-weight: 600; margin-top: var(--s2); }
.progression li { display: inline-flex; align-items: center; gap: var(--s2); }
.progression li span { padding: 0.35rem 0.7rem; border-radius: 999px; background: var(--surface-2); }
.progression li:not(:last-child)::after { content: "→"; color: var(--muted); font-weight: 400; }

/* Case galleries: tiles preview, the viewer shows full detail */
.gallery-wrap { margin-top: var(--s8); }
.gallery-count { font-weight: 500; letter-spacing: 0.04em; }
.gallery-sub { margin: var(--s6) 0 var(--s3); font-size: var(--fs-label); font-weight: 600; color: var(--text); }
.gallery-sub:first-of-type { margin-top: var(--s3); }
.gallery { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-top: var(--s3); }
.gallery-sub + .gallery { margin-top: 0; }
.shot { gap: var(--s2); }
.shot figcaption { line-height: 1.45; }
.shot-link {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
  cursor: zoom-in; transition: border-color var(--t-hover) var(--ease);
}
.shot-link:hover { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.shot-link img { width: 100%; height: 100%; object-fit: contain; padding: var(--s2); }
.shot.top .shot-link img { object-fit: cover; object-position: top center; padding: 0; }
.shot.graph .shot-link { background: #FAF8F6; }
.shot-link::after {
  content: ""; position: absolute; right: var(--s2); bottom: var(--s2); width: 1.75rem; height: 1.75rem; border-radius: var(--r-sm);
  background: rgb(19 18 17 / 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9' fill='none' stroke='%23F2EEE9' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.875rem no-repeat;
}
.gallery[data-count="1"] .shot-link { aspect-ratio: auto; }
.gallery[data-count="1"] .shot-link img { height: auto; max-height: 34rem; }
.gallery-note { margin-top: var(--s4); }

/* Image viewer (dialog). Deliberately dark in both themes, like any photo viewer. */
.viewer {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0C0B0A; color: #F2EEE9;
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer::backdrop { background: transparent; }
.viewer-bar, .viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--gutter); }
.viewer-foot { padding-bottom: max(var(--s4), env(safe-area-inset-bottom)); }
.viewer-count { font-size: var(--fs-body-sm); font-variant-numeric: tabular-nums; color: #CFC8C0; }
.viewer-tools { display: flex; gap: var(--s2); }
.viewer .icon-btn { color: #F2EEE9; border-color: rgb(242 238 233 / 0.24); background: rgb(28 26 24 / 0.72); flex: none; }
.viewer .icon-btn:hover { border-color: rgb(242 238 233 / 0.55); }
.viewer-zoom[hidden] { display: none; }
.viewer-foot .icon-btn[hidden] { display: inline-flex; visibility: hidden; }   /* keeps the caption centred */
.viewer-zoom .i-out, .viewer-zoom[aria-pressed="true"] .i-in { display: none; }
.viewer-zoom[aria-pressed="true"] .i-out { display: block; }
.viewer-cap { flex: 1; max-width: 56rem; font-size: var(--fs-body-sm); line-height: 1.5; color: #CFC8C0; text-align: center; }
.viewer-stage { display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 var(--gutter); overflow: hidden; }
.viewer-stage:focus-visible { outline-offset: -3px; }
.viewer-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: var(--r-sm); }
.viewer.can-zoom .viewer-img { cursor: zoom-in; }
.viewer.is-zoomed .viewer-stage { display: block; overflow: auto; overscroll-behavior: contain; }
.viewer.is-zoomed .viewer-img { max-width: none; max-height: none; margin-inline: auto; cursor: zoom-out; }
@media (prefers-reduced-motion: no-preference) { .viewer[open] { animation: fade 180ms linear both; } }
@media (max-width: 39.99rem) { .viewer-cap { font-size: var(--fs-caption); } }

/* ---------- Process maps ---------- */
/* Cards reuse the card anatomy; the whole card opens the map's detail in the case dialog. */
.maps-section { border-bottom: 1px solid var(--line); }
.map-card .card-media { background: #FFFFFF; }   /* the maps are white documents in both themes */
.map-card .card-media img { object-fit: cover; object-position: top center; }
.map-open { margin-top: auto; padding-top: var(--s2); font-size: var(--fs-body-sm); font-weight: 600; color: var(--accent-text); text-decoration: none; }
.map-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.map-open:focus-visible { outline: none; }
.map-open:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.map-open span[aria-hidden] { display: inline-block; transition: transform var(--t-hover) var(--ease); }
.map-card:hover .map-open span[aria-hidden] { transform: translateX(3px); }
/* Map detail (case-content markup, shown in the case dialog): context beside the map on wide screens */
.map-detail-grid { display: grid; gap: var(--s8); margin-top: var(--s8); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 52rem) { .map-detail-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }
.map-points { display: grid; gap: var(--s6); }
.map-points p:not(.kicker) { font-size: 1rem; line-height: 1.6; }
.map-figure { margin-top: 0; }
.map-figure .gallery { margin-top: 0; }
/* The preview opens on the start of the flow; the whole map is one tap away in the viewer */
.map-detail .shot.graph .shot-link { aspect-ratio: 1 / 1; background: #FFFFFF; }
.map-detail .gallery[data-count] .shot-link img { height: 100%; max-height: none; object-fit: cover; object-position: top left; padding: 0; }
@media (max-width: 39.99rem) { .map-detail .shot.graph .shot-link { aspect-ratio: 4 / 3; } }
.map-full { margin-top: var(--s4); }

/* ---------- Stack ---------- */
.stack-section { border-bottom: 1px solid var(--line); }
/* Logo-first grid. Marks are single-colour masks in the theme's muted tone; on hover the
   tile lifts and the mark takes its brand colour, mixed towards the text colour so dark
   brands stay visible on a dark tile (and light ones on a light tile). */
.tools { display: grid; gap: var(--s10); }
.tools-group h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); margin-bottom: var(--s4); font-size: var(--fs-caption); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 650; color: var(--accent-text); }
.tools-group h3 span { letter-spacing: 0.02em; text-transform: none; font-weight: 500; color: var(--muted); }
.tools-grid { display: grid; gap: var(--s5) var(--s3); grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr)); }
.tool { display: grid; justify-items: center; gap: var(--s2); text-align: center; --mark: var(--muted); --lift: 0; }
.tool-tile {
  display: grid; place-items: center; width: 4.5rem; height: 4.5rem;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  transform: translateY(var(--lift));
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.tool .mark {
  width: 2rem; height: 2rem; background: var(--mark);
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  transition: background-color 200ms var(--ease);
}
.tool-text { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.02em; color: var(--mark); transition: color 200ms var(--ease); }
.tool-name { font-size: var(--fs-caption); line-height: 1.3; color: var(--muted); transition: color 200ms var(--ease); }
.tools-group.is-past .tool-tile { background: transparent; border-style: dashed; }
@media (hover: hover) {
  .tool:hover { --lift: -4px; --mark: color-mix(in oklab, var(--brand, var(--text)) 78%, var(--text)); }
  .tool:hover .tool-tile { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: var(--surface-2); }
  .tool:hover .tool-name { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) { .tool { --lift: 0 !important; } }
@media (forced-colors: active) { .tool .mark { background: CanvasText; } }

/* ---------- Approach ---------- */
.steps { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); counter-reset: s; }
.steps li { padding: var(--s6); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.steps li::before { counter-increment: s; content: "Step " counter(s, decimal-leading-zero); display: block; margin-bottom: var(--s3); font-size: var(--fs-caption); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 650; color: var(--accent-text); }
.steps p { margin-top: var(--s2); font-size: var(--fs-body-sm); color: var(--muted); }
.approach-note { margin-top: var(--s6); font-size: var(--fs-body-sm); color: var(--muted); max-width: 46rem; }

/* ---------- About ---------- */
.about-grid { display: grid; gap: var(--s10); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 56rem) { .about-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s16); } }
.portrait { border-radius: var(--r-lg); overflow: hidden; background: #2A2624; aspect-ratio: 4 / 5; max-width: 26rem; border: 1px solid var(--line); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-text h2 { margin-top: var(--s4); }
.about-text p:not(.eyebrow) { max-width: var(--measure); color: var(--muted); }
.about-text p.first { margin-top: var(--s5); }
.about-facts { margin-top: var(--s6); border-top: 1px solid var(--line); }
.about-facts div { display: grid; grid-template-columns: 7rem 1fr; gap: var(--s4); padding-block: var(--s3); border-bottom: 1px solid var(--line); font-size: var(--fs-body-sm); }
.about-facts dt { color: var(--muted); }
.background { margin-top: var(--s12); }
.background h3.sub { font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s4); font-weight: 650; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); max-width: 52rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; user-select: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s4); min-height: 3.5rem; padding-block: var(--s3); font-weight: 600; font-size: 1.0625rem; line-height: 1.4; }
.faq summary::-webkit-details-marker { display: none; }
.sum-icon { width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; flex: none; transition: transform 240ms var(--ease-spring), border-color var(--t-hover) var(--ease); }
.sum-icon svg { width: 11px; height: 11px; }
summary:hover .sum-icon { border-color: var(--text); }
details[open] > summary .sum-icon { transform: rotate(45deg); }
.faq .answer { padding-bottom: var(--s5); color: var(--muted); max-width: 46rem; font-size: var(--fs-body-sm); }
@media (prefers-reduced-motion: no-preference) { details[open] > .answer { animation: settle 320ms var(--ease-spring) both; } }
@keyframes settle { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Discovery call ---------- */
.discovery { position: relative; overflow: hidden; isolation: isolate; }
.discovery::before {   /* one soft warm glow behind the booking panel */
  content: ""; position: absolute; z-index: -1; right: -10%; top: -20%; width: 60%; aspect-ratio: 1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  pointer-events: none;
}
.discovery-grid { display: grid; gap: var(--s10); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 56rem) { .discovery-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s16); } }
.discovery-intro h2 { margin-top: var(--s4); }
.discovery-intro .lede { margin-top: var(--s4); }
.call-steps { counter-reset: call; display: grid; gap: var(--s3); margin-top: var(--s8); }
.call-steps li { position: relative; padding: var(--s4) var(--s5) var(--s4) 4rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.call-steps li::before {
  counter-increment: call; content: counter(call, decimal-leading-zero);
  position: absolute; left: var(--s5); top: var(--s4);
  font-size: var(--fs-label); font-weight: 650; letter-spacing: 0.06em; color: var(--accent-text); font-variant-numeric: tabular-nums; line-height: 1.6;
}
.call-steps h3 { font-size: 1rem; }
.call-steps p { margin-top: var(--s1); font-size: var(--fs-body-sm); line-height: 1.5; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: var(--s10); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s16); } }
.contact-grid h2 { margin-top: var(--s4); }
.contact-grid .lede { margin-top: var(--s4); }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s8); }
.contact-links { border-top: 1px solid var(--line); }
.contact-links li { border-bottom: 1px solid var(--line); }
.contact-links a, .contact-links .static {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: var(--s4); align-items: center;
  min-height: 4rem; padding-inline: var(--s2); text-decoration: none; font-size: var(--fs-body-sm);
}
.contact-links a { border-radius: var(--r-sm); transition: background-color var(--t-hover) var(--ease); }
.contact-links a:hover { background: var(--surface); }
.contact-links .k { font-size: var(--fs-caption); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.contact-links .v { overflow-wrap: anywhere; font-weight: 550; }
.contact-links svg { width: 1rem; height: 1rem; color: var(--accent-text); transition: transform var(--t-hover) var(--ease); }
.contact-links a:hover svg { transform: translateX(3px); }
@media (max-width: 29.99rem) { .contact-links a, .contact-links .static { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s3); padding-block: var(--s3); } .contact-links .k { grid-column: 1 / -1; } }
.booking { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: 0 24px 60px -32px rgb(0 0 0 / 0.55); }
.booking-intro { padding: clamp(1.25rem, 0.75rem + 2vw, 2rem); }
.booking-intro p { margin-top: var(--s2); font-size: var(--fs-body-sm); color: var(--muted); }
.booking-intro p.booking-fallback { margin-top: var(--s4); font-size: var(--fs-caption); }
.booking-fallback a { display: inline-block; padding-block: 0.6rem; margin-block: -0.6rem; }
/* Space for the 860px calendar is held from the start, so nothing shifts when it arrives;
   the status covers that space (and the iframe's white pre-load paint) until the iframe loads. */
.booking-frame { position: relative; min-height: 860px; border-top: 1px solid var(--line); }
.booking-frame.is-autosized { min-height: 0; }   /* the widget reports its height per step (js/site.js) */
.booking-status { position: absolute; inset: 0; z-index: 1; padding: var(--s4) clamp(1.25rem, 0.75rem + 2vw, 2rem) 0; font-size: var(--fs-body-sm); color: var(--muted); background: var(--surface); }
.booking-frame iframe { display: block; width: 100%; height: 860px; border: 0; background: #fff; }

/* ---------- Footer ---------- */
/* A signature, not a section: two-tone name and role on one side, plain text links on the other. */
.site-footer { padding-block: var(--s8); border-top: 1px solid var(--line); background: var(--bg-band); font-size: var(--fs-label); color: var(--muted); }
.footer-sign { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s8); }
.footer-name { font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem); line-height: 1.25; letter-spacing: -0.02em; font-weight: 650; color: var(--text); }
.footer-role { margin-top: var(--s1); line-height: 1.5; }
.footer-social { display: flex; flex-wrap: wrap; gap: 0 var(--s4); margin-inline: calc(-1 * var(--s1)); }
/* Below ~1400px the fixed back-to-top button lands in the links' column at the page end;
   reserve its width beside the links rather than padding the bottom of the page. */
@media (max-width: 87.49rem) { .footer-social { margin-right: calc(46px + var(--s4)); } }
.footer-social a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s1);
  font-size: var(--fs-label); font-weight: 550; color: var(--muted); text-decoration: none;
  transition: color var(--t-hover) var(--ease), transform 200ms var(--ease);
}
/* Accent hairline that draws in on hover/focus only — never a resting underline */
.footer-social a::after {
  content: ""; position: absolute; left: var(--s1); right: var(--s1); bottom: 0.7rem; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 220ms var(--ease);
}
.footer-social a:hover, .footer-social a:focus-visible { color: var(--accent-text); transform: translateY(-2px); }
.footer-social a:hover::after, .footer-social a:focus-visible::after { transform: scaleX(1); }

/* Back-to-top: fixed, bottom-right, revealed once the hero has scrolled away (js/site.js). */
.to-top {
  position: fixed; z-index: 45;
  right: max(var(--gutter), env(safe-area-inset-right));
  bottom: max(var(--s5), calc(env(safe-area-inset-bottom) + var(--s3)));
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px -12px rgb(0 0 0 / 0.5);
  text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: opacity 200ms var(--ease), transform 240ms var(--ease-spring), visibility 0s, border-color var(--t-hover) var(--ease), color var(--t-hover) var(--ease);
}
:root[data-theme="light"] .to-top { box-shadow: 0 10px 24px -14px rgb(31 29 27 / 0.35); }
.to-top svg { width: 20px; height: 20px; transition: transform 200ms var(--ease); }
.to-top:hover { border-color: color-mix(in srgb, var(--accent) 70%, var(--line-strong)); color: var(--accent-text); }
.to-top:hover svg { transform: translateY(-2px); }
.to-top:active { transform: scale(0.94); }
.js .to-top:not(.is-visible) { opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 200ms var(--ease), transform 200ms var(--ease), visibility 0s linear 200ms; }
@media (prefers-reduced-transparency: reduce) { .to-top { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ---------- Reveal: content stays visible unless JS opts in ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(16px); }
  .js [data-reveal] { transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease-spring); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active, .icon-btn:active, .filter:active { transform: none; }
  .card-more span { transition: none; }
  .sum-icon, .js .nav-links { transition-duration: 1ms !important; }
  .footer-social a:hover, .footer-social a:focus-visible, .to-top:active, .to-top:hover svg, .js .to-top:not(.is-visible) { transform: none; }
}

@media print {
  .site-header, .booking, .nav-toggle, .skip-link, .filters, .show-more, .to-top { display: none; }
  .js .case-library { display: block; }
  .card[hidden] { display: flex; }
}

/* Hero diagram: simplified stacked version on small screens */
.wf-m { display: none; }
.wf-d { max-width: 30rem; margin-inline: auto; }   /* single column: keep the map from growing oversized */
.wf-m .node text { font-size: 14.5px; }
.wf-m .lbl { font-size: 11.5px; }
.wf-m .node.alt text { font-size: 13px; }
@media (max-width: 39.99rem) {
  .wf-d { display: none; }
  .wf-m { display: block; }
}
