:root {
  --ink: #1A2430;
  --tide: #0C1219;
  --paper: #EEF1F4;
  --cerulean: #3A7CA5;
  --fog: #6E7A86;
  --teal: #4A6B6A;
  --display: "Fraunces", Georgia, serif;
  --body: "Source Sans 3", system-ui, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--cerulean); }
a:hover { color: var(--teal); }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cerulean);
  display: block;
  margin-bottom: 0.75rem;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(238, 241, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(26, 36, 48, 0.08);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.site-nav a[aria-current="page"] {
  color: var(--cerulean);
  border-bottom: 2px solid var(--cerulean);
  padding-bottom: 2px;
}

/* Hero — CURRENT TABLE (front) */
.hero-table {
  background: var(--tide);
  color: var(--paper);
  padding: 3rem 0 4rem;
}

.hero-table__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: end;
}

.hero-table__visual {
  position: relative;
  min-height: 320px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(238, 241, 244, 0.2);
}

.hero-table__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 18, 25, 0.75), transparent 60%);
}

.hero-table__panel {
  border: 1px solid rgba(58, 124, 165, 0.45);
  padding: 1.75rem;
  background: rgba(26, 36, 48, 0.6);
}

.hero-table h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--paper);
}

.hero-table .table-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cerulean);
  margin-bottom: 1rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  border: 1px solid rgba(26, 36, 48, 0.12);
  background: #fff;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--cerulean); }

.card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.card-body { padding: 1.15rem; flex: 1; display: flex; flex-direction: column; }

.card-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fog);
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.card p { font-size: 0.92rem; color: var(--fog); margin: 0 0 0.75rem; flex: 1; }

.card-link {
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--cerulean);
  font-weight: 600;
}

/* Article */
.section { padding: 4rem 0; }

.section--tide {
  background: var(--tide);
  color: var(--paper);
}

.prose { max-width: 680px; }
.prose--wide { max-width: 760px; }

.prose p { margin: 0 0 1.15em; }
.prose h2 { margin-top: 2rem; font-size: 1.5rem; }

.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: clamp(1.85rem, 4vw, 2.6rem); }

.article-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fog);
  margin-top: 0.75rem;
}

.article-figure { margin: 2rem 0; }
.article-figure img { width: 100%; }
.article-figure figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fog);
  margin-top: 0.5rem;
}

/* Archive groups */
.archive-group { margin-bottom: 3rem; }
.archive-group h2 {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  border-bottom: 1px solid rgba(26, 36, 48, 0.12);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

/* Author layout */
.author-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.author-portrait {
  border: 1px solid rgba(26, 36, 48, 0.12);
}

.author-portrait img { width: 100%; }

/* Reach / contact */
.reach-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.contact-panel {
  border: 1px solid rgba(26, 36, 48, 0.12);
  padding: 1.75rem;
  background: #fff;
}

.form-stack { display: grid; gap: 1rem; }

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input, select, textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(26, 36, 48, 0.18);
  width: 100%;
  background: var(--paper);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--cerulean);
  outline-offset: 1px;
}

.checkbox-label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-weight: 400;
  font-size: 0.88rem;
}

.checkbox-label input { width: auto; margin-top: 0.2rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  background: var(--cerulean);
  color: #fff;
}

.btn:hover { background: var(--teal); color: #fff; }

.form-msg {
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.form-msg--ok {
  background: rgba(74, 107, 106, 0.12);
  border-left: 3px solid var(--teal);
}

.form-msg--err {
  background: rgba(58, 124, 165, 0.12);
  border-left: 3px solid var(--cerulean);
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* Maps */
.map-wrap { width: 100%; }
.map-wrap--a { height: 490px; }
.map-wrap--b { height: 180px; }
.map-wrap--c { height: 140px; }
.map-wrap--d { height: 120px; }

.map-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: grayscale(0.35) contrast(1.05);
}

.map-caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fog);
  padding: 0.5rem 1.25rem;
  background: rgba(26, 36, 48, 0.04);
}

/* Footer */
.site-footer {
  background: var(--tide);
  color: var(--paper);
  padding: 3rem 0 1.5rem;
  background-image: url('/images/15-footer-texture.jpg');
  background-size: cover;
  background-blend-mode: overlay;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding: 0 1.25rem;
}

.footer-brand {
  font-family: var(--display);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 1.25rem 0;
}

.footer-links a {
  color: var(--paper);
  text-decoration: none;
  font-size: 0.88rem;
}

.footer-links a:hover { color: var(--cerulean); }

.footer-note {
  font-size: 0.82rem;
  color: rgba(238, 241, 244, 0.7);
  line-height: 1.5;
}

.footer-copy {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(238, 241, 244, 0.5);
  margin-top: 1.5rem;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--tide);
  color: var(--paper);
  padding: 1rem 1.25rem;
  z-index: 200;
  border-top: 1px solid rgba(58, 124, 165, 0.35);
}

.cookie-banner[hidden] { display: none; }

.cookie-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-inner p {
  margin: 0;
  font-size: 0.88rem;
  flex: 1 1 280px;
}

.cookie-inner a { color: var(--cerulean); }

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-actions button {
  padding: 0.5rem 0.9rem;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--cerulean);
  background: transparent;
  color: var(--paper);
}

.cookie-actions button:hover {
  background: var(--cerulean);
}

#cookie-custom {
  width: 100%;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(238, 241, 244, 0.15);
}

#cookie-custom label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  margin-right: 1rem;
}

/* 404 */
.error-page {
  min-height: 50vh;
  display: flex;
  align-items: center;
  text-align: center;
}

.error-page h1 { font-size: 4rem; color: var(--cerulean); }

/* Legal prose */
.legal-prose { max-width: 760px; }
.legal-prose h2 { font-size: 1.25rem; margin-top: 2rem; }
.legal-prose h3 { font-size: 1.05rem; margin-top: 1.5rem; }
.legal-prose ul, .legal-prose ol { padding-left: 1.25rem; }
.legal-prose li { margin-bottom: 0.5rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero-table__grid,
  .card-grid,
  .author-layout,
  .reach-layout {
    grid-template-columns: 1fr;
  }

  .header-inner { justify-content: center; text-align: center; }
  .site-nav { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
