/* ===========================================================
   Tokens
   =========================================================== */
:root {
  --bg: #0a0c0b;
  --bg-alt: #0f1311;
  --surface: #141917;
  --line: #2d3a33;
  --line-strong: #435549;
  --text: #f3f6f4;
  --text-soft: #b9c3bc;
  --text-dim: #8b968e;
  --copper: #e8964a;
  --copper-bright: #ffb46b;
  --copper-dim: rgba(232, 150, 74, 0.45);
  --signal: #6dcf8f;
  --signal-glow: rgba(109, 207, 143, 0.3);

  --font-head: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --max-width: 1100px;
  --header-h: 64px;

  color-scheme: dark;
}

/* ===========================================================
   Base
   =========================================================== */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--copper); color: var(--bg); }

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.75rem, 8vw, 6rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.85rem, 3vw, 2.35rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }

p { margin: 0 0 1em; max-width: 62ch; }

a {
  color: var(--copper);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--copper-bright); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===========================================================
   Progress bar
   =========================================================== */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 40;
  pointer-events: none;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--copper);
}

/* ===========================================================
   Header
   =========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

/* "GF" drawn as a little IC package with pins */
.wordmark {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--copper);
  border-radius: 4px;
}
.wordmark::before,
.wordmark::after {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  width: 4px;
  background: repeating-linear-gradient(to bottom, var(--copper) 0 2px, transparent 2px 6px);
}
.wordmark::before { left: -5px; }
.wordmark::after { right: -5px; }
.wordmark:hover { color: var(--text); border-color: var(--copper-bright); }

.nav {
  display: flex;
  gap: 1.4rem;
}

.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--copper); }

.nav a {
  position: relative;
  padding: 0.25rem 0 0.25rem 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-soft);
  white-space: nowrap;
}

/* status LED in front of each link */
.nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.nav a:hover { color: var(--text); }
.nav a:hover::before { background: var(--copper); }
.nav a.active { color: var(--text); }
.nav a.active::before { background: var(--signal); }

/* ===========================================================
   Sections
   =========================================================== */
section {
  position: relative;
  padding: 5.5rem 0;
  scroll-margin-top: var(--header-h);
}

main > section:nth-of-type(even) { background: var(--bg-alt); }

/* copper trace divider with two vias */
main > section:not(.hero):not(.page-hero)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(var(--max-width) - 3rem), calc(100% - 3rem));
  height: 7px;
  margin-top: -3px;
  background:
    radial-gradient(circle at 12% 50%, transparent 0 1.5px, var(--copper) 1.6px 3px, transparent 3.2px),
    radial-gradient(circle at 88% 50%, transparent 0 1.5px, var(--copper) 1.6px 3px, transparent 3.2px),
    linear-gradient(90deg, transparent, var(--copper-dim) 12%, var(--copper-dim) 88%, transparent) center / 100% 1px no-repeat;
  pointer-events: none;
}

/* the divider draws itself outward from the center when the section reveals */
:root.js main > section[data-reveal]::before {
  clip-path: inset(0 50% 0 50%);
  transition: clip-path 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.15s;
}
:root.js main > section[data-reveal].in-view::before { clip-path: inset(0 0 0 0); }

/* section headings get an LED that "powers on" when revealed */
main > section:not(.hero) h2::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.6em;
  border: 2px solid var(--copper);
  border-radius: 2px;
  vertical-align: middle;
  transform: translateY(-0.08em);
  transition: background 0.4s ease 0.35s, border-color 0.4s ease 0.35s;
}
main > section.in-view h2::before,
:root:not(.js) main > section h2::before {
  background: var(--signal);
  border-color: var(--signal);
}

/* ===========================================================
   Scroll reveal (progressive enhancement — see script.js)
   =========================================================== */
:root.js section[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
:root.js section[data-reveal].in-view {
  opacity: 1;
  transform: none;
}

/* list items enter one after another (script.js sets data-stagger and --i) */
:root.js [data-stagger] > * { opacity: 0; }
:root.js .in-view [data-stagger] > * {
  opacity: 1;
  animation: rise-in 0.55s ease backwards;
  animation-delay: calc(var(--i, 0) * 70ms + 150ms);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
}

/* ===========================================================
   Hero
   =========================================================== */
.hero {
  min-height: 70vh;
  min-height: 70svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 0 6rem;
  overflow: hidden;
  text-align: center;
  background: var(--bg);
}

.circuit-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 50% 50%, rgba(10, 12, 11, 0.94) 0%, rgba(10, 12, 11, 0.7) 50%, rgba(10, 12, 11, 0) 100%),
    linear-gradient(to bottom, rgba(10, 12, 11, 0) 78%, var(--bg-alt) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  margin-bottom: 0.3em;
  animation: rise 0.6s ease both;
}

.hero-role {
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1rem);
  letter-spacing: 0.02em;
  color: var(--copper);
}

.hero-tagline {
  max-width: 56ch;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

.hero-role,
.hero-tagline,
.hero-actions { animation: rise 0.6s ease both; }
.hero-role    { animation-delay: 0.08s; }
.hero-tagline { animation-delay: 0.16s; }
.hero-actions { animation-delay: 0.24s; }

@keyframes rise {
  from { transform: translateY(12px); }
  to   { transform: none; }
}

/* ===========================================================
   Buttons
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--copper);
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--copper);
  color: #14100b;
}
.btn-primary:hover {
  background: var(--copper-bright);
  border-color: var(--copper-bright);
  color: #14100b;
}

.btn-secondary {
  background: transparent;
  color: var(--copper);
}
.btn-secondary:hover {
  background: rgba(232, 150, 74, 0.1);
  color: var(--text);
}

/* ===========================================================
   About
   =========================================================== */
.about-inner:has(.about-photo) {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

.photo-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

.photo-frame::before,
.photo-frame::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--copper);
}
.photo-frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: 2px; }
.photo-frame::after { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: 2px; }

.about-copy p { color: var(--text-soft); }

/* ===========================================================
   Skills
   =========================================================== */
.spec-table {
  margin: 1.5rem 0 0;
  border-top: 1px solid var(--line);
}
.spec-table div {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.spec-table dt {
  padding-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--copper);
}
.spec-table dd {
  max-width: 68ch;
  margin: 0;
  color: var(--text-soft);
}

/* ===========================================================
   Projects
   =========================================================== */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-card {
  --hole: var(--line-strong);
  position: relative;
  padding: 2rem 2.25rem;
  background-color: var(--surface);
  /* four corner mounting holes */
  background-image:
    radial-gradient(circle at 14px 14px, var(--bg) 0 2.5px, var(--hole) 3px 4.5px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) 14px, var(--bg) 0 2.5px, var(--hole) 3px 4.5px, transparent 5px),
    radial-gradient(circle at 14px calc(100% - 14px), var(--bg) 0 2.5px, var(--hole) 3px 4.5px, transparent 5px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), var(--bg) 0 2.5px, var(--hole) 3px 4.5px, transparent 5px);
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: border-color 0.25s ease;
}

/* copper accent trace along the top edge */
.project-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 2.25rem;
  width: 56px;
  height: 2px;
  background: var(--copper);
}

.project-card:hover {
  --hole: var(--copper);
  border-color: var(--copper-dim);
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.project-head h3 { margin: 0; font-size: 1.25rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  white-space: nowrap;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.status-done { color: var(--signal); }
.status-done::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.project-points {
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}
.project-points li { margin-bottom: 0.6rem; max-width: 72ch; }
.project-points li:last-child { margin-bottom: 0; }
.project-points li::marker { color: var(--copper); }

.project-meta {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding-top: 1rem;
  font-size: 0.85rem;
  border-top: 1px dashed var(--line-strong);
}
.project-meta div { display: flex; gap: 0.75rem; }
.project-meta dt {
  min-width: 3.5rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}
.project-meta dd { margin: 0; color: var(--text); }

/* ===========================================================
   Education / Experience / Volunteer — serial log
   =========================================================== */
.log-list {
  position: relative;
  margin-top: 1.5rem;
  padding-left: 1.75rem;
}

.log-list::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.6rem;
  bottom: 1.6rem;
  width: 1px;
  background: var(--line-strong);
}

.log-entry {
  position: relative;
  display: grid;
  grid-template-columns: 12.5rem 1fr;
  column-gap: 1.75rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.log-entry:last-child { border-bottom: none; }

/* node on the trace */
.log-entry::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem + 1px);
  top: 1.6rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--copper);
  transition: background 0.25s ease;
}
.log-entry:hover::before { background: var(--signal); }

.log-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: nowrap;
  color: var(--signal);
}
.log-date::before { content: "[ "; color: var(--text-dim); }
.log-date::after  { content: " ]"; color: var(--text-dim); }

.log-body { min-width: 0; }
.log-body h3 { margin-bottom: 0.25rem; }

.log-org {
  margin: 0 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--copper);
}

.log-desc {
  max-width: 62ch;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.log-points {
  max-width: 68ch;
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}
.log-points li { margin-bottom: 0.35rem; }
.log-points li:last-child { margin-bottom: 0; }
.log-points li::marker { color: var(--copper); }

/* ===========================================================
   Interests — one board per interest (builds on .project-card)
   =========================================================== */
.interest-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.interest-card { display: flex; flex-direction: column; }
.interest-card:first-child { grid-column: 1 / -1; }
.interest-card .project-head { flex-wrap: nowrap; align-items: baseline; }

/* index number with a status LED that lights on hover */
.interest-index {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.interest-index::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.25s ease;
}
.interest-card:hover .interest-index::after { background: var(--signal); }

.interest-summary {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.interest-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-top: 1px dashed var(--line-strong);
}
.interest-cta {
  margin-left: auto;
  color: var(--copper);
  transition: color 0.25s ease;
}
.interest-card:hover .interest-cta { color: var(--copper-bright); }

/* stretched link: the whole card is clickable */
.card-link { color: var(--text); }
.card-link:hover { color: var(--text); }
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 4px;
}
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* sits above the stretched link so it stays clickable */
.card-ig {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
}
.card-ig svg { width: 15px; height: 15px; color: var(--copper); }
.card-ig:hover { color: var(--copper-bright); }

/* ===========================================================
   Links inside body text — underline trace draws in
   =========================================================== */
main p a:not(.btn) {
  background: linear-gradient(var(--copper-bright), var(--copper-bright)) left bottom / 0 1px no-repeat;
  transition: background-size 0.3s ease, color 0.2s ease;
}
main p a:not(.btn):hover { background-size: 100% 1px; }

/* ===========================================================
   Page header (every tab page and interest page)
   =========================================================== */
.page-hero {
  padding: 4rem 0 3rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.page-hero + section { padding-top: 3.5rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-soft);
}
.back-link:hover { color: var(--copper-bright); }

.page-hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  margin-bottom: 0.4em;
}
.page-hero h1:last-child { margin-bottom: 0; }

.page-intro {
  margin-bottom: 0;
  font-size: 1.1rem;
  color: var(--text-soft);
}

.ig-button { margin-top: 1rem; gap: 0.55rem; }
.ig-button svg { width: 18px; height: 18px; }

.gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 0;
  padding: 0;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.gallery-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}
.gallery-open:hover img { opacity: 0.85; }

/* discourage saving: no image drag, no right-click/long-press "save image" target */
.gallery-item img,
.lightbox img {
  pointer-events: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
          user-select: none;
  -webkit-touch-callout: none;
}
.gallery-open:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }

.gallery-item-wide {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  min-height: 96px;
}

/* a wide photo across both columns, and a tall photo spanning two rows */
.gallery { grid-auto-flow: dense; }
.gallery-item-feature {
  grid-column: 1 / -1;
  aspect-ratio: 8 / 3;
}
.gallery-item-tall {
  grid-row: span 2;
  aspect-ratio: auto;
}
/* tall photos placed side by side in one row */
.gallery-item-portrait { aspect-ratio: 2 / 3; }

.gallery-ig {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--copper);
  background: rgba(232, 150, 74, 0.06);
  transition: background 0.25s ease, color 0.25s ease;
}
.gallery-ig svg { width: 30px; height: 30px; }
.gallery-ig:hover { background: rgba(232, 150, 74, 0.14); color: var(--copper-bright); }

.gallery-note {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.module-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 2.5rem;
  padding-bottom: 4.5rem;
}
.module-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  transition: border-color 0.25s ease;
}
.module-nav a:hover { border-color: var(--copper-dim); color: var(--text); }
.module-nav span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--copper);
}
.module-nav .module-nav-next { grid-column: 2; text-align: right; }

/* ===========================================================
   Lightbox
   =========================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
  background: rgba(5, 7, 6, 0.96);
}
.lightbox[hidden] { display: none; }

.lightbox figure {
  grid-column: 2;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  border-radius: 2px;
}
.lightbox figcaption {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-soft);
  text-align: center;
}

.lightbox button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.lightbox button:hover { border-color: var(--copper); color: var(--copper-bright); }
.lightbox button[hidden] { display: none; }
.lightbox-prev { grid-column: 1; }
.lightbox-next { grid-column: 3; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* ===========================================================
   Contact
   =========================================================== */
.contact p { color: var(--text-soft); }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.contact-links a {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--copper-dim);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.contact-links a:hover { border-color: var(--copper-bright); }

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
  padding: 1.75rem 0 2.25rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.footer-inner p {
  margin: 0;
  color: var(--text-dim);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.footer-links a { display: inline-block; padding: 0.75rem 0.25rem; color: var(--text-soft); }
.footer-links a:hover { color: var(--copper-bright); }

/* ===========================================================
   404
   =========================================================== */
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.not-found-code {
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  color: var(--copper);
}
.not-found p { color: var(--text-soft); }

/* Skip link: hidden until focused with the keyboard */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 50;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--copper);
  color: #14100b;
}
.skip-link:focus { top: 1rem; color: #14100b; }

/* Featured projects on the homepage */
.featured-more { margin-top: 1.5rem; font-family: var(--font-mono); font-size: 0.9rem; }
@media (min-width: 861px) {
  .featured .project-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================================================
   Responsive
   =========================================================== */

@media (max-width: 640px) {
  .nav { flex-wrap: wrap; gap: 0.5rem 1.1rem; padding: 0.5rem 0; }

  /* with JS the links fold into a menu; without it they simply wrap */
  :root.js .header-inner { flex-wrap: nowrap; }
  :root.js .nav-toggle { display: block; }
  :root.js .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  :root.js .nav-open .nav { display: flex; }
  :root.js .nav a { padding: 0.75rem 0 0.75rem 16px; font-size: 0.95rem; }
}

@media (max-width: 720px) {
  section { padding: 4rem 0; }
  .about-inner:has(.about-photo) { grid-template-columns: 1fr; gap: 2rem; }
  .spec-table div { grid-template-columns: 1fr; gap: 0.25rem; }
  .photo-frame { max-width: 220px; }
  .log-entry { grid-template-columns: 1fr; row-gap: 0.35rem; }
  .project-card { padding: 1.75rem 1.5rem; }
  .project-card::before { left: 1.5rem; }
  .interest-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-item-feature { aspect-ratio: 3 / 2; }
  .gallery-item-tall { grid-row: auto; aspect-ratio: 2 / 3; }
  .module-nav { grid-template-columns: 1fr; }
  .module-nav .module-nav-next { grid-column: 1; }
  .lightbox { grid-template-columns: 1fr; padding: 4rem 0.75rem 5rem; }
  .lightbox figure { grid-column: 1; grid-row: 1; }
  .lightbox img { max-height: calc(100vh - 13rem); }
  .lightbox-prev,
  .lightbox-next { position: absolute; bottom: 1.25rem; }
  .lightbox-prev { left: calc(50% - 56px); }
  .lightbox-next { left: calc(50% + 12px); }
}

@media (max-width: 460px) {
  .hero-actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 280px; }
  .btn { justify-content: center; }
}

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