/* ============================================================
   allenfbyrd.com v2 — styles.css
   Editorial-meets-engineering. Fraunces / Inter / JetBrains Mono.
   ------------------------------------------------------------
   Tokens are split into:
     • base scale / motion (always on)
     • palette  ([data-palette="cream"|"slate"|"ink"])
     • accent   ([data-accent="crimson"|"forest"|"indigo"|"amber"])
     • theme    ([data-theme="light"|"dark"] or system pref)
     • density  ([data-density="generous"|"compact"])
     • markers  ([data-markers="on"|"off"])
   The Tweaks panel just swaps these attributes on <html>.
   ============================================================ */

/* ---------- Base tokens (palette/accent-agnostic) ---------- */
:root {
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Display font alternates — switchable via [data-display]. */
}
:root[data-display="instrument"] { --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif; }
:root[data-display="newsreader"] { --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif; }
:root[data-display="fraunces"]   { --serif: 'Fraunces',   'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif; }
:root[data-display="instrument"], :root[data-display="newsreader"] {
  /* These fonts don't need opsz tweaking */
  --display-vars: normal;

  --measure: 68ch;
  --container: min(92vw, 1320px);
  --container-wide: min(96vw, 1520px);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;
  --space-8: 8.5rem;

  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);

  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
  --radius-pill: 999px;
}

/* ============================================================
   PALETTES — paper/ink/muted tokens, light & dark
   ============================================================ */

/* Default = Cream (warm). Applied unless overridden. */
:root,
:root[data-palette="cream"] {
  --paper:     #f7f4ed;
  --paper-2:   #efeadf;
  --paper-3:   #e6dfd0;
  --ink:       #15140f;
  --ink-2:     #2c2922;
  --ink-mid:   #4a4640;
  --muted:     #807a70;
  --rule:      #e0d9c8;
  --rule-soft: #ece5d3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-palette="slate"]):not([data-palette="ink"]),
  :root[data-theme="dark"][data-palette="cream"],
  :root[data-theme="dark"]:not([data-palette]) {
    --paper:     #100d07;
    --paper-2:   #1a1611;
    --paper-3:   #25201a;
    --ink:       #ece6da;
    --ink-2:     #d4cdbe;
    --ink-mid:   #a8a194;
    --muted:     #756f64;
    --rule:      #2a251d;
    --rule-soft: #1f1a14;
    color-scheme: dark;
  }
}

/* Slate (cool / contemporary). */
:root[data-palette="slate"] {
  --paper:     #f4f5f7;
  --paper-2:   #e9ebef;
  --paper-3:   #dde0e6;
  --ink:       #0e1116;
  --ink-2:     #1f242c;
  --ink-mid:   #3d4654;
  --muted:     #6b7280;
  --rule:      #d6dae2;
  --rule-soft: #e4e7ec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="slate"]:not([data-theme="light"]),
  :root[data-theme="dark"][data-palette="slate"] {
    --paper:     #0b0e13;
    --paper-2:   #131820;
    --paper-3:   #1c222c;
    --ink:       #e6eaf1;
    --ink-2:     #c5cbd5;
    --ink-mid:   #8b94a3;
    --muted:     #5e6776;
    --rule:      #232a36;
    --rule-soft: #181d27;
    color-scheme: dark;
  }
}
:root[data-theme="dark"][data-palette="slate"] {
  --paper:     #0b0e13;
  --paper-2:   #131820;
  --paper-3:   #1c222c;
  --ink:       #e6eaf1;
  --ink-2:     #c5cbd5;
  --ink-mid:   #8b94a3;
  --muted:     #5e6776;
  --rule:      #232a36;
  --rule-soft: #181d27;
  color-scheme: dark;
}

/* Ink (sharp, high-contrast executive). */
:root[data-palette="ink"] {
  --paper:     #ffffff;
  --paper-2:   #f5f5f5;
  --paper-3:   #e8e8e8;
  --ink:       #050505;
  --ink-2:     #1a1a1a;
  --ink-mid:   #404040;
  --muted:     #6e6e6e;
  --rule:      #dadada;
  --rule-soft: #ececec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="ink"]:not([data-theme="light"]),
  :root[data-theme="dark"][data-palette="ink"] {
    --paper:     #050505;
    --paper-2:   #0e0e0e;
    --paper-3:   #1a1a1a;
    --ink:       #fafafa;
    --ink-2:     #d4d4d4;
    --ink-mid:   #8a8a8a;
    --muted:     #5a5a5a;
    --rule:      #1e1e1e;
    --rule-soft: #141414;
    color-scheme: dark;
  }
}
:root[data-theme="dark"][data-palette="ink"] {
  --paper:     #050505;
  --paper-2:   #0e0e0e;
  --paper-3:   #1a1a1a;
  --ink:       #fafafa;
  --ink-2:     #d4d4d4;
  --ink-mid:   #8a8a8a;
  --muted:     #5a5a5a;
  --rule:      #1e1e1e;
  --rule-soft: #141414;
  color-scheme: dark;
}

/* Explicit light override (always wins, regardless of system). */
:root[data-theme="light"][data-palette="cream"],
:root[data-theme="light"]:not([data-palette]) {
  --paper:     #f7f4ed;
  --paper-2:   #efeadf;
  --paper-3:   #e6dfd0;
  --ink:       #15140f;
  --ink-2:     #2c2922;
  --ink-mid:   #4a4640;
  --muted:     #807a70;
  --rule:      #e0d9c8;
  --rule-soft: #ece5d3;
  color-scheme: light;
}

/* ============================================================
   ACCENTS — single hue, paired tones for hover + tint
   ============================================================ */

:root,
:root[data-accent="crimson"] {
  --accent:     #a62a2a;
  --accent-mid: #c14545;
  --accent-soft: rgba(166, 42, 42, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-accent="crimson"],
  :root[data-theme="dark"][data-accent="crimson"],
  :root[data-theme="dark"]:not([data-accent]) {
    --accent:     #df7a7a;
    --accent-mid: #ef9595;
    --accent-soft: rgba(223, 122, 122, 0.18);
  }
}
:root[data-theme="dark"][data-accent="crimson"],
:root[data-theme="dark"]:not([data-accent]) {
  --accent:     #df7a7a;
  --accent-mid: #ef9595;
  --accent-soft: rgba(223, 122, 122, 0.18);
}

:root[data-accent="forest"] { --accent: #2f6b46; --accent-mid: #3f8359; --accent-soft: rgba(47, 107, 70, 0.12); }
:root[data-theme="dark"][data-accent="forest"] { --accent: #6cc090; --accent-mid: #88d3a8; --accent-soft: rgba(108, 192, 144, 0.18); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-accent="forest"] {
    --accent: #6cc090; --accent-mid: #88d3a8; --accent-soft: rgba(108, 192, 144, 0.18);
  }
}

:root[data-accent="indigo"] { --accent: #3a4cb8; --accent-mid: #5366cc; --accent-soft: rgba(58, 76, 184, 0.12); }
:root[data-theme="dark"][data-accent="indigo"] { --accent: #8b9bff; --accent-mid: #a3b1ff; --accent-soft: rgba(139, 155, 255, 0.18); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-accent="indigo"] {
    --accent: #8b9bff; --accent-mid: #a3b1ff; --accent-soft: rgba(139, 155, 255, 0.18);
  }
}

:root[data-accent="amber"] { --accent: #a85a08; --accent-mid: #c8740f; --accent-soft: rgba(168, 90, 8, 0.12); }
:root[data-theme="dark"][data-accent="amber"] { --accent: #e9a85a; --accent-mid: #f4bc77; --accent-soft: rgba(233, 168, 90, 0.18); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-accent="amber"] {
    --accent: #e9a85a; --accent-mid: #f4bc77; --accent-soft: rgba(233, 168, 90, 0.18);
  }
}

/* Selection mirrors the accent. */
::selection { background: var(--accent-soft); color: var(--ink); }

/* ============================================================
   DENSITY — multiplies vertical rhythm
   ============================================================ */
:root,
:root[data-density="generous"] {
  --rhythm: 1;
}
:root[data-density="compact"] {
  --rhythm: 0.72;
}

/* ============================================================
   RESET + BASE
   ============================================================ */

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* Sticky-safe horizontal-overflow guard: `clip` (not `hidden`) prevents a
     stray wide element from forcing horizontal scroll WITHOUT creating a
     scroll container that would break the position:sticky header. */
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'cv02', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
a:hover {
  text-decoration-color: var(--accent);
  color: var(--accent-mid);
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 1000;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 640px)  { .container, .container-wide { padding: 0 2rem; } }
@media (min-width: 1280px) { .container, .container-wide { padding: 0 3rem; } }
@media (min-width: 1600px) { .container, .container-wide { padding: 0 4rem; } }

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 1.2rem 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .container-wide {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2.2rem;
  flex-wrap: wrap;
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  /* center (not baseline) + a normal line-height so the serif wordmark
     shares the nav's optical centre instead of floating a few px high. */
  align-items: center;
  gap: 0.55rem;
  line-height: 1.5;
}
.wordmark-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-self: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--accent) 80%, var(--paper)) 0%, var(--accent) 60%, var(--ink) 100%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 20%, transparent),
    0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}
.wordmark-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.wordmark-name em {
  font-style: italic;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1.6rem;
  font-size: 0.88rem;
  align-items: center;
}
.site-nav a {
  color: var(--ink-mid);
  text-decoration: none;
  position: relative;
  padding: 0.2rem 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 0.18s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-cta {
  font-family: var(--sans);
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.45rem 0.9rem !important;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink) !important;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-cta::after { display: none; }
.nav-cta:hover { border-color: var(--ink); background: var(--paper-2); }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s var(--ease);
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 1px;
  pointer-events: none;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle:hover { border-color: var(--rule); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .site-header .container-wide { position: relative; justify-content: space-between; gap: 1rem; }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 1.5rem 1rem;
    z-index: 90;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 0.85rem 0; border-bottom: 1px solid var(--rule-soft); font-size: 0.95rem; }
  .site-nav a:last-child { border-bottom: none; }
  .site-nav a::after { display: none; }
  .nav-cta { text-align: center; align-self: flex-start; margin-top: 0.5rem; }
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  padding: calc(var(--space-7) * var(--rhythm)) 0 calc(var(--space-6) * var(--rhythm));
  border-bottom: 1px solid var(--rule);
}

.hero-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.hero-meta-top .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.05em;
  margin-right: 0.5em;
}

/* Firms/schools credentials in the hero meta line, grouped so the wrap is
   clean. On phones the two groups STACK (firms on one line, schools on the
   next) — a true line break with no stranded "·" at the junction. At
   >=640px (where all four fit) they sit on one line with "·" separators
   between every name, matching the desktop original. Each group is nowrap
   so a multi-word name never splits ("Georgia / Tech"). */
.hero-creds {
  display: inline-flex;
  flex-direction: column;   /* mobile: firms line, then schools line */
  align-items: center;
  gap: 0.25em 0;
}
.cred-group {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
/* "·" between the two names inside a group */
.cred-group > span:not(:first-child)::before {
  content: "·";
  margin: 0 0.7em;
  color: var(--muted);
}
@media (min-width: 640px) {
  /* One line: lay the groups in a row and add a "·" between them too,
     recreating the single "A · B · C · D" credential line. */
  .hero-creds { flex-direction: row; }
  .cred-group:not(:first-child)::before {
    content: "·";
    margin: 0 0.7em;
    color: var(--muted);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}
@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: var(--space-6);
    align-items: end;
  }
}

.hero-heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.2vw, 6.4rem);
  font-variation-settings: "opsz" 144;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-3);
  color: var(--ink);
  text-wrap: balance;
}
.hero-heading em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
  /* Italic forward-lean creates extra optical gap with the following roman.
     Tighten with a small negative right-margin. */
  margin-right: -0.03em;
}
.hero-heading .accent {
  color: var(--accent);
  font-style: normal;
  font-weight: inherit;
}
.hero-heading .ampersand {
  font-style: italic;
  color: var(--ink-mid);
  font-weight: 300;
}

.hero-lede {
  max-width: 56ch;
  color: var(--ink-mid);
  font-size: clamp(1.05rem, 1.3vw, 1.18rem);
  line-height: 1.6;
  margin: 0 0 var(--space-4);
}
.hero-lede strong { color: var(--ink); font-weight: 500; }

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-2); color: var(--paper); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); background: var(--paper-2); text-decoration: none; color: var(--ink); }
.btn-arrow { font-family: var(--mono); font-size: 0.9em; }

/* Right column of hero — portrait / mark / availability card */
.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hero-card {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-mid);
  line-height: 1.7;
}
.hero-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-card-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
}
.hero-card-dot::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%      { box-shadow: 0 0 0 6px transparent; }
}
.hero-card kbd {
  font-family: inherit;
  font-size: 0.85em;
  padding: 0.1em 0.4em;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.hero-card-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
  border-top: 1px dashed var(--rule);
}
.hero-card-row:first-of-type { border-top: 0; padding-top: 0; }
.hero-card-row span:first-child { color: var(--muted); }
.hero-card-row span:last-child { color: var(--ink); text-align: right; }
.hero-card-row a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.hero-card-row a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* Credentials tape — running marquee under hero */
.tape {
  margin-top: var(--space-5);
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.tape-track {
  display: inline-flex;
  gap: 3.2rem;
  align-items: center;
  white-space: nowrap;
  animation: tape-scroll 60s linear infinite;
  padding-right: 3.2rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
}
.tape-track span { display: inline-flex; align-items: center; gap: 0.5rem; }
.tape-track span::before {
  content: "✦";
  color: var(--accent);
  font-size: 0.6em;
  vertical-align: 0.3em;
}
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Hero variants ----------------------------------------------- */
/* Variant: split (portrait + copy). */
:root[data-hero="split"] .hero-grid {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1024px) {
  :root[data-hero="split"] .hero-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: stretch;
  }
}
:root[data-hero="split"] .hero-aside .portrait-slot { display: block; }

/* Variant: quiet (centered, restrained). */
:root[data-hero="quiet"] .hero-grid {
  grid-template-columns: minmax(0, 1fr);
  text-align: center;
}
:root[data-hero="quiet"] .hero-heading {
  font-size: clamp(2rem, 5vw, 3.8rem);
  margin-inline: auto;
  max-width: 22ch;
}
:root[data-hero="quiet"] .hero-lede {
  margin-inline: auto;
  font-size: 1.05rem;
}
:root[data-hero="quiet"] .hero-actions { justify-content: center; }
:root[data-hero="quiet"] .hero-aside { display: none; }
:root[data-hero="quiet"] .hero-meta-top { justify-content: center; }

/* Portrait slot — hidden by default, shown in split variant. */
.portrait-slot {
  display: none;
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(135deg,
      var(--paper-2) 0,
      var(--paper-2) 12px,
      var(--paper-3) 12px,
      var(--paper-3) 24px);
  border: 1px solid var(--rule);
  overflow: hidden;
}
.portrait-slot::after {
  content: "PORTRAIT  ·  REPLACE";
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  width: max-content;
}

/* ============================================================
   SECTION RHYTHM
   ============================================================ */

.section {
  padding: calc(var(--space-7) * var(--rhythm)) 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  margin-bottom: var(--space-5);
  align-items: end;
}
@media (min-width: 768px) {
  .section-head { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 2rem; }
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.section-eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--accent);
}
.section-marker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-right: 0.6rem;
}
:root[data-markers="off"] .section-marker { display: none; }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.section-title em { margin-right: -0.03em; }
.section-blurb {
  margin: 0;
  color: var(--ink-mid);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 50ch;
}

/* ============================================================
   PROSE
   ============================================================ */

.prose p {
  max-width: var(--measure);
  color: var(--ink-mid);
  font-size: 1.05rem;
  margin: 0 0 1rem;
  line-height: 1.75;
}
.prose p:last-child { margin-bottom: 0; }
.prose em { color: var(--accent); font-style: italic; }

.pull-quote {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  font-variation-settings: "opsz" 144;
  line-height: 1.25;
  color: var(--ink);
  margin: var(--space-4) 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--accent);
  max-width: 36ch;
}
.pull-quote .by {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.pull-quote--small {
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  font-style: normal;
  line-height: 1.55;
  color: var(--ink-mid);
  border-left-color: var(--rule);
  margin-top: var(--space-3);
  font-variation-settings: normal;
}
.pull-quote--small .by { color: var(--muted); }

.about-asides {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* About: two-col grid */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-6); }
}

/* ============================================================
   TIMELINE (Experience / Education / Service)
   ============================================================ */

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.entry {
  display: grid;
  grid-template-columns: clamp(170px, 14vw, 230px) minmax(0, 1fr);
  gap: 2rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule-soft);
  position: relative;
}
.entry:first-child { border-top: 0; padding-top: 0.4rem; }

.entry-when {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-top: 0.4rem;
}
.entry-when small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.entry-what h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.6vw, 1.55rem);
  margin: 0 0 0.2rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
}
.entry-role {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--ink-mid);
  font-style: italic;
}
.entry-role em { color: var(--accent); }
.entry-desc {
  margin: 0;
  color: var(--ink-mid);
  max-width: 64ch;
  line-height: 1.7;
  font-size: 0.98rem;
}

/* Metric chips inline in entries */
.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
}
.metric {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-mid);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.metric-num {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  font-feature-settings: 'tnum';
}
.metric-arrow { color: var(--accent); font-size: 0.7rem; }

@media (max-width: 640px) {
  .entry { grid-template-columns: 1fr; gap: 0.6rem; }
  .entry-when { padding-top: 0; }
  /* Let metric chips wrap their text instead of overflowing the viewport. */
  .metric { white-space: normal; }
  /* The hero's large top padding is too tall on phones; roughly halve it. */
  .hero { padding-top: calc(var(--space-5) * var(--rhythm)); }
}

/* ============================================================
   PROJECTS  (featured + grid)
   ============================================================ */

.project-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: var(--paper-2);
  margin-bottom: var(--space-5);
  transition: border-color 0.2s var(--ease), transform 0.25s var(--ease);
}
@media (min-width: 900px) {
  .project-featured {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-5);
    padding: 2rem;
  }
}
.project-featured:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); }

.project-thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background:
    radial-gradient(at 30% 30%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    repeating-linear-gradient(45deg,
      var(--paper) 0,
      var(--paper) 16px,
      var(--paper-3) 16px,
      var(--paper-3) 18px);
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.project-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Anchor left so a wide (2:1) banner like the Evidentia logo card is
     cropped from the RIGHT (empty space) to fit the 16:9 thumb — keeps the
     logo (far left) and the title/badges (centre) intact. */
  object-position: left center;
  display: block;
}
.project-thumb:has(img) { background: var(--paper-3); }
.project-thumb:has(img)::after { display: none; }
.project-thumb::after {
  content: attr(data-label);
  position: absolute;
  bottom: 1rem; left: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
}

.project-body { display: flex; flex-direction: column; }
.project-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.project-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.project-title a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
.project-title a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.project-desc {
  color: var(--ink-mid);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0 0 1rem;
  max-width: 56ch;
}

.project-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 700px)  { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: border-color 0.2s var(--ease), transform 0.25s var(--ease), background 0.2s var(--ease);
  text-decoration: none;
  color: inherit;
}
.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
  background: var(--paper-2);
  transform: translateY(-2px);
}
.project-card .project-tag { margin-bottom: 0.6rem; }
.project-card h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.project-card p {
  font-size: 0.95rem;
  color: var(--ink-mid);
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
}
.project-card .arrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

/* Case-study mini-spec block inside the featured project */
.case-spec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
}
@media (min-width: 700px) {
  .case-spec { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
}
.case-spec div { display: flex; flex-direction: column; gap: 0.2rem; }
.case-spec dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-spec dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  font-feature-settings: 'tnum';
  letter-spacing: -0.005em;
}

.project-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.project-meta a { color: var(--accent); }

/* ============================================================
   CAPABILITIES (replaces Skills)
   ============================================================ */

.capabilities {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}
@media (min-width: 700px)  { .capabilities { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .capabilities { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.cap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  position: relative;
  transition: border-color 0.2s var(--ease);
}
.cap:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); }
.cap-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.cap h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.18rem;
  margin: 0;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.cap p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--ink-mid);
  line-height: 1.6;
}
.cap ul {
  list-style: none;
  /* The old 0.4rem top *margin* becomes top *padding* so the gap above the
     list is always present, even in the tallest card. */
  padding: 0.4rem 0 0;
  /* margin-top:auto pushes the list to the bottom of the flex-column card.
     Cards in a row stretch to equal height (grid default), so the lists
     bottom-align across each row regardless of description length. */
  margin: auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cap ul li {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-mid);
  padding-left: 0.95rem;
  position: relative;
  line-height: 1.5;
}
.cap ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ============================================================
   TESTIMONIALS
   ============================================================ */

.testimonials {
  columns: 1;
  column-gap: 1.25rem;
}
@media (min-width: 800px)  { .testimonials { columns: 2; } }
@media (min-width: 1200px) { .testimonials { columns: 3; } }

.testimonial {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem 1.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper);
  position: relative;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 1.25rem;
}
.testimonial::before {
  content: "“";
  position: absolute;
  top: 0.4rem; left: 1.2rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.35;
}
.testimonial-body {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 1.3rem 0 0;
  font-style: italic;
  font-variation-settings: "opsz" 22;
}
.testimonial-by {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
}
.testimonial-id { flex: 1 1 auto; min-width: 0; }
.testimonial-source {
  position: absolute;
  top: 0.8rem;
  right: 1.1rem;
  z-index: 2;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

/* Closing quote mark, mirrors the opening one (bottom-right) — kept in flow */
.testimonial-closequote {
  align-self: flex-end;
  font-family: var(--serif);
  font-style: italic;
  font-size: 3.2rem;
  line-height: 0.7;
  height: 1.5rem;
  color: var(--accent);
  opacity: 0.3;
  margin: 0;
  pointer-events: none;
  user-select: none;
}

/* Clickable testimonial (stretched link covers the whole card) */
.testimonial--link { cursor: pointer; transition: border-color 0.2s var(--ease), transform 0.25s var(--ease); }
.testimonial--link:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--rule)); transform: translateY(-2px); }
.testimonial--link:hover .testimonial-source { color: var(--accent); border-color: var(--accent); }
.testimonial--link:focus-within { border-color: var(--accent); }
.testimonial-stretch {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-indent: -9999px;
  overflow: hidden;
}
.testimonial-stretch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Two-line client dialogue */
.testimonial-dialogue { display: flex; flex-direction: column; gap: 0.6rem; }
.testimonial-dialogue .dialogue-line { display: block; }
.testimonial-dialogue .dialogue-line + .dialogue-line { color: var(--ink); }

/* Multi-paragraph quote bodies keep a clear break between parts */
.quote-para { display: block; }
.quote-para + .quote-para { margin-top: 0.85rem; }
.testimonial-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--paper-3), var(--paper-2));
  border: 1px solid var(--rule);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
  flex: 0 0 46px;
}
.testimonial-avatar--img { overflow: hidden; background: var(--paper-3); }
.testimonial-avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
}
.testimonial-name {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.2;
}
.testimonial-title {
  display: block;
  font-family: var(--sans);
  font-weight: 450;
  font-size: 0.82rem;
  color: var(--ink-mid);
  line-height: 1.3;
  margin-top: 0.12rem;
}
.testimonial-sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.35;
  margin-top: 0.18rem;
}
.testimonial-role {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}
.testimonial[data-placeholder="true"] {
  background:
    repeating-linear-gradient(45deg,
      var(--paper) 0, var(--paper) 14px,
      var(--paper-2) 14px, var(--paper-2) 16px);
}
.testimonial[data-placeholder="true"] .testimonial-body {
  color: var(--muted);
  font-style: italic;
}
.testimonial[data-placeholder="true"]::after {
  content: "REPLACE";
  position: absolute;
  top: 1rem; right: 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--rule));
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.45rem;
}

/* ============================================================
   CERTS
   ============================================================ */

.certs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 700px) { .certs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; } }

.certs li {
  display: grid;
  grid-template-columns: clamp(110px, 12vw, 140px) 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule-soft);
}
.certs li:first-child { border-top: 0; }
@media (min-width: 700px) {
  .certs li:nth-child(2) { border-top: 0; }
}

.cert-status {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  text-align: center;
  justify-self: start;
  font-weight: 500;
}
.cert-status--earned   { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.cert-status--passed   { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cert-name {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.2vw, 1.18rem);
  color: var(--ink);
  letter-spacing: -0.005em;
  font-weight: 500;
}
.cert-link {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--accent);
  white-space: nowrap;
  text-decoration: none;
}
.cert-link:hover { text-decoration: underline; }

.certs-note {
  margin: 1.5rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
  max-width: var(--measure);
}

@media (max-width: 540px) {
  .certs li { grid-template-columns: auto 1fr; gap: 0.5rem 0.8rem; }
  .cert-link { grid-column: 1 / -1; justify-self: start; }
}

/* ============================================================
   CONTACT / CTA
   ============================================================ */

.contact-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  /* No extra top padding — the section's own top padding already gives the
     same gap every other section has below the full-width divider. Keep the
     bottom padding for breathing room before the footer. */
  padding: 0 0 var(--space-5);
}
@media (min-width: 900px) {
  .contact-block { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-6); align-items: start; }
}
.contact-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 1rem;
  color: var(--ink);
  text-wrap: balance;
}
.contact-headline em { margin-right: -0.03em; }
.contact-headline a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.contact-headline a:hover { text-decoration-color: var(--accent); }
.contact-blurb {
  margin: 0 0 1.5rem;
  color: var(--ink-mid);
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 50ch;
}
.contact-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.86rem;
}
.contact-links li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule-soft);
}
.contact-links li:first-child { border-top: 0; }
.contact-links .label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}
.contact-links a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.contact-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  background: var(--paper-2);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  align-items: center;
}
.footer-col p { margin: 0; }
.footer-meta { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.footer-dot { color: var(--rule); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  gap: 0;
  padding: 2px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
}
.theme-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
  cursor: pointer;
}
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.theme-toggle svg { width: 14px; height: 14px; display: block; }

/* Terminal hint pill */
.term-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.term-hint:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--paper);
}
.term-hint kbd {
  font-family: inherit;
  font-size: 0.95em;
  line-height: 1;
  padding: 0.18em 0.45em;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
@media (max-width: 540px) {
  .term-hint-label { display: none; }
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].visible { opacity: 1; transform: translateY(0); }
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-reveal-stagger].visible > * { opacity: 1; transform: translateY(0); }
[data-reveal-stagger].visible > *:nth-child(1) { transition-delay: 0.05s; }
[data-reveal-stagger].visible > *:nth-child(2) { transition-delay: 0.12s; }
[data-reveal-stagger].visible > *:nth-child(3) { transition-delay: 0.19s; }
[data-reveal-stagger].visible > *:nth-child(4) { transition-delay: 0.26s; }
[data-reveal-stagger].visible > *:nth-child(5) { transition-delay: 0.33s; }
[data-reveal-stagger].visible > *:nth-child(6) { transition-delay: 0.40s; }

/* ============================================================
   TERMINAL MODAL (keep)
   ============================================================ */

#terminal {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 14, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
#terminal.open { display: flex; opacity: 1; }

.term-window {
  width: min(720px, 100%);
  max-height: 72vh;
  background: #0e0e0e;
  color: #e9e7e0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 13px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.28s var(--ease);
}
#terminal.open .term-window { transform: translateY(0) scale(1); }

.term-bar {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: #181818;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.term-buttons { display: flex; gap: 0.35rem; }
.term-buttons span { width: 11px; height: 11px; border-radius: 50%; background: #3a3a3a; }
.term-buttons span:nth-child(1) { background: #ff5f57; }
.term-buttons span:nth-child(2) { background: #febc2e; }
.term-buttons span:nth-child(3) { background: #28c840; }
.term-title { flex: 1; text-align: center; color: #7d7c78; font-size: 11px; }
.term-close { color: #7d7c78; font-size: 20px; line-height: 1; padding: 0 0.35rem; transition: color 0.2s ease; }
.term-close:hover { color: #e9e7e0; }

.term-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.2rem;
  line-height: 1.7;
}
.term-body::-webkit-scrollbar { width: 6px; }
.term-body::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-accent { color: #e8b04a; }

.term-input-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #060606;
}
.term-prompt { color: #e8b04a; white-space: nowrap; }
#term-input {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: #e9e7e0;
  font: inherit;
  caret-color: #e8b04a;
}

/* ============================================================
   MOBILE SAFETY PASS (<=560px)
   Prevents overflow / cramped tap targets on small screens.
   ============================================================ */
@media (max-width: 560px) {
  /* Full-width, comfortable tap targets for hero CTAs — stacked so two long
     labels can't sit side-by-side and overflow the right edge. */
  .hero-actions { width: 100%; flex-direction: column; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 48px; }

  /* Contact rows stack so long emails / URLs never collide with labels */
  .contact-links li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    justify-content: flex-start;
  }
  .contact-links li a,
  .contact-links li span:last-child { max-width: 100%; word-break: break-word; }

  /* Testimonial attribution wraps cleanly on small screens */
  .testimonial-by { flex-wrap: wrap; }

  /* Section heads: blurb sits under title cleanly (grid already 1-col here) */
  .section-head { gap: 0.5rem; }

  /* Case-study spec: 2-up instead of cramped 4-up on phones */
  .case-spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Project featured padding trim */
  .project-featured { padding: 1.25rem; }

  /* Footer wraps centered rather than justified */
  .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 380px) {
  /* Tighten oversized display type so it never clips on the smallest phones */
  .case-spec { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   FOCUS / PRINT / MOTION
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media print {
  :root {
    --paper: #fff; --ink: #000; --ink-mid: #000; --muted: #444;
    --accent: #000; --rule: #999; --rule-soft: #ccc;
  }
  .site-header, .site-nav, #terminal, .theme-toggle, .tape, .tweaks-panel, [data-reveal]:not(.visible) { display: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  body { font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  a[href^="#"]::after, a[href^="mailto:"]::after, a[href^="tel:"]::after { content: ""; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .tape-track { animation: none !important; }
  [data-reveal], [data-reveal-stagger] > * { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   TWEAKS PANEL (design-time only — hidden by default)
   ============================================================ */
.tweaks-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(320px, calc(100vw - 2rem));
  max-height: calc(100vh - 2.5rem);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.15), 0 0 0 1px var(--rule-soft);
  z-index: 950;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--sans);
}
.tweaks-panel.is-open { display: flex; }
.tweaks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper-2);
}
.tweaks-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
}
.tweaks-close {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
}
.tweaks-close:hover { color: var(--ink); background: var(--paper-3); }
.tweaks-body {
  padding: 0.85rem 1rem 1.1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.tweaks-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tweaks-group > label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.tweaks-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.4rem;
}
.tweaks-pill {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-mid);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.tweaks-pill:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 40%, var(--rule)); }
.tweaks-pill[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.tweaks-swatch {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--swatch, var(--accent));
  border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
}
.tweaks-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.tweaks-input:focus { outline: 0; border-color: var(--accent); }
.tweaks-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 949;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}
.tweaks-launcher.is-visible { display: flex; }
