/* ==========================================================================
   Showroom: public styles
   Calm, neutral base. Each section carries a theme that sets its accent
   colour (--sec) and a subtle background motif:
     .theme-tech    code & product management: dot grid + code/roadmap line art
     .theme-motion  motorsport & photography: contour lines + aperture line art
     .theme-plain   neutral
   ========================================================================== */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0efec;
  --border: #e5e3de;
  --border-strong: #d4d1ca;
  --text: #16171a;
  --muted: #62656c;
  --ink: #16171a;          /* primary buttons */
  --ink-text: #ffffff;

  --tech: #4b5bd7;
  --motion: #c8571f;
  --neutral: #4a4d55;

  /* used by admin.css and as the default section accent */
  --accent: var(--tech);
  --accent-hover: #3b4ac4;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--tech) 12%, transparent);
  --sec: var(--neutral);

  --ok: #13804f;
  --warn: #9a6400;
  --danger: #c62828;
  --shadow-sm: 0 1px 2px rgba(20, 20, 25, 0.06);
  --shadow: 0 12px 32px -12px rgba(20, 20, 25, 0.18);

  --font-display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1012;
    --surface: #17181b;
    --surface-2: #1e2024;
    --border: #2a2c31;
    --border-strong: #3a3d44;
    --text: #ececea;
    --muted: #9a9ea6;
    --ink: #ececea;
    --ink-text: #111214;

    --tech: #8f9bff;
    --motion: #f0955a;
    --neutral: #b4b7be;

    --accent-hover: #a8b1ff;
    --accent-ink: #111214;
    --ok: #4cc38a;
    --warn: #e0a940;
    --danger: #ff6b6b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  }
}

.theme-tech { --sec: var(--tech); }
.theme-motion { --sec: var(--motion); }
.theme-plain { --sec: var(--neutral); }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.1; margin: 0; font-family: var(--font-display); letter-spacing: 0.01em; text-transform: uppercase; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--ink-text); padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--sec); outline-offset: 3px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }

.brand {
  display: inline-flex; transition: opacity 0.15s; align-items: center; gap: 10px;
  font: 700 21px/1 var(--font-display); letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none;
}
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; flex: none;
  background: var(--ink); color: var(--ink-text);
  font: 700 15px/1 var(--font-display); letter-spacing: 0.01em; white-space: nowrap; overflow: hidden;
}

.brand:hover { opacity: 0.8; }

/* ---------- Buttons, pills, tags ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px; border-radius: 10px;
  font: 600 15px/1 var(--font-body); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--sec)); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: 14px; border-radius: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font: 600 12px/1.3 var(--font-body);
}
.pill-status { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.pill-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.pill-draft { background: var(--warn); color: #fff; }
.card-media .pill { position: absolute; top: 12px; left: 12px; box-shadow: var(--shadow-sm); }
.card-media .pill-draft { left: auto; right: 12px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li, .tags a {
  font-size: 12.5px; color: var(--muted); background: var(--surface-2);
  padding: 3px 9px; border-radius: 6px; text-decoration: none;
}
.tags li:has(a) { padding: 0; background: none; }
.tags a:hover { color: var(--sec); }

.kicker { font: 500 12px/1.4 var(--font-mono); color: var(--muted); letter-spacing: 0.02em; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero::before {
  /* soft glow in both section colours over a faint grid */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 60% at 85% 20%, color-mix(in srgb, var(--motion) 14%, transparent), transparent 70%),
    radial-gradient(45% 65% at 65% 90%, color-mix(in srgb, var(--tech) 16%, transparent), transparent 70%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%);
  opacity: 0.9;
}
.hero-inner {
  position: relative; display: grid; gap: 48px; align-items: center;
  padding-block: clamp(64px, 11vw, 132px) clamp(56px, 9vw, 112px);
}
@media (min-width: 920px) { .hero-inner { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); } }

.eyebrow { font: 600 14px/1.4 var(--font-body); color: var(--motion); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 18px; }
.hero-title { font: italic 700 clamp(44px, 7.6vw, 96px)/0.95 var(--font-display); letter-spacing: -0.005em; max-width: 14ch; }
.hero-text { margin-top: 22px; max-width: 56ch; font-size: clamp(16px, 1.9vw, 18.5px); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-aside { display: flex; flex-direction: column; gap: 12px; }
.hero-tile {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: var(--radius); text-decoration: none;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(6px);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.hero-tile:hover { border-color: color-mix(in srgb, var(--sec) 50%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow); }
.hero-tile-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px;
  color: var(--sec); background: color-mix(in srgb, var(--sec) 12%, transparent);
}
.hero-tile-body { display: flex; flex-direction: column; min-width: 0; }
.hero-tile-body strong { font: 700 21px/1.15 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; }
.hero-tile-body span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-tile-count { font: 500 13px/1 var(--font-mono); color: var(--muted); padding: 6px 9px; border-radius: 7px; background: var(--surface-2); }

/* ---------- Themed bands (home sections) & page headers ---------- */

.band, .page-band { position: relative; overflow: hidden; isolation: isolate; }
.band { padding-block: clamp(64px, 9vw, 104px); border-bottom: 1px solid var(--border); }

.band.theme-tech, .theme-tech > .page-band, .theme-tech > article > .page-band {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--tech) 30%, transparent) 1px, transparent 0) 0 0 / 22px 22px,
    color-mix(in srgb, var(--tech) 4%, var(--bg));
}
.band.theme-motion, .theme-motion > .page-band, .theme-motion > article > .page-band {
  background:
    repeating-radial-gradient(ellipse 120% 90% at 105% -15%, transparent 0 26px, color-mix(in srgb, var(--motion) 20%, transparent) 26px 27px),
    color-mix(in srgb, var(--motion) 4%, var(--bg));
}
.band.theme-plain { background: var(--bg); }

/* fade the pattern towards the bottom so it sits behind the content */
.band.theme-tech::before, .band.theme-motion::before,
.theme-tech > .page-band::before, .theme-motion > .page-band::before,
.theme-tech > article > .page-band::before, .theme-motion > article > .page-band::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 92%);
  opacity: 0.85;
}

.motif {
  position: absolute; z-index: -1; top: 20px; right: max(-40px, calc((100vw - var(--maxw)) / 2 - 80px));
  width: min(480px, 44vw); height: auto; color: var(--sec); opacity: 0.16; pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 35%);
}
.page-band .motif { top: 8px; opacity: 0.14; width: min(460px, 44vw); }
@media (max-width: 720px) { .motif { opacity: 0.1; width: 90vw; right: -30vw; } }

.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font: 500 12.5px/1 var(--font-mono); color: var(--sec);
  padding: 7px 11px 7px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--sec) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sec) 22%, transparent);
}
.section-eyebrow .theme-icon { width: 15px; height: 15px; }
.theme-plain .section-eyebrow { color: var(--muted); background: var(--surface); border-color: var(--border); }

.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.block-title { font: 700 clamp(34px, 5vw, 50px)/1 var(--font-display); letter-spacing: 0.01em; }
.block-intro { color: var(--muted); margin-top: 10px; max-width: 60ch; font-size: 17px; }
.link-more { color: var(--sec); font-weight: 600; text-decoration: none; white-space: nowrap; font-size: 15px; }
.link-more:hover { text-decoration: underline; text-underline-offset: 4px; }
.empty { color: var(--muted); padding: 32px; border: 1px dashed var(--border-strong); border-radius: var(--radius); text-align: center; background: var(--surface); }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); grid-auto-flow: row dense; }

/* Card grid: 6 columns, so cards can be full (6), half (3) or a third (2) wide.
   `dense` lets later cards fill gaps left by wider ones. */
.cards { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row dense; }
@media (min-width: 760px) {
  .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .card-full { grid-column: span 6; }
  .card-half { grid-column: span 3; }
  .card-third { grid-column: span 3; } /* tablets: thirds become halves */
}
@media (min-width: 1000px) { .card-third { grid-column: span 2; } }

/* ---------- Cards ---------- */

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.card-static { cursor: default; }
.card:not(.card-static):hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--sec) 45%, var(--border)); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--border); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:not(.card-static):hover .card-media img { transform: scale(1.03); }

.card-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; text-align: center; color: var(--sec);
  background: color-mix(in srgb, var(--sec) 6%, var(--surface));
}
.theme-tech .card-placeholder {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--tech) 35%, transparent) 1px, transparent 0) 0 0 / 18px 18px,
    color-mix(in srgb, var(--tech) 6%, var(--surface));
}
.theme-motion .card-placeholder {
  background:
    repeating-radial-gradient(ellipse 130% 100% at 110% 120%, transparent 0 16px, color-mix(in srgb, var(--motion) 22%, transparent) 16px 17px),
    color-mix(in srgb, var(--motion) 6%, var(--surface));
}
.card-placeholder .theme-icon { width: 34px; height: 34px; padding: 8px; box-sizing: content-box; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.card-placeholder span { font: 700 22px/1.1 var(--font-display); text-transform: uppercase; color: var(--text); opacity: 0.75; max-width: 22ch; }

.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.card-title { font: 700 26px/1.05 var(--font-display); letter-spacing: 0.01em; }
.card-text { color: var(--muted); font-size: 15px; }
.card .tags { margin-top: auto; padding-top: 10px; }

@media (min-width: 760px) {
  /* full-width cards: image beside the text */
  .card-full { flex-direction: row; }
  .card-full .card-media { flex: 0 0 56%; aspect-ratio: 16 / 10; border-bottom: 0; border-right: 1px solid var(--border); }
  .card-full .card-body { justify-content: center; padding: clamp(24px, 3.2vw, 44px); gap: 12px; }
  .card-full .card-title { font-size: clamp(32px, 3.4vw, 42px); }
  .card-full .card-text { font-size: 16.5px; }
  .card-full .tags { margin-top: 8px; }
  .card-flip { flex-direction: row-reverse; }
  .card-flip .card-media { border-right: 0; border-left: 1px solid var(--border); }
  .card-half .card-title { font-size: 30px; }
}

/* ---------- About & contact ---------- */

.about-contact { display: grid; gap: 48px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .about-contact { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.about .prose { margin-top: 18px; }
.about .socials { margin-top: 24px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-sm); }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form h3 { font: 700 28px/1 var(--font-display); }
.contact-form .btn { align-self: flex-start; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
input, textarea, select {
  font: inherit; font-weight: 400; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; width: 100%; min-height: 44px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; border: 1px solid; }
.notice ul { margin: 0; padding-left: 18px; }
.notice-success { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.notice-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.notice-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); margin-bottom: 16px; }

.socials { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.socials a {
  display: inline-block; padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font-size: 14px; font-weight: 500; text-decoration: none; transition: border-color 0.15s;
}
.socials a:hover { border-color: var(--border-strong); }

/* ---------- Prose (Markdown) ---------- */

.prose { font-size: 17px; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose h2 { font-size: 32px; }
.prose h3 { font-size: 24px; }
.prose a { color: var(--sec); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--sec); }
.prose blockquote { margin-inline: 0; padding: 4px 0 4px 18px; border-left: 3px solid color-mix(in srgb, var(--sec) 60%, transparent); color: var(--muted); }
.prose code { font: 0.86em var(--font-mono); background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: var(--surface-2); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: var(--radius-sm); }
.prose em:only-child { color: var(--muted); }

/* ---------- Inner pages ---------- */

.page-band { border-bottom: 1px solid var(--border); }
.page-band-inner { position: relative; padding-block: 28px clamp(40px, 6vw, 64px); }
.page { padding-block: 40px 0; }
.page-end { height: clamp(56px, 8vw, 96px); }
.breadcrumb { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 28px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.page-title { font: italic 700 clamp(42px, 7vw, 78px)/0.95 var(--font-display); max-width: 20ch; }
.page-intro { color: var(--muted); font-size: clamp(16px, 1.9vw, 19px); margin-top: 14px; max-width: 62ch; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; text-decoration: none; color: var(--muted); transition: border-color 0.15s, color 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip[aria-current='true'] { background: var(--sec); border-color: var(--sec); color: var(--surface); }

.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; }
.meta-text { color: var(--muted); font: 500 13px/1 var(--font-mono); }
.item-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.item-cover img { width: 100%; max-height: 640px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.item-cover { margin: 0 auto 48px; }
.item-body { max-width: 72ch; }
.item-content .block { padding-top: clamp(48px, 7vw, 80px); }

.gallery {
  /* Equal 16:9 tiles (photos are centre-cropped; the lightbox shows them uncropped).
     An unfinished last row is centred so the block stays balanced. */
  --cols: 3; --gap: 14px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap);
}
@media (max-width: 900px) { .gallery { --cols: 2; --gap: 10px; } }
.gallery-item {
  position: relative; display: block; flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); cursor: zoom-in; box-shadow: var(--shadow-sm);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.3s, opacity 0.3s;
}
.gallery-item::after {
  /* thin inner frame in the section colour on hover */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 0 color-mix(in srgb, var(--sec) 80%, transparent); transition: box-shadow 0.25s;
}
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.06); }
.gallery-item:hover::after, .gallery-item:focus-visible::after { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--sec) 80%, transparent); }
@media (hover: hover) {
  /* the other photos step back slightly while one is hovered */
  .gallery:has(.gallery-item:hover) .gallery-item:not(:hover) img { filter: brightness(0.7) saturate(0.75); }
}
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px;
  font-size: 13px; font-weight: 500; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s;
}
.gallery-item:hover .gallery-caption, .gallery-item:focus-visible .gallery-caption { opacity: 1; transform: none; }
@media (hover: none) { .gallery-caption { opacity: 1; transform: none; } }
.item-content .block-title { margin-bottom: 24px; font-size: clamp(30px, 3.8vw, 40px); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(56px, 8vw, 88px); }
.pager-link {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none;
  font: 700 22px/1.1 var(--font-display); text-transform: uppercase; transition: border-color 0.15s;
}
.pager-link:hover { border-color: color-mix(in srgb, var(--sec) 50%, var(--border)); }
.pager-link .kicker { color: var(--sec); }
.pager-next { text-align: right; grid-column: 2; }

.error-page { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-block: 120px; }
.error-code { font: 500 15px/1 var(--font-mono); color: var(--muted); padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.error-page .page-title { margin-inline: auto; }
.error-page .btn { margin-top: 20px; }

/* ---------- Footer ---------- */

.site-footer { padding-block: 28px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  background: rgba(8, 8, 10, 0.94); padding: 16px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; border-radius: 4px; }
.lightbox figcaption { color: #ddd; font-size: 14px; text-align: center; }
.lightbox button { background: none; border: 0; color: #fff; cursor: pointer; font-size: 44px; line-height: 1; padding: 12px; opacity: 0.75; }
.lightbox button:hover { opacity: 1; }
.lightbox-close { position: absolute; top: 8px; right: 12px; }
@media (max-width: 600px) { .lightbox-nav { position: absolute; bottom: 12px; } .lightbox-prev { left: 12px; } .lightbox-next { right: 12px; } .lightbox { grid-template-columns: 1fr; } }

/* ---------- Key facts ---------- */

.facts {
  display: grid; gap: 1px; margin: 0 0 48px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.fact { background: var(--surface); padding: 18px 20px 18px 22px; display: flex; flex-direction: column-reverse; gap: 6px; position: relative; }
.fact::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px; background: color-mix(in srgb, var(--sec) 70%, transparent); border-radius: 2px; }
.fact dt { color: var(--muted); font: 500 12px/1.3 var(--font-mono); }
.fact-text dd { font-size: clamp(22px, 2.2vw, 26px) !important; }
.fact dd { margin: 0; font: italic 700 clamp(28px, 3.4vw, 38px)/1.05 var(--font-display); text-transform: uppercase; color: var(--text); overflow-wrap: anywhere; }

/* ---------- Videos (self-hosted) ---------- */

.videos { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.video-figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.video {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain;
  border-radius: var(--radius); background: #000; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.video-figure figcaption { color: var(--muted); font-size: 14px; }
