/* ─────────────────────────────────────────────────────────────
   Design tokens
   Editorial look: white ground, black type, a wide grotesk in light
   weights, lots of air, scroll-driven reveals.
   Albert Sans stands in for the commercial grotesk.
   Accent #dcc7be is a warm clay used for surfaces, never for text.
   ───────────────────────────────────────────────────────────── */
:root {
  --ink:      #000;
  --ink-60:   rgba(0, 0, 0, 0.6);   /* 5.7:1 on white, AA for body text */
  --ink-12:   rgba(0, 0, 0, 0.12);  /* hairlines only */
  --mute:     #c4c4c4;              /* unrevealed headline words */
  --bg:       #fff;
  --accent:   #dcc7be;
  --ground:   #f4f1ef;              /* demo and viewer grounds */
  --shadow:   rgba(0, 0, 0, 0.08);
  color-scheme: light;

  --sans: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gutter: clamp(1rem, 2vw, 1.5rem);
  --measure: 96rem;
  --rhythm: clamp(5rem, 12vw, 12rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --head-h: 4rem;
}

/* Dark theme. Same tokens, swapped values. Applied when the visitor picks it
   (data-theme on <html>) or, with no choice stored, when the system asks for it. */
:root[data-theme="dark"] {
  --ink: #f2f2f2; --ink-60: rgba(242, 242, 242, 0.62); --ink-12: rgba(242, 242, 242, 0.14);
  --mute: #4a4a4a; --bg: #0e0e0e; --ground: #1a1a1a; --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2f2f2; --ink-60: rgba(242, 242, 242, 0.62); --ink-12: rgba(242, 242, 242, 0.14);
    --mute: #4a4a4a; --bg: #0e0e0e; --ground: #1a1a1a; --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
/* Accent surfaces keep black type in both themes. */
.band, .footer-contact, .guide-answer {
  --ink: #000; --ink-60: rgba(0, 0, 0, 0.6); --ink-12: rgba(0, 0, 0, 0.12); --bg: #fff;
  color: var(--ink);
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--head-h); }

body {
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 0.75rem 1.25rem; font-size: 0.8rem; text-decoration: none;
}
.skip:focus { left: 0; }

.wrap { padding-inline: var(--gutter); max-width: var(--measure); margin-inline: auto; }

/* ── Type scale ── */
.t-display {
  font-size: clamp(2.4rem, 5.6vw, 6rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.t-page {
  font-size: clamp(1.75rem, 3.6vw, 3.6rem);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.t-sub {
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.t-small { font-size: 0.9rem; line-height: 1.4; }
.t-label {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.muted { color: var(--ink-60); }

/* Text link: small caps with an underline that slides in. */
.link {
  font-size: 0.72rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 0.2rem;
  transition: background-size 0.4s var(--ease);
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  font: inherit; font-size: 0.78rem; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
  color: var(--bg); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 0.7rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ── Header: fixed top bar, white, hairline once the page scrolls ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  height: var(--head-h);
}
.site-header .wrap {
  height: 100%;
  display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { width: 26px; height: auto; filter: grayscale(1) brightness(0); }
:root[data-theme="dark"] .brand img { filter: grayscale(1) brightness(0) invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: grayscale(1) brightness(0) invert(1); } }

/* Theme toggle and icon buttons in the header and footer */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
/* Light/dark switch: a track with sun and moon, the knob covers the inactive one. */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
}
.theme-toggle__track {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  width: 52px; height: 28px; padding: 0 6px;
  border: 1px solid var(--ink-12); border-radius: 999px;
  background: var(--ground);
}
.theme-toggle__icon { width: 14px; height: 14px; color: var(--ink-60); }
.theme-toggle__knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink);
  transition: transform 0.25s var(--ease);
}
.theme-toggle[aria-checked="true"] .theme-toggle__knob { transform: translateX(24px); }
.theme-toggle:hover .theme-toggle__track { border-color: var(--ink-60); }
.social { display: flex; gap: 0.25rem; margin-left: -10px; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.social svg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand span { font-size: 1.15rem; font-weight: 400; letter-spacing: -0.02em; white-space: nowrap; }
.head-end { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.lang-switch { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }

/* ── Header menu: dropdown panels on desktop, full-screen sheet on mobile ── */
.site-nav { flex: 1; }
.site-nav ul { list-style: none; }
.site-nav__list { display: flex; gap: 0.25rem 1.5rem; }
.nav-item { position: relative; }
.nav-btn, .nav-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px;
  font: inherit; font-size: 0.9rem; color: inherit;
  background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: none;
}
.nav-btn:hover, .nav-link:hover, .nav-btn[aria-expanded="true"] { text-decoration: underline; text-underline-offset: 0.3em; }
.nav-caret {
  width: 0.4rem; height: 0.4rem;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform 0.25s var(--ease);
}
.nav-btn[aria-expanded="true"] .nav-caret { transform: translateY(0.1rem) rotate(-135deg); }
.nav-panel {
  position: absolute; top: 100%; left: -1.25rem; z-index: 60;
  display: flex; gap: 2.5rem;
  min-width: 15rem;
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--ink-12);
  border-radius: 4px;
  box-shadow: 0 12px 32px var(--shadow);
}
.nav-panel[hidden] { display: none; }
.nav-group { display: grid; gap: 0.5rem; align-content: start; min-width: 11rem; }
.nav-group__title { color: var(--ink-60); }
.nav-group ul { display: grid; }
.nav-group a { display: flex; align-items: center; min-height: 40px; font-size: 0.95rem; text-decoration: none; white-space: nowrap; }
.nav-group a:hover { text-decoration: underline; text-underline-offset: 0.3em; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none; border: 0; padding: 0; color: inherit; cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
  display: block; width: 20px; height: 1.5px; background: currentColor;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease);
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ''; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }
.site-header.is-open .menu-toggle__bars { background: transparent; }
.site-header.is-open .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.site-header.is-open .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 60rem) {
  .menu-toggle { display: inline-flex; }
  .head-end .btn { display: none; }
  .site-nav {
    display: none;
    position: fixed; inset: var(--head-h) 0 0 0; z-index: 55;
    overflow-y: auto;
    background: var(--bg);
    padding: 1rem var(--gutter) 3rem;
  }
  .site-header.is-open .site-nav { display: block; }
  .site-nav__list { flex-direction: column; gap: 0; }
  .nav-item { border-bottom: 1px solid var(--ink-12); }
  .nav-btn, .nav-link { width: 100%; justify-content: space-between; font-size: 1.15rem; min-height: 56px; }
  .nav-panel {
    position: static; display: grid; gap: 1.25rem;
    padding: 0 0 1.25rem; border: 0; box-shadow: none; min-width: 0;
  }
  .nav-group a { white-space: normal; }
}
html.menu-open { overflow: hidden; }

/* ── Landing extras ── */
.also { margin-top: 1.5rem; }
.also a { text-underline-offset: 0.25em; }
.demo-copy, .zones-text { max-width: 54ch; margin-bottom: 2rem; }
.stage--media { margin-top: 0; width: 100%; aspect-ratio: auto; background: none; overflow: visible; border-radius: 0; animation: none !important; }
.link-row { list-style: none; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.link-row .link { display: inline-flex; align-items: center; min-height: 44px; }

/* ── Sections ── */
section { margin-top: var(--rhythm); }
.eyebrow { display: block; margin-bottom: 1.25rem; color: var(--ink-60); }
.center { text-align: center; margin-inline: auto; }

/* ── Hero: statement, figures, then a media frame that opens to full width ── */
.hero { margin-top: 0; padding-top: clamp(3rem, 10vh, 8rem); }
.hero h1 .t-display { max-width: 16ch; }
.hero .t-sub { max-width: 46ch; margin-top: 1.75rem; color: var(--ink-60); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

.figures {
  display: grid; gap: 2rem clamp(1.5rem, 4vw, 4rem);
  grid-template-columns: repeat(2, 1fr);
  margin-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--ink-12);
  padding-top: 1.5rem;
}
@media (min-width: 52rem) { .figures { grid-template-columns: repeat(4, 1fr); } }
.figure strong {
  display: block;
  font-size: clamp(2.2rem, 4.2vw, 4rem);
  font-weight: 300; line-height: 1; letter-spacing: -0.04em;
}
.figure span { display: block; margin-top: 0.6rem; color: var(--ink-60); font-size: 0.9rem; max-width: 22ch; }

/* The frame starts inset and grows edge to edge as it scrolls in (hero). */
.stage {
  position: relative;
  margin-top: clamp(3rem, 6vw, 5rem);
  margin-inline: auto;
  width: min(100% - 2 * var(--gutter), 72rem);
  aspect-ratio: 16 / 9;
  background: var(--ground);
  overflow: hidden;
  border-radius: 4px;
}
@supports (animation-timeline: view()) {
  .stage {
    animation: open-up linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }
  @keyframes open-up {
    from { width: min(100% - 2 * var(--gutter), 72rem); border-radius: 4px; }
    to   { width: 100%; border-radius: 0; }
  }
}

/* ── Statement: words go from grey to black as the block crosses the viewport ── */
.statement { max-width: 28ch; }
@supports (animation-timeline: view()) {
  .statement {
    color: transparent;
    background: linear-gradient(90deg, var(--ink) 0 50%, var(--mute) 50% 100%) 100% 0 / 200% 100% no-repeat;
    -webkit-background-clip: text; background-clip: text;
    animation: ink-in linear both;
    animation-timeline: view();
    animation-range: entry 40% cover 60%;
  }
  @keyframes ink-in { to { background-position: 0 0; } }
}

/* ── Services: numbered rows, figure on the right ── */
.rows { list-style: none; border-top: 1px solid var(--ink-12); }
.rows li {
  display: grid; gap: 0.75rem 2rem;
  grid-template-columns: 1fr;
  padding-block: clamp(1.75rem, 3.5vw, 3rem);
  border-bottom: 1px solid var(--ink-12);
}
@media (min-width: 62rem) {
  .rows li { grid-template-columns: 3rem 1.2fr 1.6fr 0.9fr; align-items: baseline; }
}
.rows h3 { font-size: clamp(1.4rem, 2.2vw, 2rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; }
.rows h3 a { text-decoration: none; }
.rows h3 a:hover { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.rows p { color: var(--ink-60); max-width: 54ch; }
.rows .num { color: var(--ink-60); }
.rows .fig strong { display: block; font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
.rows .fig span { display: block; margin-top: 0.4rem; font-size: 0.85rem; color: var(--ink-60); }

/* ── Data band: accent surface, big numbers ── */
.band { background: var(--accent); padding-block: clamp(4rem, 9vw, 8rem); }
.band .figures { border-top-color: rgba(0, 0, 0, 0.18); }
.band .figure span { color: rgba(0, 0, 0, 0.7); }

/* ── Process: four steps, each with a small looping demo ── */
.steps {
  list-style: none;
  display: grid; gap: clamp(2.5rem, 4vw, 3rem) clamp(1rem, 2vw, 1.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 80rem) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps h3 { font-size: 1.3rem; font-weight: 400; letter-spacing: -0.015em; margin-top: 1.25rem; }
.steps p { color: var(--ink-60); margin-top: 0.5rem; max-width: 40ch; }
.steps .t-label { color: var(--ink-60); margin-top: 1rem; display: block; }

.demo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--ground);
  border-radius: 4px;
  overflow: hidden;
  display: grid; place-items: center;
}
.demo svg { width: 62%; height: auto; overflow: visible; }
.demo .tag {
  position: absolute; left: 0.9rem; bottom: 0.8rem;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-60);
}
.demo .count { position: absolute; right: 0.9rem; bottom: 0.8rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; }

/* ── Process demos: one wooden chair in four steps (ProcessDemo.astro) ──
   Each loop runs 8 s; the base state of every rule is the step's final
   frame, so reduced motion and no-CSS-animation browsers see a still. */
.pd .pd-svg { width: 66%; height: auto; overflow: visible; }
.pd--big { height: 100%; aspect-ratio: auto; background: transparent; }
.pd--big .pd-svg { width: auto; height: 82%; max-width: 70%; }
.pd--big .pd-win { inset: 10% 14% 14%; }
.pd--big .pd-type { font-size: clamp(0.9rem, 1.6vw, 1.5rem); }
.pd--big .pd-copy { gap: 14px; }
.pd--big .pd-l { height: 8px; border-radius: 4px; }
.pd--big .pd-btns i { width: 22px; height: 22px; }
.pd--big .pd-show .pd-svg { height: auto; width: 80%; max-width: none; }
.pd .pd-ln, .pd .pd-edge, .pd .pd-quad { fill: none; stroke: var(--ink); stroke-linejoin: round; }
.pd .pd-ln { stroke-width: 1.1; stroke-dasharray: 1; }
.pd .pd-edge { stroke-width: 0.9; }
.pd .pd-quad { stroke-width: 0.45; opacity: 0.55; }
.pd .pd-paper { fill: var(--ground); }

/* 01 CAD: outlines draw, then the quad topology appears on every face */
.in .pd--cad .pd-ln { animation: pd-draw 8s var(--ease) infinite; }
.in .pd--cad .pd-quads { animation: pd-quads 8s var(--ease) infinite; }
@keyframes pd-draw { 0% { stroke-dashoffset: 1; } 30%, 92% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 1; } }
@keyframes pd-quads { 0%, 32% { opacity: 0; } 42%, 88% { opacity: 1; } 96%, 100% { opacity: 0; } }

/* 02 Optimise: the dense quad mesh thins to the clean one, silhouette fixed */
.pd--opt .pd-dense .pd-quad { opacity: 0.7; stroke-width: 0.3; }
.pd--opt .pd-dense { opacity: 0; }
.in .pd--opt .pd-dense { animation: pd-thin 8s var(--ease) infinite; }
@keyframes pd-thin { 0%, 20% { opacity: 1; } 55%, 92% { opacity: 0; } 100% { opacity: 1; } }

/* 03 Materials: wood faces, three finishes cross-fading */
.pd .pd-wood--top   { fill: #d9b88f; }
.pd .pd-wood--front { fill: #c49a6c; }
.pd .pd-wood--side  { fill: #a8794e; }
.pd .pd-grain { fill: none; stroke: #f3e2c8; stroke-width: 0.6; opacity: 0.7; }
.in .pd--mat .pd-wood--top   { animation: pd-wood-top 9s ease-in-out infinite; }
.in .pd--mat .pd-wood--front { animation: pd-wood-front 9s ease-in-out infinite; }
.in .pd--mat .pd-wood--side  { animation: pd-wood-side 9s ease-in-out infinite; }
@keyframes pd-wood-top   { 0%, 28% { fill: #d9b88f; } 33%, 61% { fill: #8a5a3b; } 66%, 95% { fill: #ecd2ad; } 100% { fill: #d9b88f; } }
@keyframes pd-wood-front { 0%, 28% { fill: #c49a6c; } 33%, 61% { fill: #6b4329; } 66%, 95% { fill: #ddb98c; } 100% { fill: #c49a6c; } }
@keyframes pd-wood-side  { 0%, 28% { fill: #a8794e; } 33%, 61% { fill: #55331f; } 66%, 95% { fill: #c79f72; } 100% { fill: #a8794e; } }
.pd-swatches { position: absolute; right: 0.8rem; top: 0.8rem; display: grid; gap: 0.3rem; font-size: 0.7rem; color: var(--ink-60); }
.pd-sw { display: flex; align-items: center; gap: 0.4rem; opacity: 0.45; }
.pd-sw i { width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 1px solid var(--ink-12); }
.pd-sw--0 i { background: #c49a6c; }
.pd-sw--1 i { background: #6b4329; }
.pd-sw--2 i { background: #ddb98c; }
.pd-sw--0 { opacity: 1; }
.in .pd--mat .pd-sw { animation: pd-sw 9s steps(1) infinite; }
.in .pd--mat .pd-sw--1 { animation-delay: -6s; }
.in .pd--mat .pd-sw--2 { animation-delay: -3s; }
@keyframes pd-sw { 0% { opacity: 1; color: var(--ink); } 33.3%, 100% { opacity: 0.45; color: var(--ink-60); } }

/* 04 Web: a browser window; copy types in on the left, the chair appears right */
.pd-win { position: absolute; inset: 11% 9% 16%; border: 1px solid var(--ink); border-radius: 5px; background: var(--bg); display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.pd-bar { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--ink-12); }
.pd-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-12); }
.pd-page { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 8%; gap: 6%; }
.pd-copy { display: grid; gap: 7px; }
.pd-type { font-size: clamp(0.62rem, 0.9vw, 0.8rem); white-space: nowrap; width: fit-content; max-width: 100%; overflow: hidden; }
.pd-l { display: block; height: 4px; border-radius: 2px; background: var(--ink-12); }
.pd-l--1 { width: 92%; } .pd-l--2 { width: 78%; } .pd-l--3 { width: 60%; }
.pd-btns { display: flex; gap: 5px; margin-top: 4px; }
.pd-btns i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink-12); }
.pd-btns i:nth-child(1) { background: #c49a6c; } .pd-btns i:nth-child(2) { background: #6b4329; } .pd-btns i:nth-child(3) { background: #ddb98c; }
.pd--web .pd-show .pd-svg { width: 100%; }
.in .pd--web .pd-type { animation: pd-type 8s steps(28) infinite; }
.in .pd--web .pd-l { animation: pd-line 8s var(--ease) infinite; transform-origin: left; }
.in .pd--web .pd-l--2 { animation-delay: 0.15s; }
.in .pd--web .pd-l--3 { animation-delay: 0.3s; }
.in .pd--web .pd-show { animation: pd-show 8s var(--ease) infinite; }
@keyframes pd-type { 0%, 5% { clip-path: inset(0 100% 0 0); } 40%, 92% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 100% 0 0); } }
@keyframes pd-line { 0%, 40% { transform: scaleX(0); } 52%, 92% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes pd-show { 0%, 50% { opacity: 0; transform: translateY(6px); } 62%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ── Cards: sectors ── */
.cards {
  list-style: none;
  display: grid; grid-template-columns: 1fr;
  border-top: 1px solid var(--ink-12);
}
@media (min-width: 48rem) { .cards { grid-template-columns: repeat(2, 1fr); column-gap: clamp(2rem, 5vw, 5rem); } }
@media (min-width: 80rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards li { border-bottom: 1px solid var(--ink-12); padding-block: 1.75rem; display: grid; gap: 0.6rem; align-content: start; }
.cards h3 { font-size: 1.2rem; font-weight: 400; letter-spacing: -0.015em; }
.cards h3 a { text-decoration: none; }
.cards h3 a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.cards p { color: var(--ink-60); max-width: 48ch; }

/* ── Section head ── */
.section-head {
  display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}
.section-head h2 { max-width: 22ch; }

/* ── FAQ: native disclosure ── */
.faq { border-top: 1px solid var(--ink-12); max-width: 64rem; }
.faq details { border-bottom: 1px solid var(--ink-12); padding-block: 1.25rem; }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 44px;
  font-size: clamp(1.1rem, 1.6vw, 1.4rem); font-weight: 300; letter-spacing: -0.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 200; font-size: 1.6em; line-height: 1; transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-60); max-width: 64ch; margin-top: 0.75rem; }

/* ── Long-form text (legal, articles) ── */
.prose { max-width: 70ch; }
.prose h1 { margin-bottom: 2rem; }
.prose h2 { font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 400; letter-spacing: -0.015em; margin-block: 2.5rem 0.75rem; }
.prose p, .prose li { color: var(--ink-60); }
.prose p + p, .prose ul { margin-top: 0.9rem; }
.prose ul { padding-left: 1.2rem; }

/* ── Footer: contact on the accent surface, then meta ── */
.site-footer { margin-top: var(--rhythm); }
.footer-contact { background: var(--accent); padding-block: clamp(4rem, 8vw, 7rem); }
.footer-contact .grid {
  display: grid; gap: 2.5rem clamp(2rem, 6vw, 6rem);
  grid-template-columns: 1fr;
}
@media (min-width: 62rem) { .footer-contact .grid { grid-template-columns: 1fr 1.3fr; } }
.footer-intro { margin-top: 1.25rem; max-width: 40ch; color: rgba(0, 0, 0, 0.7); }

#contact-form { display: grid; gap: 1.25rem 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { #contact-form { grid-template-columns: 1fr 1fr; } }
#contact-form[hidden] { display: none; }
.field { display: grid; gap: 0.35rem; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: 0.72rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.55rem 0;
  min-height: 44px;
}
.field textarea { resize: vertical; }
.consent { display: flex; gap: 0.6rem; align-items: start; font-size: 0.9rem; }
.consent input { margin-top: 0.3rem; accent-color: var(--ink); }
.hp { display: none; }
.form-status { margin-top: 1rem; }

.footer-meta {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
  padding-block: 3rem 2rem;
}
@media (min-width: 48rem) { .footer-meta { grid-template-columns: 2fr 1fr 1fr; } }
.footer-meta ul { list-style: none; display: grid; gap: 0.45rem; }
.footer-meta a { text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.footer-meta h2 { margin-bottom: 0.9rem; color: var(--ink-60); }
.footer-bottom {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
  border-top: 1px solid var(--ink-12); padding-top: 1.25rem;
  color: var(--ink-60);
}

/* ── Scroll reveal (JS adds .in). Without JS everything stays visible. ── */
.js [data-reveal] { opacity: 0; transform: translateY(1.5rem); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .statement { color: var(--ink); background: none; }
  .stage { width: 100%; }
  .pd .pd-ln { stroke-dashoffset: 0; }
}

/* Service pages: comparison tables only. Black type on white, hairlines, and
   a horizontal scroll on narrow screens instead of a squeezed table. */
.table-wrap {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  overflow-x: auto;
  border-top: 1px solid var(--ink-12);
}
.svc-table {
  width: 100%;
  min-width: 44rem;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.45;
}
.svc-table caption {
  text-align: left;
  padding-block: 1rem;
  color: var(--ink-60);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.svc-table th, .svc-table td {
  padding: 0.9rem 1.25rem 0.9rem 0;
  border-bottom: 1px solid var(--ink-12);
  vertical-align: top;
}
.svc-table thead th { font-weight: 400; }
.svc-table tbody th { font-weight: 400; color: var(--ink-60); }

/* Guides */
.crumbs { padding-top: 2rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; color: var(--ink-60); }
.crumbs li + li::before { content: '/'; margin-right: 0.5rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.crumbs [aria-current='page'] { color: var(--ink); }

.guide { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.guide-head { max-width: 54rem; }
.guide-head h1 { margin-bottom: 1.75rem; }
.guide-answer {
  background: var(--accent);
  padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 2.5vw, 2rem);
  border-radius: 4px;
  max-width: 48rem;
}
.guide-answer p { color: var(--ink); line-height: 1.35; }
.guide-meta { margin-top: 1.25rem; }

.guide-layout { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); }
@media (min-width: 62rem) {
  .guide-layout { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
  .guide-toc { position: sticky; top: calc(var(--head-h) + 1.5rem); }
}
.guide-toc h2 { color: var(--ink-60); margin-bottom: 1rem; }
.guide-toc ol { list-style: none; counter-reset: toc; border-top: 1px solid var(--ink-12); }
.guide-toc li { border-bottom: 1px solid var(--ink-12); }
.guide-toc a {
  display: block; padding-block: 0.7rem; min-height: 44px;
  font-size: 0.9rem; line-height: 1.35; text-decoration: none; color: var(--ink-60);
}
.guide-toc a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }

.guide-body { max-width: 68ch; }
.guide-section { margin-top: 0; }
.guide-section + .guide-section { margin-top: clamp(2.5rem, 5vw, 4rem); }
.guide-section h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  font-weight: 300; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.guide-section h3 {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  font-weight: 400; letter-spacing: -0.015em;
  margin-block: 2rem 0.6rem;
}
.guide-section p { color: var(--ink-60); }
.guide-section p + p { margin-top: 0.9rem; }
.guide-lead { color: var(--ink) !important; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.4; }
.guide-list { list-style: none; margin-top: 1.25rem; border-top: 1px solid var(--ink-12); }
.guide-list li {
  color: var(--ink-60);
  padding-block: 0.65rem 0.65rem 0.65rem 1.5rem;
  border-bottom: 1px solid var(--ink-12);
  position: relative;
}
.guide-list li::before { content: '—'; position: absolute; left: 0; color: var(--ink-60); }
.guide-section .table-wrap { margin-top: 1.75rem; }

.guide-cta-text { margin-top: 1.25rem; max-width: 46ch; color: rgba(0, 0, 0, 0.75); }
.band .hero-actions { margin-top: 2rem; }
.band .btn { background: var(--ink); border-color: var(--ink); }
.band .btn:hover { background: var(--bg); color: var(--ink); border-color: var(--ink); }
/* The secondary button stays outlined on accent bands, or its black text sits on black. */
.band .btn--ghost { background: transparent; color: var(--ink); }
.band .btn--ghost:hover { background: var(--ink); color: var(--bg); }
.guides-list { list-style: none; border-top: 1px solid var(--ink-12); max-width: 62rem; }
.guides-list li { display: grid; gap: 0.35rem; padding-block: 1.5rem; border-bottom: 1px solid var(--ink-12); }
.guides-list h2 { font-size: 1.2rem; font-weight: 400; letter-spacing: -0.015em; }
.guides-list a { text-decoration: none; }
.guides-list a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.guides-list p { color: var(--ink-60); max-width: 56ch; }

/* Chair demo */

/* The stage takes the height of the demo instead of the global 16:9 frame. */
.stage--media { aspect-ratio: auto; }

/* Viewer and controls sit side by side like a product configurator: the model
   on the left, a numbered stepper plus swatches on the right. */
.chair-demo { display: grid; grid-template-columns: 1fr; background: var(--bg); }
.chair-demo__stage {
  position: relative;
  height: clamp(16rem, 56vh, 30rem);
  background: var(--ground);
  overflow: hidden;
}
@media (min-width: 64rem) {
  .chair-demo {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: stretch;
  }
  .chair-demo__stage { height: min(72vh, 44rem); }
}
.chair-demo__poster,
.chair-demo__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chair-demo__poster { object-fit: cover; transition: opacity 0.6s var(--ease); }
.chair-demo__canvas { opacity: 0; transition: opacity 0.6s var(--ease); }
.chair-demo.is-ready .chair-demo__poster { opacity: 0; visibility: hidden; }
.chair-demo.is-ready .chair-demo__canvas { opacity: 1; }

.chair-demo__hint,
.chair-demo__loading {
  position: absolute; bottom: 0.8rem; margin: 0;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-60); opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.chair-demo__hint { right: 0.9rem; }
.chair-demo__loading { left: 0.9rem; }
.chair-demo.is-ready .chair-demo__hint { opacity: 1; }
.chair-demo.is-engaged .chair-demo__hint { opacity: 0; }
.js .chair-demo:not(.is-ready):not(.is-failed) .chair-demo__loading { opacity: 1; }
.chair-demo.is-failed .chair-demo__hint { display: none; }

.chair-demo__controls {
  display: grid; align-content: start; min-width: 0;
  gap: 1rem;
  padding: 1.25rem var(--gutter) 1.5rem;
}
@media (min-width: 64rem) {
  .chair-demo__controls { padding: 1.5rem 1.6rem; border-left: 1px solid var(--ink-12); align-content: safe center; }
}
.chair-demo__caption { margin: 0; }

/* Steps 1–4: numbered tabs, hairline underline on the active one. */
.chair-demo__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--ink-12);
}
.chair-demo__step {
  position: relative;
  display: grid; gap: 0.15rem; align-content: start; justify-items: start;
  min-height: 44px;
  padding: 0.45rem 0.35rem 0.7rem;
  background: none; border: 0; border-radius: 0;
  font: inherit; text-align: left; color: var(--ink-60);
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.chair-demo__step::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: transparent;
  transition: background-color 0.3s var(--ease);
}
.chair-demo__step:hover { color: var(--ink); }
.chair-demo__step[aria-selected="true"] { color: var(--ink); }
.chair-demo__step[aria-selected="true"]::after { background: var(--ink); }
.chair-demo__step-num { font-size: 0.6rem; letter-spacing: 0.12em; color: var(--ink-60); }
.chair-demo__step-label { font-size: 0.8rem; line-height: 1.15; letter-spacing: -0.01em; }
.chair-demo__step-value {
  max-width: 100%;
  font-size: 0.68rem; line-height: 1.2; color: var(--ink-60);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.chair-demo__panels { min-height: 13.75rem; }
.chair-demo__panel[hidden] { display: none; }
.chair-demo__grid {
  display: grid;
  gap: 0.8rem 0.4rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
/* Stacked layout can afford more swatches per row than the narrow side panel. */
@media (min-width: 48rem) {
  .chair-demo__panels { min-height: 9.5rem; }
  .chair-demo__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
  .chair-demo__panels { min-height: 13.75rem; }
  .chair-demo__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* One finish: square swatch, name underneath, 44px target. */
.chair-demo__swatch {
  display: grid; gap: 0.4rem; justify-items: center; align-content: start;
  min-width: 44px; min-height: 44px;
  padding: 0;
  background: none; border: 0; border-radius: 0;
  font: inherit; color: var(--ink-60);
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.chair-demo__swatch:hover { color: var(--ink); }
.chair-demo__swatch[aria-pressed="true"] { color: var(--ink); }
.chair-demo__swatch[disabled] { cursor: default; opacity: 0.6; }

.chair-demo__chip {
  position: relative; display: block;
  width: 44px; height: 44px;
  border-radius: 2px;
  background: var(--chip, #ddd);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
  transition: box-shadow 0.3s var(--ease);
}
.chair-demo__swatch:hover .chair-demo__chip { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
.chair-demo__swatch[aria-pressed="true"] .chair-demo__chip {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Fabrics and straps read as textile in the swatch too: a weave drawn in CSS
   over the base colour, never a second colour of its own. */
.chair-demo__panel[data-kind="fabric"] .chair-demo__chip::after,
.chair-demo__panel[data-kind="weave"] .chair-demo__chip::after {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit;
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
}
.chair-demo__panel[data-kind="fabric"] .chair-demo__chip::after {
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.55) 0 1px, rgba(0, 0, 0, 0.35) 1px 2px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 1px, rgba(0, 0, 0, 0.3) 1px 2px);
  background-size: 2px 2px, 2px 2px;
}
.chair-demo__panel[data-kind="weave"] .chair-demo__chip::after {
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.6) 0 1px, rgba(0, 0, 0, 0.55) 1px 3px);
  background-size: 3px 3px;
}

.chair-demo__name {
  font-size: 0.7rem; line-height: 1.2; text-align: center;
  overflow-wrap: anywhere;
}

.chair-demo__summary {
  grid-column: 1 / -1;
  margin: 0; padding: 0.9rem var(--gutter);
  border-top: 1px solid var(--ink-12);
  font-size: 0.85rem; color: var(--ink);
}
@media (min-width: 64rem) {
  .chair-demo__summary { padding-inline: 1.6rem; }
}
.chair-demo__caption { color: var(--ink-60); }

@media (prefers-reduced-motion: reduce) {
  .chair-demo__poster,
  .chair-demo__canvas,
  .chair-demo__hint,
  .chair-demo__loading,
  .chair-demo__chip,
  .chair-demo__step,
  .chair-demo__step::after,
  .chair-demo__swatch { transition: none; }
}

/* Without JS the stage is a still: the poster stays and the controls would lie. */
html:not(.js) .chair-demo__steps,
html:not(.js) .chair-demo__panels,
html:not(.js) .chair-demo__summary { display: none; }

/* ── Footer nav ── */
/* The meta area holds the brand, the route columns (Servicios, Zonas,
   Sectores, Guías, Empresa, Idioma) and the legal line. Columns wrap on
   their own, so a route that hides itself never leaves a gap. */
.footer-meta { grid-template-columns: 1fr; gap: 2.5rem clamp(1.5rem, 4vw, 3rem); }
.footer-brand { display: grid; gap: 1.5rem; justify-items: start; align-content: start; }
.footer-brand ul { list-style: none; display: grid; gap: 0.45rem; }
.footer-nav {
  display: grid;
  gap: 2rem clamp(1.25rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}
.footer-col ul { list-style: none; display: grid; gap: 0.45rem; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.footer-col h2 { margin-bottom: 0.9rem; color: var(--ink-60); }
.footer-social { color: var(--ink-60); }
@media (min-width: 62rem) {
  .footer-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Tool logos */
/* Home landing, "Software" block: seven marks on a single row, evenly spaced
   across the content width. Monochrome at rest, ink on hover; the name sits
   under each logo. On narrow phones the row does not wrap: it becomes a
   horizontal scroll-snap strip. The SVGs are inlined at build time (see
   Home.astro), so fill follows the theme. */
.tool-grid {
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(5.5rem, 1fr);
  align-items: start;
  gap: 1rem;
  margin: 0.5rem auto 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tool-grid::-webkit-scrollbar { display: none; }
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  min-width: 0;
  scroll-snap-align: center;
  color: var(--ink-60);
  transition: color 0.25s var(--ease);
}
.tool:hover { color: var(--ink); }
.tool svg {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  fill: currentColor;
}
.tool__name {
  font-size: 0.8rem;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
}
@media (min-width: 48rem) {
  .tool-grid {
    grid-auto-columns: minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 2.5rem);
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .tool { scroll-snap-align: none; }
  .tool svg { width: 2.75rem; height: 2.75rem; }
}
@media (min-width: 64rem) {
  .tool svg { width: 3rem; height: 3rem; }
}

/* Dot ground */
/* Site-wide page texture: a 22px grid of 1px dots in the accent tone, faint
   enough to read as paper grain rather than a pattern. The white ground stays
   as the body background-color; only the dots are painted on top. It follows
   the same theme mechanism as the rest of the tokens (data-theme on <html>
   written by the header switch, system preference as fallback), with a dimmer
   accent so the dots stay quiet on the dark ground. Opaque surfaces that own
   their background (header, accent bands, demo grounds, form) paint over it. */
body {
  background-image: radial-gradient(circle, rgba(220, 199, 190, 0.55) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: 0 0;
}
:root[data-theme="dark"] body {
  background-image: radial-gradient(circle, rgba(220, 199, 190, 0.14) 1px, transparent 1.2px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background-image: radial-gradient(circle, rgba(220, 199, 190, 0.14) 1px, transparent 1.2px);
  }
}

/* Kitchen demo (landing hero) ───────────────────────────────────────────────
   An 18 s loop in four acts, all CSS: 0–4 s outlines draw from CAD, 4–7 s
   faces fill in and the model settles, 7–12 s modules are swapped, 12–17 s
   the fronts cycle through three finishes, 17–18 s it fades back to the
   drawing. Base rules describe the finished kitchen, which is exactly what
   reduced-motion visitors and browsers without CSS animations see. */
@property --kd-front {
  syntax: '<color>';
  inherits: true;
  initial-value: #e0dad3;
}
@property --kd-top {
  syntax: '<color>';
  inherits: true;
  initial-value: #f5f2ed;
}

.kd {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.kd__frame {
  position: relative;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 8 / 5;
}
.kd__svg {
  width: 100%;
  height: 100%;
  --kd-front: #5a5a5a;
  --kd-top: #b3ada3;
  animation: kd-finish 18s linear infinite;
}
.kd__svg path {
  stroke-width: 1.1;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.kd-face { fill: var(--kd-front); }
.kd-top { fill: var(--kd-top); }
.kd-line { fill: none; }
.kd-panel,
.kd-handle,
.kd-burner,
.kd-oven { fill: none; }
.kd-panel { stroke-width: 0.8; opacity: 0.5; }
.kd-handle { stroke-width: 1.9; opacity: 0.9; }
.kd-burner { stroke-width: 0.9; }
.kd-basin { fill: rgba(0, 0, 0, 0.12); stroke-width: 0.8; }
.kd-basin--wall { fill: rgba(0, 0, 0, 0.2); }
.kd-basin--side { fill: rgba(0, 0, 0, 0.28); }
.kd-oven { fill: #2e2e2e; }

.kd-grid path { stroke: var(--ink); stroke-width: 0.7; opacity: 0.16; }

/* Ink: the drawing is light-on-dark in act 1, then the hairlines turn dark
   over the material fills once the volume arrives. */
.kd-ink {
  stroke: #171310;
  animation: kd-ink 18s linear infinite;
}
@keyframes kd-ink {
  0%, 22% { stroke: var(--ink); fill-opacity: 0; }
  27%, 95% { stroke: #171310; fill-opacity: 1; }
  96.5%, 100% { stroke: var(--ink); fill-opacity: 0; }
}

/* Scene: fades in, holds, fades out while every layer resets for the loop. */
.kd-scene {
  opacity: 1;
  animation: kd-scene 18s linear infinite;
}
@keyframes kd-scene {
  0% { opacity: 0; transform: translateY(14px); }
  4% { opacity: 1; transform: translateY(14px); }
  22% { transform: translateY(14px); }
  34%, 94% { opacity: 1; transform: none; }
  96%, 100% { opacity: 0; transform: none; }
}

/* Draw: dashoffset is inherited, so one animation draws a whole layer. */
.kd-draw { animation: kd-draw-a 18s linear infinite; }
.kd-draw path { stroke-dasharray: 1; }
.kd-draw--floor { animation-name: kd-draw-floor; }
.kd-draw--a { animation-name: kd-draw-a; }
.kd-draw--b { animation-name: kd-draw-b; }
.kd-draw--c { animation-name: kd-draw-c; }
@keyframes kd-draw-floor {
  0%, 4% { stroke-dashoffset: 1; }
  12%, 95% { stroke-dashoffset: 0; }
  97%, 100% { stroke-dashoffset: 1; }
}
@keyframes kd-draw-a {
  0%, 6% { stroke-dashoffset: 1; }
  18%, 95% { stroke-dashoffset: 0; }
  97%, 100% { stroke-dashoffset: 1; }
}
@keyframes kd-draw-b {
  0%, 8% { stroke-dashoffset: 1; }
  20%, 95% { stroke-dashoffset: 0; }
  97%, 100% { stroke-dashoffset: 1; }
}
@keyframes kd-draw-c {
  0%, 14% { stroke-dashoffset: 1; }
  22%, 95% { stroke-dashoffset: 0; }
  97%, 100% { stroke-dashoffset: 1; }
}

/* Swaps. The removed units slide forward and fade; insertions drop in from
   above behind the worktops. Opacity only, so the base state is the final
   kitchen and nothing judders when the loop restarts. */
.kd-out, .kd-out2 { opacity: 0; animation: kd-out 18s linear infinite; }
.kd-in { opacity: 1; animation: kd-in 18s linear infinite; }
.kd-in2, .kd-in2b { opacity: 1; animation: kd-in2 18s linear infinite; }
.kd-in3 { opacity: 1; animation: kd-in3 18s linear infinite; }
@keyframes kd-out {
  0%, 40% { opacity: 1; transform: none; }
  45%, 96% { opacity: 0; transform: translate(-16px, 9px); }
  96.1%, 100% { opacity: 1; transform: none; }
}
@keyframes kd-out2 {
  0%, 58% { opacity: 1; transform: none; }
  62.5%, 96% { opacity: 0; transform: translate(-13px, 8px); }
  96.1%, 100% { opacity: 1; transform: none; }
}
.kd-out2 { animation-name: kd-out2; }
@keyframes kd-in {
  0%, 45% { opacity: 0; transform: translateY(-30px); }
  50%, 96% { opacity: 1; transform: none; }
  96.1%, 100% { opacity: 0; transform: translateY(-30px); }
}
@keyframes kd-in2 {
  0%, 50% { opacity: 0; transform: translateY(-34px); }
  56%, 96% { opacity: 1; transform: none; }
  96.1%, 100% { opacity: 0; transform: translateY(-34px); }
}
@keyframes kd-in3 {
  0%, 62% { opacity: 0; transform: translateY(-30px); }
  66.5%, 96% { opacity: 1; transform: none; }
  96.1%, 100% { opacity: 0; transform: translateY(-30px); }
}

/* Finishes: neutral during acts 1–3, then oak + white, sage + terrazzo,
   graphite + stone, cross-fading in step with the callout text. */
@keyframes kd-finish {
  0%, 66.6% { --kd-front: #e0dad3; --kd-top: #f5f2ed; }
  69%, 76% { --kd-front: #c9a97f; --kd-top: #f2efe9; }
  78.5%, 86% { --kd-front: #8a9a86; --kd-top: #d3cdc0; }
  88.5%, 95% { --kd-front: #5a5a5a; --kd-top: #b3ada3; }
  100% { --kd-front: #e0dad3; --kd-top: #f5f2ed; }
}

/* Callouts: labels over the drawing, max three at a time. */
.kd__ui { position: absolute; inset: 0; pointer-events: none; }
.kd-call { position: absolute; inset: 0; opacity: 1; animation: kd-call 18s linear infinite; }
.kd-call--3 { animation-name: kd-call-3; }
.kd-call--4 { opacity: 0; animation-name: kd-call-4; }
@keyframes kd-call {
  0%, 27% { opacity: 0; }
  31%, 94% { opacity: 1; }
  96%, 100% { opacity: 0; }
}
@keyframes kd-call-3 {
  0%, 27% { opacity: 0; }
  31%, 48% { opacity: 1; }
  50%, 63% { opacity: 0; }
  66%, 94% { opacity: 1; }
  96%, 100% { opacity: 0; }
}
@keyframes kd-call-4 {
  0%, 50% { opacity: 0; }
  53%, 63% { opacity: 1; }
  65%, 100% { opacity: 0; }
}
.kd-call__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--ink-60);
}
.kd-call__line {
  position: absolute;
  width: var(--len);
  height: 1px;
  margin-top: -0.5px;
  background: var(--ink-60);
  transform-origin: 0 50%;
  transform: rotate(var(--ang));
}
.kd-call__bubble {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--ink-12);
  border-radius: 6px;
  background: var(--bg);
  box-shadow: 0 2px 6px var(--shadow);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0;
  white-space: nowrap;
}
.kd-call__bubble span { grid-area: 1 / 1; }
.kd-call--1 .kd-call__bubble { left: 21.3%; top: 21%; }
.kd-call--2 .kd-call__bubble { left: 83%; top: 31.6%; }
.kd-call--3 .kd-call__bubble { left: 23.8%; top: 84%; }
.kd-call--4 .kd-call__bubble { left: 67.5%; top: 84%; }
.kd-tx { opacity: 0; }
.kd-tx--keep, .kd-tx--3 { opacity: 1; }
.kd-tx--0 { animation: kd-tx0 18s linear infinite; }
.kd-tx--1 { animation: kd-tx1 18s linear infinite; }
.kd-tx--2 { animation: kd-tx2 18s linear infinite; }
.kd-tx--3 { animation: kd-tx3 18s linear infinite; }
@keyframes kd-tx0 {
  0%, 28% { opacity: 0; }
  31%, 66% { opacity: 1; }
  68%, 100% { opacity: 0; }
}
@keyframes kd-tx1 {
  0%, 67% { opacity: 0; }
  69%, 76% { opacity: 1; }
  77.5%, 100% { opacity: 0; }
}
@keyframes kd-tx2 {
  0%, 77% { opacity: 0; }
  79%, 86% { opacity: 1; }
  87.5%, 100% { opacity: 0; }
}
@keyframes kd-tx3 {
  0%, 87% { opacity: 0; }
  89%, 95% { opacity: 1; }
  96%, 100% { opacity: 0; }
}

/* Act captions, bottom left, one at a time. */
.kd__caps { position: absolute; left: 4%; bottom: 5%; display: grid; }
.kd-cap {
  grid-area: 1 / 1;
  opacity: 0;
  color: var(--ink-60);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.kd-cap--4 { opacity: 1; }
.kd-cap--1 { animation: kd-cap1 18s linear infinite; }
.kd-cap--2 { animation: kd-cap2 18s linear infinite; }
.kd-cap--3 { animation: kd-cap3 18s linear infinite; }
.kd-cap--4 { animation: kd-cap4 18s linear infinite; }
@keyframes kd-cap1 {
  0%, 3% { opacity: 0; }
  6%, 21% { opacity: 1; }
  23%, 100% { opacity: 0; }
}
@keyframes kd-cap2 {
  0%, 23% { opacity: 0; }
  26%, 37% { opacity: 1; }
  39%, 100% { opacity: 0; }
}
@keyframes kd-cap3 {
  0%, 39% { opacity: 0; }
  42%, 65% { opacity: 1; }
  67%, 100% { opacity: 0; }
}
@keyframes kd-cap4 {
  0%, 67% { opacity: 0; }
  70%, 94% { opacity: 1; }
  96%, 100% { opacity: 0; }
}

/* Narrow screens: two callouts, no leaders, inside the frame. */
@media (max-width: 40rem) {
  .kd-call--3, .kd-call--4 { display: none; }
  .kd-call__line, .kd-call__dot { display: none; }
  .kd-call--1 .kd-call__bubble { left: 31%; top: 21%; }
  .kd-call--2 .kd-call__bubble { left: 68%; top: 45%; }
  .kd-call__bubble { padding: 0.25rem 0.45rem; font-size: 11px; }
  .kd__caps { left: 5%; bottom: 4%; }
  .kd-cap { font-size: 9px; letter-spacing: 0.05em; }
}

@media (prefers-reduced-motion: reduce) {
  .kd-call--4 { opacity: 0; }
}

/* On service pages the demo comes in through the stage slot, which marks the
   frame as media (auto height). The demo is absolutely positioned, so it
   needs the 16:9 frame back or it collapses to zero height. */
.stage--media:has(> .kd) {
  aspect-ratio: 16 / 9;
  background: var(--ground);
  overflow: hidden;
  border-radius: 4px;
}

/* Sofa demo (SofaDemo.astro): the kitchen loop with its own fabrics. Faces
   are shaded from the fabric colour, legs take the second finish, bubbles
   are placed from the markup. */
.sd .kd__svg {
  --kd-front: #5d7262;
  --kd-top: #222222;
  animation-name: sd-finish;
}
.sd-top { fill: color-mix(in srgb, var(--kd-front) 78%, #ffffff); }
.sd-side { fill: color-mix(in srgb, var(--kd-front) 82%, #000000); }
.sd .sd-leg { stroke: var(--kd-top); stroke-width: 3; opacity: 1; }
.sd .kd-call__bubble { left: var(--bx); top: var(--by); }
@keyframes sd-finish {
  0%, 66.6% { --kd-front: #e0dad3; --kd-top: #8a8178; }
  69%, 76% { --kd-front: #cdbfa6; --kd-top: #c9a97f; }
  78.5%, 86% { --kd-front: #eee8dc; --kd-top: #6b4a33; }
  88.5%, 95% { --kd-front: #5d7262; --kd-top: #222222; }
  100% { --kd-front: #e0dad3; --kd-top: #8a8178; }
}


/* Image gallery (ImageGallery.astro): one horizontal band that fits the
   viewport. Tiles sit at staggered heights, rise in one after another and
   then float gently; on phones the band scrolls sideways with snap. */
.stage:has(> .ig) { background: none; width: min(100% - 2 * var(--gutter), 96rem); margin-inline: auto; aspect-ratio: auto; overflow: visible; animation: none; }
.ig { display: flex; align-items: flex-start; gap: clamp(0.75rem, 1.4vw, 1.5rem); padding-block: 1rem 3rem; }
/* Each tile grows by its aspect ratio, so the row fills the width with equal heights. */
.ig__item { margin: 0; flex: 1 1 0; min-width: 0; border-radius: 4px; overflow: hidden; background: var(--ground); }
.ig__item--tall { flex-grow: 0.75; }
.ig__item--wide { flex-grow: 1.333; }
.ig__item--small { flex-grow: 1; }
.ig__item--large { flex-grow: 1.5; }
.ig__item img { display: block; width: 100%; height: auto; object-fit: cover; }
.ig__item--tall img { aspect-ratio: 3 / 4; }
.ig__item--wide img { aspect-ratio: 4 / 3; }
.ig__item--small img { aspect-ratio: 1 / 1; }
.ig__item--large img { aspect-ratio: 3 / 2; }
.ig__item:nth-child(3n + 2) { margin-top: clamp(1.5rem, 4vw, 4rem); }
.ig__item:nth-child(3n) { margin-top: clamp(0.75rem, 2vw, 2rem); }
.js .ig [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.js .ig [data-reveal]:nth-child(3) { transition-delay: 0.2s; }
.js .ig [data-reveal]:nth-child(4) { transition-delay: 0.3s; }
.js .ig [data-reveal]:nth-child(5) { transition-delay: 0.4s; }
.js .ig [data-reveal]:nth-child(6) { transition-delay: 0.5s; }
.ig__item.in img { animation: ig-float 9s ease-in-out infinite; }
.ig__item:nth-child(2n).in img { animation-delay: -3s; }
.ig__item:nth-child(3n).in img { animation-delay: -6s; }
@keyframes ig-float { 0%, 100% { transform: translateY(0) scale(1.03); } 50% { transform: translateY(-10px) scale(1.03); } }
@media (max-width: 48rem) {
  .ig { overflow-x: auto; scroll-snap-type: x mandatory; }
  .ig__item { scroll-snap-align: center; flex: 0 0 62vw; }
  .ig__item--wide, .ig__item--large { flex-basis: 82vw; }
}
@media (prefers-reduced-motion: reduce) { .ig__item img, .ig__item.in img { animation: none; } }

/* Showroom plan (ShowroomPlan.astro): top-down render and a caption. The
   render has a transparent background, so it sits on the page in both themes. */
.stage:has(> .sp) { background: none; width: min(100% - 2 * var(--gutter), 88rem); margin-inline: auto; aspect-ratio: auto; overflow: visible; animation: none; }
.sp__plan { position: relative; aspect-ratio: 2400 / 1023; }
.sp__img { display: block; width: 100%; height: 100%; object-fit: contain; }
.js .sp__img { opacity: 0; transition: opacity 0.8s var(--ease); }
.js .sp.in .sp__img { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .js .sp__img { transition: none; } }
.sp__caption { display: grid; gap: 0.35rem; margin-top: 1rem; }
.sp__caption .t-label { color: var(--ink-60); }
.sp__line { font-size: clamp(1.1rem, 1.8vw, 1.7rem); font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; }

/* Turntable (Turntable.astro): sticky stage, object turns with the scroll. */
.tt { position: relative; height: 300vh; margin-top: var(--rhythm); }
.tt__sticky { position: sticky; top: var(--head-h); height: calc(100vh - var(--head-h)); display: grid; place-items: center; overflow: hidden; }
.tt__stage { position: relative; width: min(60vw, 46rem); aspect-ratio: 1 / 1; max-height: 86%; }
.tt__poster, .tt__canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tt__canvas { opacity: 0; transition: opacity 0.6s var(--ease); }
.tt--live .tt__canvas { opacity: 1; }
.tt--live .tt__poster { opacity: 0; transition: opacity 0.6s var(--ease); }
.tt__panels { list-style: none; position: absolute; inset: 0; pointer-events: none; }
.tt__panel { position: absolute; top: 50%; width: min(20rem, 26vw); transform: translateY(calc(-50% + 1.5rem)); opacity: 0; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.tt__panel--left { right: calc(50% + min(60vw, 46rem) * 0.37); }
.tt__panel--right { left: calc(50% + min(60vw, 46rem) * 0.37); }
.tt__panel.is-on { opacity: 1; transform: translateY(-50%); }
.tt__panel h3 { font-size: clamp(1.5rem, 2.4vw, 2.3rem); font-weight: 300; letter-spacing: -0.02em; margin-top: 0.5rem; }
.tt__panel p { color: var(--ink-60); margin-top: 0.5rem; font-size: 1.05rem; }
.tt__panel .t-label { color: var(--ink-60); }
@media (max-width: 52rem) {
  .tt { height: 260vh; }
  .tt__stage { width: 92vw; max-height: 55%; }
  .tt__panel { top: auto; bottom: 1.5rem; left: var(--gutter); right: var(--gutter); width: auto; transform: translateY(1rem); }
  .tt__panel.is-on { transform: none; }
}
.tt--static { height: auto; }
.tt--static .tt__sticky { position: static; height: auto; display: grid; gap: 2rem; padding-inline: var(--gutter); }
.tt--static .tt__panels { position: static; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.tt--static .tt__panel { position: static; width: auto; opacity: 1; transform: none; }

/* Split sections: short answer beside an image; .split--flip puts the image left. */
.split { display: grid; gap: 2rem clamp(2rem, 6vw, 6rem); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 62rem) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--flip .split__media { order: -1; }
}
.split__text .t-page { margin-bottom: 2rem; max-width: 20ch; }
.split__text .t-sub { max-width: 44ch; }
.split__media { margin: 0; border-radius: 4px; overflow: hidden; background: var(--ground); }
.split__media img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 11; object-fit: cover; }
.split__media--contain { background: none; border-radius: 0; }
.split__media--contain img { aspect-ratio: auto; object-fit: contain; }

/* Splat embed (SplatEmbed.astro): poster first, SuperSplat iframe on click. */
.stage:has(> .splat) { background: none; aspect-ratio: auto; overflow: visible; animation: none; }
.splat { margin: 0; }
.splat__frame { position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: #000; }
.splat__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.splat__play { position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%); }
.splat__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.splat.is-live .splat__poster, .splat.is-live .splat__play { display: none; }
.splat__cap { margin-top: 0.75rem; }
@media (max-width: 48rem) { .splat__frame { aspect-ratio: 4 / 5; } }


/* Language switch (Base.astro): one code per available language. With three
   or more they no longer fit the header at mobile width, so from there the
   codes live in the menu panel instead (same links, same order). */
.lang-switch { gap: 0.9rem; }
.lang-switch a { text-decoration: none; }
.lang-switch a:hover, .lang-switch a:focus-visible { text-decoration: underline; text-underline-offset: 0.3em; }
.lang-switch-nav { display: none; }
@media (max-width: 60rem) {
  .head-end > .lang-switch--wide { display: none; }
  .lang-switch-nav { display: flex; align-items: center; min-height: 56px; }
}

/* Footer newsletter (Footer.astro): sign-up posted to worker/index.js, which
   stores the email in D1. On wide screens it is one more column after the
   link columns, headed like them; narrower, it stacks under the nav. */
.footer-newsletter { display: grid; gap: 0.9rem; align-content: start; max-width: 22rem; }
.footer-newsletter h2 { color: var(--ink-60); margin-bottom: 0; }
#nl-form { display: grid; gap: 0.75rem; }
#nl-form[hidden] { display: none; }
.nl-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--ink); }
.nl-row input {
  flex: 1; min-width: 0; min-height: 44px;
  font: inherit; font-size: 0.9rem; color: var(--ink);
  background: transparent; border: 0; border-radius: 0;
  padding: 0.5rem 0;
}
.nl-row input::placeholder { color: var(--ink-60); opacity: 1; }
.nl-submit {
  flex: none; width: 44px; min-height: 44px;
  display: grid; place-items: center;
  background: none; border: 0; color: var(--ink); cursor: pointer;
  transition: transform 0.25s var(--ease);
}
.nl-submit svg { width: 18px; height: 18px; }
.nl-submit:hover { transform: translateX(3px); }
.nl-submit:disabled { opacity: 0.4; cursor: default; transform: none; }
.footer-newsletter .consent { font-size: 0.8rem; color: var(--ink-60); }
.footer-newsletter .consent a { text-decoration: underline; text-underline-offset: 0.2em; }
.nl-status { color: var(--ink-60); }
@media (prefers-reduced-motion: reduce) { .nl-submit { transition: none; } }
@media (min-width: 62rem) {
  .footer-meta { grid-template-columns: minmax(0, 1fr) minmax(15rem, 17rem); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Footer: TechBehemoths verification badge */
.footer-badge { display: inline-flex; align-items: center; min-height: 44px; }
.footer-badge img { height: 28px; width: auto; display: block; }
