/* ============================================================================
   SMOKY EMBER BRANDING
   ----------------------------------------------------------------------------
   Authored for SEB. The ARCHITECTURE is ported from WS-TEMPLATE (three-state
   theming, --on-dark, --ui-scale, 320px reflow clamps) because those parts were
   debugged the hard way. The LOOK is not ported: this is an agency site, so it
   must not read as a re-skin of a client build.

   Token names describe ROLE, not appearance (--accent, never --ember), so a
   theme flip cannot make a name lie.
   ========================================================================== */

:root {
  /* --- Palette. Forge: cold iron, warm coal. --- */
  --bg:             #0B0B0C;   /* page background -- warm black, not #000 */
  --surface:        #121214;   /* raised sections */
  --surface-2:      #191A1D;   /* cards */
  --accent:         #E2622A;   /* ember: buttons, accents */
  --accent-strong:  #C24A16;   /* ember pressed / hover */
  --accent-text:    #F2854B;   /* ember AS TEXT -- lifted for contrast */
  --accent-warm:    #D9C7A8;   /* bone / cream secondary */
  --ink:            #F2EDE4;   /* primary text -- cream, never pure white */
  --ink-muted:      #9A9289;   /* secondary text */

  --line:   rgba(242,237,228,0.11);
  --line-2: rgba(242,237,228,0.22);

  /* --- Surfaces dark in BOTH themes: heroes, footer, coal bands. ---
     Text on these reads from --on-dark, NEVER --ink. Flip to light and --ink
     goes dark -> dark-on-dark. This is the usual way a light theme breaks. */
  --on-dark:       #F2EDE4;
  --on-dark-muted: rgba(242,237,228,0.70);

  /* --- Type --- */
  --display: "Big Shoulders Display", "Haettenschweiler", "Arial Narrow", sans-serif;
  --serif:   "Newsreader", Georgia, "Times New Roman", serif;
  --mono:    ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

  /* --- Layout --- */
  --wrap: 1280px;
  /* Capped against the viewport: the clamp floor is in rem, so the text-size
     control inflates it and on a narrow screen two gutters alone can push
     .wrap past the edge. */
  --gutter: min(clamp(1.15rem, 4vw, 3.5rem), 6vw);
  --ui-scale: 1;
}

/* Explicit light theme. Tokens ONLY -- never restate a component here. */
:root[data-theme="light"] {
  --bg:            #F7F3EC;   /* warm paper */
  --surface:       #EFE9DF;
  --surface-2:     #FFFCF7;
  --ink:           #16150F;
  --ink-muted:     #5C574E;
  --accent:        #C24A16;
  --accent-strong: #A03B0F;
  --accent-text:   #A63C10;   /* darker: ember as text on paper */
  --line:          rgba(22,21,15,0.14);
  --line-2:        rgba(22,21,15,0.24);
  /* --on-dark stays cream: those surfaces are dark in this theme too. */
}

/* The third viewer state. An explicit choice stamps data-theme on the root;
   the DEFAULT "system" setting stamps NOTHING, so only prefers-color-scheme
   separates light from dark here. Without this block, a visitor whose OS is
   light and who never touched the toggle gets the dark theme. Guarded with
   :not([data-theme]) so the explicit toggle always wins. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg:            #F7F3EC;
    --surface:       #EFE9DF;
    --surface-2:     #FFFCF7;
    --ink:           #16150F;
    --ink-muted:     #5C574E;
    --accent:        #C24A16;
    --accent-strong: #A03B0F;
    --accent-text:   #A63C10;
    --line:          rgba(22,21,15,0.14);
    --line-2:        rgba(22,21,15,0.24);
  }
}

/* ---------------------------------------------------------------- reset --- */

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

/* Root sizing in rem so the visitor's own browser text setting is respected
   rather than overridden. --ui-scale is the on-page control on top of it. */
html {
  font-size: calc(100% * var(--ui-scale));
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain. The one texture the whole design leans on -- it is what stops flat
   near-black from looking like a default dark mode. Pointer-events off so it
   never eats a click. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  /* NOTE: this blend crushes NEUTRAL LIGHT surfaces on the dark page -- a cream
     panel renders as dark olive, while a saturated colour survives. Verified
     2026-09-30 by forcing a panel magenta (vivid) then cream (muddy), with the
     grain live in both cases. Raising the panel above z-index 9998 does NOT
     escape it, and soft-light only reduces it. Before putting any pale panel on
     a dark page, solve this first. */
  opacity: .34;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
:root[data-theme="light"] body::after { opacity: .18; mix-blend-mode: multiply; }

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

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--ink); }

::selection { background: var(--accent); color: #0B0B0C; }

/* ----------------------------------------------------------- typography --- */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -0.005em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

/* Fluid, but the floor is in rem so 200% browser text still works. */
h1 { font-size: clamp(2.9rem, 9vw, 7.5rem); }
h2 { font-size: clamp(2rem, 5.2vw, 3.9rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); letter-spacing: .01em; }

p { margin: 0 0 1.15em; max-width: 68ch; }

.lead {
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 56ch;
}

.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3em;
  font-size: .82rem;
  color: var(--accent-text);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: .9rem;
}
/* The rule that trails every eyebrow -- a printer's rule, not a divider. */
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

.serif-accent { font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; }

/* ---------------------------------------------------------------- layout --- */

.wrap { width: min(var(--wrap), 100%); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: clamp(4.5rem, 11vw, 9rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }

.band-surface { background: var(--surface); }
/* Coal band: dark in BOTH themes. Everything inside reads from --on-dark. */
.band-coal { background: #0B0B0C; color: var(--on-dark); }
.band-coal h1, .band-coal h2, .band-coal h3 { color: var(--on-dark); }
.band-coal p, .band-coal .lead { color: var(--on-dark-muted); }

hr.rule { border: 0; height: 1px; background: var(--line); margin: 0; }

/* ---------------------------------------------------------------- header --- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  /* Grid, not flex, so the wordmark can sit in a centre track that the logo and
     the nav cannot encroach on. Absolute-centring it instead would collide with
     the nav between roughly 900px and 1200px, where the links start early
     enough to reach the middle of the header. The empty 4th track is the mobile
     hamburger; on desktop it is display:none and collapses to zero. */
  display: grid;
  /* 1fr on BOTH sides, not "auto 1fr auto" -- equal outer tracks are what put
     the wordmark at the true centre of the header. With a single 1fr the centre
     track floats between the logo and the nav, and since the nav is far wider
     than the badge the name lands noticeably left of middle.
     Three tracks, not four: a fourth track for the hamburger still contributes
     its column-gap on desktop even while the button is display:none, which
     dragged the wordmark 20px left of centre. The button is placed into track 3
     explicitly instead -- it shares the cell with <nav>, whose list is
     absolutely positioned at that breakpoint and so takes no width. */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, padding .3s;
}
.site-header.scrolled {
  background: rgba(11,11,12,0.86);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
  padding-block: .7rem;
}
.site-header.nav-open { background: #0B0B0C; }

.brand { display: flex; align-items: center; justify-self: start; text-decoration: none; }
/* Track 3 is a full 1fr so that track 1 can match it and hold the wordmark at
   true centre. Without this the nav aligns to the START of that wide track and
   ends up hugging the wordmark instead of the right edge. */
.site-header nav { justify-self: end; }
/* Big at rest, compact once scrolled. The badge IS the wordmark -- it carries
   "SMOKY EMBER BRANDING" inside it -- so the adjacent text lockup was removed
   rather than competing with it for width.
   At the 92px floor on a 320px screen: gutters take ~38, leaving 282; mark 92 +
   toggle ~34 = 126. Plenty. */
.brand img {
  width: clamp(80px, 11vw, 148px);
  height: auto;
  aspect-ratio: 1;
  transition: width .3s cubic-bezier(.2,.7,.3,1);
}
/* Shrink on scroll so a tall header does not eat the page on a laptop or phone. */
.site-header.scrolled .brand img { width: clamp(52px, 5.5vw, 68px); }
/* The wordmark and the badge trade places as you scroll. At rest the badge is
   the loud one and the name is a quiet caption; once the header compacts, the
   badge drops back and the name takes over. They cross rather than both
   shrinking, so the header stays visually the same weight at both ends while
   clearly being in two different states. */
.site-header .brand-text {
  justify-self: center;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: clamp(.85rem, 1.05vw, 1.15rem);     /* small while the badge is big */
  line-height: 1;
  color: var(--on-dark);
  transition: font-size .35s cubic-bezier(.2,.7,.3,1), letter-spacing .35s cubic-bezier(.2,.7,.3,1);
  white-space: nowrap;
  /* A nowrap item in a 1fr track can still push the track past its share. This
     keeps the grid in charge at 320px rather than the text. */
  min-width: 0;
}
.site-header.scrolled .brand-text {
  font-size: clamp(1.05rem, 2.1vw, 2.35rem);     /* large once the badge shrinks */
  letter-spacing: .08em;
}
/* The full stop takes the site's ember accent. */
.brand-text span { color: var(--accent-text); }

.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .9rem;
  color: var(--on-dark);
  text-decoration: none;
  position: relative;
  padding-block: .3rem;
}
/* Underline grows from the left -- the only nav flourish, kept cheap. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 0;
  background: var(--accent);
  transition: width .28s cubic-bezier(.2,.7,.3,1);
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { width: 100%; }
.nav-links a[aria-current="page"] { color: var(--accent-text); }

.nav-toggle { display: none; grid-column: 3; grid-row: 1; justify-self: end; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 2px; background: var(--on-dark); margin: 5px 0; transition: transform .3s, opacity .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .site-header { gap: .75rem; }
  .nav-toggle { display: block; }
  .nav-links {
    /* Anchored to the header, NOT a hardcoded 64px top -- the header's height
       now varies with the fluid brand mark, and a fixed offset would overlap
       it or leave a gap. The header is position:fixed, so absolute + top:100%
       tracks its real height. */
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #0B0B0C;
    border-bottom: 1px solid var(--line);
    padding: 1rem var(--gutter) 2rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; border-bottom: 1px solid var(--line); }
  .nav-links a { display: block; padding: 1.1rem 0; font-size: 1.15rem; }
  .nav-links .btn { margin-top: 1.25rem; width: 100%; text-align: center; }
}

/* ----------------------------------------------------- nav submenu (Work) ---
   Desktop: opens on hover AND on focus-within, so it is reachable by keyboard
   without a click. The caret button is the explicit control -- the parent "Work"
   link stays a real link to work.html rather than becoming a dead toggle, so a
   visitor who just wants the Work page is never trapped opening a menu.
   Mobile (<=900px) ignores all of that and renders the submenu inline and
   always-open: hover does not exist on touch, and a nested flyout inside an
   already-open drawer is a worse answer than two indented links. */

.has-sub { position: relative; display: flex; align-items: center; gap: .35rem; }

.sub-toggle {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  padding: .3rem .1rem;
  color: var(--on-dark);
  cursor: pointer;
  line-height: 0;
}
.sub-toggle svg { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.sub-toggle svg path { transition: transform .25s cubic-bezier(.2,.7,.3,1); transform-origin: 50% 50%; }
.has-sub:hover .sub-toggle svg path,
.has-sub:focus-within .sub-toggle svg path { transform: rotate(180deg); }

.subnav {
  position: absolute;
  top: calc(100% + .9rem);
  left: -1.1rem;
  z-index: 120;
  min-width: 14rem;
  margin: 0;
  padding: .45rem 0;
  list-style: none;
  background: rgba(11,11,12,0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  /* The ember hairline on top is the only ornament -- it ties the panel to the
     same accent the nav underline uses. */
  border-top: 2px solid var(--accent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s cubic-bezier(.2,.7,.3,1), visibility .2s;
}
/* The gap between the link and the panel would drop the hover without this --
   an invisible bridge keeps the pointer "inside" while it travels down. */
.has-sub::after {
  content: "";
  position: absolute;
  top: 100%; left: -1.1rem; right: -1.1rem;
  height: 1rem;
}
.has-sub:hover .subnav,
.has-sub:focus-within .subnav,
.has-sub.open .subnav {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.subnav a {
  display: block;
  padding: .7rem 1.1rem;
  font-size: .8rem;
  letter-spacing: .12em;
  white-space: nowrap;
}
.subnav a::after { display: none; }   /* the sliding underline belongs to the top level only */
.subnav a:hover { background: rgba(226,98,42,.14); color: var(--accent-text); }

@media (max-width: 900px) {
  .has-sub { display: block; }
  .sub-toggle { display: none; }
  .subnav {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    background: none;
    backdrop-filter: none;
    border: 0;
    padding: 0 0 .6rem;
  }
  .subnav li { border-bottom: 0; }
  .subnav a {
    padding: .55rem 0 .55rem 1.1rem;
    font-size: .95rem;
    border-left: 2px solid var(--line-2);
    color: var(--on-dark-muted);
  }
  .subnav a[aria-current="page"] { color: var(--accent-text); border-left-color: var(--accent); }
}

/* --------------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .95rem;
  padding: .95rem 1.7rem;
  border: 1px solid transparent;
  border-radius: 0;           /* square: forged, not app-like */
  cursor: pointer;
  text-decoration: none;
  transition: background .22s, color .22s, border-color .22s, transform .22s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #0B0B0C; }
.btn-primary:hover { background: var(--accent-strong); color: #0B0B0C; }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-text); }
.band-coal .btn-outline, .hero .btn-outline, .site-footer .btn-outline { color: var(--on-dark); border-color: rgba(242,237,228,0.3); }

/* ------------------------------------------------------------------ hero --- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  /* Clears the AT-REST header (~183px with the large brand mark). */
  padding-block: clamp(12rem, 20vw, 14rem) clamp(3rem, 8vw, 6rem);
  background: #0B0B0C;
  color: var(--on-dark);
  overflow: hidden;
  isolation: isolate;
}

/* The ember. A bottom-weighted radial that reads as heat coming off coals,
   not as a neon glow. Two layers so the falloff is not a single flat ramp. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 12% 108%, rgba(226,98,42,0.34) 0%, rgba(226,98,42,0.10) 34%, transparent 68%),
    radial-gradient(90% 55% at 78% 102%, rgba(194,74,22,0.22) 0%, transparent 62%);
}
/* Hairline grid: the drafting-table layer. Fades out before it reaches the
   copy so it never competes with the headline. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(242,237,228,.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(242,237,228,.055) 1px, transparent 1px);
  background-size: 84px 84px;
  -webkit-mask-image: radial-gradient(130% 90% at 50% 100%, #000 10%, transparent 72%);
          mask-image: radial-gradient(130% 90% at 50% 100%, #000 10%, transparent 72%);
}

.hero h1 { color: var(--on-dark); margin-bottom: .35em; }
/* The one grid-breaking move: the second line pulls right on wide screens. */
.hero h1 .line-2 { display: block; }
@media (min-width: 900px) { .hero h1 .line-2 { margin-left: 2.2em; } }
.hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -.01em; color: var(--accent-text); }

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-top: 2rem;
  border-top: 1px solid rgba(242,237,228,0.16);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; }

/* Keep the hero's trailing item out of the fixed .a11y-bar's corner. Below this
   width .hero-foot has already wrapped, so the two no longer share a line. */
@media (min-width: 1000px) { .hero-foot { padding-right: 16rem; } }

.tagline {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .34em;
  font-size: .85rem;
  color: var(--on-dark-muted);
}
.tagline b { color: var(--accent-text); font-weight: 600; }

/* Staggered page-load reveal. One orchestrated moment beats scattered
   micro-interactions -- and it is disabled wholesale by the reduced-motion
   block above. */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .85s cubic-bezier(.2,.7,.3,1) both; }
.reveal-1 { animation-delay: .05s; }
.reveal-2 { animation-delay: .18s; }
.reveal-3 { animation-delay: .31s; }
.reveal-4 { animation-delay: .44s; }

/* ------------------------------------------------------------- page head --- */

.page-head {
  /* Clears the AT-REST header (~183px with the large brand mark). */
  padding-block: clamp(13rem, 20vw, 15rem) clamp(2.5rem, 5vw, 4rem);
  background: #0B0B0C;
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
}
.page-head::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(90% 60% at 8% 110%, rgba(226,98,42,0.26), transparent 62%);
}
.page-head > * { position: relative; }
.page-head h1 { color: var(--on-dark); font-size: clamp(2.4rem, 7vw, 5.2rem); }
.page-head .lead { color: var(--on-dark-muted); }

/* ------------------------------------------------------------------ work --- */

/* Editorial index, not a card grid. Each entry is a numbered row that opens
   up on hover -- reads like a specimen book, which is the whole point. */
.work-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.work-item { border-bottom: 1px solid var(--line); }

.work-link {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding-block: clamp(1.8rem, 4vw, 2.9rem);
  text-decoration: none;
  color: inherit;
  transition: padding-inline .35s cubic-bezier(.2,.7,.3,1), background .35s;
}
.work-link:hover, .work-link:focus-visible {
  background: linear-gradient(90deg, rgba(226,98,42,.10), transparent 62%);
  padding-inline: clamp(.6rem, 2vw, 1.4rem);
  color: inherit;
}

.work-num { font-family: var(--mono); font-size: .8rem; color: var(--accent-text); letter-spacing: .1em; }
.work-body h3 { margin-bottom: .35rem; transition: color .25s; }
.work-link:hover .work-body h3 { color: var(--accent-text); }
.work-body p { color: var(--ink-muted); margin: 0; font-size: 1rem; max-width: 60ch; }
.work-meta {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .work-link { grid-template-columns: 3rem 1fr; }
  .work-meta { grid-column: 2; }
}

/* Screenshot frame. Aspect-locked so a missing image cannot collapse the row. */
.shot {
  border: 1px solid var(--line);
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s cubic-bezier(.2,.7,.3,1); }
.shot:hover img { transform: scale(1.03); }

/* -------------------------------------------------------------- services --- */

/* minmax(min(Npx,100%),1fr) is the reflow floor: a plain minmax(260px,1fr)
   overflows below 320px. Copy this pattern for any new grid. */
.grid-3 { display: grid; gap: clamp(1rem, 2.4vw, 1.9rem); grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }
.grid-2 { display: grid; gap: clamp(1.4rem, 3.5vw, 3.5rem); grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }

.card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  position: relative;
  transition: border-color .3s, transform .3s;
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }
/* Ember tick in the corner -- a maker's mark, one per card. */
.card::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 26px; height: 2px;
  background: var(--accent);
}
.card h3 { margin-bottom: .6rem; }
.card p { color: var(--ink-muted); margin: 0; font-size: .98rem; }

.card-num { font-family: var(--mono); font-size: .75rem; color: var(--accent-text); letter-spacing: .12em; display: block; margin-bottom: 1.2rem; }

/* Capability list -- dense, two columns, hairline separated. */
.cap-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 620px) { .cap-list { columns: 1; } }
.cap-list li {
  break-inside: avoid;
  padding: .7rem 0 .7rem 1.6rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: .98rem;
}
.cap-list li::before { content: "\2014"; position: absolute; left: 0; color: var(--accent-text); }

/* ----------------------------------------------------------------- steps --- */

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); }
.steps li { counter-increment: step; background: var(--bg); padding: clamp(1.6rem, 3.4vw, 2.4rem); display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: start; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: .8;
  color: var(--accent);
}
.steps h3 { margin-bottom: .4rem; }
.steps p { margin: 0; color: var(--ink-muted); }

/* ----------------------------------------------------------------- stats --- */

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.stat { background: var(--bg); padding: clamp(1.6rem, 3.5vw, 2.6rem) clamp(1rem, 2vw, 1.6rem); }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: .9; color: var(--ink); }
.stat span { font-family: var(--display); text-transform: uppercase; letter-spacing: .18em; font-size: .76rem; color: var(--ink-muted); }

/* ----------------------------------------------------------------- forms --- */

.form-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

label { display: block; font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; color: var(--ink-muted); margin-bottom: .5rem; }
label .req { color: var(--accent-text); }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 0;
  padding: .85rem 1rem;
  transition: border-color .2s, background .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
textarea { min-height: 9rem; resize: vertical; }

/* The honeypot. Must be reachable by nothing and visible to no one, but NOT
   display:none -- some bots skip hidden fields, which defeats the trap. */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- footer --- */

.site-footer { background: #0B0B0C; color: var(--on-dark-muted); border-top: 1px solid var(--line); padding-block: clamp(3.5rem, 7vw, 5.5rem) 2rem; }
.site-footer h3 { color: var(--on-dark); font-size: 1rem; letter-spacing: .18em; margin-bottom: 1.1rem; }
.site-footer a { color: var(--on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-text); }
.footer-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.footer-bottom { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.5rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-size: .85rem; }
/* Clearance for the fixed .a11y-bar, which is pinned bottom-right and would
   otherwise sit on top of the last footer line on every page. */
.site-footer { padding-bottom: 4.5rem; }

/* ----------------------------------------------- accessibility (main.js) --- */

/* main.js injects these; the page gets them just by including the script. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link {
  position: fixed; top: -100px; left: var(--gutter); z-index: 1000;
  background: var(--accent); color: #0B0B0C;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .12em;
  padding: .8rem 1.3rem; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; color: #0B0B0C; }

/* One focus style everywhere. Visible on cream AND on coal. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.a11y-bar { position: fixed; right: 0; bottom: 0; z-index: 999; display: flex; align-items: center; gap: .35rem; background: rgba(11,11,12,.92); border: 1px solid var(--line); border-right: 0; border-bottom: 0; padding: .45rem .6rem; }
.a11y-bar button { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; background: transparent; color: var(--on-dark); border: 1px solid transparent; padding: .35rem .6rem; cursor: pointer; }
.a11y-bar button:hover { border-color: var(--line-2); color: var(--accent-text); }
.a11y-size { font-family: var(--mono); font-size: .72rem; color: var(--on-dark-muted); min-width: 3.2em; text-align: center; }

/* ------------------------------------------------------- theme-aware logo --- */

/* Two files, one visible at a time. A <picture> with media queries cannot do
   this: the explicit [data-theme] toggle is an attribute, not a media state, so
   the browser would keep serving whichever source prefers-color-scheme matched.
   Swapping display on two <img> is the only approach that honours BOTH the
   toggle and the unstamped system default.
   NEVER put loading="lazy" on these. A lazy image inside display:none is never
   fetched at all, so toggling the theme shows an empty box while the other file
   downloads. Verified 2026-09-30: currentSrc was "" and complete false even with
   the element scrolled into view, while the file itself served 200. Both marks
   must load eagerly for the swap to be instant. */
.logo-swap { display: block; line-height: 0; }
.logo-swap img { display: block; width: 100%; height: auto; }

/* Base = dark surface. */
.logo-swap .is-on-light { display: none; }
.logo-swap .is-on-dark  { display: block; }

:root[data-theme="light"] .logo-swap .is-on-light { display: block; }
:root[data-theme="light"] .logo-swap .is-on-dark  { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .logo-swap .is-on-light { display: block; }
  :root:not([data-theme]) .logo-swap .is-on-dark  { display: none; }
}

/* Inside a .band-coal or the footer the surface stays dark in BOTH themes, so
   the swap must NOT fire -- otherwise the black mark lands on black. */
.band-coal .logo-swap:not(.logo-swap--inverted) .is-on-light,
.site-footer .logo-swap:not(.logo-swap--inverted) .is-on-light,
.hero .logo-swap:not(.logo-swap--inverted) .is-on-light,
.page-head .logo-swap:not(.logo-swap--inverted) .is-on-light { display: none !important; }
.band-coal .logo-swap:not(.logo-swap--inverted) .is-on-dark,
.site-footer .logo-swap:not(.logo-swap--inverted) .is-on-dark,
.hero .logo-swap:not(.logo-swap--inverted) .is-on-dark,
.page-head .logo-swap:not(.logo-swap--inverted) .is-on-dark { display: block !important; }

/* The badge shown at a size where its line work is actually legible. */
/* Sized off vw so it scales with the viewport, with a hard px floor and a
   ceiling. The floor (240px) still fits a 320px screen: the two gutters take
   ~38px, leaving ~282px. box-sizing:border-box means the padding is inside
   this width, so the number here IS the outer diameter. */
.badge-emblem { width: clamp(280px, 52vw, 600px); max-width: 100%; margin-inline: auto; aspect-ratio: 1; }

/* --- Inverted plate: REMOVED 2026-09-30 -------------------------------------
   A cream disc carrying the dark mark (so the badge reads opposite to the
   header) is the intended design, but the grain overlay above renders any
   neutral light panel as dark olive. Reinstate this once the grain is reworked
   to leave pale surfaces alone -- not before. */

/* ------------------------------------------------------------- lightbox --- */

.lightbox { position: fixed; inset: 0; z-index: 1001; background: rgba(11,11,12,.96); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox button { position: absolute; background: transparent; border: 1px solid var(--line-2); color: var(--on-dark); font-size: 1.5rem; width: 3rem; height: 3rem; cursor: pointer; }
.lb-close { top: 1.5rem; right: 1.5rem; }
.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }
.lb-count { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: .8rem; color: var(--on-dark-muted); }

/* --------------------------------------------------------------- utility --- */

.prose p { max-width: 68ch; }
.center { text-align: center; margin-inline: auto; }
.mt-0 { margin-top: 0; }
.stack > * + * { margin-top: 1.4rem; }

/* ------------------------------------------------------------ gallery grid ---
   Every tile is a square coal plate with the artwork letterboxed inside it. The
   source files are square logos, 2:3 posters and 3:2 banners; a masonry layout
   of those reads as clutter, whereas one silhouette repeated reads as a set.
   The plate colour is baked into the JPEG/WebP too, so the image and the tile
   are the same black and the seam never shows -- in either theme. */

.gal-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 2.4rem;
}
.chip {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--line-2);
  padding: .6rem 1.1rem;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip.is-on {
  color: #0B0B0C;
  background: var(--accent);
  border-color: var(--accent);
}

.gal-grid {
  display: grid;
  /* min() floor, not a bare 260px -- below ~300px a fixed floor overflows the
     gutters and the page scrolls sideways. */
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 1.1rem;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #0F0F11;
  border: 1px solid var(--line);
  transition: border-color .25s, transform .25s cubic-bezier(.2,.7,.3,1);
}
/* The caption sits BELOW the plate, not over it. These are logos -- an overlay
   lands squarely on the wordmark it is captioning, and on the one piece with a
   cream background the overlay text disappeared entirely. A label strip costs a
   little height and is legible on every tile regardless of what the artwork
   behind it does. */
.gal-plate { overflow: hidden; }
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}
.gallery-item:hover { border-color: var(--accent); transform: translateY(-3px); }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.gal-meta {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .95rem 1rem 1.05rem;
  border-top: 1px solid var(--line);
  background: #0B0B0C;
}
.gal-title {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 1.05rem;
  line-height: 1.1;
  color: var(--on-dark);
}
.gal-sub {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
/* The ember rule draws on hover only -- the same gesture as the nav underline,
   reused so the grid feels like the rest of the site rather than a bolt-on. */
.gal-meta::before {
  content: "";
  position: absolute;
  left: 0; top: -1px;
  height: 2px; width: 0;
  background: var(--accent);
  transition: width .3s cubic-bezier(.2,.7,.3,1);
}
.gallery-item:hover .gal-meta::before { width: 100%; }

.gal-grid .gallery-item[hidden] { display: none; }
.gal-empty { color: var(--ink-muted); margin-top: 2rem; }

.wrap.narrow { width: min(60rem, 100%); }

@media (prefers-reduced-motion: reduce) {
  .gallery-item, .gallery-item img, .gal-meta::before, .subnav { transition: none; }
  .gallery-item:hover { transform: none; }
  .gallery-item:hover img { transform: none; }
}

