/* Pen Lines — Red Thread */
:root {
  --ink: #241F1C;
  --night: #0D0A09;
  --paper: #EFEBE4;
  --oxblood: #7A2E2A;
  --fog: #5C554F;
  --clay: #4E4540;
  --fog-light: #B5ADA5;
  --shell: 1140px;
  --shell-wide: 1160px;
  --margin-col: min(180px, 28vw);
  --gutter: clamp(24px, 5vw, 64px);
  --measure: min(68ch, 100%);
  --pad-sm: clamp(48px, 8vw, 80px);
  --pad-md: clamp(64px, 10vw, 96px);
  --pad-lg: 120px;
  --pad-xl: 144px;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "Public Sans", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --focus: 0 0 0 3px rgba(122, 46, 42, 0.35);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

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

.mono { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.09em; text-transform: uppercase; }

.accent, em.accent { color: var(--oxblood); font-style: italic; }

a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--clay); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--night); color: var(--paper); padding: 8px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

.site-header {
  background: var(--night);
  color: var(--paper);
  border-bottom: 1px solid var(--clay);
  position: sticky; top: 0; z-index: 200;
}

.header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 16px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--paper);
  text-decoration: none;
  line-height: 1.2;
}
.site-logo span { display: block; font-family: var(--font-sans); font-size: 0.75rem; font-weight: 400; color: var(--fog-light); margin-top: 4px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-nav a { color: rgba(239, 235, 228, 0.92); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--paper); }
.site-nav a[aria-current="page"] { color: #D4A09C; text-decoration: underline; }

.page-shell { max-width: var(--shell); margin: 0 auto; padding: var(--pad-sm) var(--gutter); width: 100%; }
.page-shell--wide { max-width: var(--shell-wide); }

.surface-warm-paper { background: var(--paper); }

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 12px;
}

.lede { font-size: 1.15rem; color: var(--clay); margin: 0; max-width: var(--measure); line-height: 1.65; }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.35em; }
.prose p:last-child { margin-bottom: 0; }
.content-column { max-width: var(--measure); }

.article-grid {
  display: grid;
  grid-template-columns: 1fr var(--margin-col);
  gap: 32px 40px;
  margin-top: 32px;
}
.article-grid--hanging .prose-col > p:first-child::first-line { font-weight: 500; }

.margin-col { display: flex; flex-direction: column; gap: 24px; }

.margin-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  line-height: 1.55;
  color: var(--clay);
  border-left: 2px solid var(--oxblood);
  padding-left: 14px;
  background: rgba(122, 46, 42, 0.04);
  padding-top: 8px;
  padding-bottom: 8px;
  padding-right: 8px;
}
.margin-note--hero { background: transparent; border-left-color: var(--clay); }
.margin-note__idx { display: block; color: var(--oxblood); margin-bottom: 4px; font-weight: 600; }

.thread-rule {
  position: relative;
  height: 8px;
  margin: 28px 0;
  max-width: 100%;
}
.thread-rule__oxblood {
  display: block;
  height: 2px;
  background: var(--oxblood);
  width: 100%;
  transform-origin: left;
  transition: transform 0.6s ease;
}
.thread-rule__clay {
  display: block;
  height: 1px;
  background: var(--clay);
  width: 100%;
  margin-top: 6px;
  opacity: 0.55;
}

html.js .thread-rule__oxblood { transform: scaleX(0); }
html.js .thread-rule.is-drawn .thread-rule__oxblood { transform: scaleX(1); }

.photo-frame {
  margin: 32px 0;
  padding: 12px;
  border: 1px solid rgba(78, 69, 64, 0.35);
  background: #F7F4EF;
  box-shadow: 0 8px 32px rgba(13, 10, 9, 0.06);
  border-radius: 2px;
}
.photo-frame img { width: 100%; object-fit: cover; border-radius: 1px; }
.photo-frame--wide { max-width: none; }
.photo-frame--banner { margin: 24px 0 32px; padding: 8px; }
.photo-frame--banner img { max-height: 280px; object-fit: cover; }
.photo-frame--subtle { opacity: 0.95; }
.photo-frame--subtle img { max-height: 180px; }
.photo-frame--inline { max-width: var(--measure); }
.photo-caption { margin-top: 10px; text-align: right; color: var(--fog); font-size: 0.72rem; letter-spacing: 0.04em; }

.reveal-photo {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
html.js .reveal-photo { opacity: 0; transform: translateY(14px); }
html.js .reveal-photo.is-visible { opacity: 1; transform: translateY(0); }

html.js .margin-note { opacity: 0; transform: translateX(10px); transition: opacity 0.4s ease, transform 0.4s ease; }
html.js .margin-note.is-visible { opacity: 1; transform: translateX(0); }

.landing-top {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px; flex-wrap: wrap; gap: 8px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 68%) var(--margin-col);
  gap: 24px 40px;
  align-items: start;
  margin-bottom: 24px;
}
.landing-hero--archive { margin-bottom: 8px; }

.note-list { display: flex; flex-direction: column; gap: 0; margin-top: 24px; }

.note-card {
  display: grid;
  grid-template-columns: 120px 1fr 96px;
  gap: 16px 24px;
  align-items: center;
  padding: 22px 12px;
  border-top: 1px solid rgba(78, 69, 64, 0.2);
  text-decoration: none;
  color: inherit;
  border-radius: 2px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.note-card:hover { background: rgba(122, 46, 42, 0.045); }
.note-card:hover .note-card__title { color: var(--oxblood); }
.note-card__date { color: var(--fog); font-weight: 500; }
.note-card__title { font-family: var(--font-serif); font-size: 1.25rem; margin: 0 0 6px; font-weight: 600; line-height: 1.25; }
.note-card__standfirst { margin: 0; font-size: 0.95rem; color: var(--clay); line-height: 1.5; }
.note-card__thumb { width: 96px; height: 72px; object-fit: cover; border: 1px solid rgba(78, 69, 64, 0.35); border-radius: 1px; }

.archive-group { margin-top: 48px; }
.archive-group__label { color: var(--oxblood); margin-bottom: 16px; font-weight: 500; }
.archive-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px 20px;
  padding: 18px 12px;
  border-top: 1px solid rgba(78, 69, 64, 0.18);
  text-decoration: none;
  color: inherit;
  border-radius: 2px;
  transition: background 0.2s ease;
}
.archive-card:hover { background: rgba(122, 46, 42, 0.04); }
.archive-card img { width: 96px; height: 72px; object-fit: cover; border: 1px solid rgba(78, 69, 64, 0.3); border-radius: 1px; }
.archive-card h3 { font-family: var(--font-serif); margin: 4px 0 6px; font-size: 1.15rem; line-height: 1.25; }
.archive-card p { margin: 0; color: var(--clay); font-size: 0.95rem; line-height: 1.5; }
.archive-card__date { color: var(--fog); font-weight: 500; }

.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}
.about-portrait img { width: 100%; }

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact-photo { margin-top: 0; margin-bottom: 24px; }
.contact-details {
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--ink);
  padding: 20px 24px;
  background: rgba(122, 46, 42, 0.05);
  border-left: 3px solid var(--oxblood);
}

.disclaimer-block {
  max-width: var(--measure);
  padding: 24px 0;
  font-size: 0.95rem;
  color: var(--clay);
  border-top: 1px solid rgba(78, 69, 64, 0.3);
}

.article-end { margin-top: 32px; font-family: var(--font-mono); font-size: 0.75rem; }

.eyebrow, .dateline { color: var(--fog); margin: 0 0 8px; font-weight: 500; }

.text-link { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.05em; }

.manage-cookies-btn {
  margin: 24px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--oxblood);
  color: var(--oxblood);
  padding: 10px 18px;
  cursor: pointer;
}
.manage-cookies-btn:hover, .manage-cookies-btn:focus-visible { background: var(--oxblood); color: var(--paper); outline: none; box-shadow: var(--focus); }

.site-footer {
  background: var(--night);
  color: var(--paper);
  margin-top: var(--pad-md);
  padding: var(--pad-sm) var(--gutter);
}
.footer-inner { max-width: var(--shell); margin: 0 auto; font-size: 0.9rem; line-height: 1.7; }
.footer-inner a { color: var(--paper); }
.footer-brand { font-size: 1rem; margin-bottom: 4px; }
.footer-meta { color: var(--fog-light); font-size: 0.85rem; }
.footer-links { margin-top: 12px; }
.footer-links a { margin-right: 20px; opacity: 0.92; }
.footer-links a:hover { opacity: 1; }

/* Maps */
.map-b { margin-top: var(--pad-sm); border-top: 1px solid rgba(78, 69, 64, 0.25); padding-top: 16px; }
.map-eyebrow { color: var(--fog); margin: 0 0 10px; font-weight: 500; }
.map-eyebrow.page-shell { padding-bottom: 0; padding-top: 0; }
.map-wrap {
  position: relative;
  border: 1px solid var(--oxblood);
  overflow: hidden;
  background: rgba(78, 69, 64, 0.08);
}
.map-a .map-wrap { min-height: 490px; }
.map-b .map-wrap { height: 190px; }
.map-c .map-wrap { height: 300px; }
.map-d .map-wrap { height: 170px; max-width: 480px; }

.map-wrap iframe { width: 100%; border: 0; display: block; filter: saturate(0.88) contrast(1.02); }
.map-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: inherit; height: 100%; padding: 24px; text-align: center; color: var(--clay);
}
.map-placeholder[hidden], .map-wrap iframe[hidden] { display: none !important; }
.map-placeholder button, .map-placeholder [data-load-map] {
  margin-top: 12px; font-family: var(--font-mono); font-size: 0.75rem;
  background: var(--oxblood); color: var(--paper); border: 0; padding: 10px 18px; cursor: pointer;
}
.map-note { font-size: 0.85rem; color: var(--fog); margin-top: 8px; }

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5000;
  background: var(--paper);
  border-top: 1px solid var(--clay);
  box-shadow: 0 -4px 24px rgba(13, 10, 9, 0.08);
  transform: translateY(0);
  transition: transform 0.35s ease;
}
.cookie-banner[hidden] { display: none !important; }
.cookie-thread {
  height: 2px;
  background: var(--oxblood);
  width: 100%;
  max-width: calc(var(--shell) - var(--gutter) * 2);
  margin: 0 auto;
}
.cookie-inner { max-width: var(--shell); margin: 0 auto; padding: 16px var(--gutter) 20px; }
.cookie-text { margin: 12px 0; font-size: 0.95rem; max-width: 60ch; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cookie-btn {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--oxblood); color: var(--paper); border: 1px solid var(--oxblood);
  padding: 10px 16px; cursor: pointer;
}
.cookie-btn--ghost { background: transparent; color: var(--oxblood); }
.cookie-btn:focus-visible, .cookie-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
#cookie-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(78, 69, 64, 0.25); }
#cookie-panel[hidden] { display: none !important; }
.cookie-panel-title { font-family: var(--font-serif); font-weight: 600; margin: 0 0 12px; }
.cookie-toggle-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 8px 0; font-size: 0.9rem;
}
.cookie-toggle {
  font-family: var(--font-mono); font-size: 0.65rem; min-width: 48px;
  background: transparent; border: 1px solid var(--clay); color: var(--clay); padding: 6px 10px; cursor: pointer;
}
.cookie-toggle.is-on { background: var(--oxblood); border-color: var(--oxblood); color: var(--paper); }
.cookie-toggle.is-locked { opacity: 0.7; cursor: not-allowed; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 900px) {
  .article-grid, .landing-hero { grid-template-columns: 1fr; }
  .margin-col { display: none; }
  .article-grid--hanging .prose-col .margin-inline {
    display: block; font-style: italic; color: var(--fog);
    margin: 0 0 1.25em 1.5em; padding-left: 12px; border-left: 2px solid var(--oxblood);
    font-family: var(--font-mono); font-size: 0.75rem;
  }
  .about-layout, .contact-layout { grid-template-columns: 1fr; }
  .note-card { grid-template-columns: 1fr 72px; padding: 18px 8px; }
  .note-card__date { grid-column: 1 / -1; }
  .map-a .map-wrap { min-height: 300px; }
  .map-b .map-wrap { height: 130px; }
  .map-c .map-wrap { height: 200px; }
  .map-d .map-wrap { height: 150px; }
}

@media (max-width: 540px) {
  body { font-size: 1.0625rem; }
  .page-title { font-size: 1.85rem; }
  .note-card { grid-template-columns: 1fr; }
  .note-card__thumb { display: none; }
  .archive-card { grid-template-columns: 72px 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html.js .thread-rule__oxblood, html.js .reveal-photo, html.js .margin-note { opacity: 1; transform: none; }
}
