/* Fonts are self-hosted (the CSP allows only this origin). Both are variable and OFL-licensed. */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 400 800; font-stretch: 100%; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree-latin.woff2') format('woff2');
  font-weight: 400 700; font-style: normal; font-display: swap;
}

/* Night at the campsite for heads and the footer; morning mist for the content between. */
:root {
  --night: #0c1d15;
  --night-deep: #09160f;
  --pine: #173a2a;
  --pine-raised: #133024;
  --moss: #2a4737;
  --moss-soft: #1f3a2c;
  --fern: #8fb89a;
  --smoke: #eef1e7;
  --smoke-bright: #f4f6ef;
  --smoke-dim: #c3cfc4;
  --muted: #93a697;

  --mist: #edf2ec;
  --mist-deep: #dfe8de;
  --paper: #ffffff;
  --ink: #0f2219;
  --ink-soft: #3f5a4b;
  --line: #d3ddd3;
  /* Form field edges: at least 3:1 against every surface a field sits on (WCAG 1.4.11). */
  --field-edge: #66886f;

  --ember: #f2842b;
  --flame: #ffb25b;
  --coal: #1b0f06;
  /* Orange for text on the light sections, where --ember and --flame fail 4.5:1. */
  --ember-ink: #9a4d12;

  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

  --shell: 82rem;
  --radius-xl: 48px;
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--smoke);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1rem; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 2.5rem; }
@media (max-width: 40rem) { .shell { padding: 0 1rem; } }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--smoke); color: var(--night); padding: 0.6rem 1rem; border-radius: var(--radius-sm); z-index: 60; }

:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 6px; }
.sheet :focus-visible { outline-color: var(--ember-ink); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- header: a floating pill ---------- */
.site-header { position: sticky; top: 0; z-index: 40; padding: 1rem 0 0; }
.nav-pill {
  position: relative;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.6rem 0.6rem 0.6rem 1.4rem;
  border: 1px solid rgba(143, 184, 154, 0.22); border-radius: 999px;
  background: rgba(12, 29, 21, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; margin-right: auto;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; color: var(--smoke);
}
.brand svg { flex: none; }
.brand-tent { fill: none; stroke: var(--smoke); stroke-width: 2.2; stroke-linejoin: round; }
.brand-fire { fill: var(--ember); }

.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  color: var(--smoke-dim); font-size: 0.95rem; font-weight: 500; text-decoration: none;
}
.site-nav a:hover { color: var(--smoke); background: rgba(143, 184, 154, 0.12); }
.site-nav a[aria-current="page"] { color: var(--smoke); background: rgba(143, 184, 154, 0.16); }
.site-nav .nav-contact { display: none; }

.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; line-height: 1;
  padding: 0.32rem 0.55rem; border-radius: 999px;
  background: rgba(242, 132, 43, 0.18); color: var(--flame);
}

.nav-toggle {
  display: none; height: 44px; padding: 0 1.1rem;
  border: 1px solid rgba(195, 207, 196, 0.35); border-radius: 999px;
  background: transparent; color: var(--smoke); font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer;
}

@media (max-width: 62rem) {
  .nav-pill { gap: 0.6rem; }
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; top: calc(100% + 0.5rem); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    padding: 0.75rem; border-radius: var(--radius-md);
    background: var(--night); border: 1px solid rgba(143, 184, 154, 0.22);
    box-shadow: 0 24px 60px rgba(4, 12, 8, 0.5);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.85rem 1rem; font-size: 1.02rem; }
}
@media (max-width: 30rem) {
  .site-header .header-cta { display: none; }
  .site-nav .nav-contact { display: inline-flex; color: var(--flame); }
}

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 52px; padding: 0 1.6rem; border-radius: 999px;
  background: var(--ember); color: var(--coal); border: 1.5px solid var(--ember);
  font-family: var(--sans); font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.button:hover { background: var(--flame); border-color: var(--flame); color: var(--coal); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.button-small { min-height: 44px; padding: 0 1.3rem; font-size: 0.95rem; }
.button-large { min-height: 58px; padding: 0 1.9rem; font-size: 1.08rem; }
/* Outline on dark backgrounds. */
.button-quiet { background: transparent; color: var(--smoke); border-color: rgba(195, 207, 196, 0.4); }
.button-quiet:hover { background: rgba(143, 184, 154, 0.12); border-color: var(--fern); color: var(--smoke); }
/* Outline on the light sheet. */
.button-ink { background: transparent; color: var(--ink); border-color: var(--ink); }
.button-ink:hover { background: var(--ink); border-color: var(--ink); color: var(--smoke); }
.button-solid-ink { background: var(--ink); color: var(--smoke); border-color: var(--ink); }
.button-solid-ink:hover { background: var(--pine); border-color: var(--pine); color: var(--smoke); }

.text-link { color: var(--ink); font-weight: 600; text-underline-offset: 0.2em; text-decoration-thickness: 1.5px; }
.text-link:hover { color: var(--ember-ink); }

/* ---------- home hero ---------- */
.hero { padding: 3.5rem 0 7.5rem; }
.hero .shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 3.5rem; align-items: stretch; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 1.9rem; }
.note-pill {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 0.6rem;
  padding: 0.45rem 1rem 0.45rem 0.8rem; border-radius: 999px;
  border: 1px solid rgba(143, 184, 154, 0.25); font-size: 0.9rem; color: var(--smoke-dim);
}
.note-pill::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ember); flex: none; }
.hero h1 {
  font-weight: 800; font-size: clamp(2.9rem, 5.4vw, 4.75rem); line-height: 0.98; letter-spacing: -0.045em;
  color: var(--smoke-bright);
}
.hero-lede { margin: 0; max-width: 34rem; font-size: 1.2rem; line-height: 1.6; color: var(--smoke-dim); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-stats { margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; }
.hero-stats div { display: flex; flex-direction: column-reverse; gap: 0.2rem; margin: 0; }
.hero-stats dt { font-size: 0.88rem; color: var(--muted); }
.hero-stats dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 2.5rem; line-height: 1.05; letter-spacing: -0.035em; }

.art-panel {
  position: relative; min-height: 34rem; overflow: hidden;
  border-radius: 36px; background: var(--night); border: 1px solid rgba(143, 184, 154, 0.2);
}
.art-panel .hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-note {
  position: absolute; left: 1.4rem; right: 1.4rem; bottom: 1.4rem;
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.9rem 1.1rem; border-radius: 20px;
  background: rgba(12, 29, 21, 0.8); border: 1px solid rgba(143, 184, 154, 0.25);
  backdrop-filter: blur(6px);
}
.art-note-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(242, 132, 43, 0.18); }
.art-note-icon path { fill: none; stroke: var(--flame); stroke-width: 1.8; stroke-linejoin: round; }
.art-note p { margin: 0; display: flex; flex-direction: column; font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
.art-note p span { font-size: 0.82rem; font-weight: 400; color: var(--muted); }
.art-note a { color: var(--smoke); }
.art-note a:hover { color: var(--flame); }

@media (max-width: 62rem) {
  .hero { padding: 2.5rem 0 4.5rem; }
  .hero .shell { grid-template-columns: 1fr; gap: 2rem; }
  .art-panel { min-height: 20rem; order: 1; }
  .hero-stats { order: 2; }
}
@media (max-width: 40rem) {
  .hero-actions .button { flex: 1 1 100%; }
  .hero-stats { gap: 1rem 1.75rem; }
  .hero-stats dd { font-size: 1.9rem; }
  .art-note { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; }
}

/* The campfire scene (lib/art.mjs). The fire is the one moving thing on the site. */
.star { fill: var(--smoke); }
.ridge { fill: var(--night); stroke: var(--fern); stroke-width: 1.1; }
.ground { stroke: var(--fern); stroke-opacity: 0.8; stroke-width: 1.2; }
.pine { fill: var(--night); stroke: var(--fern); stroke-width: 1.3; stroke-linejoin: round; }
.tent-body { fill: var(--night); stroke: var(--smoke-dim); stroke-width: 1.6; stroke-linejoin: round; }
.tent-lit { stroke: var(--flame); stroke-width: 2; stroke-opacity: 0.8; }
.tent-door { fill: none; stroke: var(--smoke-dim); stroke-width: 1.3; }
.tent-line { stroke: var(--smoke-dim); stroke-width: 1.2; }
.log { stroke: #9a5b2c; stroke-width: 5; stroke-linecap: round; }
.flame { fill: url(#flamefill); }
.flame-core { fill: #ffe2a3; }
.spark { fill: var(--flame); opacity: 0; }
.flame, .fire-glow, .spark { transform-box: fill-box; }
.flame { transform-origin: 50% 100%; }
.fire-glow { transform-origin: 50% 70%; }
.flame-back { animation: flicker 2.6s ease-in-out infinite; }
.flame-left { animation: flicker 1.9s ease-in-out infinite reverse; }
.flame-core { animation: flicker 1.4s ease-in-out infinite; }
.fire-glow { animation: breathe 3.8s ease-in-out infinite; }
.spark { animation: rise 3.4s ease-out infinite; }
.spark-2 { animation-delay: 0.9s; }
.spark-3 { animation-delay: 1.8s; }
.spark-4 { animation-delay: 2.6s; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  25% { transform: scale(0.94, 1.07) skewX(-2deg); }
  50% { transform: scale(1.04, 0.95) skewX(1.5deg); }
  75% { transform: scale(0.97, 1.04) skewX(-1deg); }
}
@keyframes breathe { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes rise { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -70px); } }

/* ---------- interior page heads ---------- */
.page-head { padding: 4.5rem 0 6.5rem; }
.page-head .label { margin: 0 0 1rem; color: var(--fern); font-weight: 600; }
.page-head h1 {
  font-weight: 800; font-size: clamp(2.6rem, 5.6vw, 4.6rem); line-height: 1; letter-spacing: -0.045em;
  max-width: 54rem; margin-bottom: 1.5rem; color: var(--smoke-bright);
}
.page-head .lede { margin: 0; max-width: 42rem; font-size: 1.18rem; color: var(--smoke-dim); }
.page-head .hero-actions { margin-top: 2rem; }
@media (max-width: 40rem) { .page-head { padding: 2.5rem 0 4.5rem; } }

.group-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.group-nav a {
  text-decoration: none; font-size: 0.93rem; font-weight: 500; color: var(--smoke-dim);
  border: 1px solid rgba(195, 207, 196, 0.35); border-radius: 999px; padding: 0.45rem 1rem;
}
.group-nav a:hover { color: var(--smoke); border-color: var(--fern); background: rgba(143, 184, 154, 0.12); }

/* ---------- the morning sheet: every page's content ---------- */
.sheet {
  position: relative;
  background: var(--mist); color: var(--ink);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding-bottom: 4rem;
}
@media (max-width: 40rem) { .sheet { border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }
.sheet a:not(.button):hover { color: var(--ember-ink); }

.section { padding: 7rem 0 0; }
.section-first { padding-top: 5rem; }
@media (max-width: 40rem) { .section { padding-top: 4.5rem; } .section-first { padding-top: 3.5rem; } }

.section-title { display: flex; flex-direction: column; gap: 0.9rem; max-width: 48rem; margin-bottom: 3rem; }
.section-title h2 { font-size: clamp(2.2rem, 4.4vw, 3.5rem); line-height: 1.03; letter-spacing: -0.035em; }
.section-title p { margin: 0; font-size: 1.12rem; color: var(--ink-soft); }
.section-title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 2rem; margin-bottom: 2.5rem; }
.section-title-row .section-title { margin-bottom: 0; }

/* Who we build for */
.audience { border-bottom: 1px solid var(--line); }
.audience .shell { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.audience p { margin: 0; font-weight: 600; color: var(--ink-soft); }
.audience ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.audience li { padding: 0.5rem 1.1rem; border-radius: 999px; background: var(--paper); font-size: 0.95rem; font-weight: 500; }

/* Services: a title column beside an editorial list */
.services { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 3rem 6rem; }
.services .section-title { margin-bottom: 0; position: sticky; top: 7rem; align-self: start; }
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 1.5rem; padding: 2rem 0; border-top: 1px solid #cdd8cd; }
.service-list li:last-child { border-bottom: 1px solid #cdd8cd; }
.service-list h3 { font-size: clamp(1.45rem, 2.2vw, 1.85rem); margin-bottom: 0.6rem; }
.service-list p { margin: 0; color: var(--ink-soft); max-width: 38rem; }
.icon-tile { width: 56px; height: 56px; border-radius: 18px; background: var(--ink); display: grid; place-items: center; }
.icon-tile path, .icon-tile rect, .icon-tile circle { fill: none; stroke: var(--flame); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 56rem) {
  .services { grid-template-columns: 1fr; gap: 2rem; }
  .services .section-title { position: static; }
}
@media (max-width: 40rem) { .service-list li { grid-template-columns: 1fr; gap: 1rem; } }

/* ---------- project bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(18rem, auto); gap: 1rem; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 0.7rem;
  padding: 1.75rem; border-radius: var(--radius-lg); background: var(--paper); color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tile:hover, .tile:focus-within { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15, 34, 25, 0.12), inset 0 0 0 3px var(--ember-ink); }
.tile-dark:hover, .tile-dark:focus-within, .tile-night:hover, .tile-night:focus-within { box-shadow: 0 18px 40px rgba(15, 34, 25, 0.2), inset 0 0 0 3px var(--flame); }
.tile-feature { grid-column: span 2; grid-row: span 2; padding: 2.25rem; gap: 1rem; }
.tile-tall { grid-row: span 2; }
.tile-mist { background: var(--mist-deep); }
.tile-dark { background: var(--pine); color: var(--smoke); }
.tile-night { background: var(--ink); color: var(--smoke); }
.tile > .status { align-self: flex-start; }
.tile-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; }
.tile h3 { font-size: 1.6rem; letter-spacing: -0.025em; }
.tile-feature h3 { font-size: 2.5rem; letter-spacing: -0.035em; }
.tile-tall h3 { font-size: 2rem; }
.tile p { margin: 0; font-size: 0.97rem; line-height: 1.55; color: var(--ink-soft); }
.tile-feature p { font-size: 1.08rem; max-width: 30rem; }
.tile-dark p, .tile-night p { color: var(--smoke-dim); }
/* The whole tile is one link: the title's link stretches over the card. */
.tile-link { color: inherit; text-decoration: none; }
.tile-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.tile-link:focus-visible { outline: none; }
.tile-visual { margin-top: auto; }

.status {
  display: inline-block; flex: none; font-size: 0.78rem; font-weight: 700; line-height: 1.2;
  padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--mist); color: var(--ink); white-space: nowrap;
}
.tile-mist .status { background: var(--paper); }
.status-live { background: var(--ink); color: var(--flame); }
.tile-dark .status, .tile-night .status { background: rgba(238, 241, 231, 0.12); color: var(--smoke); }

/* Small drawings inside the tiles */
.paper-mini { border-radius: var(--radius-md); background: var(--mist); padding: 1.25rem 1.4rem; font-variant-numeric: tabular-nums; }
.paper-mini div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.paper-mini div:first-child { border-top: 0; padding-top: 0; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); }
.paper-mini div:last-child { font-weight: 700; font-size: 1.08rem; padding-bottom: 0; }
.roster-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.roster-mini span { height: 40px; border-radius: 10px; background: var(--fern); }
.roster-mini .day { height: auto; background: none; font-size: 0.75rem; color: var(--muted); text-align: center; }
.roster-mini .off { background: rgba(143, 184, 154, 0.25); }
.roster-mini .refused { background: none; border: 2px dashed var(--ember); }
.roster-note { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.8rem; font-size: 0.88rem; color: var(--flame); }
.roster-note::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); flex: none; }
.check-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; font-size: 0.9rem; }
.check-mini li { display: flex; align-items: center; gap: 0.6rem; }
.check-mini li::before { content: ''; width: 18px; height: 18px; border-radius: 6px; background: var(--moss); flex: none; }
.check-mini .todo { color: var(--ink-soft); }
.check-mini .todo::before { background: none; border: 2px solid var(--field-edge); }
.state-mini { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.state-mini span { padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--mist); font-size: 0.82rem; font-weight: 600; }
.state-mini span:first-child { background: var(--ink); color: var(--smoke); }
.rows-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; font-size: 0.9rem; }
.rows-mini li { display: flex; justify-content: space-between; gap: 1rem; }
.rows-mini .ok { color: var(--moss); font-weight: 600; }
.rows-mini .due { color: var(--ember-ink); font-weight: 600; }
.tag-mini { display: inline-flex; align-items: center; gap: 0.75rem; padding: 0.65rem 1rem 0.65rem 0.8rem; border-radius: var(--radius-sm); background: var(--paper); font-size: 0.88rem; line-height: 1.35; }
.tag-mini::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--moss); flex: none; }
.tag-mini strong { display: block; }
.chain-mini { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.chain-mini span { padding: 0.45rem 0.6rem; border-radius: 10px; background: var(--ink); color: var(--fern); font-size: 0.8rem; font-weight: 600; }
.chain-mini span:last-child { color: var(--flame); }
.chain-mini i { width: 12px; height: 2px; background: var(--field-edge); }
.loop-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--smoke-dim); }
.loop-mini li { display: flex; justify-content: space-between; gap: 1rem; }
.loop-mini li:last-child { color: var(--flame); }

@media (max-width: 68rem) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-feature { grid-column: span 2; grid-row: span 1; }
  .tile-tall { grid-row: span 1; }
}
@media (max-width: 40rem) {
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .tile-feature { grid-column: span 1; padding: 1.6rem; }
  .tile-feature h3 { font-size: 2rem; }
  .tile { min-height: 14rem; }
}

/* ---------- project dialog ---------- */
.project-dialog {
  width: min(58rem, calc(100% - 2rem)); max-height: calc(100% - 3rem);
  margin: auto; padding: 0; border: 0; border-radius: 36px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px rgba(4, 12, 8, 0.45);
  overflow-y: auto; overscroll-behavior: contain;
}
.project-dialog::backdrop { background: rgba(9, 22, 15, 0.7); backdrop-filter: blur(3px); }
.dialog-body { position: relative; padding: 3rem 3.25rem 3.25rem; }
.dialog-content { display: flex; flex-direction: column; gap: 2rem; }
.dialog-close {
  position: absolute; top: 1.4rem; right: 1.4rem; z-index: 1;
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--mist); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.dialog-close:hover { background: var(--mist-deep); }
.dialog-close path { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.dialog-head { display: flex; flex-direction: column; gap: 0.9rem; padding-right: 3.5rem; }
.dialog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.95rem; color: var(--ink-soft); }
.dialog-head h2 { font-weight: 800; font-size: clamp(2.4rem, 5vw, 3.5rem); line-height: 1; letter-spacing: -0.04em; }
.dialog-summary { margin: 0; font-size: 1.2rem; line-height: 1.55; color: var(--ink-soft); }
.dialog-video {
  margin: 0; aspect-ratio: 16 / 9; border-radius: var(--radius-md); background: var(--night); color: var(--smoke);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; padding: 1.5rem;
}
.dialog-video-play { width: 72px; height: 72px; border-radius: 50%; border: 2px solid rgba(238, 241, 231, 0.4); display: grid; place-items: center; }
.dialog-video-play path { fill: none; stroke: var(--smoke); stroke-width: 1.8; stroke-linejoin: round; }
.dialog-video figcaption { display: flex; flex-direction: column; gap: 0.3rem; }
.dialog-video strong { font-size: 1.05rem; }
.dialog-video span { font-size: 0.95rem; color: var(--smoke-dim); }
.dialog-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.dialog-stats li { border-radius: 20px; background: var(--mist); padding: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.dialog-stats strong { font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1.05; letter-spacing: -0.03em; }
.dialog-stats span { font-size: 0.88rem; line-height: 1.45; color: var(--ink-soft); }
.dialog-section h3 { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.dialog-section p { margin: 0; line-height: 1.7; color: #26382e; }
.dialog-details { margin: 0; }
.dialog-details div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; padding: 0.9rem 0; border-top: 1px solid #dfe7de; }
.dialog-details dt { font-weight: 700; font-size: 0.95rem; }
.dialog-details dd { margin: 0; font-size: 0.95rem; line-height: 1.6; color: var(--ink-soft); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 44rem) {
  /* On a phone the dialog is a full-height sheet. */
  .project-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .dialog-body { padding: 1.5rem 1rem 2rem; }
  .dialog-content { gap: 1.5rem; }
  .dialog-close { top: 0.9rem; right: 0.9rem; }
  .dialog-stats { grid-template-columns: 1fr 1fr; }
  .dialog-details div { grid-template-columns: 1fr; gap: 0.25rem; }
}
body.dialog-open { overflow: hidden; }

/* ---------- process trail ---------- */
.trail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.trail li { counter-increment: step; display: flex; flex-direction: column; gap: 1rem; }
.trail-marker { display: flex; align-items: center; gap: 1rem; }
.trail-marker::before {
  content: counter(step); flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--flame);
  font-family: var(--display); font-weight: 700; font-size: 1.25rem;
}
.trail-marker::after { content: ''; flex-grow: 1; border-top: 2px dashed #9fb7a5; }
.trail li:last-child .trail-marker::before { background: var(--ember); color: var(--coal); }
.trail li:last-child .trail-marker::after { display: none; }
.trail h3 { font-size: 1.45rem; letter-spacing: -0.02em; }
.trail p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 56rem) {
  .trail { grid-template-columns: 1fr; gap: 0; }
  .trail li { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 1rem; row-gap: 0.35rem; padding-bottom: 1.75rem; position: relative; }
  .trail-marker { grid-row: span 2; flex-direction: column; align-self: stretch; }
  .trail-marker::after { border-top: 0; border-left: 2px dashed #9fb7a5; flex-grow: 1; margin-bottom: -1.75rem; }
  .trail h3 { padding-top: 0.6rem; }
}

/* ---------- closing panel: night again, with the fire's glow ---------- */
.cta-panel {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl); background: var(--night); color: var(--smoke);
  padding: 4.5rem 4rem;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem 4.5rem; align-items: start;
}
.cta-panel::before {
  content: ''; position: absolute; left: -8rem; bottom: -14rem; width: 46rem; height: 34rem; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242, 132, 43, 0.28), rgba(242, 132, 43, 0));
  pointer-events: none;
}
.cta-panel > * { position: relative; }
.cta-copy { display: flex; flex-direction: column; gap: 1.4rem; }
.cta-copy h2 { font-weight: 800; font-size: clamp(2.4rem, 4.8vw, 4rem); line-height: 1; letter-spacing: -0.04em; color: var(--smoke-bright); }
.cta-copy p { margin: 0; max-width: 30rem; font-size: 1.1rem; color: var(--smoke-dim); }
.cta-copy a:not(.button) { color: var(--flame); font-weight: 600; }
.cta-panel-slim { grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: 3.75rem 4rem; }
.cta-panel-slim .cta-copy h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
@media (max-width: 60rem) {
  .cta-panel, .cta-panel-slim { grid-template-columns: 1fr; padding: 2.75rem 1.75rem; }
}
@media (max-width: 40rem) {
  .cta-panel, .cta-panel-slim { border-radius: var(--radius-lg); padding: 2.25rem 1.1rem 1.25rem; }
}

/* ---------- forms ---------- */
.form-card { border-radius: var(--radius-lg); background: var(--paper); color: var(--ink); padding: 2.5rem; }
.form-card > h2 { font-size: 1.75rem; margin-bottom: 0.4rem; }
.form-card > p { color: var(--ink-soft); margin-bottom: 1.75rem; }
.cta-panel .form-card { background: var(--pine-raised); color: var(--smoke); padding: 2rem; }
@media (max-width: 40rem) { .form-card, .cta-panel .form-card { padding: 1.25rem; } }

.enquiry { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1rem; }
.enquiry .full { grid-column: 1 / -1; }
@media (max-width: 36rem) { .enquiry { grid-template-columns: 1fr; } }
.field { display: grid; gap: 0.45rem; align-content: start; }
.field label { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.optional { color: var(--ink-soft); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background-color: var(--mist); border: 1px solid var(--field-edge); border-radius: var(--radius-sm);
  min-height: 52px; padding: 0.75rem 0.95rem;
}
.field select {
  appearance: none; padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: right 1.2rem center, right 0.85rem center;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem; background-repeat: no-repeat;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ember-ink); box-shadow: 0 0 0 2px var(--ember-ink); }
.cta-panel .field input:focus, .cta-panel .field select:focus, .cta-panel .field textarea:focus { border-color: var(--flame); box-shadow: 0 0 0 2px var(--flame); }
.field .hint { margin: 0; font-size: 0.84rem; color: var(--ink-soft); }
.cta-panel .field label { color: var(--smoke-dim); }
.cta-panel .optional, .cta-panel .field .hint { color: var(--muted); }
.cta-panel .field input, .cta-panel .field select, .cta-panel .field textarea { background-color: var(--night); color: var(--smoke); }
.cta-panel .field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); }
.cta-panel .field select option { background: var(--pine-raised); color: var(--smoke); }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form-status { margin: 0; min-height: 1.5rem; font-size: 0.95rem; }
.form-status.ok { color: var(--moss); font-weight: 600; }
.form-status.err { color: #a3261a; font-weight: 600; }
.cta-panel .form-status.ok { color: var(--fern); }
.cta-panel .form-status.err { color: #ffa38a; }
.consent { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
.consent a { color: inherit; }
.cta-panel .consent { color: var(--muted); }

/* ---------- interior page components, on the sheet ---------- */
.split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 2rem 5rem; }
.split + .split { margin-top: 5rem; }
.split h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); line-height: 1.08; }
.split .body p { color: var(--ink-soft); max-width: 42rem; }
.split .body p:last-child { margin-bottom: 0; }
@media (max-width: 56rem) { .split { grid-template-columns: 1fr; gap: 1.25rem; } }

.pull {
  margin: 0; max-width: 52rem; padding: 2.5rem 3rem; border-radius: var(--radius-lg); background: var(--paper);
  font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.2; letter-spacing: -0.025em;
  text-wrap: balance;
}
@media (max-width: 40rem) { .pull { padding: 1.75rem 1.4rem; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: step; }
.steps li { counter-increment: step; background: var(--paper); border-radius: var(--radius-md); padding: 1.75rem; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--ink); color: var(--flame); font-family: var(--display); font-weight: 700; margin-bottom: 1.1rem;
}
.steps h3 { font-size: 1.25rem; margin-bottom: 0.5rem; letter-spacing: -0.015em; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
@media (max-width: 60rem) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 36rem) { .steps { grid-template-columns: 1fr; } }
.steps-compact { grid-template-columns: 1fr; gap: 0.75rem; }
.steps-compact li { padding: 1.4rem 1.5rem; }

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.principles article { background: var(--paper); border-radius: var(--radius-md); padding: 2rem; }
.principles h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.principles p { margin: 0; color: var(--ink-soft); }
.principles .icon { width: 2.75rem; height: 2.75rem; margin-bottom: 1.25rem; }
.icon path, .icon circle, .icon rect { fill: none; stroke: var(--moss); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon .ember-stroke { stroke: var(--ember-ink); }

.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stack li { border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.9rem; background: var(--mist); color: var(--ink); }
.split .stack li { background: var(--paper); }

.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.week div { background: var(--paper); border-radius: var(--radius-md); padding: 1.5rem; }
.week div:last-child { background: var(--ink); color: var(--smoke); }
.week h3 { font-size: 1.15rem; margin-bottom: 0.45rem; }
.week p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.week div:last-child p { color: var(--smoke-dim); }
@media (max-width: 60rem) { .week { grid-template-columns: 1fr; } }

.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 3rem; }
.perks div { background: var(--paper); border-radius: var(--radius-md); padding: 1.6rem; }
.perks h3 { font-size: 1.15rem; margin-bottom: 0.4rem; letter-spacing: -0.015em; }
.perks p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
@media (max-width: 60rem) { .perks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 36rem) { .perks { grid-template-columns: 1fr; } }

.roles { display: grid; gap: 1rem; }
.role {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: center;
  background: var(--paper); border-radius: var(--radius-md); padding: 2rem 2.25rem;
}
.role h3 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.role .meta { color: var(--moss); font-weight: 600; font-size: 0.92rem; margin-bottom: 0.75rem; }
.role p:last-child { margin: 0; color: var(--ink-soft); max-width: 44rem; }
@media (max-width: 44rem) { .role { grid-template-columns: 1fr; padding: 1.5rem; } }
.section-foot { margin-top: 2rem; }

/* Projects page */
.project-group { scroll-margin-top: 7rem; }
.project-group + .project-group { margin-top: 5rem; }
.group-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem;
  padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line);
}
.group-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; }
.group-head p { margin: 0; color: var(--ink-soft); max-width: 34rem; }
.project-list { display: grid; gap: 1rem; }
.project {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2rem 3rem;
  background: var(--paper); border-radius: var(--radius-lg); padding: 2.25rem; scroll-margin-top: 7rem;
}
@media (max-width: 56rem) { .project { grid-template-columns: 1fr; padding: 1.6rem; } }
.project-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.4rem; }
.project h3 { font-size: 2rem; letter-spacing: -0.035em; }
.project .for { color: var(--moss); font-weight: 600; margin-bottom: 1rem; }
.project .summary { font-size: 1.08rem; }
.project .detail p { color: var(--ink-soft); }
.project .detail p:last-of-type { margin-bottom: 1.25rem; }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 3rem 4rem; align-items: start; }
@media (max-width: 60rem) { .contact-grid { grid-template-columns: 1fr; } }
.contact-aside h2 { font-size: 1.7rem; margin-bottom: 1.4rem; }
.contact-direct { margin-top: 2rem; color: var(--ink-soft); }
.contact-direct a { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }

/* Legal text */
.prose { max-width: 46rem; background: var(--paper); border-radius: var(--radius-lg); padding: 3rem; }
@media (max-width: 40rem) { .prose { padding: 1.5rem; } }
.prose h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; letter-spacing: -0.02em; }
.prose h2:first-of-type { margin-top: 1.5rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul { padding-left: 1.2rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--ink); font-weight: 600; }
.prose .updated { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--mist); }
.treeline { height: 90px; background: url('/treeline.svg') bottom / 100% 100% no-repeat; }
.footer-body { background: var(--night); padding: 2.5rem 0 3rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr) minmax(0, 1.3fr) minmax(0, 0.8fr); gap: 2.5rem; }
@media (max-width: 56rem) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 30rem) { .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }
.footer-about p { color: var(--muted); font-size: 0.93rem; max-width: 26rem; margin-top: 1rem; }
.footer-col h2 { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; letter-spacing: 0; margin-bottom: 1rem; color: var(--smoke); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-col a { color: var(--smoke-dim); text-decoration: none; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 0.5rem; overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--flame); }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--moss);
  font-size: 0.88rem; color: var(--muted);
}
.footer-base p { margin: 0; }

.section, .page-head, .hero { scroll-margin-top: 6rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flame, .fire-glow, .spark { animation: none; }
  .spark { opacity: 0; }
  .button, .tile { transition: none; }
  .tile:hover, .tile:focus-within { transform: none; }
}
