/* ==========================================================================
   Antler Technical — site styles
   Dark, hairline, spec-sheet inspired. Linen base, Dark Bark bands.
   ========================================================================== */

:root {
  /* Antler Technical palette
     Dark Bark #332D27 · Walnut #665747 · Warm Taupe #B5A48C · Linen #E9E3D8 · White #F8F6F1 */
  --bark: #332D27;
  --walnut: #665747;
  --taupe: #B5A48C;
  --linen: #E9E3D8;
  --white: #F8F6F1;

  --bg: var(--linen);
  --bg-raised: var(--white);
  --surface: #FCFBF8;
  --surface-2: #DDD4C6;
  --line: rgba(51, 45, 39, 0.13);
  --line-strong: rgba(51, 45, 39, 0.24);
  --text: var(--bark);
  --text-dim: #574A3D;
  --muted: #6E604F;
  --accent: var(--walnut);
  --accent-soft: rgba(181, 164, 140, 0.28);
  --accent-line: rgba(102, 87, 71, 0.45);
  --grain: rgba(51, 45, 39, 0.05);
  --grain-dot: rgba(51, 45, 39, 0.12);
  --btn-bg: var(--bark);
  --btn-fg: var(--white);
  --btn-hover: #463D35;
  --rail: var(--taupe);
  --ok: #2F7A55;
  --err: #B03A2E;

  --font-serif: "Lora", Georgia, serif;
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 68px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--taupe); color: var(--bark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(72px, 10vw, 128px) 0; border-top: 1px solid var(--line); }
.section--flush { border-top: 0; }
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); letter-spacing: -0.03em; }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--text-dim); max-width: 60ch; }
.dim { color: var(--text-dim); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow .idx { color: var(--accent); }
.eyebrow::before {
  content: ""; width: 18px; height: 1px; background: var(--line-strong);
}
.eyebrow--plain::before { display: none; }

.section-head {
  display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 64px);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .section-head { grid-template-columns: 1fr 1fr; align-items: end; }
  .section-head .eyebrow { grid-column: 1 / -1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  font-weight: 500; font-size: 0.95rem; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
  cursor: pointer; background: transparent;
}
.btn:hover { border-color: var(--text-dim); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); font-weight: 600; }
.btn--primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 0.875rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; color: var(--text);
  border-bottom: 1px solid var(--line-strong); padding-bottom: 2px;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.link-arrow:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--bark);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: var(--bark); }
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 1.02rem; }
.brand .tld { color: var(--accent); }
.tally {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 10px rgba(181,164,140,.45);
  flex: none;
}

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  font-size: 0.92rem; color: var(--text-dim);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:not(.btn):hover { color: var(--text); background: var(--surface); }
.nav-links a[aria-current="page"]:not(.btn) { color: var(--text); }
.nav-links a[aria-current="page"]:not(.btn)::after {
  content: ""; display: block; height: 2px; width: 14px; margin: 3px auto -5px;
  background: var(--accent); border-radius: 2px;
}
.nav-links .nav-cta { margin-left: 10px; }

.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 16px; height: 1.5px; background: var(--text); position: relative;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s;
  }
  .nav-open .nav-links { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .nav-links li { border-bottom: 1px solid var(--line); }
  .nav-links li:last-child { border-bottom: 0; }
  .nav-links a:not(.btn) { display: flex; justify-content: space-between; padding: 16px 0; border-radius: 0; font-size: 1.1rem; color: var(--text); }
  .nav-links a:not(.btn):hover { background: transparent; color: var(--accent); }
  .nav-links a[aria-current="page"]:not(.btn)::after { margin: 0; align-self: center; }
  .nav-links .nav-cta { margin: 20px 0 0; }
  .nav-links .nav-cta .btn { width: 100%; height: 50px; }
  .nav-open { overflow: hidden; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(72px, 12vw, 150px) 0 clamp(64px, 9vw, 110px); overflow: hidden; }
.hero::before {
  /* rack-unit grid */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, var(--grain) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grain) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1;
  width: 620px; height: 620px; right: -160px; top: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(181,164,140,0.14), transparent 65%);
  filter: blur(10px);
}
.hero-status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
  background: var(--bg-raised);
}
.hero-status .tally { width: 7px; height: 7px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.hero h1 { margin: 28px 0 0; max-width: 14ch; }
.hero h1 .plus { color: var(--accent); font-weight: 500; }
.hero .lede { margin-top: 26px; }
.hero .btn-row { margin-top: 40px; }

.hero-spec {
  margin-top: clamp(56px, 8vw, 96px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.hero-spec div { padding: 20px 20px 0 0; }
.hero-spec div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.hero-spec dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.hero-spec dd { margin: 6px 0 0; font-weight: 500; color: var(--text); }
@media (max-width: 760px) {
  .hero-spec { grid-template-columns: 1fr 1fr; }
  .hero-spec div:nth-child(3) { padding-left: 0; border-left: 0; }
  .hero-spec div:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 20px; }
}

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: clamp(64px, 10vw, 120px) 0 clamp(48px, 7vw, 80px); position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(to right, var(--grain) 1px, transparent 1px);
  background-size: 64px 100%;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.page-head h1 { margin-top: 22px; font-size: clamp(2.4rem, 5.6vw, 4.25rem); max-width: 18ch; }
.page-head .lede { margin-top: 22px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.cell { background: var(--bg-raised); padding: clamp(24px, 3vw, 36px); position: relative; transition: background .25s var(--ease); }
.cell:hover { background: var(--surface); }
.cell .num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.1em; }
.cell h3 { margin-top: 36px; }
.cell p { margin-top: 10px; color: var(--text-dim); font-size: 0.95rem; }
.cell .icon { width: 28px; height: 28px; color: var(--accent); }
.cell .icon + h3 { margin-top: 28px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 18px 0 0; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-dim);
}

/* ---------- Signal flow (process) ---------- */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.flow::before {
  content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, var(--accent-line), var(--line-strong) 60%, var(--line));
}
.flow li { position: relative; padding: 36px 20px 0 0; }
.flow li::before {
  content: ""; position: absolute; top: 0; left: 0; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-strong);
}
.flow li:first-child::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.flow .step { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.flow h3 { margin-top: 8px; font-size: 1.1rem; }
.flow p { margin-top: 8px; color: var(--text-dim); font-size: 0.92rem; }
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; gap: 0; }
  .flow::before { top: 0; bottom: 0; left: 7px; right: auto; width: 1px; height: auto;
    background: linear-gradient(to bottom, var(--accent-line), var(--line-strong) 60%, var(--line)); }
  .flow li { padding: 0 0 32px 40px; }
  .flow li:last-child { padding-bottom: 0; }
}

/* ---------- Work / portfolio ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter {
  height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-dim);
  font-size: 0.875rem; transition: all .2s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--text-dim); }
.filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 960px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .work-grid { grid-template-columns: 1fr; } }

.work-card { display: flex; flex-direction: column; gap: 16px; }
.work-card[hidden] { display: none; }
.work-media {
  aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; position: relative;
  background: var(--surface); border: 1px solid var(--line);
}
.work-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.work-card:hover .work-media img { transform: scale(1.03); }
.work-media--placeholder {
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--grain) 14px 15px),
    var(--surface);
}
.work-media--placeholder span {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.work-media--placeholder span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--muted); }
.work-media .badge {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px);
}
.work-meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; }
.work-card h3 { font-size: 1.1rem; }
.work-card p { color: var(--text-dim); font-size: 0.92rem; margin-top: -6px; }

/* ---------- Split / about ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 6vw, 80px); }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; } .split--even { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .split--contact { grid-template-columns: 7fr 4fr; } }
.prose p + p { margin-top: 1.1em; }
.prose p { color: var(--text-dim); font-size: 1.05rem; }
.prose strong { color: var(--text); font-weight: 500; }

.portrait {
  aspect-ratio: 4 / 5; border-radius: var(--radius); border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 38%, var(--surface-2) 0 22%, transparent 22.5%),
    radial-gradient(ellipse 42% 30% at 50% 92%, var(--surface-2) 0 98%, transparent 100%),
    var(--surface);
  position: relative; overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption {
  position: absolute; left: 14px; bottom: 14px; right: 14px;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

.spec-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.spec-list li {
  display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.spec-list .k { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.spec-list .v { color: var(--text); }
.spec-list .v span { color: var(--text-dim); }
@media (max-width: 520px) { .spec-list li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- CTA band ---------- */
.cta-band {
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  padding: clamp(36px, 6vw, 72px);
  background:
    radial-gradient(ellipse 60% 120% at 100% 0%, rgba(181,164,140,0.16), transparent 60%),
    var(--bg-raised);
  display: grid; gap: 28px; align-items: end;
}
@media (min-width: 860px) { .cta-band { grid-template-columns: 1.4fr 1fr; } .cta-band .btn-row { justify-content: flex-end; } }
.cta-band h2 { max-width: 16ch; }
.cta-band p { margin-top: 14px; color: var(--text-dim); max-width: 46ch; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 20px; }
.form-row { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
.field label .opt { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 1rem; color: var(--text);
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23665747' stroke-width='1.5'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.field select option { background: var(--surface); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--err); }
.field .error { font-size: 0.8rem; color: var(--err); min-height: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips legend { font-size: 0.85rem; color: var(--text-dim); font-weight: 500; margin-bottom: 10px; padding: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-dim); font-size: 0.9rem; cursor: pointer;
  transition: all .2s var(--ease); user-select: none;
}
.chip span:hover { border-color: var(--text-dim); color: var(--text); }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 4px; }
.form-foot .fine { font-size: 0.82rem; color: var(--muted); }
.form-status { font-size: 0.92rem; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid; display: none; }
.form-status.is-visible { display: block; }
.form-status.ok { color: var(--ok); border-color: rgba(47,122,85,.35); background: rgba(47,122,85,.07); }
.form-status.err { color: var(--err); border-color: rgba(176,58,46,.35); background: rgba(176,58,46,.06); }

.contact-aside { display: grid; gap: 28px; align-content: start; }
.contact-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--bg-raised); }
.contact-card h3 { font-size: 1rem; }
.contact-card p { color: var(--text-dim); font-size: 0.92rem; margin-top: 8px; }
.contact-card a.link-arrow { margin-top: 14px; }
.contact-card ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.contact-card li { display: flex; gap: 12px; font-size: 0.92rem; color: var(--text-dim); }
.contact-card li::before { content: "→"; color: var(--accent); font-family: var(--font-mono); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 32px; margin-top: clamp(72px, 10vw, 128px); }
.footer-top { display: grid; gap: 40px; grid-template-columns: 1.6fr 1fr 1fr; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-brand p { margin-top: 12px; color: var(--muted); font-size: 0.92rem; max-width: 34ch; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.footer-col ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.footer-col a { color: var(--text-dim); font-size: 0.92rem; transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted);
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.16em; color: var(--accent); text-transform: uppercase; }
.notfound h1 { margin: 18px auto 0; font-size: clamp(2.2rem, 5vw, 3.5rem); }
.notfound p { margin: 16px auto 0; color: var(--text-dim); max-width: 44ch; }
.notfound .btn-row { justify-content: center; margin-top: 32px; }

/* ==========================================================================
   Service tabs
   ========================================================================== */
.page-head--tabs { padding-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 0 clamp(28px, 5vw, 64px); margin-top: 22px; }
.tab {
  position: relative; background: none; border: 0; padding: 0 0 22px; cursor: pointer;
  font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.1;
  color: var(--muted); transition: color .2s var(--ease);
  display: inline-flex; align-items: flex-start; gap: 10px;
}
.tab:hover { color: var(--text-dim); }
.tab[aria-selected="true"] { color: var(--text); }
.tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab-idx {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 400; letter-spacing: 0.1em;
  margin-top: 0.7em; color: var(--muted);
}
.tab[aria-selected="true"] .tab-idx { color: var(--accent); }
[role="tabpanel"][hidden] { display: none; }
[role="tabpanel"] > .section { animation: panel-in .45s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.skill-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 32px; }
@media (max-width: 900px) { .skill-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .skill-list { grid-template-columns: 1fr; } }
.skill-list li {
  display: flex; align-items: center; gap: 14px; padding: 18px 0;
  border-top: 1px solid var(--line); font-weight: 500;
}
.skill-list li::before {
  content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

.after-list { margin-top: 36px; }

/* ==========================================================================
   Wire-diagram layer: a signal rail down the left, nodes on section labels,
   junctions where dividers cross it, and ports on the CTA boxes.
   ========================================================================== */
:root { --rail-x: calc(max(0px, (100% - var(--wrap)) / 2) + var(--gutter) - 32px); }

/* Dot-grid canvas behind page tops */
.hero::before, .page-head::before {
  background-image: radial-gradient(circle, var(--grain-dot) 1px, transparent 1.3px);
  background-size: 24px 24px;
}

@media (min-width: 900px) {
  main { position: relative; }
  main::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: var(--rail-x); width: 1px; pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--line-strong) 120px, var(--line-strong) calc(100% - 180px), transparent);
  }

  /* Junctions where section dividers cross the rail */
  .section { position: relative; }
  .section::before {
    content: ""; position: absolute; top: -3.5px; left: calc(var(--rail-x) - 3.5px);
    width: 8px; height: 8px; background: var(--bg); border: 1px solid var(--line-strong); transform: rotate(45deg);
  }
  .section--flush::before { display: none; }

  /* Section labels hang off the rail */
  .page-head .eyebrow, .section-head > .eyebrow { position: relative; }
  .page-head .eyebrow::before, .section-head > .eyebrow::before {
    position: absolute; left: -28px; top: 50%; width: 20px; margin: 0;
    background: linear-gradient(to right, var(--accent-line), var(--line-strong));
  }
  .page-head .eyebrow::after, .section-head > .eyebrow::after {
    content: ""; position: absolute; left: -36.5px; top: 50%; margin-top: -4.5px;
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
  }

  /* Hero badge is the signal source */
  .hero-status { position: relative; }
  .hero-status::before {
    content: ""; position: absolute; left: -32px; width: 32px; top: 50%; height: 1px;
    background: linear-gradient(to right, var(--accent-line), var(--line-strong));
  }
  .hero-status::after {
    content: ""; position: absolute; left: -36.5px; top: 50%; margin-top: -4.5px;
    width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), 0 0 12px rgba(181,164,140,.45);
  }

  /* CTA boxes plug into the rail */
  .cta-band { position: relative; }
  .cta-band::before {
    content: ""; position: absolute; left: -33px; width: 33px; top: 50%; height: 1px; background: var(--line-strong);
  }
  .cta-band::after {
    content: ""; position: absolute; left: -5px; top: 50%; margin-top: -4.5px;
    width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent);
  }

  /* Arrowheads between process steps */
  .flow li:not(:last-child)::after {
    content: ""; position: absolute; top: 4px; right: 14px; width: 6px; height: 6px;
    border-top: 1px solid var(--text-dim); border-right: 1px solid var(--text-dim); transform: rotate(45deg);
  }
}

/* ==========================================================================
   Dark Bark bands: header, page tops, CTA boxes, footer
   ========================================================================== */
.cta-band, .site-footer {
  --bg: var(--bark);
  --bg-raised: #3B342D;
  --surface: #433B33;
  --surface-2: #4C4339;
  --line: rgba(233, 227, 216, 0.12);
  --line-strong: rgba(233, 227, 216, 0.22);
  --text: var(--white);
  --text-dim: #DCD3C5;
  --muted: #A89883;
  --accent: var(--taupe);
  --accent-soft: rgba(181, 164, 140, 0.18);
  --accent-line: rgba(181, 164, 140, 0.5);
  --grain: rgba(248, 246, 241, 0.04);
  --grain-dot: rgba(248, 246, 241, 0.09);
  --btn-bg: var(--linen);
  --btn-fg: var(--bark);
  --btn-hover: var(--white);
  color: var(--text);
  color-scheme: dark;
}
.page-head { background: var(--bg); isolation: isolate; }
.site-footer { background: var(--bg); }
.cta-band { border-color: transparent; background: radial-gradient(ellipse 60% 120% at 100% 0%, rgba(181,164,140,0.16), transparent 60%), var(--bg); }
.brand .tld { font-weight: 500; }

@media (min-width: 900px) {
  main::before { z-index: 1; background: linear-gradient(to bottom, transparent, var(--rail) 120px, var(--rail) calc(100% - 180px), transparent); }
  .section::before { z-index: 2; }
}

/* ==========================================================================
   Brand mark
   ========================================================================== */
.brand .mark { width: 36px; height: auto; flex: none; fill: var(--accent); }
.footer-brand .brand .mark { width: 38px; }

/* Oversized, faint antler watermark behind page headings */
.page-head::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  right: max(-60px, calc((100% - var(--wrap)) / 2 - 40px)); top: 50%; transform: translateY(-46%);
  height: min(84%, 440px); aspect-ratio: 743.75 / 432.9; max-width: 62vw;
  background: url("../img/brand/mark-light.svg") no-repeat center / contain;
  opacity: 0.05;
}
@media (max-width: 760px) {
  .page-head::after { right: -16%; height: auto; width: 92vw; max-width: none; opacity: 0.045; }
}

/* Low-contrast repeating mark pattern in the footer */
.site-footer { position: relative; isolation: isolate; overflow: hidden; }
.site-footer::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("../img/brand/pattern-light.svg") repeat 0 0 / 220px 150px;
  opacity: 0.035;
}

/* ==========================================================================
   Visual direction v2 — engineering studio, woodland identity
   ========================================================================== */

/* Editorial serif headings */
h1, h2, .tab, .cta-band h2, .notfound h1 {
  font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.02em;
  font-optical-sizing: auto;
}
h1 { line-height: 1.04; }
h2 { line-height: 1.08; }
h1 .accent, h2 .accent { font-style: italic; font-weight: 400; }
.tab { letter-spacing: -0.025em; }

/* Wordmark: clean and prominent */
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--text);
}
.wordmark .tld {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.66rem; letter-spacing: 0.12em;
  color: var(--accent); padding: 3px 6px 2px; border: 1px solid var(--line-strong); border-radius: 3px;
}
.footer-brand .brand { gap: 14px; }

/* Light header */
.site-header { background: rgba(233, 227, 216, 0.86); border-bottom-color: var(--line); }
.site-header.is-scrolled { background: rgba(233, 227, 216, 0.95); }
@media (max-width: 860px) { .nav-links { background: var(--linen); } }

/* Page tops: cream drafting paper */
.page-head::before {
  background-image:
    linear-gradient(to right, rgba(51,45,39,0.075) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(51,45,39,0.075) 1px, transparent 1px),
    linear-gradient(to right, rgba(51,45,39,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(51,45,39,0.035) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
}
.page-head::after { background-image: url("../img/brand/mark-dark.svg"); opacity: 0.05; }
.page-head--drawing::after { display: none; }

/* Technical line drawings */
.field-drawing { display: none; margin: 0; color: var(--walnut); }
.field-drawing svg { width: 100%; height: auto; overflow: visible; }
.field-drawing text {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.06em;
  fill: var(--muted); stroke: none;
}
.field-drawing text.k { fill: var(--text); font-weight: 500; }
.field-drawing text.u { font-size: 6.5px; }
.field-drawing .dot { fill: var(--linen); }
.field-drawing .faint { stroke-opacity: 0.35; }
.field-drawing .aud { stroke-dasharray: 4 2.5; }
.field-drawing .net { stroke-dasharray: 0.5 2.5; stroke-linecap: round; stroke-width: 1.3; }
@media (min-width: 1100px) {
  .page-head--drawing .wrap { display: flex; align-items: center; gap: clamp(36px, 5vw, 72px); }
  .page-head--tabs.page-head--drawing .wrap { align-items: flex-end; }
  .page-head-text { flex: 1 1 auto; min-width: 0; }
  .field-drawing {
    display: block; flex: 0 0 clamp(300px, 32vw, 430px);
    opacity: 0; animation: draw-in 1s var(--ease) .15s forwards;
  }
  .page-head--tabs .field-drawing { flex-basis: clamp(290px, 30vw, 400px); align-self: center; margin-bottom: 24px; }
}
@keyframes draw-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Topographic contours */
.site-footer::before {
  background: url("../img/brand/pattern-light.svg") repeat 0 0 / 120px 90px;
  opacity: 0.06;
}
.cta-band { position: relative; isolation: isolate; }
.cta-band > div:first-child::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: calc(var(--radius) + 4px); pointer-events: none;
  background: url("../img/brand/wire-light.svg") center / cover no-repeat;
  /* Traces stay faint under the copy and come up to full strength on the right */
  mask-image: linear-gradient(to right, rgba(0,0,0,.4), rgba(0,0,0,.55) 35%, #000 70%);
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.4), rgba(0,0,0,.55) 35%, #000 70%);
}
.section--topo { position: relative; isolation: isolate; overflow: hidden; }
.section--topo > .wrap::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  right: -12%; top: 0; bottom: 0; width: 70%;
  background: url("../img/brand/topo-dark.svg") center / cover no-repeat;
  mask-image: linear-gradient(to left, #000 30%, transparent);
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent);
}

/* Photo slots as figure frames */
.work-grid { counter-reset: fig; }
.work-card { counter-increment: fig; }
.work-media--placeholder {
  --cm: var(--muted);
  background:
    linear-gradient(var(--cm), var(--cm)) top 12px left 12px / 14px 1px no-repeat,
    linear-gradient(var(--cm), var(--cm)) top 12px left 12px / 1px 14px no-repeat,
    linear-gradient(var(--cm), var(--cm)) top 12px right 12px / 14px 1px no-repeat,
    linear-gradient(var(--cm), var(--cm)) top 12px right 12px / 1px 14px no-repeat,
    linear-gradient(var(--cm), var(--cm)) bottom 12px left 12px / 14px 1px no-repeat,
    linear-gradient(var(--cm), var(--cm)) bottom 12px left 12px / 1px 14px no-repeat,
    linear-gradient(var(--cm), var(--cm)) bottom 12px right 12px / 14px 1px no-repeat,
    linear-gradient(var(--cm), var(--cm)) bottom 12px right 12px / 1px 14px no-repeat,
    linear-gradient(to right, rgba(51,45,39,0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, rgba(51,45,39,0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--white);
}
.work-media--placeholder span:not(.badge)::before { display: none; }
.work-media--placeholder span:not(.badge) { font-size: 0; }
.work-media--placeholder span:not(.badge)::after {
  content: "FIG. " counter(fig, decimal-leading-zero) " — Photo pending";
  font-size: 0.7rem;
}
.work-media .badge { top: 22px; left: 22px; }

/* Mobile menu scrim */
@media (max-width: 860px) {
  html.nav-open body::after {
    content: ""; position: fixed; inset: 0; z-index: 40;
    background: rgba(51, 45, 39, 0.38);
    animation: panel-in .2s var(--ease);
  }
  .nav-links { box-shadow: 0 18px 30px -18px rgba(51, 45, 39, 0.4); }
  html.nav-open .site-header { background: var(--linen); }
}

/* Keep page-top text at the same height on every page */
@media (min-width: 1100px) {
  .page-head--drawing .wrap { align-items: flex-start; }
  .page-head--tabs.page-head--drawing .wrap { display: block; position: relative; }
  .page-head--tabs .field-drawing {
    position: absolute; right: var(--gutter); bottom: 14px; margin: 0;
    /* Room wiring is taller than it is wide; cap it so it fits under the header */
    width: clamp(250px, 22vw, 300px);
  }
}

/* ==========================================================================
   Type scheme: Manrope (wordmark 700, headings 600, body 400),
   Lora for occasional editorial accents, IBM Plex Mono for technical labels
   ========================================================================== */
body { font-weight: 400; }
h1, h2, .tab, .cta-band h2, .notfound h1 {
  font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.035em;
}
h3 { font-weight: 600; letter-spacing: -0.015em; }
h1 .accent, h2 .accent {
  font-family: var(--font-serif); font-style: italic; font-weight: 500;
  letter-spacing: -0.01em; font-size: 1.04em;
}
.wordmark { font-weight: 700; letter-spacing: 0.18em; }
.prose strong { font-weight: 600; }

/* Portrait photo: caption sits on a soft shade so it reads over the image */
.portrait img + figcaption {
  left: 0; right: 0; bottom: 0; padding: 40px 16px 14px;
  color: var(--linen);
  background: linear-gradient(to top, rgba(33, 28, 24, 0.62), transparent);
}

/* Cut-out portrait: transparent headshot straight on the page color */
.portrait--cutout { background: var(--bg); border-color: transparent; border-radius: 0; }
.portrait--cutout img { object-fit: cover; object-position: center top; }
.portrait--cutout img + figcaption { background: none; padding: 0 16px 14px; }

/* About page: a little tighter than the other pages */
.page-about .section { padding: clamp(56px, 7vw, 92px) 0; }
.page-about .section-head { margin-bottom: clamp(28px, 4vw, 44px); }
.page-about .prose p + p { margin-top: 0.9em; }

/* Process line as a signal chain: a cable-label tag sits on the wire after each node */
.flow--nodes .node {
  position: absolute; left: 24px; top: 7px; transform: translateY(-50%); z-index: 1;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 6px;
  background: var(--bg);
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); white-space: nowrap; line-height: 1;
}
.flow--nodes .node b {
  display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 3px;
  border: 1px solid var(--line-strong); font-weight: 500; font-size: 0.6rem; letter-spacing: 0; color: var(--accent);
}
@media (max-width: 900px) {
  .flow--nodes .node { position: static; transform: none; display: flex; width: max-content; margin-bottom: 8px; padding: 0; background: none; }
}

/* ==========================================================================
   Final pass: rhythm, line breaks, no inline styles
   ========================================================================== */
/* One section's worth of space around the CTA box and above the footer
   (was two stacked paddings, which left ~256px gaps) */
.section--flush { padding-top: 0; }
.site-footer { margin-top: 0; }
.notfound { padding: clamp(72px, 10vw, 128px) 0; }

/* Even line lengths in headings; no one-word last lines in paragraphs */
h1, h2, h3 { text-wrap: balance; }
.lede, .prose p, .cta-band p, .cell p, .flow p, .work-card p { text-wrap: pretty; }

/* Spacing that used to live in style="" attributes (blocked by the CSP) */
.portrait { margin: 0; }
.eyebrow + .prose { margin-top: 24px; }
.prose + .spec-list { margin-top: 32px; }
