/* ==========================================================================
   Brian Duke — Portfolio v2 (editorial)
   Dark-first. Navy/slate base, cyan/indigo accents, Fraunces serif display.
   No frameworks, no build step.
   ========================================================================== */

/* ---------- Design tokens ----------
   Palette: Texas State maroon and old gold over warm, natural neutrals.
   Dark theme reads like evening Hill Country granite; light like warm paper. */
:root {
  --bg: #1a1013;
  --bg-alt: #231418;
  --surface: rgba(220, 175, 185, 0.06);
  --surface-solid: #2b191e;
  --border: rgba(220, 175, 185, 0.16);
  --text: #ece2dc;
  --text-muted: #af9d99;
  --heading: #f8f2ec;
  --accent: #d9a760;   /* old gold */
  --accent-2: #b0525e; /* maroon, lifted for dark bg */
  --accent-3: #e0c184; /* light gold */
  --glass: rgba(26, 16, 19, 0.74);
  --shadow: 0 12px 40px rgba(12, 6, 8, 0.55);
  --radius: 14px;
  --nav-h: 68px;
  --max-w: 1120px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

[data-theme="light"] {
  --bg: #faf6ef;
  --bg-alt: #f3ece1;
  --surface: rgba(80, 18, 20, 0.04);
  --surface-solid: #ffffff;
  --border: rgba(80, 18, 20, 0.14);
  --text: #3c2b28;
  --text-muted: #7e6a64;
  --heading: #501214;  /* Texas State maroon for headings */
  --accent: #6e181f;   /* maroon, link-safe */
  --accent-2: #8a6a2f; /* old gold, deepened for contrast */
  --accent-3: #a3805a;
  --glass: rgba(250, 246, 239, 0.84);
  --shadow: 0 12px 40px rgba(80, 18, 20, 0.10);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.serif { font-family: var(--font-serif); }
.desktop-only { display: inline; }

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

/* ---------- Loader / progress (unchanged infra) ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark {
  width: 74px; height: 74px; border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  animation: pulse 1.2s ease-in-out infinite;
}
.loader-mark img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--bg);
}
@keyframes pulse { 50% { transform: scale(1.06); opacity: 0.75; } }

.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 60;
  height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: var(--glass);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.navbar.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--heading); text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }
.logo-photo {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.logo-text { font-size: 0.95rem; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--heading); background: var(--surface); }
.nav-links a.nav-cta {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  margin-left: 6px;
}
.nav-links a.nav-cta:hover { opacity: 0.9; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  transition: background 0.2s ease;
}
.theme-toggle:hover { background: var(--border); }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
.menu-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; padding: 0 9px;
}
.menu-toggle span {
  height: 2px; width: 100%; border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 72px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.glow {
  position: absolute; border-radius: 50%;
  filter: blur(110px); opacity: 0.3;
  animation: drift 18s ease-in-out infinite alternate;
}
.glow-1 { width: 520px; height: 520px; top: -140px; right: -120px; background: var(--accent-2); }
.glow-2 { width: 420px; height: 420px; bottom: -160px; left: -100px; background: var(--accent); animation-delay: -9s; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }

.hero-inner { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 56px; width: 100%; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 16px; margin-bottom: 26px;
  background: var(--surface);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6f9b5d;
  box-shadow: 0 0 0 4px rgba(111, 155, 93, 0.2);
}
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(3.4rem, 9vw, 6.2rem);
  font-weight: 700; letter-spacing: -0.02em; line-height: 0.98;
  color: var(--heading); margin-bottom: 26px;
}
.hero-headline {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  font-weight: 600; color: var(--text);
  margin-bottom: 16px; min-height: 2.2em;
}
.accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.type-caret {
  display: inline-block; width: 2px; height: 1.1em;
  margin-left: 3px; vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.05s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-sub { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 30px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 10px;
  font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 6px 22px rgba(176, 122, 60, 0.28);
}
.btn-secondary { color: var(--heading); background: var(--surface); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--heading); }

.hero-photo { margin: 0; position: relative; }
.hero-photo img {
  width: 100%; max-height: 66vh; object-fit: cover; object-position: center 22%;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.hero-photo figcaption, figcaption {
  font-size: 0.8rem; color: var(--text-muted);
  margin-top: 10px; font-style: italic;
}

.scroll-indicator { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); opacity: 0.6; }
.scroll-indicator:hover { opacity: 1; }
.mouse { display: block; width: 24px; height: 38px; border: 2px solid var(--text-muted); border-radius: 14px; position: relative; }
.wheel {
  position: absolute; top: 7px; left: 50%;
  width: 3px; height: 7px; border-radius: 3px;
  background: var(--text-muted);
  transform: translateX(-50%);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 45% { transform: translate(-50%, 10px); opacity: 0; } 50% { transform: translate(-50%, 0); opacity: 0; } 100% { opacity: 1; } }

/* ---------- Numbers band ---------- */
.numbers-band {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 56px 0;
}
.numbers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.number-item { display: flex; flex-direction: column; gap: 6px; }
.number-value {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 700; line-height: 1;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.number-label { font-size: 0.85rem; color: var(--text-muted); max-width: 24ch; }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.015em; line-height: 1.15;
  color: var(--heading); margin-bottom: 22px;
}
.section-sub { max-width: 62ch; color: var(--text-muted); margin-bottom: 44px; }

/* ---------- Story ---------- */
.story-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; margin-top: 34px; }
.story-text p { margin-bottom: 20px; }
.story-text .dropcap::first-letter {
  font-family: var(--font-serif);
  font-size: 3.4em; font-weight: 700; line-height: 0.8;
  float: left; margin: 0.06em 0.12em 0 0;
  color: var(--accent);
}
.story-photo { margin: 0; position: sticky; top: calc(var(--nav-h) + 24px); }
.story-photo img { border-radius: 18px; border: 1px solid var(--border); box-shadow: var(--shadow); }

/* ---------- Journey / chapters ---------- */
.journey { padding: 110px 0 60px; }
.chapter { padding: 70px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.chapter-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 24px 56px;
  align-items: start;
}
.chapter-grid.flip { grid-template-columns: 1.4fr 0.9fr; }
.chapter-grid.flip .chapter-head { order: 2; }
.chapter-grid.flip .chapter-body { order: 1; }
.chapter-grid.flip .chapter-gallery { order: 3; }

.chapter-head { align-self: start; }
.chapter-num {
  display: block;
  font-size: 3.4rem; font-weight: 700; line-height: 1;
  font-style: italic;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent);
  opacity: 0.85;
  margin-bottom: 14px;
}
.chapter-dates { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); margin-bottom: 10px; }
.chapter-head h3 {
  font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.2;
  color: var(--heading);
}
.chapter-sub { margin-top: 12px; font-size: 0.9rem; color: var(--text-muted); }
.chapter-facts { list-style: none; margin-top: 22px; }
.chapter-facts li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 0.84rem; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 1px;
}
.chapter-facts li:last-child { border-bottom: 1px solid var(--border); }
.chapter-facts strong {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.chapter-body p { margin-bottom: 18px; }
.chapter-lesson {
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
}
.chapter-lesson strong { color: var(--accent); }
.exp-link { font-size: 0.9rem; font-weight: 600; }

.chapter-gallery { grid-column: 1 / -1; display: grid; gap: 16px; margin-top: 26px; }
.gallery-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-4 { grid-template-columns: repeat(4, 1fr); }
.chapter-gallery figure { margin: 0; }
.chapter-gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.chapter-gallery img:hover { transform: scale(1.02); box-shadow: var(--shadow); }

/* Journey divider */
.journey-divider {
  display: flex; align-items: center; gap: 20px;
  margin-top: 70px; padding-top: 0;
}
.journey-divider span { flex: 1; height: 1px; background: var(--border); }
.journey-divider p {
  font-size: 1.15rem; font-style: italic; color: var(--text-muted);
  white-space: nowrap;
}

/* Featured chapter (H-E-B case study) */
.chapter-featured {
  background: var(--bg-alt);
  border-top: none;
  border-block: 1px solid var(--border);
  padding: 90px 0;
}
.chapter-featured .chapter-head { position: static; margin-bottom: 40px; max-width: 720px; }
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 40px; }
.case-block {
  padding: 26px 26px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.case-block h4 {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); margin-bottom: 10px;
}
.case-block p { font-size: 0.95rem; }
.case-numbers {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  padding: 30px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(211, 164, 79, 0.08), rgba(176, 82, 94, 0.08));
  margin-bottom: 40px;
}
.case-numbers > div { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-muted); }
.case-stat {
  font-family: var(--font-serif);
  font-size: 2.2rem; font-weight: 700; color: var(--heading); line-height: 1;
}
.case-quote {
  margin: 44px auto; max-width: 760px; text-align: center;
}
.case-quote p {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 500; line-height: 1.45;
  color: var(--heading); margin-bottom: 14px;
}
.case-quote cite { font-size: 0.85rem; color: var(--text-muted); font-style: normal; }
.case-postscript { margin-top: 30px; }
.case-postscript h4 {
  font-family: var(--font-serif); font-size: 1.25rem; color: var(--heading); margin-bottom: 12px;
}
.case-postscript > p { max-width: 72ch; margin-bottom: 24px; color: var(--text-muted); }

/* Next strip */
.next-strip {
  margin-top: 60px; padding: 40px 44px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.next-strip h3 { font-size: 1.4rem; color: var(--heading); margin-bottom: 10px; }
.next-strip p { color: var(--text-muted); max-width: 80ch; }

/* ---------- Endorsements ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.quote-card {
  padding: 30px 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.quote-card p {
  font-family: var(--font-serif);
  font-size: 1.08rem; line-height: 1.55; color: var(--heading);
  margin-bottom: 14px;
}
.quote-card cite {
  font-size: 0.8rem; font-style: normal; color: var(--accent);
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em;
}

/* ---------- Toolkit ---------- */
.toolkit-list { display: flex; flex-direction: column; }
.toolkit-row {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px;
  padding: 36px 0; border-top: 1px solid var(--border);
  align-items: center;
}
.toolkit-row:last-child { border-bottom: 1px solid var(--border); }
.toolkit-info h3 { font-family: var(--font-serif); font-size: 1.3rem; color: var(--heading); margin-bottom: 10px; }
.toolkit-info p { color: var(--text-muted); font-size: 0.96rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono); font-size: 0.74rem;
  color: var(--text-muted);
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Projects ---------- */
.project-feature {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
  padding: 30px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 30px;
}
.project-shot { margin: 0; }
.project-shot img { border-radius: 12px; border: 1px solid var(--border); }
.project-feature-text h3 { font-family: var(--font-serif); font-size: 1.5rem; color: var(--heading); margin-bottom: 12px; }
.project-feature-text p { color: var(--text-muted); margin-bottom: 16px; }
.project-feature-text .tag-row { margin-bottom: 20px; }

.repo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gh-repo {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.22s ease, transform 0.22s ease;
}
.gh-repo:hover { border-color: var(--accent); transform: translateY(-3px); text-decoration: none; }
.gh-repo-name { font-family: var(--font-mono); font-size: 0.86rem; font-weight: 600; color: var(--heading); }
.gh-repo-desc { font-size: 0.82rem; color: var(--text-muted); }
.repo-note { margin-top: 22px; font-weight: 600; }

/* ---------- Beyond ---------- */
.beyond-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto; gap: 20px;
}
.beyond-item { margin: 0; }
.beyond-item img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.beyond-item.tall { grid-row: span 2; }
.beyond-item.tall img { aspect-ratio: 3 / 4.4; height: 100%; }
.beyond-item img:hover { transform: scale(1.02); box-shadow: var(--shadow); }
.beyond-item figcaption { font-style: normal; margin-top: 10px; font-size: 0.85rem; }
.beyond-item figcaption strong { color: var(--heading); }

/* ---------- Credentials ---------- */
.cred-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; }
.cred-col h3 { font-family: var(--font-serif); font-size: 1.3rem; color: var(--heading); margin-bottom: 20px; }
.cred-list { list-style: none; }
.cred-list li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 0; border-top: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-muted);
}
.cred-list li:last-child { border-bottom: 1px solid var(--border); }
.cred-list strong { color: var(--heading); font-size: 1rem; }
.cred-when { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent); }

/* ---------- Resume ---------- */
.resume-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; }
.resume-embed {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.resume-embed object { display: block; }
.resume-embed p { padding: 30px; color: var(--text-muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; margin-top: 14px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--heading); }
.form-field input, .form-field textarea {
  font-family: inherit; font-size: 0.95rem;
  color: var(--text);
  padding: 13px 15px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.2s ease;
  resize: vertical;
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { align-self: flex-start; }
.form-status { font-size: 0.88rem; color: var(--accent); min-height: 1.4em; }
.contact-links { display: flex; flex-direction: column; gap: 14px; }
.contact-link {
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.contact-link:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.contact-link-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.contact-link-value { font-weight: 600; color: var(--heading); }
.contact-location { color: var(--text-muted); font-size: 0.9rem; padding-left: 4px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-top: 52px; padding-bottom: 36px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-col p { font-size: 0.88rem; color: var(--text-muted); }
.footer-col a { font-size: 0.9rem; color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding-top: 20px; padding-bottom: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-muted);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 26px; right: 26px; z-index: 40;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-solid); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
  box-shadow: var(--shadow);
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: var(--accent); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- 404 ---------- */
.error-page {
  min-height: 100svh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px; position: relative; overflow: hidden;
}
.error-code {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 18vw, 9rem); font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-page h1 { color: var(--heading); font-size: 1.5rem; margin: 12px 0 10px; }
.error-page p { color: var(--text-muted); margin-bottom: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { max-width: 480px; }
  .numbers-grid { grid-template-columns: repeat(2, 1fr); }
  .story-grid, .cred-grid, .contact-grid { grid-template-columns: 1fr; }
  .story-photo { position: static; max-width: 480px; }
  .chapter-grid, .chapter-grid.flip { grid-template-columns: 1fr; }
  .chapter-grid.flip .chapter-head { order: 0; }
  .case-grid, .quote-grid { grid-template-columns: 1fr; }
  .case-numbers { grid-template-columns: repeat(2, 1fr); }
  .toolkit-row { grid-template-columns: 1fr; gap: 18px; }
  .project-feature { grid-template-columns: 1fr; }
  .repo-strip { grid-template-columns: repeat(2, 1fr); }
  .beyond-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .desktop-only { display: none; }
}

@media (max-width: 640px) {
  .section { padding: 78px 0; }
  .logo-text { display: none; }
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 14px 20px 22px;
    background: var(--glass);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
  .nav-links a { padding: 13px 14px; font-size: 1rem; }
  .nav-links a.nav-cta { margin-left: 0; margin-top: 6px; text-align: center; }
  .numbers-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .gallery-2, .gallery-3, .gallery-4 { grid-template-columns: 1fr 1fr; }
  .beyond-grid { grid-template-columns: 1fr; }
  .beyond-item.tall { grid-row: auto; }
  .beyond-item.tall img { aspect-ratio: 4 / 3; }
  .repo-strip { grid-template-columns: 1fr; }
  .case-numbers { padding: 22px; }
  .resume-embed object { height: 520px; }
}
