@font-face {
  font-family: 'Cinzel';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/cinzel-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Cinzel';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/cinzel-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Vollkorn';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/vollkorn-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Vollkorn';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/vollkorn-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Vollkorn';
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url('/assets/fonts/vollkorn-400-italic.woff2') format('woff2');
}

:root {
  --void: #0b141d;
  --void-2: #131f2b;
  --void-3: #1a2a38;
  --brass: #b9822f;
  --brass-bright: #e7ad57;
  --brass-dim: #7c5a26;
  --frost: #9fc4d1;
  --frost-dim: #5f7d88;
  --verdigris: #4d7a70;
  --parchment: #ead9bb;
  --parchment-dim: #b8a985;
  --ink: #16222c;
  --shadow: rgba(3, 7, 11, 0.55);
  --bg: var(--void);
  --bg-panel: var(--void-2);
  --bg-panel-2: var(--void-3);
  --text: var(--parchment);
  --text-dim: var(--parchment-dim);
  --accent: var(--brass);
  --accent-bright: var(--brass-bright);
  --accent-cold: var(--frost);
  --line: var(--verdigris);
  --rivet: #3a2c17;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ede2c9;
    --bg-panel: #e2d3ab;
    --bg-panel-2: #d6c497;
    --text: var(--ink);
    --text-dim: #4a4032;
    --accent: #93611f;
    --accent-bright: #7a4f18;
    --accent-cold: #3f6672;
    --line: #3f6259;
    --rivet: #cbb679;
    --shadow: rgba(90, 70, 30, 0.25);
  }
}
:root[data-theme="dark"] {
  --bg: var(--void);
  --bg-panel: var(--void-2);
  --bg-panel-2: var(--void-3);
  --text: var(--parchment);
  --text-dim: var(--parchment-dim);
  --accent: var(--brass);
  --accent-bright: var(--brass-bright);
  --accent-cold: var(--frost);
  --line: var(--verdigris);
  --rivet: #3a2c17;
  --shadow: rgba(3, 7, 11, 0.55);
}
:root[data-theme="light"] {
  --bg: #ede2c9;
  --bg-panel: #e2d3ab;
  --bg-panel-2: #d6c497;
  --text: var(--ink);
  --text-dim: #4a4032;
  --accent: #93611f;
  --accent-bright: #7a4f18;
  --accent-cold: #3f6672;
  --line: #3f6259;
  --rivet: #cbb679;
  --shadow: rgba(90, 70, 30, 0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vollkorn', Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
}

::selection { background: var(--accent); color: var(--void); }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-cold);
  outline-offset: 3px;
}

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

.label {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--accent-cold);
}

h1, h2, h3 {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
  letter-spacing: 0.02em;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.wrap-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
  max-width: 1120px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { width: 34px; height: 34px; flex: none; color: var(--accent-cold); object-fit: contain; display: block; }
.brand-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}
.brand-name em { font-style: normal; color: var(--accent-bright); }
nav.primary { display: flex; gap: clamp(0.9rem, 2.2vw, 2rem); }
nav.primary a {
  text-decoration: none;
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
nav.primary a:hover, nav.primary a[aria-current="page"] { color: var(--accent-bright); border-color: var(--accent-bright); }

/* Below this width the brand + 4 nav links no longer fit on one line —
   stack the brand on its own row and spread nav links full-width instead
   of letting two separate flex containers wrap into each other. */
@media (max-width: 560px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }
  nav.primary {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem 1rem;
  }
  nav.primary a { font-size: 0.7rem; letter-spacing: 0.08em; }
}

/* ---------- Ticker ---------- */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  overflow: hidden;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  animation: ticker 42s linear infinite;
  padding: 0.5rem 0;
}
.ticker-track span {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0 2.5rem;
  border-right: 1px solid var(--line);
}
.ticker-track span b { color: var(--accent-cold); font-weight: 600; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .porthole-col { order: -1; margin: 0 auto; }
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
}
h1.title {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.05;
  color: var(--text);
}
h1.title em {
  font-style: normal;
  color: var(--accent-bright);
  display: block;
}
.lede {
  margin-top: 1.3rem;
  max-width: 46ch;
  color: var(--text-dim);
  font-size: 1.08rem;
}
.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.btn {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  display: inline-block;
  cursor: pointer;
  background: transparent;
}
.btn.solid {
  background: var(--accent);
  color: var(--void);
  border-color: var(--accent);
}
.btn.solid:hover { background: var(--accent-bright); border-color: var(--accent-bright); box-shadow: 0 0 22px -4px var(--accent-bright); }
.btn.ghost:hover { color: var(--accent-bright); border-color: var(--accent-bright); }

/* ---------- Porthole ---------- */
.porthole-col { display: flex; justify-content: center; }
.porthole {
  position: relative;
  width: clamp(220px, 30vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 18px;
  background:
    radial-gradient(circle at 30% 28%, #d9a75c, var(--brass-dim) 55%, #4a3313 100%);
  box-shadow:
    0 0 0 2px var(--rivet),
    0 18px 50px -12px var(--shadow),
    inset 0 0 30px rgba(0,0,0,0.5);
}
.porthole::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-conic-gradient(var(--rivet) 0deg 1.2deg, transparent 1.2deg 9deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 12px), #000 calc(50% - 11px), #000 calc(50% - 4px), transparent calc(50% - 3px));
          mask: radial-gradient(circle, transparent calc(50% - 12px), #000 calc(50% - 11px), #000 calc(50% - 4px), transparent calc(50% - 3px));
  opacity: 0.9;
}
.porthole-glass {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 40px 8px rgba(0,0,0,0.65), inset 0 0 0 3px #1a1208;
}
.porthole-glass canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.porthole-glass .frost-fringe {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle, transparent 62%, rgba(230,245,250,0.22) 88%, rgba(230,245,250,0.5) 100%);
  pointer-events: none;
}

/* ---------- Small porthole (page headers) ---------- */
.porthole-small {
  width: clamp(120px, 18vw, 160px);
}
.porthole-small.porthole { padding: 10px; }

/* ---------- Page header (non-hero pages) ---------- */
.page-header {
  padding: clamp(2.5rem, 6vw, 4rem) 0 2rem;
  border-bottom: 1px solid var(--line);
}

/* ---------- Section shell ---------- */
section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.section-head .label { white-space: nowrap; }

/* ---------- Instrument panel (nav preview) ---------- */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}
.plate {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.6rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.plate::before, .plate::after {
  content: "";
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent-bright), var(--rivet) 70%);
  top: 10px; left: 10px;
}
.plate::after { left: auto; right: 10px; }
.plate-icon { width: 30px; height: 30px; color: var(--accent-cold); margin-bottom: 1rem; }
.plate h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.plate p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }
.plate:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 1px var(--accent-bright), 0 14px 30px -14px var(--shadow), 0 0 40px -10px var(--accent-bright);
  transform: translateY(-2px);
}

/* ---------- Field notes ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}
.note-card {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.note-thumb {
  aspect-ratio: 16/10;
  border-radius: 3px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.note-date {
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--accent-cold);
}
.note-card h3 { font-size: 1.15rem; }
.note-card h3 a { text-decoration: none; }
.note-card h3 a:hover { color: var(--accent-bright); }
.note-card p { margin: 0; color: var(--text-dim); font-size: 0.95rem; }
.note-card .read {
  margin-top: 0.2rem;
  font-family: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.note-card .read:hover { color: var(--accent-bright); }

/* ---------- Blog index list (denser than the card grid) ---------- */
.post-list { display: flex; flex-direction: column; gap: 0; }
.post-list-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  flex-wrap: wrap;
}
.post-list-item:hover h3 { color: var(--accent-bright); }
.post-list-item h3 { font-size: 1.1rem; transition: color 0.2s ease; }
.post-list-item .note-date { flex: none; }

/* ---------- Article (single post) ---------- */
.article-body {
  font-size: 1.08rem;
}
.article-body h2 {
  font-size: 1.4rem;
  margin-top: 2.4rem;
  margin-bottom: 0.8rem;
}
.article-body p { margin: 0 0 1.2rem; color: var(--text); }
.article-body p:first-of-type {
  font-size: 1.15rem;
  color: var(--text-dim);
}
.article-body a { color: var(--accent-bright); }
.article-body blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.4rem;
  color: var(--text-dim);
  font-style: italic;
}
.article-body ul, .article-body ol { color: var(--text); padding-left: 1.4rem; }
.article-body img { border-radius: 3px; border: 1px solid var(--line); margin: 1.6rem 0; }
.article-body code {
  font-family: ui-monospace, monospace;
  background: var(--bg-panel);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
}
.back-link:hover { color: var(--accent-bright); }

/* ---------- Coordinates strip ---------- */
.coords {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
}
.coords div { text-align: center; }
.coords .num {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}
.coords .cap {
  margin-top: 0.3rem;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Gallery ---------- */
.gallery-section { margin-bottom: 3rem; }
.gallery-cat-heading {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}
.gallery-item {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: saturate(0.9);
}
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.06); filter: saturate(1.1); }
.gallery-empty {
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
}
.gallery-empty h3 { margin-bottom: 0.6rem; color: var(--text); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  color: var(--parchment, #ead9bb);
  cursor: pointer;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: var(--accent, #b9822f); color: var(--void, #0b141d); }
.lightbox-close {
  top: 1.2rem;
  right: 1.2rem;
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
  line-height: 1;
}
.lightbox-prev { left: 1.2rem; }
.lightbox-next { right: 1.2rem; }
@media (max-width: 640px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.5rem; }
  .lightbox-prev { left: 0.4rem; }
  .lightbox-next { right: 0.4rem; }
  .lightbox-close { top: 0.6rem; right: 0.6rem; }
}

/* ---------- Contact ---------- */
.contact-plate {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-plate a.btn { align-self: flex-start; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer-links a:hover { color: var(--accent-bright); }
.stamp {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ---------- 404 ---------- */
.error-page {
  text-align: center;
  padding: clamp(4rem, 12vw, 8rem) 0;
}
.error-page .num {
  font-family: 'Cinzel', serif;
  font-size: clamp(3rem, 10vw, 6rem);
  color: var(--accent-bright);
}
