/* =========================================================
   Tywi Digital v3 — grounded, premium, Welsh
   Dark moss + gold + paper. General Sans display, Inter Tight body.
   ========================================================= */

:root {
  /* Palette — Welsh, slightly warmed */
  --bg-deep:    #101b14;       /* mossy charcoal */
  --bg-lifted:  #16241c;
  --bg-card:    #1d2f25;
  --line-dark:  #33443a;
  --muted-dark: #a5b3aa;

  --paper:      #f4f0e2;       /* warm off-white, slightly oat */
  --paper-deep: #ece5cf;
  --stone:      #e4dcc4;
  --line-light: #d3cab1;
  --muted-light:#575f55;
  --ink:        #17201a;       /* near-black on paper */

  --gold:       #c9a24b;
  --gold-bright:#dcb75f;
  --gold-text:  #8a6c1f;       /* AA on paper */
  --gold-deep:  #6b5318;
  --green:      #9cbf8a;
  --green-deep: #4d7240;
  --blue:       #5b94a6;
  --blue-deep:  #335b69;

  /* Type */
  --f-display: "General Sans", "Inter Tight", system-ui, sans-serif;
  --f-body:    "Inter Tight", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --ease-smooth:    cubic-bezier(.4,0,.2,1);
  --ease-settle:    cubic-bezier(.54,1.16,.44,1);
  --ease-spring:    cubic-bezier(.68,-.1,.32,1.5);
  --ease-pop:       cubic-bezier(.34,1.56,.64,1);
  --ease-accordion: cubic-bezier(.77,0,.175,1);
  --ease-fast:      cubic-bezier(.16,1,.3,1);

  --r-12: 12px; --r-16: 16px; --r-20: 20px; --r-30: 30px;
  --r-40: 40px; --r-pill: 9999px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
/* Anchor targets land clear of the fixed header */
[id] { scroll-margin-top: 96px; }
body {
  background: var(--bg-deep);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold); color: #1a1407; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
[data-js-theme="light"] :focus-visible { outline-color: var(--gold-deep); }

/* =========================================================
   Paper grain — subtle SVG noise as background texture
   ========================================================= */
/* No blend mode: blending a fixed full-viewport layer forces the
   compositor to re-blend the whole screen on every animation frame. */
.grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* =========================================================
   Typography
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.6rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
}
h2 {
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  letter-spacing: -0.028em;
}
h3 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: -0.02em;
}
h4 {
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
}
em, .italic { font-style: italic; }

/* Gold italic emphasis inside display headings */
h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--gold);
  letter-spacing: -0.02em;
}
[data-js-theme="light"] h1 em,
[data-js-theme="light"] h2 em,
[data-js-theme="light"] h3 em,
.panel--paper h1 em, .panel--paper h2 em, .panel--paper h3 em,
.panel--stone h1 em, .panel--stone h2 em, .panel--stone h3 em {
  color: var(--gold-deep);
}

p { margin: 0; text-wrap: pretty; }

/* Bilingual eyebrow — mono caps + Welsh italic */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted-dark);
  font-weight: 400;
}
[data-js-theme="light"] .eyebrow { color: var(--muted-light); }
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.eyebrow .cy {
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--gold);
}
[data-js-theme="light"] .eyebrow .cy { color: var(--gold-deep); }

/* Subtle drop cap helper (used on inner pages) */
.dropcap::first-letter {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 4.5em;
  float: left;
  line-height: 0.85;
  padding: 0.1em 0.18em 0 0;
  color: var(--gold);
}

/* =========================================================
   Layout
   ========================================================= */
.page {
  position: relative;
  padding: 96px 14px 14px;
}
@media (min-width: 768px) { .page { padding: 110px 18px 18px; } }
@media (min-width: 1200px){ .page { padding: 120px 22px 22px; } }

.panel {
  position: relative;
  border-radius: var(--r-40);
  padding: clamp(48px, 7vw, 110px) clamp(22px, 6vw, 88px);
  margin: 14px 0;
  overflow: hidden;
}
@media (min-width: 1024px) { .panel { border-radius: 52px; margin: 18px 0; } }
@media (min-width: 1400px) { .panel { border-radius: 64px; padding: 120px 110px; margin: 22px 0; } }

.panel--dark {
  background: var(--bg-lifted);
  color: var(--paper);
  box-shadow:
    inset 0 0 140px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.04);
}
.panel--paper {
  background: var(--paper);
  color: var(--ink);
  box-shadow:
    inset 0 0 140px rgba(160,140,100,0.14),
    inset 20px 20px 50px rgba(130,115,80,0.05);
}
.panel--stone {
  background: var(--stone);
  color: var(--ink);
  box-shadow:
    inset 0 0 140px rgba(120,108,80,0.16);
}

.panel--paper .eyebrow, .panel--stone .eyebrow { color: var(--muted-light); }
.panel--paper .eyebrow .cy, .panel--stone .eyebrow .cy { color: var(--gold-deep); }

.section + .section { margin-top: clamp(72px, 10vw, 160px); }

.section__head {
  max-width: 880px;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section__head--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.section__head .lede {
  margin-top: 24px;
  font-size: clamp(1.05rem, 1.25vw, 1.2rem);
  max-width: 58ch;
  opacity: 0.78;
  font-weight: 400;
  line-height: 1.55;
}

/* =========================================================
   Header
   ========================================================= */
.header {
  position: fixed; top: 14px; left: 14px; right: 14px;
  z-index: 50;
  padding: 13px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  border-radius: var(--r-pill);
  background: rgba(16, 27, 20, 0.55);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    inset 0 0 80px rgba(0,0,0,0.18),
    0 14px 40px rgba(0,0,0,0.25);
  transition: background 200ms;
}
@media (min-width: 768px) { .header { top: 18px; left: 18px; right: 18px; padding: 13px 24px; } }
@media (min-width: 1200px){ .header { top: 22px; left: 22px; right: 22px; } }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  isolation: isolate;
  transition: transform 260ms var(--ease-pop), text-shadow 260ms ease, color 220ms ease;
}
@media (max-width: 480px) {
  .brand { font-size: 18px; gap: 9px; }
  .brand__mark { width: 24px; height: 24px; }
}
.brand .ampersand,
.brand em {
  font-style: italic;
  color: var(--gold);
  margin: 0 1px;
  transition: color 260ms ease;
}
.brand__mark {
  width: 30px; height: 30px;
  position: relative;
  display: inline-grid;
  place-items: center;
}
.brand__mark::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(243,238,221,0.08) 0%, rgba(243,238,221,0) 28%),
    linear-gradient(180deg, #e5bd61 0%, #c9a24b 56%, #a77e2d 100%);
  clip-path: circle(50% at 50% 50%);
  transform: translateY(115%) scale(0.92);
  transform-origin: 50% 100%;
  opacity: 0;
  transition:
    transform 520ms var(--ease-spring),
    opacity 320ms ease,
    box-shadow 320ms ease;
  box-shadow: 0 0 0 0 rgba(201,162,75,0);
}
.brand__mark svg {
  width: 100%; height: 100%; display: block;
  position: relative;
  z-index: 1;
  overflow: visible;
}
.brand__mark svg circle,
.brand__mark svg path {
  transition:
    stroke 320ms ease,
    fill 420ms ease,
    transform 520ms var(--ease-spring),
    opacity 260ms ease;
  transform-origin: center;
  transform-box: fill-box;
}
.brand > span:last-child { position: relative; }
.brand > span:last-child::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -0.08em;
  height: 1px;
  background: linear-gradient(90deg, rgba(201,162,75,0), rgba(201,162,75,0.9), rgba(201,162,75,0));
  transform: scaleX(0.18);
  transform-origin: 50% 50%;
  opacity: 0;
  transition: transform 420ms var(--ease-settle), opacity 260ms ease;
}
.brand:hover,
.brand:focus-visible {
  transform: translateY(-1px);
  text-shadow: 0 10px 28px rgba(201,162,75,0.12);
}
.brand:hover .brand__mark::before,
.brand:focus-visible .brand__mark::before {
  transform: translateY(0) scale(1);
  opacity: 1;
  box-shadow: 0 10px 24px -10px rgba(201,162,75,0.45);
}
.brand:hover .brand__mark svg circle,
.brand:focus-visible .brand__mark svg circle {
  stroke: rgba(243,238,221,0.78);
  transform: scale(1.03);
}
.brand:hover .brand__mark svg path,
.brand:focus-visible .brand__mark svg path {
  stroke: rgba(20,32,26,0.88);
  transform: translateY(-0.4px);
}
.brand:hover > span:last-child::after,
.brand:focus-visible > span:last-child::after {
  transform: scaleX(1);
  opacity: 1;
}
.brand:hover .ampersand,
.brand:hover em,
.brand:focus-visible .ampersand,
.brand:focus-visible em {
  color: #ead6a1;
}

.nav { display: none; }
@media (min-width: 900px) {
  .nav {
    display: flex; gap: 2px; align-items: center;
  }
  .nav a {
    padding: 9px 13px;
    border-radius: var(--r-pill);
    font-size: 14.5px;
    color: rgba(244,240,226,0.78);
    transition: background 180ms, color 180ms;
  }
  .nav a:hover { background: rgba(255,255,255,0.07); color: var(--paper); }
}

/* 900–1150px: header stacks — brand centred, nav + CTA on a row below */
@media (min-width: 900px) and (max-width: 1150px) {
  .header {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 12px;
    border-radius: 30px;
  }
  .header .brand { flex: 1 0 100%; justify-content: center; }
  .header .nav { flex-wrap: wrap; justify-content: center; }
  .page { padding-top: 168px; }
}

/* =========================================================
   Language toggle — floating action button (bottom-right)
   ========================================================= */
.lang-toggle {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 80;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  padding: 5px;
  border-radius: 999px;
  background: rgba(16, 27, 20, 0.78);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    inset 0 0 0 1px rgba(244,240,226,0.10),
    0 18px 40px -16px rgba(0,0,0,0.45);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition:
    transform 320ms var(--ease-pop),
    background 200ms,
    box-shadow 200ms;
  animation: lang-toggle-in 700ms var(--ease-spring) 600ms both;
}
.lang-toggle:hover {
  transform: translateY(-2px);
  background: rgba(16, 27, 20, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(244,240,226,0.16),
    0 24px 50px -18px rgba(0,0,0,0.55);
}
.lang-toggle:active { transform: translateY(0); }
.lang-toggle:disabled,
.lang-toggle.is-loading {
  cursor: wait;
  opacity: 0.82;
}
.lang-toggle:disabled:hover,
.lang-toggle.is-loading:hover { transform: none; }

@keyframes lang-toggle-in {
  from { opacity: 0; transform: translate(16px, 16px) scale(0.7); }
  to   { opacity: 1; transform: none; }
}

.lang-toggle__opt {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  text-align: center;
  color: rgba(244,240,226,0.6);
  transition: color 360ms var(--ease-fast);
  pointer-events: none;
  user-select: none;
  font-weight: 500;
}
.lang-toggle__pill {
  position: absolute;
  top: 5px; bottom: 5px; left: 5px;
  width: calc(50% - 5px);
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 4px 14px -4px rgba(201,162,75,0.5);
  transition: transform 520ms var(--ease-spring);
  transform: translateX(0);
}
.lang-toggle[data-lang="cy"] .lang-toggle__pill { transform: translateX(100%); }
.lang-toggle[data-lang="en"] .lang-toggle__opt[data-l="en"],
.lang-toggle[data-lang="cy"] .lang-toggle__opt[data-l="cy"] {
  color: #1a1407;
}

@media (max-width: 600px) {
  .lang-toggle { bottom: 16px; right: 16px; font-size: 11px; }
  .lang-toggle__opt { padding: 8px 14px; }
}

.lang-toggle--mobile {
  position: static;
  margin: 0 0 22px;
  align-self: start;
  background: rgba(255,255,255,0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 1px rgba(244,240,226,0.10);
  animation: none;
}
.lang-toggle--mobile:hover { transform: none; }

/* Wave swap animation state */
.i18n-out {
  opacity: 0 !important;
  filter: blur(4px);
  transform: translateY(6px);
  transition:
    opacity 240ms var(--ease-fast),
    filter 240ms var(--ease-fast),
    transform 280ms var(--ease-fast) !important;
}
.i18n-in {
  animation: i18n-in 420ms var(--ease-fast) both;
}
@keyframes i18n-in {
  from { opacity: 0; filter: blur(4px); transform: translateY(-6px); }
  to   { opacity: 1; filter: none;     transform: none; }
}

[data-i18n], [data-i18n-auto] {
  transition:
    opacity 260ms var(--ease-fast),
    filter 260ms var(--ease-fast),
    transform 300ms var(--ease-fast);
}

.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  padding: 0;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  flex-shrink: 0;
  position: relative;
  z-index: 101;
  transition: background 200ms;
}
.menu-btn:hover { background: rgba(255,255,255,0.12); }
.menu-btn .bars {
  position: relative;
  width: 18px; height: 12px;
}
.menu-btn .bars::before,
.menu-btn .bars::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: var(--paper);
  transition: transform 380ms var(--ease-spring), top 320ms var(--ease-fast), bottom 320ms var(--ease-fast);
}
.menu-btn .bars::before { top: 1px; }
.menu-btn .bars::after  { bottom: 1px; }
.menu-btn.is-open .bars::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.menu-btn.is-open .bars::after {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}
@media (min-width: 900px) { .menu-btn { display: none; } }

/* =========================================================
   Mobile overlay menu
   ========================================================= */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  visibility: hidden;
}
.mobile-menu.is-open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-menu__panel {
  position: absolute;
  inset: 0;
  background: var(--bg-deep);
  overflow: hidden;
  clip-path: circle(0% at calc(100% - 36px) 42px);
  transition: clip-path 720ms var(--ease-fast);
}
.mobile-menu.is-open .mobile-menu__panel {
  clip-path: circle(160% at calc(100% - 36px) 42px);
}

.mobile-menu__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
}
.mobile-menu__bg path {
  fill: none;
  stroke: rgba(244,240,226,0.18);
  stroke-width: 1;
}
.mobile-menu__bg path.river {
  stroke: var(--gold);
  stroke-width: 1.4;
  opacity: 0.7;
}

.mobile-menu__inner {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 90px 28px 32px;
  max-width: 540px;
  margin-left: auto;
  width: 100%;
}

.mobile-menu__eyebrow {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-dark);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-fast), transform 700ms var(--ease-fast);
  transition-delay: 200ms;
}
.mobile-menu__eyebrow .cy {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold);
}
.mobile-menu.is-open .mobile-menu__eyebrow {
  opacity: 1; transform: none;
}

.mobile-menu__nav {
  align-self: center;
  display: grid;
  gap: 6px;
  padding: 24px 0;
}
.mobile-menu__nav a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 7.5vw, 2.8rem);
  letter-spacing: -0.028em;
  line-height: 1.05;
  color: var(--paper);
  border-bottom: 1px solid rgba(244,240,226,0.08);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 700ms var(--ease-fast),
    transform 800ms var(--ease-fast),
    color 200ms;
  transition-delay: calc(var(--i, 0) * 70ms + 280ms);
}
.mobile-menu.is-open .mobile-menu__nav a {
  opacity: 1; transform: none;
}
.mobile-menu__nav a:hover { color: var(--gold); }
.mobile-menu__nav a:active { color: var(--gold); }
.mobile-menu__nav a .cy {
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  font-size: 0.42em;
  letter-spacing: 0;
  margin-left: 12px;
  align-self: center;
  opacity: 0.85;
  white-space: nowrap;
}
.mobile-menu__nav a .arrow {
  font-family: var(--f-body);
  font-style: normal;
  color: var(--muted-dark);
  font-size: 0.4em;
  margin-left: auto;
  transition: transform 280ms var(--ease-pop), color 200ms;
}
.mobile-menu__nav a:hover .arrow {
  color: var(--gold);
  transform: translate(4px, -4px);
}

.mobile-menu__foot {
  display: grid;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-fast), transform 700ms var(--ease-fast);
  transition-delay: 740ms;
}
.mobile-menu.is-open .mobile-menu__foot {
  opacity: 1; transform: none;
}
.mobile-menu__foot .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1407;
  font-weight: 500;
  font-size: 15px;
  transition: background 200ms;
}
.mobile-menu__foot .cta:hover { background: var(--gold-bright); }
.mobile-menu__foot .meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.mobile-menu__foot .meta a:hover { color: var(--gold); }

body.menu-open { overflow: hidden; }

.mobile-menu__close {
  position: absolute;
  top: 24px; right: 22px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(244,240,226,0.06);
  box-shadow: inset 0 0 0 1px rgba(244,240,226,0.18);
  color: var(--paper);
  display: grid; place-items: center;
  opacity: 0;
  transform: scale(0.7) rotate(-45deg);
  transition:
    opacity 500ms var(--ease-fast),
    transform 600ms var(--ease-spring),
    background 200ms;
  transition-delay: 360ms;
  z-index: 5;
}
.mobile-menu.is-open .mobile-menu__close {
  opacity: 1;
  transform: none;
}
.mobile-menu__close:hover {
  background: var(--gold);
  color: var(--ink);
}
.mobile-menu__close svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  border-radius: var(--r-pill);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  transition: transform 220ms var(--ease-pop), background 200ms, color 200ms, box-shadow 200ms, translate 300ms var(--ease-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn .arr { transition: transform 240ms var(--ease-pop); display: inline-block; }
.btn:hover .arr { transform: translate(3px, -3px); }

.btn--primary {
  background: var(--paper); color: var(--ink);
  box-shadow: 0 10px 26px -10px rgba(0,0,0,0.4);
}
.btn--primary:hover { background: white; box-shadow: 0 16px 36px -12px rgba(0,0,0,0.45); }

[data-js-theme="light"] .btn--primary {
  background: var(--ink); color: var(--paper);
}
[data-js-theme="light"] .btn--primary:hover { background: #2b3a30; }

.btn--gold {
  background: var(--gold); color: #1a1407;
  box-shadow: 0 10px 26px -10px rgba(201,162,75,0.5);
}
.btn--gold:hover { background: var(--gold-bright); }

.btn--ghost {
  background: transparent;
  color: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.btn--ghost:hover { background: rgba(255,255,255,0.06); }
[data-js-theme="light"] .btn--ghost {
  color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18);
}
[data-js-theme="light"] .btn--ghost:hover { background: rgba(0,0,0,0.04); }

.btn--small { padding: 11px 18px; font-size: 14px; }

/* Kept for older templates that reference it */
.river-rail { display: none; }

/* =========================================================
   HERO — pinned scrollytelling split, three acts
   The shell provides the scroll runway; the hero pins inside it.
   JS drives --hp (0..1 progress) and data-phase (0|1|2).
   ========================================================= */
.hero-shell {
  position: relative;
  margin: 0;
  padding: 0;
}
.hero {
  padding: 0;
  min-height: min(calc(100svh - 128px), 880px);
  display: grid;
}
@media (min-width: 1000px) and (prefers-reduced-motion: no-preference) {
  .hero-shell { height: 430vh; }
  .hero-shell .hero {
    position: sticky;
    top: 14px;
    height: calc(100svh - 28px);
    min-height: 0;
    margin: 0;
  }
}
/* =========================================================
   The valley scene — night breaks into dawn as you scroll.
   Every layer reads --hp (0..1). Each animated layer is its
   own compositor surface: transform + opacity only, no
   blend modes, no filters on anything that moves per frame.
   ========================================================= */
.hero__scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  transform: scale(calc(1 + var(--hp, 0) * 0.06));
  transform-origin: 60% 72%;
  will-change: transform;
}

.scene-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #070f0b 0%, #0d1d15 42%, #143126 66%, #1b4231 78%, #12241a 100%);
}

/* Dawn — a warm horizon that swells as the story progresses.
   Timed to hold back so act one stays properly nocturnal. */
.scene-dawn {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(95% 66% at 52% 60%, rgba(240,190,102,0.55) 0%, rgba(206,126,74,0.22) 42%, transparent 70%),
    linear-gradient(180deg, rgba(20,40,30,0) 26%, rgba(214,160,74,0.16) 58%, rgba(26,20,7,0) 100%);
  opacity: calc((var(--hp, 0) - 0.12) * 1.14);
  will-change: opacity;
}

/* Crescent moon — high in the night sky, sets as the sun rises */
.scene-moon {
  position: absolute;
  left: 31%;
  top: 12%;
  width: clamp(48px, 5vw, 72px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #eaeedf 0%, #c6d1c0 62%, rgba(198,209,192,0) 74%);
  box-shadow: 0 0 34px 8px rgba(222,233,218,0.16);
  transform: translate(calc(var(--hp, 0) * -5vw), calc(var(--hp, 0) * 16vh)) scale(calc(1 - var(--hp, 0) * 0.15));
  opacity: calc(0.9 - var(--hp, 0) * 1.7);
  will-change: transform, opacity;
}
.scene-moon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 66% 38%, #0c1b13 56%, transparent 58%);
}

/* High clouds — drift at rest, catch the dawn light */
.scene-cloud {
  position: absolute;
  height: 46px;
  border-radius: 999px;
  background:
    radial-gradient(60% 100% at 40% 55%, rgba(190,205,195,0.10), transparent 74%),
    radial-gradient(42% 88% at 72% 40%, rgba(190,205,195,0.07), transparent 76%);
  will-change: transform;
}
.scene-cloud::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(60% 100% at 40% 55%, rgba(240,200,130,0.16), transparent 74%),
    radial-gradient(42% 88% at 72% 40%, rgba(240,200,130,0.10), transparent 76%);
  opacity: calc((var(--hp, 0) - 0.15) * 1.2);
}
.scene-cloud--a {
  top: 19%; left: 6%;
  width: min(320px, 26vw);
  animation: cloud-drift 64s ease-in-out infinite alternate;
}
.scene-cloud--b {
  top: 27%; right: 5%;
  width: min(420px, 32vw);
  animation: cloud-drift 82s ease-in-out -30s infinite alternate-reverse;
}
@keyframes cloud-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(48px); }
}

/* Birds — arrive with first light, gliding across the valley */
.scene-birds {
  position: absolute;
  top: 24%;
  left: 58%;
  width: clamp(120px, 12vw, 180px);
  opacity: calc((var(--hp, 0) - 0.55) * 2.2);
  animation: birds-glide 46s linear infinite;
  will-change: transform, opacity;
}
.scene-birds path {
  fill: none;
  stroke: rgba(23,32,26,0.75);
  stroke-width: 2.4;
  stroke-linecap: round;
}
@keyframes birds-glide {
  from { transform: translate(6vw, 1vh); }
  to   { transform: translate(-46vw, -5vh); }
}

/* Stars — twinkle at rest, fade as dawn arrives */
.scene-starfield {
  position: absolute;
  inset: 0;
  opacity: calc(1 - var(--hp, 0) * 1.5);
  will-change: opacity;
}
.scene-stars {
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 2px;
  border-radius: 50%;
}
.scene-stars--a {
  box-shadow:
    60px 44px 0 0.6px rgba(244,240,226,0.8),
    190px 122px 0 0.2px rgba(244,240,226,0.55),
    310px 64px 0 0.7px rgba(244,240,226,0.9),
    430px 168px 0 0.1px rgba(244,240,226,0.5),
    560px 92px 0 0.5px rgba(244,240,226,0.75),
    700px 52px 0 0.3px rgba(244,240,226,0.6),
    845px 142px 0 0.6px rgba(244,240,226,0.85),
    985px 74px 0 0.2px rgba(244,240,226,0.55),
    1120px 112px 0 0.5px rgba(244,240,226,0.8),
    1265px 44px 0 0.3px rgba(244,240,226,0.6),
    1385px 132px 0 0.6px rgba(244,240,226,0.85),
    1505px 84px 0 0.2px rgba(244,240,226,0.5);
  animation: star-twinkle 4.2s ease-in-out infinite alternate;
}
.scene-stars--b {
  box-shadow:
    122px 206px 0 0.4px rgba(244,240,226,0.6),
    244px 32px 0 0.6px rgba(244,240,226,0.8),
    382px 112px 0 0.2px rgba(244,240,226,0.5),
    522px 194px 0 0.5px rgba(244,240,226,0.7),
    662px 142px 0 0.3px rgba(244,240,226,0.55),
    802px 92px 0 0.6px rgba(244,240,226,0.85),
    942px 182px 0 0.2px rgba(244,240,226,0.5),
    1082px 40px 0 0.5px rgba(244,240,226,0.75),
    1222px 152px 0 0.3px rgba(244,240,226,0.6),
    1342px 72px 0 0.6px rgba(244,240,226,0.8),
    1462px 184px 0 0.2px rgba(244,240,226,0.5),
    92px 92px 0 0.4px rgba(244,240,226,0.65);
  animation: star-twinkle 5.6s ease-in-out -2.4s infinite alternate;
}
@keyframes star-twinkle {
  from { opacity: 1; }
  to   { opacity: 0.35; }
}

/* A shooting star crosses the night sky every so often */
.scene-shooting {
  position: absolute;
  top: 15%;
  left: 68%;
  width: 110px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(244,240,226,0), rgba(244,240,226,0.9));
  opacity: 0;
  transform: rotate(-24deg) translateX(0);
  animation: shooting-star 13s linear infinite 4s;
  will-change: transform, opacity;
}
@keyframes shooting-star {
  0%, 88% { opacity: 0; transform: rotate(-24deg) translateX(0); }
  90%     { opacity: 0.9; }
  95%     { opacity: 0; transform: rotate(-24deg) translateX(-360px); }
  100%    { opacity: 0; transform: rotate(-24deg) translateX(-360px); }
}

/* The sun — rises from behind the ridges in the open corridor
   between the copy and the project stack */
.scene-sun {
  position: absolute;
  left: 48%;
  top: 56%;
  width: clamp(100px, 12vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #f8eecb 0%, #eec573 52%, rgba(238,197,115,0) 74%);
  box-shadow:
    0 0 70px 26px rgba(238,197,115,0.45),
    0 0 200px 100px rgba(214,150,66,0.25);
  transform: translate(-50%, calc(20vh - var(--hp, 0) * 52vh)) scale(calc(0.85 + var(--hp, 0) * 0.3));
  opacity: calc(var(--hp, 0) * 2 - 0.24);
  will-change: transform, opacity;
}

/* Hill ridges — four depths, each its own composited layer */
.scene-ridge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}
.scene-ridge--4 { transform: translate(0, calc(var(--hp, 0) * -6px)); }
.scene-ridge--3 { transform: translate(calc(var(--hp, 0) * -16px), calc(var(--hp, 0) * -2px)); }
.scene-ridge--2 { transform: translate(calc(var(--hp, 0) * -34px), calc(var(--hp, 0) * 6px)); }
.scene-ridge--1 { transform: translate(calc(var(--hp, 0) * -56px), calc(var(--hp, 0) * 14px)); }
.scene-ridge--4 path { fill: #2c503d; }
.scene-ridge--3 path { fill: #223e2f; }
.scene-ridge--2 path { fill: #172c20; }
.scene-ridge--1 path { fill: #0c1911; }

/* A cottage on the ridge — its window lights up at first light.
   Opacity flips with data-phase (twice per journey), never per frame. */
.cottage .cottage-body,
.cottage .cottage-chimney { fill: #0e1d14; }
.cottage .cottage-window {
  fill: #f0c776;
  opacity: 0;
  transition: opacity 1200ms var(--ease-fast);
}
.hero[data-phase="2"] .cottage .cottage-window { opacity: 0.95; }

/* The Tywi — draws itself down the valley with scroll, and turns
   golden as the sun climbs (JS scrubs stroke-dashoffset) */
.scene-river {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
  transform: translate(calc(var(--hp, 0) * -44px), calc(var(--hp, 0) * 10px));
}
.scene-river .river {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scene-river .river--under {
  stroke: rgba(91,148,166,0.28);
  stroke-width: 14;
}
.scene-river .river--main {
  stroke: rgba(186,228,232,0.9);
  stroke-width: 5;
}
.scene-river .river--dawnlit {
  stroke: rgba(240,199,118,0.95);
  stroke-width: 3.5;
  opacity: calc((var(--hp, 0) - 0.15) * 1.12);
}
@media (min-width: 1000px) and (prefers-reduced-motion: no-preference) {
  .hero-shell .scene-river .river--main,
  .hero-shell .scene-river .river--dawnlit {
    stroke-dasharray: 1000;
    stroke-dashoffset: 760;
  }
}
.scene-river .river--glint {
  stroke: rgba(244,240,226,0.9);
  stroke-width: 1.8;
  stroke-dasharray: 18 62 8 110;
  opacity: 0.65;
  animation: tywi-current 14s linear infinite;
}
@keyframes tywi-current {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -1000; }
}

/* Warm light washing over the foreground as the sun climbs */
.scene-glowwash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(205deg, rgba(238,190,105,0.18) 0%, transparent 46%),
    radial-gradient(60% 42% at 52% 62%, rgba(238,190,105,0.3), transparent 70%);
  opacity: calc((var(--hp, 0) - 0.14) * 1.05);
  will-change: opacity;
}

/* Sunlight pooling where the river meets the valley floor */
.scene-riverglow {
  position: absolute;
  left: 43%;
  top: 87%;
  width: min(360px, 30vw);
  height: 100px;
  transform: translate(-50%, -50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(240,199,118,0.32), transparent 70%);
  opacity: calc((var(--hp, 0) - 0.2) * 1.1);
  will-change: opacity;
}

/* Fireflies over the night valley — pulse gently, gone by dawn */
.scene-fireflies {
  position: absolute;
  left: 30%;
  top: 72%;
  opacity: calc(0.85 - var(--hp, 0) * 1.5);
  will-change: opacity;
}
.scene-fireflies__dots {
  width: 3px; height: 3px;
  border-radius: 50%;
  box-shadow:
    12px 24px 0 1px rgba(238,197,115,0.75),
    96px 64px 0 0.5px rgba(238,197,115,0.55),
    198px 30px 0 1px rgba(238,197,115,0.7),
    286px 80px 0 0.5px rgba(238,197,115,0.5),
    358px 44px 0 1px rgba(238,197,115,0.65),
    52px 96px 0 0.5px rgba(238,197,115,0.5);
  animation: firefly-pulse 3.8s ease-in-out infinite alternate;
}
@keyframes firefly-pulse {
  from { opacity: 1; }
  to   { opacity: 0.25; }
}

/* Valley mist — soft gradients (no blur filters), burns off at dawn */
.scene-mist {
  position: absolute;
  left: -10%; right: -10%;
  height: 120px;
  background:
    radial-gradient(50% 55% at 42% 50%, rgba(198,224,214,0.11), transparent 72%),
    radial-gradient(46% 60% at 68% 46%, rgba(198,224,214,0.08), transparent 74%);
  opacity: calc(0.9 - var(--hp, 0) * 0.75);
  will-change: transform, opacity;
}
.scene-mist--a { top: 58%; animation: mist-drift 30s ease-in-out infinite alternate; }
.scene-mist--b { top: 70%; height: 140px; animation: mist-drift 24s ease-in-out -12s infinite alternate-reverse; }
@keyframes mist-drift {
  from { transform: translateX(-3%); }
  to   { transform: translateX(3%); }
}

@media (prefers-reduced-motion: reduce) {
  /* Static mid-dawn tableau */
  .hero__scene { transform: none !important; }
  .scene-dawn { opacity: 0.55 !important; }
  .scene-sun {
    opacity: 1 !important;
    transform: translate(-50%, -10vh) scale(1) !important;
  }
  .scene-starfield { opacity: 0.35 !important; }
  .scene-shooting { display: none !important; }
  .scene-mist { opacity: 0.35 !important; }
  .scene-moon { opacity: 0.15 !important; transform: none !important; }
  .scene-birds { opacity: 0.5 !important; transform: none !important; }
  .scene-fireflies { opacity: 0 !important; }
  .scene-riverglow { opacity: 0.5 !important; }
  .cottage .cottage-window { opacity: 0.95 !important; }
  .scene-river .river--main,
  .scene-river .river--dawnlit {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
  .scene-river .river--dawnlit { opacity: 0.5 !important; }
}

.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(40px, 5vw, 72px);
  padding: clamp(48px, 6vw, 80px) clamp(22px, 5vw, 80px);
  width: 100%;
}
@media (min-width: 1000px) {
  .hero__inner { grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); }
}

.hero__copy {
  max-width: 620px;
  /* counter-parallax against the shot choreography — instant scroll feedback */
  transform: translateY(calc(var(--hp, 0) * -64px));
}

.hero__h {
  margin-top: 26px;
  color: var(--paper);
  font-size: clamp(2.5rem, 4.6vw, 4.3rem);
  line-height: 1.04;
}
.hero__sub {
  margin-top: 24px;
  max-width: 44ch;
  font-size: clamp(1.02rem, 1.2vw, 1.15rem);
  line-height: 1.55;
  color: rgba(244,240,226,0.8);
}
.hero__ctas {
  margin-top: 36px;
  display: flex; gap: 12px; flex-wrap: wrap;
}

/* Entry choreography — copy rises, shots settle in */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * {
    opacity: 0;
    transform: translateY(26px);
    animation: hero-rise 900ms var(--ease-fast) forwards;
  }
  .hero__copy > .eyebrow  { animation-delay: 80ms; }
  .hero__copy > .hero__h  { animation-delay: 180ms; }
  .hero__copy > .hero__sub { animation-delay: 300ms; }
  .hero__copy > .hero__ctas { animation-delay: 420ms; }

  /* Entry lives on the container so the shots' own transforms stay free
     for the scroll-phase choreography */
  .hero__visual {
    opacity: 0;
    animation: hero-settle 1100ms var(--ease-fast) 300ms forwards;
  }
}
@keyframes hero-rise {
  to { opacity: 1; transform: none; }
}
@keyframes hero-settle {
  from { opacity: 0; transform: translateY(34px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__stage {
  display: grid;
  gap: 24px;
  align-content: center;
}

.hero__visual {
  position: relative;
  min-height: clamp(340px, 36vw, 520px);
}
.hero__visual .shot {
  position: absolute;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow:
    0 40px 80px -30px rgba(0,0,0,0.6),
    0 0 0 1px rgba(244,240,226,0.09);
  transform: rotate(var(--tilt, 0deg));
  translate: var(--px, 0) var(--py, 0);
  will-change: transform, translate, opacity;
}
.hero__visual .shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
}
.hero__visual .shot--a {
  --tilt: -1.2deg;
  top: 2%; left: 0;
  width: 76%;
  aspect-ratio: 16 / 10;
  z-index: 3;
}
.hero__visual .shot--b {
  --tilt: 1.6deg;
  top: 44%; right: 0;
  width: 58%;
  aspect-ratio: 16 / 10;
  z-index: 2;
}
.hero__visual .shot--c {
  --tilt: -2.2deg;
  top: 72%; left: 4%;
  width: 40%;
  aspect-ratio: 16 / 9;
  z-index: 1;
}

/* Act choreography lives in script-v2.js — each scroll frame
   interpolates the shots between keyframe poses (frame-locked). */

/* Story captions — one per act, crossfading in sync with the shots */
.hero__story {
  display: grid;
  min-height: 92px;
  align-items: start;
}
.story-item {
  grid-area: 1 / 1;
  display: grid;
  gap: 6px;
  justify-items: start;
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 350ms var(--ease-fast),
    transform 420ms var(--ease-fast),
    visibility 0s 350ms;
}
.hero[data-phase="0"] .story-item:nth-child(1),
.hero[data-phase="1"] .story-item:nth-child(2),
.hero[data-phase="2"] .story-item:nth-child(3) {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 400ms var(--ease-fast) 80ms,
    transform 480ms var(--ease-fast) 80ms,
    visibility 0s;
}
.story-item__meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.story-item strong {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  color: var(--paper);
}
.story-item__cta {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--gold);
  font-weight: 500;
  font-size: 14.5px;
}
.story-item__cta .arr { transition: transform 240ms var(--ease-pop); }
.story-item:hover .story-item__cta .arr { transform: translateX(4px); }

/* Act rail — three segments filling with scroll progress */
.hero__acts {
  display: flex;
  gap: 8px;
  width: min(220px, 60%);
  margin-top: 4px;
}
.hero__acts span {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(244,240,226,0.16);
  position: relative;
  overflow: hidden;
}
/* Fill boundaries match the act hold points (0.29 / 0.65 / 1) */
.hero__acts span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform-origin: 0 50%;
  transform: scaleX(clamp(0, calc(var(--hp, 0) / 0.29), 1));
}
.hero__acts span:nth-child(2)::after { transform: scaleX(clamp(0, calc((var(--hp, 0) - 0.29) / 0.36), 1)); }
.hero__acts span:nth-child(3)::after { transform: scaleX(clamp(0, calc((var(--hp, 0) - 0.65) / 0.35), 1)); }

@media (max-width: 999px) {
  .hero { min-height: 0; }
  .hero__stage { gap: 18px; }
  .hero__visual { min-height: 0; }
  .hero__visual .shot { position: relative; width: 100%; }
  .hero__visual .shot--a { aspect-ratio: 16 / 10; }
  .hero__visual .shot--b,
  .hero__visual .shot--c { display: none; }
  /* Static mid-dawn tableau on small screens */
  .hero__copy { transform: none; }
  .hero__scene { transform: none; }
  .scene-dawn { opacity: 0.55; }
  .scene-sun { opacity: 1; transform: translate(-50%, -8vh) scale(1); }
  .scene-starfield { opacity: 0.35; }
  .scene-mist { opacity: 0.35; }
  .scene-moon { opacity: 0.15; transform: none; }
  .scene-birds { opacity: 0.5; }
  .scene-fireflies { opacity: 0; }
  .scene-riverglow { opacity: 0.5; }
  .cottage .cottage-window { opacity: 0.95; }
  .hero__acts { display: none; }
}

/* =========================================================
   Results strip
   ========================================================= */
.stats { padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(40px, 5vw, 72px); }
.stats__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 820px) {
  .stats__row { grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 64px); }
}
.stat-item {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-left: 24px;
  border-left: 1px solid rgba(244,240,226,0.14);
}
.stat-item__value {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 4.4vw, 3.8rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--gold);
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.stat-item__value small {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--muted-dark);
}
.stat-item__label {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted-dark);
  max-width: 34ch;
}

/* =========================================================
   Work — asymmetric case study grid
   ========================================================= */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) {
  .work-grid { grid-template-columns: repeat(12, 1fr); }
  .work-card:nth-child(4n+1) { grid-column: span 7; }
  .work-card:nth-child(4n+2) { grid-column: span 5; }
  .work-card:nth-child(4n+3) { grid-column: span 5; }
  .work-card:nth-child(4n)   { grid-column: span 7; }
}

.work-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--r-30);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 320ms var(--ease-pop), box-shadow 320ms;
}
.work-card:hover {
  transform: translateY(-4px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 30px 60px -30px rgba(0,0,0,0.5);
}
/* Gold cursor glow, matching the .card treatment */
.work-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(201,162,75,0.09), transparent 65%);
  opacity: 0;
  transition: opacity 280ms;
}
.work-card { position: relative; }
.work-card:hover::after { opacity: 1; }
.work-card__art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 36px) 0;
  display: flex;
  align-items: flex-end;
}
.work-card__shot {
  width: 100%;
  border-radius: 10px 10px 0 0;
  box-shadow:
    0 -1px 0 rgba(255,255,255,0.12),
    0 24px 48px -18px rgba(0,0,0,0.55);
  transform: translateY(8px);
  transition: transform 500ms var(--ease-fast);
}
.work-card:hover .work-card__shot { transform: translateY(0); }
.work-card__body {
  padding: 26px 28px 30px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.work-card__type {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dark);
}
.work-card__body h3 { font-size: clamp(1.4rem, 1.8vw, 1.7rem); }
.work-card__body p {
  font-size: 15px;
  color: rgba(244,240,226,0.72);
  line-height: 1.55;
  max-width: 52ch;
}
.work-card__cta {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--gold);
  font-weight: 500;
  font-size: 15px;
}
.work-card__cta .arr { transition: transform 240ms var(--ease-pop); }
.work-card:hover .work-card__cta .arr { transform: translateX(4px); }

/* Post-portfolio CTA — the moment interest peaks */
.work-cta {
  margin-top: clamp(36px, 4vw, 56px);
  text-align: center;
  display: grid;
  gap: 18px;
  justify-items: center;
}
.work-cta p {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  color: var(--gold);
}

/* =========================================================
   Services — editorial rows + specialist links
   ========================================================= */
.svc-rows {
  border-top: 1px solid rgba(244,240,226,0.1);
}
.svc-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: clamp(28px, 3.6vw, 48px) 0;
  border-bottom: 1px solid rgba(244,240,226,0.1);
}
@media (min-width: 860px) {
  .svc-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(32px, 5vw, 88px); }
}
.svc-row__title h3 {
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
}
.svc-row__title .cy {
  display: block;
  margin-top: 10px;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  color: var(--gold);
  opacity: 0.85;
}
.svc-row__body p {
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(244,240,226,0.76);
  max-width: 58ch;
}
.svc-row__tags {
  list-style: none;
  margin: 18px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.svc-row__tags li {
  padding: 8px 15px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  color: rgba(244,240,226,0.82);
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.spec-links { margin-top: clamp(44px, 5vw, 72px); }
.spec-links__intro {
  font-size: 15px;
  color: var(--muted-dark);
  margin-bottom: 18px;
}
.spec-links__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.spec-link {
  padding: 22px;
  border-radius: var(--r-20);
  background: rgba(255,255,255,0.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  display: grid;
  gap: 10px;
  align-content: start;
  transition:
    transform 220ms var(--ease-pop),
    background 180ms,
    color 180ms,
    box-shadow 180ms;
}
.spec-link:hover {
  transform: translateY(-2px);
  background: var(--gold);
  color: #1a1407;
  box-shadow: 0 24px 40px -28px rgba(201,162,75,0.55);
}
.spec-link strong {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.spec-link span {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted-dark);
  transition: color 180ms;
}
.spec-link:hover span { color: rgba(26,20,7,0.75); }

/* =========================================================
   Cynefin + studio — the paper chapter
   ========================================================= */
/* Faint contour lines — the valley motif carried into daylight */
.cynefin-chapter::before {
  content: "";
  position: absolute;
  right: -160px;
  top: -40px;
  width: 680px;
  height: 680px;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='680' height='680' viewBox='0 0 680 680'><g fill='none' stroke='%2317201a' stroke-width='1.4' opacity='0.06'><path d='M0 90 C110 50 230 130 340 90 C450 50 570 120 680 80'/><path d='M0 185 C110 145 230 225 340 185 C450 145 570 215 680 175'/><path d='M0 280 C110 240 230 320 340 280 C450 240 570 310 680 270'/><path d='M0 375 C110 335 230 415 340 375 C450 335 570 405 680 365'/><path d='M0 470 C110 430 230 510 340 470 C450 430 570 500 680 460'/><path d='M0 565 C110 525 230 605 340 565 C450 525 570 595 680 555'/></g></svg>");
}

.cynefin {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}
.cynefin .eyebrow { justify-content: center; }
.cynefin .word {
  display: block;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(3.6rem, 10.5vw, 8rem);
  color: var(--ink);
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin-top: 20px;
  padding-bottom: 0.1em; /* italic descender reserve (y) */
}
.cynefin .desc {
  margin: clamp(24px, 3vw, 40px) auto 0;
  font-size: clamp(1.08rem, 1.4vw, 1.3rem);
  line-height: 1.55;
  max-width: 58ch;
  color: rgba(23,32,26,0.82);
}

.studio {
  margin-top: clamp(64px, 8vw, 120px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
  padding-top: clamp(36px, 4vw, 56px);
  border-top: 1px solid var(--line-light);
}
@media (min-width: 960px) {
  .studio { grid-template-columns: 1.4fr 1fr; }
}
.studio__copy { display: grid; gap: 20px; }
.studio__lede {
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  line-height: 1.45;
  color: var(--ink);
  max-width: 52ch;
  font-weight: 500;
}
.studio__body {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--muted-light);
  max-width: 58ch;
}
.studio__place {
  margin-top: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.studio__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: start;
}
.studio__spec {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(23,32,26,0.05);
  box-shadow: inset 0 0 0 1px rgba(23,32,26,0.1);
  transition: background 200ms, color 200ms, transform 240ms var(--ease-pop);
  cursor: default;
}
.studio__spec:hover {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

/* =========================================================
   Standards — bento grid
   ========================================================= */
.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(12, 1fr); grid-auto-rows: minmax(240px, auto); }
  .bento-cell--photo { grid-column: 1 / 5; grid-row: 1 / 3; }
  .bento-cell--stat  { grid-column: 5 / 10; }
  .bento-cell--perf  { grid-column: 10 / 13; }
  .bento-cell:nth-child(4) { grid-column: 5 / 9; }
  .bento-cell--green { grid-column: 9 / 13; }
}

.bento-cell {
  position: relative;
  border-radius: var(--r-30);
  padding: clamp(26px, 2.6vw, 36px);
  background: rgba(255,255,255,0.55);
  box-shadow: inset 0 0 0 1px rgba(20,32,26,0.08);
  display: grid;
  gap: 12px;
  align-content: start;
  overflow: hidden;
}
.bento-cell h3 { font-size: clamp(1.25rem, 1.7vw, 1.55rem); }
.bento-cell p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted-light);
  max-width: 46ch;
}
.bento-cell__big {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.8rem, 4.5vw, 4.2rem);
  letter-spacing: -0.045em;
  line-height: 0.95;
  color: var(--ink);
}
.bento-cell__link {
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--gold-deep);
}
.bento-cell__link .arr { transition: transform 220ms var(--ease-pop); }
.bento-cell__link:hover .arr { transform: translateX(3px); }

.bento-cell--stat {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(201,162,75,0.2), transparent 60%),
    rgba(255,255,255,0.55);
  box-shadow: inset 0 0 0 1px rgba(138,108,31,0.22);
}
.bento-cell--stat .bento-cell__big { color: var(--gold-deep); }

.bento-cell--green {
  background:
    radial-gradient(120% 90% at 100% 100%, rgba(156,191,138,0.32), transparent 60%),
    rgba(255,255,255,0.55);
  box-shadow: inset 0 0 0 1px rgba(77,114,64,0.2);
}

.bento-cell--photo {
  padding: 0;
  min-height: 380px;
}
.bento-cell--photo img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.bento-cell__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 96px 28px 28px;
  background: linear-gradient(180deg, rgba(13,20,15,0) 0%, rgba(13,20,15,0.78) 55%, rgba(13,20,15,0.92) 100%);
  display: grid;
  gap: 8px;
}
.bento-cell__caption h3 { color: var(--paper); }
.bento-cell__caption p { color: rgba(244,240,226,0.82); }

/* =========================================================
   Process — vertical timeline w/ scroll-active step
   ========================================================= */
.process {
  position: relative;
  display: grid;
  gap: 0;
}
.process__step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line-light);
  align-items: start;
  position: relative;
}
@media (min-width: 800px) {
  .process__step { grid-template-columns: 120px 1.2fr 2fr; gap: 48px; }
}
.process__step:last-child { border-bottom: 0; }
.process__step .step-num {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  letter-spacing: -0.04em;
  color: var(--gold-deep);
  line-height: 0.9;
  opacity: 0.4;
  transition: opacity 500ms var(--ease-fast), transform 500ms var(--ease-fast);
}
.panel--dark .process__step { border-bottom-color: rgba(255,255,255,0.07); }
.panel--dark .process__step .step-num { color: var(--gold); }
.process__step.active .step-num {
  opacity: 1;
  transform: translateX(6px);
}
.process__step h3 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}
.process__step .desc {
  color: var(--muted-light);
  font-size: 1.02rem;
  max-width: 56ch;
  line-height: 1.55;
}
.panel--dark .process__step .desc { color: rgba(244,240,226,0.72); }
.process__step .cy {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  color: var(--gold-deep);
  font-size: 14px;
  margin-top: 8px;
  display: block;
}
.panel--dark .process__step .cy { color: var(--gold); }

/* =========================================================
   Cards — shared with service + case study templates
   ========================================================= */
.grid-cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--r-30);
  padding: 32px 30px;
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.22),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(201,162,75,0.10), transparent 60%);
  opacity: 0; transition: opacity 280ms;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
[data-js-theme="light"] .card {
  background: rgba(255,255,255,0.65);
  box-shadow:
    inset 0 0 80px rgba(140,128,90,0.10),
    inset 0 0 0 1px rgba(0,0,0,0.05);
}
[data-js-theme="light"] .card::before {
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), rgba(138,108,31,0.12), transparent 60%);
}

.card .ord {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  color: var(--gold);
  line-height: 1;
}
[data-js-theme="light"] .card .ord { color: var(--gold-deep); }
.card h3 { margin-top: 16px; }
.card p {
  margin-top: 14px;
  color: rgba(244,240,226,0.72);
  font-size: 15.5px;
  line-height: 1.55;
}
[data-js-theme="light"] .card p { color: var(--muted-light); }

/* =========================================================
   Editorial split — shared with service templates
   ========================================================= */
.split {
  display: grid; gap: clamp(36px, 5vw, 84px);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 1000px) { .split { grid-template-columns: 1.05fr 0.95fr; } }

.editorial h2 em { color: var(--gold-deep); font-style: italic; }
.editorial .body {
  margin-top: 28px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted-light);
  max-width: 56ch;
}
.editorial .body + .body { margin-top: 16px; }
.editorial .body:first-of-type { color: var(--ink); font-size: 1.18rem; line-height: 1.55; }

.feature-list {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; gap: 0;
  font-size: 1rem;
}
.feature-list li {
  display: flex; align-items: baseline; gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-light);
}
.feature-list li:last-child { border-bottom: 0; }
.feature-list li .num {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  color: var(--gold-deep);
  font-size: 15px;
  flex-shrink: 0;
  width: 30px;
}
.feature-list li .txt {
  font-size: 1.02rem;
  color: var(--ink);
}
.panel--dark .feature-list li { border-bottom-color: rgba(255,255,255,0.07); }
.panel--dark .feature-list li .num { color: var(--gold); }
.panel--dark .feature-list li .txt { color: var(--paper); }

/* Kept for service templates */
.svc-card__cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.15rem;
}
.svc-card__cta .arr { transition: transform 240ms var(--ease-pop); }
.svc-card__cta:hover .arr { transform: translateX(4px); }

/* =========================================================
   Testimonials — paired quotes
   ========================================================= */
.quotes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) { .quotes { grid-template-columns: 1fr 1fr; } }

.quote-card {
  margin: 0;
  padding: clamp(32px, 3.4vw, 44px);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-30);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.05),
    0 20px 60px -30px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}
.quote-card blockquote {
  margin: 0 0 30px; padding: 0;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.quote-card .who {
  display: flex; align-items: center; gap: 14px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line-light);
}
.quote-card .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.avatar--harley {
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(255,255,255,0.7), transparent 48%),
    linear-gradient(135deg, rgba(201,162,75,0.72), rgba(244,240,226,0.95));
}
.avatar--luke {
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(255,255,255,0.66), transparent 48%),
    linear-gradient(135deg, rgba(91,148,166,0.52), rgba(244,240,226,0.95));
}
.quote-card .meta {
  font-size: 13.5px;
  color: var(--muted-light);
  line-height: 1.4;
}
.quote-card .meta strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
  font-size: 14.5px;
}

/* =========================================================
   Free review — split with checklist
   ========================================================= */
.review__grid {
  display: grid; gap: clamp(36px, 5vw, 72px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 1000px) { .review__grid { grid-template-columns: 1.05fr 0.95fr; } }

.review__copy { display: grid; gap: 26px; justify-items: start; }
.review__copy p {
  font-size: clamp(1.02rem, 1.2vw, 1.15rem);
  line-height: 1.6;
  color: rgba(244,240,226,0.78);
  max-width: 52ch;
}

.checklist {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: 1fr;
  gap: 0 28px;
}
@media (min-width: 640px) { .checklist { grid-template-columns: 1fr 1fr; } }
.checklist li {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(244,240,226,0.1);
  font-weight: 500;
  font-size: 1.02rem;
}
.checklist li .ico {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(201,162,75,0.16);
  color: var(--gold);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(201,162,75,0.32);
  transition: background 220ms, color 220ms, transform 280ms var(--ease-pop);
}
.checklist li .ico svg {
  width: 18px; height: 18px;
  display: block;
}
.checklist li:hover .ico {
  background: var(--gold);
  color: var(--ink);
  transform: rotate(-6deg) scale(1.06);
}

/* =========================================================
   FAQ — editorial accordion
   ========================================================= */
.faq {
  display: grid; gap: 0;
  max-width: 1000px;
  margin: clamp(28px, 3vw, 44px) auto 0;
  border-top: 1px solid var(--line-light);
}
.faq-item {
  border-bottom: 1px solid var(--line-light);
  overflow: hidden;
}
.faq-item:not([open]) .faq-a {
  display: block !important;
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}
.faq-item .faq-a {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 0;
  transition:
    max-height 0.55s var(--ease-accordion),
    opacity 0.45s var(--ease-fast) 0.05s,
    padding 0.45s var(--ease-accordion);
}
.faq-item.is-open .faq-a {
  max-height: 600px;
  opacity: 1;
  padding-bottom: 28px;
}
.panel--dark .faq { border-top-color: rgba(244,240,226,0.1); }
.panel--dark .faq-item { border-bottom-color: rgba(244,240,226,0.1); }

.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 26px 4px;
  text-align: left;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.faq-q .chev {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: transparent;
  color: var(--gold-deep);
  box-shadow: inset 0 0 0 1px var(--line-light);
  flex-shrink: 0;
  transition: transform 0.5s var(--ease-accordion), background 200ms, color 200ms;
}
.panel--dark .faq-q .chev { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(244,240,226,0.18); }
.faq-item[open] .faq-q .chev {
  transform: rotate(135deg);
  background: var(--gold);
  color: var(--ink);
}
.faq-a {
  padding: 0 4px 28px;
  max-width: 78ch;
  color: var(--muted-light);
  font-size: 1.02rem;
  line-height: 1.6;
}
.panel--dark .faq-a { color: rgba(244,240,226,0.75); }

.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }

/* =========================================================
   Contact
   ========================================================= */
.contact {
  display: grid; gap: clamp(40px, 5vw, 72px);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 1000px) { .contact { grid-template-columns: 0.85fr 1.15fr; } }

.contact__lede {
  margin-top: 26px;
  color: rgba(244,240,226,0.78);
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: 44ch;
}
.contact__details {
  list-style: none;
  padding: 0;
  margin: 44px 0 0;
  display: grid;
  gap: 13px;
  font-size: 15px;
  color: var(--muted-dark);
}
.contact__details a { color: var(--paper); transition: color 180ms; }
.contact__details a:hover { color: var(--gold); }
.contact__place {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  font-size: 1.08rem;
}

/* What happens next — quiet reassurance beside the form */
.contact__next {
  list-style: none;
  counter-reset: next;
  padding: 36px 0 0;
  margin: 36px 0 0;
  border-top: 1px solid rgba(244,240,226,0.1);
  display: grid;
  gap: 18px;
  max-width: 46ch;
}
.contact__next li {
  counter-increment: next;
  position: relative;
  padding-left: 42px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted-dark);
}
.contact__next li::before {
  content: counter(next);
  position: absolute;
  left: 0; top: 0;
  width: 27px; height: 27px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(201,162,75,0.38);
}
.contact__next strong {
  color: var(--paper);
  font-weight: 500;
}

.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; }
.field label {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--muted-dark); letter-spacing: 0.18em;
  text-transform: uppercase;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 16px 18px;
  background: rgba(244,240,226,0.04);
  color: var(--paper);
  border-radius: var(--r-16);
  box-shadow: inset 0 0 0 1px rgba(244,240,226,0.1);
  font-family: var(--f-body); font-size: 16px;
  transition: box-shadow 180ms, background 180ms;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  background: rgba(244,240,226,0.06);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.field textarea { min-height: 140px; resize: vertical; }
.form .consent { font-size: 13px; color: var(--muted-dark); }
.form .submit { margin-top: 8px; justify-self: start; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  margin: 14px 0 14px;
  padding: clamp(56px, 7vw, 120px) clamp(22px, 6vw, 88px) clamp(40px, 4vw, 64px);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(91,148,166,0.05), transparent 70%),
    var(--bg-deep);
  border-radius: var(--r-40);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  overflow: hidden;
  position: relative;
}
/* Night returns as the visitor leaves the valley */
.footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 2px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.55;
  box-shadow:
    80px 54px 0 0.5px rgba(244,240,226,0.7),
    230px 130px 0 0.2px rgba(244,240,226,0.5),
    390px 70px 0 0.6px rgba(244,240,226,0.8),
    540px 170px 0 0.2px rgba(244,240,226,0.45),
    690px 96px 0 0.5px rgba(244,240,226,0.65),
    840px 48px 0 0.3px rgba(244,240,226,0.55),
    990px 150px 0 0.6px rgba(244,240,226,0.75),
    1140px 84px 0 0.2px rgba(244,240,226,0.5),
    1290px 120px 0 0.5px rgba(244,240,226,0.7),
    1440px 60px 0 0.3px rgba(244,240,226,0.55);
  animation: star-twinkle 5s ease-in-out infinite alternate;
}
.footer__wordmark {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(4.4rem, 16vw, 14rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  padding-bottom: 0.14em; /* room for descenders under background-clip */
  text-align: center;
  position: relative;
  margin-bottom: 60px;
  background:
    radial-gradient(circle 280px at var(--mx, -400px) var(--my, -400px),
                    rgba(201, 162, 75, 1) 0%,
                    rgba(201, 162, 75, 0.55) 28%,
                    rgba(201, 162, 75, 0) 65%),
    linear-gradient(
      100deg,
      rgba(201, 162, 75, 0) 0%,
      rgba(201, 162, 75, 0) 38%,
      rgba(201, 162, 75, 1) 50%,
      rgba(201, 162, 75, 0) 62%,
      rgba(201, 162, 75, 0) 100%
    ),
    linear-gradient(rgba(244, 240, 226, 0.3), rgba(244, 240, 226, 0.3));
  background-size: 100% 100%, 220% 100%;
  background-repeat: no-repeat, no-repeat;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: wordmark-spotlight 12s linear infinite;
  cursor: default;
}
.footer__wordmark em { font-style: italic; }
@keyframes wordmark-spotlight {
  0%   { background-position: 0 0, 110% 50%, 0 0; }
  100% { background-position: 0 0, -110% 50%, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .footer__wordmark { animation: none; }
}

.footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  position: relative;
}
@media (min-width: 900px) { .footer__top { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer__brand { max-width: 38ch; }
.footer__brand .blurb { color: var(--muted-dark); font-size: 14.5px; margin-top: 18px; line-height: 1.55; }
.footer__col h2, .footer__col h5 {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--gold);
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer__col a { color: rgba(244,240,226,0.78); font-size: 14.5px; }
.footer__col a:hover { color: var(--gold); }
.footer__bottom {
  margin-top: clamp(56px, 6vw, 84px);
  padding-top: 28px;
  border-top: 1px solid rgba(244,240,226,0.08);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--f-mono); font-size: 11.5px;
  color: var(--muted-dark);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* =========================================================
   Reveal classes — driven by IntersectionObserver in JS
   ========================================================= */
.words { display: inline; }
.words .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.words .w span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 900ms var(--ease-fast);
  transition-delay: calc(var(--i, 0) * 38ms);
}
.words.in .w span { transform: none; }

.line-rise {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 900ms var(--ease-fast),
    transform 1000ms var(--ease-fast);
  transition-delay: var(--rd, 0ms);
  will-change: opacity, transform;
}
.line-rise.in { opacity: 1; transform: none; }

.fade-x {
  opacity: 0;
  transform: translateX(-16px);
  transition:
    opacity 800ms var(--ease-fast),
    transform 900ms var(--ease-fast);
  transition-delay: var(--rd, 0ms);
  will-change: opacity, transform;
}
.fade-x.in { opacity: 1; transform: none; }

.rise-scale {
  opacity: 0;
  transform: translateY(36px) scale(0.97);
  transition:
    opacity 1000ms var(--ease-fast),
    transform 1100ms var(--ease-fast);
  transition-delay: var(--rd, 0ms);
  will-change: opacity, transform;
}
.rise-scale.in { opacity: 1; transform: none; }

/* =========================================================
   Utility
   ========================================================= */
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.mt-cta { margin-top: clamp(36px, 4vw, 56px); }
.center { text-align: center; }
.maxw-md { max-width: 760px; }
.maxw-lg { max-width: 1100px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* =========================================================
   Mobile design — comprehensive tablet & phone tuning
   ========================================================= */

@media (max-width: 900px) {
  .page { padding: 86px 10px 10px; }

  .panel {
    padding: clamp(40px, 8vw, 64px) clamp(20px, 5vw, 36px);
    border-radius: 32px;
    margin: 10px 0;
  }

  .section + .section { margin-top: clamp(56px, 10vw, 100px); }

  /* Hero */
  .hero { border-radius: 32px; }
  .hero__inner { padding: 40px 22px 44px; gap: 36px; }
  .hero__h { font-size: clamp(2.1rem, 8.4vw, 3rem); margin-top: 20px; }
  .hero__sub { font-size: 1rem; margin-top: 18px; }
  .hero__ctas { margin-top: 28px; }
  .hero__ctas .btn { justify-content: center; flex: 1 1 auto; }

  /* Header */
  .header {
    top: 10px; left: 10px; right: 10px;
    padding: 11px 14px;
  }

  /* Results strip */
  .stat-item { padding-left: 18px; }
  .stat-item__value { font-size: 2.4rem; }
  .stat-item__label { font-size: 13.5px; }

  /* Section heads */
  .section__head { margin-bottom: 36px; }
  .section__head .lede { font-size: 0.98rem; margin-top: 18px; }

  /* Work */
  .work-card__art { padding: 18px 18px 0; }
  .work-card__body { padding: 22px 22px 26px; }
  .work-card__body h3 { font-size: 1.35rem; }

  /* Services */
  .svc-row { padding: 26px 0; gap: 14px; }
  .svc-row__title h3 { font-size: 1.4rem; }
  .svc-row__body p { font-size: 0.98rem; }
  .svc-row__tags li { padding: 7px 12px; font-size: 12.5px; }

  /* Cynefin */
  .cynefin .word { font-size: clamp(3rem, 15vw, 5.5rem); }
  .cynefin .desc { font-size: 1.02rem; }
  .studio { gap: 30px; }
  .studio__lede { font-size: 1.1rem; }
  .studio__spec { padding: 10px 16px; font-size: 13.5px; }

  /* Bento */
  .bento-cell { padding: 24px 22px; border-radius: 24px; }
  .bento-cell--photo { min-height: 340px; }
  .bento-cell__big { font-size: 2.6rem; }

  /* Editorial split (service pages) */
  .split { gap: 36px; }
  .editorial h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
  .editorial .body { font-size: 1rem; }
  .editorial .body:first-of-type { font-size: 1.08rem; }
  .feature-list li { padding: 14px 0; gap: 14px; }
  .feature-list li .txt { font-size: 0.98rem; }

  /* Cards */
  .grid-cards { gap: 12px; grid-template-columns: 1fr; }
  .card { padding: 24px 22px; border-radius: 22px; }
  .card h3 { font-size: 1.3rem; }

  /* Process */
  .process__step {
    grid-template-columns: 56px 1fr;
    gap: 18px;
    padding: 22px 0;
  }
  .process__step .step-num { font-size: 2rem; }
  .process__step h3 { font-size: 1.3rem; }
  .process__step .desc {
    grid-column: 1 / -1;
    font-size: 0.98rem;
    margin-top: 4px;
  }
  .process__step .cy { font-size: 13px; }

  /* Quotes */
  .quote-card { padding: 28px 24px; border-radius: 24px; }
  .quote-card blockquote { font-size: 1.2rem; }

  /* Review */
  .review__grid { gap: 32px; }
  .checklist { grid-template-columns: 1fr; gap: 0; }
  .checklist li { font-size: 0.98rem; padding: 13px 0; }

  /* FAQ */
  .faq-q { padding: 20px 4px; font-size: 1.08rem; }
  .faq-q .chev { width: 36px; height: 36px; }
  .faq-a { font-size: 0.98rem; }
  .faq-item.is-open .faq-a { padding-bottom: 22px; }

  /* Contact */
  .contact { gap: 36px; }
  .form .row { grid-template-columns: 1fr; }
  .field input, .field textarea, .field select {
    padding: 14px 16px;
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }

  /* Footer */
  .footer {
    padding: 56px 22px 32px;
    border-radius: 32px;
  }
  .footer__wordmark { font-size: clamp(3rem, 17vw, 6rem); margin-bottom: 40px; }
  .footer__top { gap: 32px; }
  .footer__col h2, .footer__col h5 { margin-bottom: 12px; font-size: 1rem; }
  .footer__bottom { font-size: 10.5px; }

  .btn { padding: 15px 22px; font-size: 14.5px; }
  .btn--small { padding: 11px 16px; font-size: 13px; }
}

/* ---------- Phone ---------- */
@media (max-width: 560px) {
  .panel {
    padding: 44px 18px;
    border-radius: 26px;
  }
  .page { padding: 80px 8px 8px; }

  .hero { border-radius: 26px; }
  .hero__inner { padding: 34px 18px 38px; }

  .header { padding: 10px 14px; gap: 8px; }
  .header .btn--small {
    padding: 9px 14px;
    font-size: 12.5px;
  }

  h1 { font-size: clamp(2rem, 9.5vw, 2.7rem) !important; }
  h2 { font-size: clamp(1.6rem, 7vw, 2.2rem) !important; }
  h3 { font-size: clamp(1.15rem, 5vw, 1.45rem) !important; }

  .cynefin .word { font-size: clamp(2.7rem, 16vw, 4.4rem); }

  .footer__wordmark { font-size: clamp(2.4rem, 21vw, 4.2rem); }
}

/* Tiny phones */
@media (max-width: 380px) {
  .panel { padding: 36px 16px; border-radius: 22px; }
  .hero { border-radius: 22px; }
  .nav { display: none; }
  .header > div > .btn--primary { display: none; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .hero__copy > *, .hero__visual, .hero__visual .shot { opacity: 1 !important; animation: none !important; }
  .hero__copy { transform: none !important; }
  .words .w span, .line-rise, .fade-x, .rise-scale { transform: none !important; opacity: 1 !important; }
}

/* =========================================================
   Final sparkle pass — extra stars, twinkles and micro-life
   ========================================================= */

/* Third hero star layer, offset twinkle phase */
.scene-stars--c {
  box-shadow:
    36px 156px 0 0.4px rgba(244,240,226,0.55),
    150px 66px 0 0.6px rgba(244,240,226,0.75),
    268px 232px 0 0.2px rgba(244,240,226,0.45),
    356px 26px 0 0.5px rgba(244,240,226,0.7),
    472px 138px 0 0.3px rgba(244,240,226,0.5),
    604px 232px 0 0.6px rgba(244,240,226,0.8),
    738px 22px 0 0.2px rgba(244,240,226,0.5),
    866px 116px 0 0.5px rgba(244,240,226,0.7),
    1002px 226px 0 0.3px rgba(244,240,226,0.55),
    1148px 24px 0 0.6px rgba(244,240,226,0.75),
    1276px 196px 0 0.2px rgba(244,240,226,0.45),
    1414px 106px 0 0.5px rgba(244,240,226,0.65),
    1540px 226px 0 0.3px rgba(244,240,226,0.5),
    696px 306px 0 0.4px rgba(244,240,226,0.45);
  animation: star-twinkle 6.8s ease-in-out -1.2s infinite alternate;
}

/* Second shooting star, different corner and cadence */
.scene-shooting--b {
  top: 7%;
  left: 30%;
  width: 90px;
  transform: rotate(-16deg) translateX(0);
  animation: shooting-star 17s linear infinite 9s;
}

/* Footer: stars already twinkle; a shooting star crosses occasionally */
.footer::after {
  content: "";
  position: absolute;
  top: 10%;
  left: 70%;
  width: 90px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(244,240,226,0), rgba(244,240,226,0.75));
  opacity: 0;
  transform: rotate(-20deg) translateX(0);
  animation: shooting-star 19s linear infinite 6s;
  pointer-events: none;
  will-change: transform, opacity;
}

/* Fireflies drift over the free-review dusk */
.review::before {
  content: "";
  position: absolute;
  top: 18%;
  left: 6%;
  width: 3px; height: 3px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    48px 36px 0 0.5px rgba(238,197,115,0.4),
    296px 128px 0 1px rgba(238,197,115,0.32),
    512px 58px 0 0.5px rgba(238,197,115,0.38),
    788px 208px 0 1px rgba(238,197,115,0.3),
    1024px 44px 0 0.5px rgba(238,197,115,0.36),
    1188px 160px 0 1px rgba(238,197,115,0.3);
  animation: firefly-pulse 4.6s ease-in-out infinite alternate;
}

/* Micro-life on hover */
.bento-cell,
.quote-card {
  transition: transform 320ms var(--ease-pop), box-shadow 320ms;
}
.bento-cell:hover,
.quote-card:hover {
  transform: translateY(-4px);
}
.stat-item {
  transition: transform 300ms var(--ease-pop);
}
.stat-item__value {
  transition: text-shadow 300ms;
}
.stat-item:hover {
  transform: translateY(-3px);
}
.stat-item:hover .stat-item__value {
  text-shadow: 0 0 26px rgba(201,162,75,0.45);
}

/* =========================================================
   Sparkle boost — deeper twinkles, bright sparkle layers,
   properly visible footer stars
   ========================================================= */

/* Deeper twinkle contrast site-wide (overrides earlier definition) */
@keyframes star-twinkle {
  from { opacity: 1; }
  to   { opacity: 0.22; }
}
@keyframes star-sparkle {
  from { opacity: 0.2; }
  to   { opacity: 1; }
}

/* Faster, offset phases so the hero sky constantly shimmers */
.scene-stars--a { animation-duration: 3.2s; }
.scene-stars--b { animation-duration: 4.4s; animation-delay: -2.1s; }
.scene-stars--c { animation-duration: 5.4s; animation-delay: -1.1s; }

/* A few bright feature stars that really glint */
.scene-stars--d {
  box-shadow:
    218px 96px 0 1px rgba(250,247,235,0.95),
    506px 178px 0 1.2px rgba(250,247,235,0.9),
    742px 58px 0 1px rgba(250,247,235,0.95),
    968px 148px 0 1.2px rgba(250,247,235,0.9),
    1204px 76px 0 1px rgba(250,247,235,0.95),
    1436px 186px 0 1.2px rgba(250,247,235,0.9),
    118px 258px 0 1px rgba(250,247,235,0.85),
    1330px 288px 0 1px rgba(250,247,235,0.85);
  animation: star-sparkle 1.9s ease-in-out infinite alternate;
}

/* Footer stars — bigger, brighter, twinkling in two offset layers */
.footer::before {
  opacity: 0.85;
  box-shadow:
    80px 54px 0 1px rgba(250,247,235,0.85),
    230px 130px 0 0.6px rgba(244,240,226,0.6),
    390px 70px 0 1.2px rgba(250,247,235,0.9),
    540px 170px 0 0.6px rgba(244,240,226,0.55),
    690px 96px 0 1px rgba(250,247,235,0.8),
    840px 48px 0 0.6px rgba(244,240,226,0.65),
    990px 150px 0 1.2px rgba(250,247,235,0.9),
    1140px 84px 0 0.6px rgba(244,240,226,0.6),
    1290px 120px 0 1px rgba(250,247,235,0.85),
    1440px 60px 0 0.6px rgba(244,240,226,0.65),
    170px 220px 0 0.8px rgba(244,240,226,0.6),
    620px 250px 0 0.8px rgba(244,240,226,0.55),
    1080px 236px 0 0.8px rgba(244,240,226,0.6);
  animation: star-twinkle 4.2s ease-in-out -1.5s infinite alternate;
}
.footer-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.footer-stars::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 2px;
  border-radius: 50%;
  box-shadow:
    140px 92px 0 1px rgba(250,247,235,0.9),
    320px 40px 0 0.6px rgba(244,240,226,0.6),
    470px 210px 0 1px rgba(250,247,235,0.8),
    760px 150px 0 1.2px rgba(250,247,235,0.9),
    920px 60px 0 0.6px rgba(244,240,226,0.6),
    1190px 200px 0 1px rgba(250,247,235,0.85),
    1390px 130px 0 0.6px rgba(244,240,226,0.6),
    1520px 40px 0 1px rgba(250,247,235,0.8);
  animation: star-sparkle 2.4s ease-in-out -0.8s infinite alternate;
}
