/* =========================================================
   South Point Engineering Club
   Direction B — "Load Test". Charcoal ground, deep Raider red,
   condensed drafting caps, monospace for anything measured.
   ========================================================= */

:root {
  --ground:   #0e1216;
  --panel:    #161c23;
  --panel-2:  #1c242c;
  --bone:     #e9e5db;
  --bone-dim: rgba(233, 229, 219, .68);
  --steel:    #7d99ab;
  --red:      #c8102e;          /* South Point red — fills and graphics */
  --red-hi:   #e01432;          /* hover only */
  --red-text: #ff8494;          /* red TEXT on the dark ground; the solid
                                   red is only 3.9:1 here, which fails */
  --line:     rgba(233, 229, 219, .13);
  --line-2:   rgba(233, 229, 219, .22);

  --cond: Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Arial Narrow",
          system-ui, sans-serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;

  --shell: 1140px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--sans);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* Only the page title is set in caps. Caps on every heading turned the
   whole page into signage, which reads as shouting rather than as design. */
h1, h2, h3 { font-family: var(--cond); line-height: 1.04; margin: 0; }
h1 { text-transform: uppercase; letter-spacing: .004em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1.2vw, 1.9rem); letter-spacing: .01em; }
h3 { font-size: clamp(1.1rem, 1rem + .55vw, 1.3rem); letter-spacing: .012em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bone); }

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

.muted { color: var(--bone-dim); }

.skip-link {
  position: absolute; left: .5rem; top: -100%; z-index: 200;
  background: var(--red); color: #fff; font-weight: 700;
  padding: .7rem 1.1rem; text-decoration: none;
}
.skip-link:focus { top: 0; }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: clamp(1rem, .6rem + 2vw, 2.5rem); }

/* ---------- Nav ---------- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14, 18, 22, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.navbar > .shell {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 62px; padding-block: .7rem;
}
.brand {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .07em;
  font-size: 1.02rem; color: var(--bone); text-decoration: none;
  display: flex; align-items: center; gap: .55rem;
}
.brand::before { content: ""; width: 9px; height: 9px; background: var(--red); flex: none; }

.nav-toggle {
  display: none; align-items: center; gap: .5rem;
  font: inherit; font-size: .9rem; color: var(--bone);
  background: transparent; border: 1px solid var(--line-2);
  padding: .45rem .8rem; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--bone-dim); }
.nav-bars { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; }
.nav-bars::before, .nav-bars::after {
  content: ""; position: absolute; left: 0; width: 16px; height: 1.5px; background: currentColor;
}
.nav-bars::before { top: -5px; }
.nav-bars::after  { top:  5px; }

.nav-links { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--bone-dim); text-decoration: none; padding-block: .3rem;
}
.nav-links a:hover { color: var(--bone); }
.nav-links a[aria-current="page"] { color: var(--bone); box-shadow: 0 2px 0 var(--red); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-photo {
  position: absolute; inset: 0;
  background-image: url("img/IMG_2202.jpeg");
  background-size: cover; background-position: center 40%;
  opacity: .14; filter: grayscale(1) contrast(1.12);
}
.hero > .shell { position: relative; padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }

.kicker {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--steel); margin-bottom: .9rem;
}
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 5.2vw, 4.4rem); }

/* Types itself out under the club name. Reserve the line height up front
   so the rest of the hero doesn't jump as characters land. */
.hero-type {
  min-height: 1.5em;
  margin-top: .55rem;
  font-family: var(--mono);
  font-size: clamp(.75rem, .7rem + .3vw, .88rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red-text);
}
.hero-type::after { content: "_"; animation: blink 1.1s steps(1) infinite; }
.hero-type.done::after { content: ""; }
@keyframes blink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }

.hero-sub {
  margin-top: 1.1rem; max-width: 52ch;
  font-size: clamp(1rem, .95rem + .35vw, 1.15rem); color: var(--bone-dim);
}

/* ---------- Next meeting: the redline annotation ----------
   Red on a drawing marks the revision — so the thing that
   changes most often is the thing outlined in red. */
.nextmeeting { display: flex; gap: .9rem; margin-top: clamp(1.6rem, 1rem + 2.4vw, 2.6rem); max-width: 620px; }
.nextmeeting .leader { width: 22px; flex: none; position: relative; }
.nextmeeting .leader::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 1px; background: var(--red); }
.nextmeeting .leader::after  { content: ""; position: absolute; left: 0; top: 11px; width: 22px; height: 1px; background: var(--red); }

.nm-body { flex: 1; border: 1px solid var(--red); background: rgba(200, 16, 46, .07); padding: 1rem 1.2rem 1.1rem; }
.nm-status { font-family: var(--mono); font-size: .64rem; letter-spacing: .17em; text-transform: uppercase; color: var(--red-text); margin-bottom: .25rem; }
.nm-when   { font-family: var(--cond); font-size: clamp(1.5rem, 1.1rem + 2vw, 2.3rem); text-transform: uppercase; line-height: 1.04; margin: 0; }
.nm-where  { font-family: var(--mono); font-size: .76rem; color: var(--bone-dim); margin: .4rem 0 0; font-variant-numeric: tabular-nums; }
.nm-unit   { font-size: .9rem; color: var(--bone-dim); margin: .7rem 0 0; }
.nm-unit strong { color: var(--bone); font-weight: 600; }

/* Dimension line, ticks and all */
.nm-dim { display: flex; align-items: center; gap: .5rem; margin-top: .85rem; color: var(--steel); }
.nm-dim i { flex: 1; height: 1px; background: currentColor; position: relative; }
.nm-dim i::before, .nm-dim i::after { content: ""; position: absolute; top: -4px; width: 1px; height: 9px; background: currentColor; }
.nm-dim i::before { left: 0; }
.nm-dim i::after  { right: 0; }
.nm-dim span { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 1.5rem; }
.btn {
  display: inline-block; font-family: var(--cond); font-size: .98rem;
  letter-spacing: .08em; text-transform: uppercase;
  background: var(--red); color: #fff; text-decoration: none;
  padding: .68rem 1.4rem; border: 1px solid var(--red);
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--red-hi); border-color: var(--red-hi); }
.btn--ghost { background: transparent; color: var(--bone); border-color: var(--line-2); }
.btn--ghost:hover { background: transparent; border-color: var(--bone-dim); }
.btn-note { font-family: var(--mono); font-size: .68rem; color: var(--bone-dim); letter-spacing: .05em; }

/* ---------- Sections ---------- */
.band { padding-block: clamp(2.5rem, 1.8rem + 3vw, 4.5rem); border-bottom: 1px solid var(--line); }
.band--panel { background: var(--panel); }
.band-head { margin-bottom: 2rem; }
.band-head .kicker { margin-bottom: .7rem; }
.band-head p { max-width: 58ch; color: var(--bone-dim); margin-top: .8rem; }

.page-head { padding-block: clamp(2rem, 1.5rem + 3vw, 3.6rem) clamp(1.4rem, 1rem + 2vw, 2.4rem); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2rem, 1.4rem + 3.4vw, 3.4rem); }
.page-head p { max-width: 58ch; color: var(--bone-dim); margin-top: .9rem; }

/* ---------- Diagram host ---------- */
.diagram { width: 100%; }
/* hidden, not visible — a cropped viewBox still paints the parts outside
   it otherwise, and the airflow lines ran straight off the card. */
.diagram svg { display: block; width: 100%; height: auto; overflow: hidden; }
.diagram--hero { max-width: 760px; margin-top: clamp(1.5rem, 1rem + 2vw, 2.4rem); }
.diagram--card { margin: .2rem 0 1rem; }
.diagram--band { max-width: 620px; margin: 0 auto clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem); }

/* Diagram parts — shared across all four drawings */
.dg-chord   { stroke: var(--bone);  stroke-width: 2.4; fill: none; }
.dg-web     { stroke: var(--steel); stroke-width: 1.8; fill: none; }
.dg-hot     { stroke: var(--red);   stroke-width: 3; }
.dg-node    { fill: var(--bone); }
.dg-load    { stroke: var(--red); stroke-width: 1.8; fill: none; }
.dg-ground  { stroke: var(--steel); stroke-width: 1.4; opacity: .55; }
.dg-label   { fill: var(--steel); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; }

.dg-flow    { stroke: var(--steel); stroke-width: 1.4; fill: none; stroke-dasharray: 16 12; opacity: .8; }
.dg-wing    { fill: var(--bone); stroke: var(--bone); stroke-width: 1; }
.dg-lift    { stroke: var(--red); stroke-width: 2; fill: none; }

.dg-rail       { stroke: var(--steel); stroke-width: 2.4; }
.dg-post       { stroke: var(--steel); stroke-width: 3; }
.dg-carriage   { fill: var(--panel-2); stroke: var(--bone); stroke-width: 1.6; }
.dg-nozzle     { fill: var(--bone); }
.dg-filament   { stroke: var(--red); stroke-width: 2; }
.dg-layer      { fill: none; stroke: var(--steel); stroke-width: 1.4; }
.dg-part .dg-layer:nth-child(1) { stroke: var(--red); }
.dg-bed        { stroke: var(--bone); stroke-width: 3; }

/* Gears — the whole outline including teeth comes from gearPath(). */
.dg-cog   { fill: var(--panel); stroke: var(--bone); stroke-width: 1.8; stroke-linejoin: round; }
.dg-rim   { fill: none; stroke: var(--bone); stroke-width: 1.2; opacity: .35; }
.dg-spoke { stroke: var(--bone); stroke-width: 1.6; opacity: .45; }
.dg-hub   { fill: var(--red); }

/* Bolt (not currently placed on a page) */
.dg-axis      { stroke: var(--steel); stroke-width: 1.2; stroke-dasharray: 14 5 3 5; opacity: .6; }
.dg-plate     { fill: var(--panel); stroke: var(--bone); stroke-width: 1.8; }
.dg-bolt-head { fill: var(--panel); stroke: var(--bone); stroke-width: 2; stroke-linejoin: round; }
.dg-facet     { stroke: var(--bone); stroke-width: 1.2; opacity: .4; }
.dg-thread    { stroke: var(--red); stroke-width: 15; stroke-dasharray: 4 5; }

/* Magnets — white reads fine on the red pole but not on the steel one,
   so the S label takes the dark ground colour instead. */
.dg-field      { fill: none; stroke: var(--steel); stroke-width: 1.6; stroke-dasharray: 5 5; }
.dg-pole-n     { fill: var(--red);   stroke: var(--bone); stroke-width: 1.6; }
.dg-pole-s     { fill: var(--steel); stroke: var(--bone); stroke-width: 1.6; }
.dg-pole-label { font-family: var(--cond); font-size: 24px; text-anchor: middle; }
.dg-label-n    { fill: #fff; }
.dg-label-s    { fill: var(--ground); }

/* Code editor */
.dg-code { border: 1px solid var(--line-2); background: var(--ground); overflow: hidden; }
.dg-code-head {
  display: flex; align-items: center; gap: .35rem;
  padding: .45rem .75rem; border-bottom: 1px solid var(--line);
}
.dg-code-head span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.dg-code-head em {
  margin-left: .5rem; font-style: normal; font-family: var(--mono);
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--steel);
}
.dg-code-body { padding: .6rem .9rem .65rem; font-family: var(--mono); font-size: clamp(.66rem, .6rem + .28vw, .78rem); line-height: 1.55; }
.dg-line { display: block; white-space: pre; overflow: hidden; width: 0; color: var(--bone); }
.dg-line i { font-style: normal; }
.dg-tag  { color: var(--red-text); }
.dg-attr { color: var(--steel); }
.dg-val  { color: var(--bone-dim); }

.dg-trace     { stroke: var(--steel); stroke-width: 2.2; fill: none; opacity: .5; }
.dg-current   { stroke: var(--red); stroke-width: 2.6; fill: none; stroke-dasharray: 5 17; stroke-linecap: round; }
.dg-battery   { stroke: var(--bone); stroke-width: 2.2; }
.dg-battery .dg-short { stroke-width: 3.4; }
.dg-resistor  { stroke: var(--bone); stroke-width: 2.2; fill: none; }
.dg-led-body  { fill: var(--red); }
.dg-led-bar   { stroke: var(--bone); stroke-width: 2.6; }
.dg-glow      { fill: var(--red); opacity: 0; }

/* Motion */
.dg-flex    { transform-origin: 50% 0; animation: dg-deflect 3.8s ease-in-out infinite; }
.dg-flow path { animation: dg-stream 1.7s linear infinite; }
.dg-head    { animation: dg-track 4.4s ease-in-out infinite; }
.dg-part .dg-layer:nth-child(1) { animation: dg-fresh 4.4s ease-in-out infinite; }
.dg-current { animation: dg-flowdash 1.1s linear infinite; }
.dg-glow    { animation: dg-lit 2.6s ease-in-out infinite; }
.dg-lift    { animation: dg-pulse 3.2s ease-in-out infinite; }

/* fill-box puts each gear's origin at its own centre, so one rule spins
   every wheel about its own axle wherever it sits. */
.dg-gear { transform-box: fill-box; transform-origin: center; }
/* One second per tooth on every wheel, so the mesh holds instead of
   drifting: 14 teeth in 14s, 10 in 10s, 8 in 8s. Get these wrong and it
   looks right for a moment and then grinds. */
.dg-gear-a { animation: dg-spin-cw  14s linear infinite; }
.dg-gear-b { animation: dg-spin-ccw 10s linear infinite; }
.dg-gear-c { animation: dg-spin-cw  8s  linear infinite; }
/* The bolt advances and backs off; the thread dashes march at the same
   time so it reads as turning rather than just sliding. */
.dg-driver { animation: dg-drive 5.6s ease-in-out infinite; }
.dg-thread { animation: dg-turn 0.9s linear infinite; }

/* Magnets creep together, then snap — the easing does the work. */
.dg-mag-l { animation: dg-snap-r 5.4s infinite; }
.dg-mag-r { animation: dg-snap-l 5.4s infinite; }
.dg-field { animation: dg-field-fade 5.4s infinite; }

@keyframes dg-snap-r {
  0%, 30%  { transform: translateX(0);    animation-timing-function: cubic-bezier(.8, 0, .9, .35); }
  46%, 76% { transform: translateX(50px); animation-timing-function: ease-in-out; }
  100%     { transform: translateX(0); }
}
@keyframes dg-snap-l {
  0%, 30%  { transform: translateX(0);     animation-timing-function: cubic-bezier(.8, 0, .9, .35); }
  46%, 76% { transform: translateX(-50px); animation-timing-function: ease-in-out; }
  100%     { transform: translateX(0); }
}
@keyframes dg-field-fade { 0%, 28% { opacity: .8 } 46%, 76% { opacity: 0 } 100% { opacity: .8 } }

/* Each line types itself in, then the block clears and starts over. */
.dg-line { animation: dg-type 8s steps(26, end) infinite; }
@keyframes dg-type { 0% { width: 0 } 9% { width: 100% } 88% { width: 100% } 94%, 100% { width: 0 } }

@keyframes dg-spin-cw  { to { transform: rotate(360deg) } }
@keyframes dg-spin-ccw { to { transform: rotate(-360deg) } }
@keyframes dg-drive    { 0%, 100% { transform: translateX(0) } 45%, 62% { transform: translateX(92px) } }
@keyframes dg-turn     { to { stroke-dashoffset: -18 } }
@keyframes dg-deflect  { 0%, 100% { transform: translateY(0) scaleY(1) } 50% { transform: translateY(3.5px) scaleY(1.05) } }
@keyframes dg-stream   { to { stroke-dashoffset: -28 } }
@keyframes dg-track    { 0%, 100% { transform: translateX(250px) } 50% { transform: translateX(390px) } }
@keyframes dg-fresh    { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }
@keyframes dg-flowdash { to { stroke-dashoffset: -44 } }
@keyframes dg-lit      { 0%, 100% { opacity: 0 } 55% { opacity: .38 } }
@keyframes dg-pulse    { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }

/* ---------- Build cards ---------- */
.builds { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 720px) { .builds { grid-template-columns: repeat(2, 1fr); } }
/* Three across on a wide screen so no one area looks like the main event. */
.builds--trio { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }
.build { background: var(--ground); padding: 1.5rem 1.6rem 1.7rem; }
.build h3 { margin-bottom: .5rem; }
.build p { color: var(--bone-dim); font-size: .95rem; }

/* Fixed height with the drawing centred, so the headings line up across
   all three cards however tall each individual diagram happens to be. */
.build .diagram {
  display: flex;
  align-items: center;
  min-height: 112px;
  margin-bottom: 1.1rem;
}

/* ---------- Facts strip ---------- */
.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 2rem; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts > div { background: var(--ground); padding: 1.1rem 1.3rem; }
.facts dt { font-family: var(--mono); font-size: .62rem; letter-spacing: .17em; text-transform: uppercase; color: var(--steel); }
.facts dd { margin: .25rem 0 0; font-family: var(--cond); font-size: 1.25rem; }

/* ---------- Schedule ---------- */
.sched { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sched li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .85rem .2rem; border-bottom: 1px solid var(--line);
}
.sched-date { font-family: var(--cond); font-size: 1.1rem; letter-spacing: .01em; }
.sched-note { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red-text); }

/* ---------- Copy card ---------- */
.copycard {
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-2); padding: 1.2rem 1.3rem;
  transition: border-color .15s ease;
}
.copycard:hover { border-color: var(--red); }
.copy-hint { display: block; margin-top: .9rem; font-family: var(--mono); font-size: .64rem; letter-spacing: .15em; text-transform: uppercase; color: var(--steel); }

/* ---------- Projects ---------- */
.pj-group { margin-bottom: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.pj-group > h2 { margin-bottom: 1.4rem; }
.pj-grid { display: grid; gap: 1.5rem; }
@media (min-width: 800px) { .pj-grid { grid-template-columns: repeat(2, 1fr); } }
.pj { background: var(--panel); border: 1px solid var(--line); padding: 1.5rem 1.6rem 1.7rem; }
.pj-head { margin-bottom: 1rem; }
.pj-term { font-family: var(--mono); font-size: .62rem; letter-spacing: .17em; text-transform: uppercase; color: var(--steel); }
.pj-head h3 { margin-top: .35rem; }
.pj > p { color: var(--bone-dim); font-size: .95rem; }
.pj-empty { color: var(--bone-dim); max-width: 54ch; }
.pj-nophotos { font-family: var(--mono); font-size: .72rem; color: var(--steel); margin-top: 1rem; }
/* Two per row, and when the count is odd the last one runs full width as
   a feature image. Works for any number: 1 is featured, 2 sit side by
   side, 3 is a pair above a feature, 4 is a plain 2x2. */
.pj-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: 1.2rem; }
.pj-shot { padding: 0; border: 1px solid var(--line-2); background: none; cursor: zoom-in; overflow: hidden; }
.pj-shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 40%; transition: transform .3s ease; }
.pj-shot:hover img { transform: scale(1.04); }

.pj-shot:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* The taller feature crop applies only where there is actually a pair
   above it. A card with a single photo keeps the standard 4:3 it had
   before, so nothing changes on the one-photo cards.
   Portrait sources, so the feature stays near square — a wide crop of a
   vertical photo is how the old strips ended up showing torsos. */
.pj-shot:last-child:nth-child(odd):not(:only-child) img { aspect-ratio: 5 / 4; }

/* ---------- People ---------- */
.people { margin: 0; display: grid; gap: .1rem 1.5rem; }
@media (min-width: 560px) { .people { grid-template-columns: max-content 1fr; } }
.people dt { font-family: var(--mono); font-size: .62rem; letter-spacing: .15em; text-transform: uppercase; color: var(--steel); padding-top: .45rem; }
.people dd { margin: 0; padding-top: .2rem; }
.people a { color: var(--bone); text-decoration-color: var(--red); text-underline-offset: 3px; }

/* ---------- Steps ---------- */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: s; background: var(--ground); padding: 1.4rem 1.5rem 1.6rem; }
.steps li::before {
  content: counter(s); display: block; font-family: var(--cond); font-size: 2rem;
  color: var(--red); line-height: 1; margin-bottom: .5rem;
}
.steps h3 { margin-bottom: .4rem; }
.steps p { color: var(--bone-dim); font-size: .93rem; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; padding: 1.5rem; background: rgba(6, 8, 11, .95); }
.lightbox[open] { display: grid; }
.lightbox img { max-width: min(100%, 1100px); max-height: 84vh; width: auto; }
.lb-caption { margin-top: 1rem; text-align: center; color: var(--bone-dim); font-family: var(--mono); font-size: .76rem; }
.lb-close, .lb-nav {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px;
  font-size: 1.4rem; line-height: 1; color: var(--bone);
  background: rgba(233, 229, 219, .1); border: 1px solid var(--line-2); cursor: pointer;
}
.lb-close:hover, .lb-nav:hover { background: rgba(233, 229, 219, .22); }
.lb-close { top: 1rem; right: 1rem; }
.lb-nav[data-dir="prev"] { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lb-nav[data-dir="next"] { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- Footer ---------- */
.site-footer { padding-block: 2.2rem; color: var(--bone-dim); font-family: var(--mono); font-size: .72rem; letter-spacing: .05em; }
.site-footer > .shell { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; }
.site-footer a { color: var(--bone-dim); }

/* ---------- Narrow screens ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; flex-direction: column; align-items: flex-start;
    gap: .1rem; width: 100%; padding-top: .5rem;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .55rem 0; font-size: .78rem; }
  .lb-nav { width: 38px; height: 38px; }
  .lb-nav[data-dir="prev"] { left: .3rem; }
  .lb-nav[data-dir="next"] { right: .3rem; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
