/* =========================================================================
   Boundless Engineering — Editorial Engineering Quarterly
   ------------------------------------------------------------------------- */

/* -- Tokens ---------------------------------------------------------------- */
:root {
  /* Color */
  --paper:        #F4EFE6;
  --paper-2:      #EAE3D5;
  --paper-3:      #DED4BD;
  --ink:          #10141A;
  --ink-2:        #3A4049;
  --ink-3:        #6B6F77;
  --rule:         #C9C0AE;
  --rule-soft:    #DCD3BE;
  --brass:        #B16A3A;
  --brass-deep:   #7E4724;
  --brass-tint:   #E9CDB1;

  --ink-bg:       #0E1218;
  --ink-bg-2:     #161B23;
  --paper-on-dark:#F4EFE6;

  /* Type */
  --font-display: "Roboto Serif", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --font-body:    "Roboto", ui-sans-serif, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono:    "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing scale */
  --s-1:   4px;
  --s-2:   8px;
  --s-3:   16px;
  --s-4:   24px;
  --s-5:   40px;
  --s-6:   64px;
  --s-7:   96px;
  --s-8:   144px;
  --s-9:   200px;

  /* Layout */
  --container: 1280px;
  --gutter:    clamp(20px, 4vw, 64px);
  --radius:    2px;

  /* Motion */
  --ease:      cubic-bezier(.2,.7,.2,1);
  --dur-1:     220ms;
  --dur-2:     500ms;
  --dur-3:     900ms;
}

/* -- Reset / base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Background paper grain — subtle dual-noise, no images */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    radial-gradient(rgba(16,20,26,0.025) 1px, transparent 1px),
    radial-gradient(rgba(177,106,58,0.018) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
  mix-blend-mode: multiply;
  opacity: 0.7;
}

::selection { background: var(--brass); color: var(--paper); }

/* -- Typography ramp ------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 380;
  color: var(--ink);
  letter-spacing: -0.012em;
  line-height: 1.02;
  margin: 0;
}

.display {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(48px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.h1 { font-size: clamp(40px, 6vw, 80px); line-height: 1.0;  letter-spacing: -0.02em; }
.h2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.05; letter-spacing: -0.018em; }
.h3 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -0.012em; }
.h4 { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.25; letter-spacing: -0.005em; }

.lede {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.4;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  max-width: 36ch;
}

p { margin: 0 0 var(--s-3); }
.body p:last-child { margin-bottom: 0; }

.meta, .mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.meta { display: inline-block; max-width: 100%; }
p.meta { display: block; }
.meta--brass { color: var(--brass); }
.meta--lg { font-size: 12px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--brass);
}

/* -- Layout ---------------------------------------------------------------- */
.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
}

main { position: relative; z-index: 2; }

section { position: relative; padding-block: clamp(64px, 10vw, 144px); }
section + section { padding-top: clamp(48px, 8vw, 112px); }

.section-band { background: var(--paper-2); }
.section-ink  { background: var(--ink-bg); color: var(--paper-on-dark); }
.section-ink h1, .section-ink h2, .section-ink h3 { color: var(--paper-on-dark); }
.section-ink .lede { color: rgba(244,239,230,0.72); }
.section-ink .meta { color: rgba(244,239,230,0.55); }
.section-ink .eyebrow { color: var(--brass-tint); }
.section-ink .eyebrow::before { background: var(--brass-tint); }
.section-ink .rule { background: linear-gradient(90deg, var(--brass-tint), transparent); }

/* Engineer's grid background — opt in per section */
.grid-bg {
  background-image:
    linear-gradient(to right, rgba(16,20,26,0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16,20,26,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}
.section-ink.grid-bg {
  background-color: var(--ink-bg);
  background-image:
    linear-gradient(to right, rgba(244,239,230,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(244,239,230,0.04) 1px, transparent 1px);
}

/* Hairline rule */
.rule {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, var(--rule) 0%, var(--rule) 60%, transparent 100%);
  border: 0;
  margin: 0;
  transform-origin: left center;
}
hr.rule { display: block; }

/* Reveal on intersect (animated by main.js) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

.reveal-rule {
  transform: scaleX(0);
  transition: transform var(--dur-3) var(--ease);
}
.reveal-rule.is-in { transform: scaleX(1); }

/* -- Scroll progress ------------------------------------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 1.5px;
  background: var(--brass);
  width: 0%;
  z-index: 100;
  transition: width 80ms linear;
  pointer-events: none;
}

/* -- Site header / nav ----------------------------------------------------- */
.site-header {
  position: sticky; top: 0;
  z-index: 50;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  background: rgba(244,239,230,0.78);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-1) var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--rule-soft); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
.brand-logo {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1;
}
.brand-mark em {
  font-style: italic;
  color: var(--brass);
}
.brand-id {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
/* Footer brand sits a bit larger to anchor the colophon */
.foot-brand .brand-logo { width: 40px; height: 40px; }
/* Mobile-overlay version stays consistent */
.nav-overlay .brand-logo { width: 32px; height: 32px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
  padding-block: 6px;
  transition: color var(--dur-1) var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-1) var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--ink);
  padding: 10px 18px 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }
.nav-cta .arrow { transition: transform var(--dur-1) var(--ease); }
.nav-cta:hover .arrow { transform: translateX(4px); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-block; }
  .site-nav.is-open .nav-overlay { display: flex; }
}

.nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--paper);
  z-index: 60;
  flex-direction: column;
  padding: var(--s-5) var(--gutter);
  gap: var(--s-5);
}
.nav-overlay header {
  display: flex; justify-content: space-between; align-items: center;
}
.nav-overlay ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: var(--s-3);
}
.nav-overlay a {
  font-family: var(--font-display);
  font-size: clamp(36px, 9vw, 64px);
  font-weight: 350;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.nav-overlay .meta { color: var(--ink-3); }

/* -- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 22px 15px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  cursor: pointer;
}
.btn .arrow { transition: transform var(--dur-1) var(--ease); }
.btn:hover { background: var(--brass); border-color: var(--brass); color: var(--paper); }
.btn:hover .arrow { transform: translateX(5px); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.section-ink .btn {
  background: var(--paper); color: var(--ink); border-color: var(--paper);
}
.section-ink .btn:hover { background: var(--brass); border-color: var(--brass); color: var(--paper); }
.section-ink .btn-ghost {
  background: transparent; color: var(--paper); border-color: var(--paper);
}
.section-ink .btn-ghost:hover { background: var(--paper); color: var(--ink); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 1px;
  font-weight: 500;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.text-link .arrow { transition: transform var(--dur-1) var(--ease); }
.text-link:hover { color: var(--brass-deep); border-color: var(--brass-deep); }
.text-link:hover .arrow { transform: translateX(4px); }

/* -- Hero ------------------------------------------------------------------ */
.hero {
  padding-block: clamp(20px, 3.5vw, 56px) clamp(40px, 7vw, 96px);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
}
.hero-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.hero-headline {
  font-family: var(--font-display);
  font-weight: 320;
  font-size: clamp(56px, 10.5vw, 156px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0;
}
.hero-headline em {
  font-style: italic;
  color: var(--brass);
  font-weight: 320;
}

/* line-by-line reveal */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.2em;
  margin-bottom: -0.05em;
}
.line > span {
  display: inline-block;
  transform: translateY(115%);
  animation: rise 1.05s var(--ease) forwards;
}
.line:nth-of-type(1) > span { animation-delay: 0.05s; }
.line:nth-of-type(2) > span { animation-delay: 0.18s; }
.line:nth-of-type(3) > span { animation-delay: 0.31s; }
.line:nth-of-type(4) > span { animation-delay: 0.44s; }

@keyframes rise {
  0%   { transform: translateY(115%); }
  100% { transform: translateY(0); }
}

.hero-foot {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule-soft);
}
@media (min-width: 760px) {
  .hero-foot { grid-template-columns: 1.2fr 1fr auto; align-items: end; }
}

.hero-schematic {
  position: absolute;
  right: var(--gutter);
  top: 88px;
  width: clamp(140px, 18vw, 240px);
  opacity: 0.85;
  pointer-events: none;
}
@media (max-width: 900px) {
  .hero-schematic { position: static; margin-bottom: var(--s-4); }
}
@media (max-width: 759px) {
  .hero-schematic { display: none; }
}

/* PNG compass — slightly smaller, lighter blend with paper, plus a soft
   gentle drift on hover/page-load so it feels printed rather than dropped in. */
img.hero-compass {
  height: auto;
  aspect-ratio: 1 / 1;
  width: clamp(140px, 18vw, 240px);
  opacity: 0.92;
  mix-blend-mode: multiply;
  filter: contrast(1.02);
  user-select: none;
}
@media (prefers-reduced-motion: no-preference) {
  img.hero-compass { animation: compass-drift 18s ease-in-out infinite alternate; }
}
@keyframes compass-drift {
  0%   { transform: rotate(-1.2deg); }
  100% { transform: rotate(1.2deg); }
}

/* -- Stat / index strip --------------------------------------------------- */
.index-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--rule-soft);
  border-block: 1px solid var(--rule-soft);
}
@media (min-width: 720px) { .index-strip { grid-template-columns: repeat(4, 1fr); } }

.index-cell {
  background: var(--paper);
  padding: var(--s-4) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.index-cell .num {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.index-cell .num em {
  font-family: var(--font-mono);
  font-size: 0.42em;
  font-style: normal;
  color: var(--brass);
  margin-left: 4px;
  vertical-align: super;
  letter-spacing: 0.1em;
}
.index-cell .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* -- Capability cards ----------------------------------------------------- */
.cap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--rule-soft);
}
@media (min-width: 760px)  { .cap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cap-grid { grid-template-columns: repeat(3, 1fr); } }

.cap-card {
  position: relative;
  padding: var(--s-5) var(--s-4) var(--s-4);
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--ink);
  transition: background var(--dur-1) var(--ease);
  min-height: 280px;
}
.cap-card:hover { background: var(--paper-2); }
.cap-card:hover .cap-arrow { transform: translate(4px, -4px); }

@media (min-width: 1100px) {
  .cap-card:nth-child(3n) { border-right: 0; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  .cap-card:nth-child(2n) { border-right: 0; }
}
@media (max-width: 759px) {
  .cap-card { border-right: 0; }
}

.cap-card .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--brass);
}
.cap-card h3 {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.cap-card p {
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.5;
  margin: 0;
}
.cap-arrow {
  margin-top: auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink-2);
  border-radius: 999px;
  color: var(--ink);
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.cap-card:hover .cap-arrow { background: var(--brass); border-color: var(--brass); color: var(--paper); }

/* -- Editorial split row -------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  align-items: start;
}
@media (min-width: 920px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); }
  .split--reverse > :first-child { order: 2; }
  .split--narrow { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}
.split aside .meta { display: block; margin-bottom: var(--s-3); }
.split aside h2 { margin-bottom: var(--s-3); }
/* Only stick the aside once the grid has actually split into two columns,
   otherwise the sticky aside paints over the form/body content below it. */
@media (min-width: 920px) {
  .split aside { position: sticky; top: 96px; }
}

.body-prose p {
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: var(--s-3);
  max-width: 62ch;
}
.body-prose p strong { color: var(--ink); font-weight: 600; }
.body-prose .lede { color: var(--ink); margin-bottom: var(--s-4); }

/* -- Pull quote / principle ---------------------------------------------- */
.principle {
  border-left: 2px solid var(--brass);
  padding: var(--s-2) 0 var(--s-2) var(--s-4);
}
.principle blockquote {
  font-family: var(--font-display);
  font-weight: 320;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 var(--s-3);
}
.principle blockquote em { font-style: italic; color: var(--brass); }
.principle .meta { color: var(--ink-3); }

.principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 880px) { .principles { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); } }

/* -- Service entry (numbered editorial) ---------------------------------- */
.entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  padding-block: var(--s-6);
  border-top: 1px solid var(--rule-soft);
}
.entry:last-of-type { border-bottom: 1px solid var(--rule-soft); }

@media (min-width: 920px) {
  .entry { grid-template-columns: 80px minmax(0, 4fr) minmax(0, 7fr); gap: var(--s-5); }
}

.entry-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--brass);
  padding-top: 8px;
}
.entry h3 {
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(28px, 3.8vw, 48px);
  line-height: 1.0;
  letter-spacing: -0.018em;
  margin-bottom: var(--s-3);
}
.entry h3 em { font-style: italic; color: var(--brass); }
.entry .promise {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 320;
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 32ch;
  margin: 0;
}
.entry .deliverables { margin-top: var(--s-4); }
.entry .deliverables h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
  margin-bottom: var(--s-2);
}
.entry .deliverables ul {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
@media (min-width: 600px) {
  .entry .deliverables ul { grid-template-columns: repeat(2, 1fr); }
}
.entry .deliverables li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  padding: 8px 0;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.entry .deliverables li::before {
  content: "—";
  color: var(--brass);
}
/* -- FAQ ------------------------------------------------------------------ */
details.faq {
  border-top: 1px solid var(--rule-soft);
  padding: var(--s-3) 0;
}
details.faq:last-child { border-bottom: 1px solid var(--rule-soft); }
details.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(20px, 1.8vw, 24px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--brass);
  flex: 0 0 auto;
  transition: transform var(--dur-1) var(--ease);
}
details.faq[open] summary::after { content: "−"; }
details.faq p {
  margin-top: var(--s-3);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.6;
  max-width: 60ch;
}

/* -- Index list (links) -------------------------------------------------- */
.idx-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule-soft);
}
.idx-list li { border-bottom: 1px solid var(--rule-soft); }
.idx-list a {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3) 0;
  text-decoration: none;
  color: var(--ink);
  transition: padding var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.idx-list a:hover { padding-inline: var(--s-3); color: var(--brass); }
.idx-list .num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--brass);
}
.idx-list .title {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.012em;
}
.idx-list .arrow {
  font-family: var(--font-mono);
  color: var(--ink-2);
  transition: transform var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.idx-list a:hover .arrow { color: var(--brass); transform: translateX(6px); }

/* -- CTA ribbon ---------------------------------------------------------- */
.cta {
  background: var(--ink-bg);
  color: var(--paper-on-dark);
  padding-block: clamp(80px, 12vw, 160px);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(244,239,230,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(244,239,230,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.cta-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  align-items: end;
}
@media (min-width: 880px) { .cta-grid { grid-template-columns: 1.4fr 1fr; } }
.cta h2 {
  font-family: var(--font-display);
  font-weight: 320;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--paper-on-dark);
  margin: 0 0 var(--s-3);
}
.cta h2 em {
  font-style: italic;
  color: var(--brass-tint);
}
.cta p {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.5;
  color: rgba(244,239,230,0.7);
  max-width: 36ch;
  margin: 0;
}
.cta-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* -- Footer -------------------------------------------------------------- */
.site-footer {
  background: var(--paper-2);
  padding-block: var(--s-6) var(--s-4);
  border-top: 1px solid var(--rule-soft);
  position: relative;
  z-index: 2;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 760px) {
  .foot-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-5); }
}
.foot-brand .brand-mark { font-size: 28px; }
.foot-brand p {
  margin-top: var(--s-3);
  color: var(--ink-2);
  max-width: 32ch;
  font-size: 15px;
  line-height: 1.5;
}
.foot-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--s-3);
  font-weight: 500;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a {
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  transition: color var(--dur-1) var(--ease);
}
.foot-col a:hover { color: var(--brass-deep); }

.colophon {
  margin-top: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--rule-soft);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.colophon a { color: inherit; text-decoration: none; }
.colophon a:hover { color: var(--brass); }

/* -- Forms (contact) -----------------------------------------------------
   Clearly framed: visible card around the form, boxed inputs, body-font
   sans, obvious focus states. Editorial labels on top in mono.
-------------------------------------------------------------------------- */
.form-card {
  background: #FFFCF6;
  border: 1px solid var(--rule);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 1px 0 0 var(--rule-soft), 0 24px 48px -32px rgba(16,20,26,0.18);
}
.form-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule-soft);
}
.form-card-head .title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.012em;
  color: var(--ink);
}
.form-card-head .title em { font-style: italic; color: var(--brass); }
.form-card-head .meta { color: var(--ink-3); }

.form-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-3);
}
@media (min-width: 600px) {
  .form-wrap { grid-template-columns: 1fr 1fr; }
}
.form-wrap > label,
.form-wrap > .full {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 600px) {
  .form-wrap > .full { grid-column: 1 / -1; }
}

.form-wrap label > span:first-child {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.form-wrap label > span:first-child::before {
  content: "*";
  color: var(--brass);
  font-size: 14px;
  margin-right: -2px;
  line-height: 0;
  position: relative;
  top: 2px;
}
.form-wrap label.optional > span:first-child::before { content: ""; margin: 0; }
.form-wrap label .opt {
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-style: normal;
  font-weight: 400;
}

.form-wrap input,
.form-wrap textarea {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  outline: 0;
  padding: 12px 14px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.form-wrap textarea { min-height: 140px; line-height: 1.55; }
.form-wrap input::placeholder,
.form-wrap textarea::placeholder { color: var(--ink-3); opacity: 0.7; }
.form-wrap input:hover,
.form-wrap textarea:hover { border-color: var(--ink-3); }
.form-wrap input:focus,
.form-wrap textarea:focus {
  background: #FFFEFB;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(177,106,58,0.12);
}
.form-wrap input:invalid:not(:placeholder-shown),
.form-wrap textarea:invalid:not(:placeholder-shown) {
  border-color: #B14A3A;
  box-shadow: 0 0 0 3px rgba(177,74,58,0.10);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-4);
  flex-wrap: wrap;
}
.form-actions .meta { color: var(--ink-3); }

.hidden {
  display: none !important;
}

/* Use :not([hidden]) so the [hidden] attribute (set on initial render and
   removed by main.js only when ?sent=1) actually hides the success block.
   Without this guard, our display:flex would override the UA's
   [hidden]{display:none} and the block would always be visible. */
.form-success:not([hidden]) {
  border: 1px solid var(--rule);
  padding: var(--s-5);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
[hidden] { display: none !important; }
.form-success h3 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.form-success h3 em { font-style: italic; color: var(--brass); }

/* -- Schematic SVG sizing ------------------------------------------------- */
.schematic { color: var(--brass); }
.schematic.dim { color: var(--ink-3); }

/* -- Two-up info row ----------------------------------------------------- */
.info-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--s-5);
}
@media (min-width: 760px) { .info-row { grid-template-columns: repeat(2, 1fr); gap: var(--s-7); } }
.info-row h4 {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(22px, 2vw, 28px);
  margin-bottom: var(--s-3);
}
.info-row p { color: var(--ink-2); margin: 0; }

/* -- Legal page ----------------------------------------------------------- */
.legal { padding-block: clamp(56px, 8vw, 112px); }
.legal .lede { margin-bottom: var(--s-5); }
.legal h2 {
  font-family: var(--font-display);
  font-weight: 380;
  font-size: clamp(24px, 2.4vw, 32px);
  margin: var(--s-5) 0 var(--s-3);
  letter-spacing: -0.012em;
}
.legal p, .legal li {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
}
.legal ul { padding-left: var(--s-3); margin-bottom: var(--s-3); }
.legal a { color: var(--brass); text-decoration: none; border-bottom: 1px solid var(--brass-tint); }
.legal a:hover { color: var(--brass-deep); border-bottom-color: var(--brass-deep); }
.legal strong { color: var(--ink); font-weight: 600; }

/* -- 404 ------------------------------------------------------------------ */
.error-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: left;
  padding-block: clamp(64px, 10vw, 144px);
}
.error-page .num {
  font-family: var(--font-display);
  font-weight: 320;
  font-size: clamp(120px, 22vw, 280px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--ink);
}
.error-page .num em {
  font-style: italic;
  color: var(--brass);
}

/* -- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .line > span { transform: none; }
  .reveal { opacity: 1; transform: none; }
  .reveal-rule { transform: scaleX(1); }
}

/* -- Print ---------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  body::before, .scroll-progress, .site-header, .nav-overlay, .cta, .site-footer .colophon { display: none !important; }
  .hero { padding-block: 0; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 80%; }
  section { padding-block: 24px; break-inside: avoid; }
}
