/* ============================================
   Design tokens
   ============================================ */
:root {
  --bg: #14120f;
  --bg-alt: #1c1914;
  --bg-raised: #221e17;
  --text: #ece6d6;
  --text-dim: #a89f8c;
  --text-faint: #6f6858;
  --accent: #8b2635;      /* oxblood */
  --accent-bright: #b23349;
  --brass: #a67c3d;       /* brass / gold */
  --rule: #332f24;

  --spine-1: #2b2e4a; /* indigo */
  --spine-2: #8b2635; /* oxblood */
  --spine-3: #a67c3d; /* brass */
  --spine-4: #3c4a3a; /* moss */
  --spine-5: #6b3f4e; /* dusty rose */
  --spine-6: #0a0a0a; /* ink */

  --serif-display: "Fraunces", "Georgia", serif;
  --serif-body: "Newsreader", "Georgia", serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;

  --spine-w: 14px;
  --max-w: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.6;
  padding-left: var(--spine-w);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: var(--text); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* ============================================
   Chapter spine — signature element
   ============================================ */
.spine {
  position: fixed;
  top: 0; left: 0;
  width: var(--spine-w);
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.spine span {
  flex: 1 1 0;
  display: block;
}
.spine span:nth-child(1) { background: var(--spine-1); }
.spine span:nth-child(2) { background: var(--spine-2); }
.spine span:nth-child(3) { background: var(--spine-3); }
.spine span:nth-child(4) { background: var(--spine-4); }
.spine span:nth-child(5) { background: var(--spine-5); }
.spine span:nth-child(6) { background: var(--spine-6); }
.spine .progress {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 3px;
  background: var(--text);
  mix-blend-mode: difference;
  transition: transform 0.05s linear;
  transform: translateY(0);
}

/* ============================================
   Header / nav
   ============================================ */
header.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}
.wordmark span { color: var(--brass); }

nav.site-nav { display: flex; gap: 1.75rem; }
nav.site-nav a {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-dim);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
nav.site-nav a:hover { color: var(--text); }
nav.site-nav a[aria-current="page"] {
  color: var(--brass);
  border-bottom-color: var(--brass);
}

main { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }

/* ============================================
   Typography helpers
   ============================================ */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  display: block;
  margin-bottom: 0.9rem;
}
h1, h2, h3 { font-family: var(--serif-display); font-weight: 600; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { color: var(--text-dim); }
p.lede { font-size: 1.25rem; color: var(--text); max-width: 62ch; }

hr.rule { border: none; border-top: 1px solid var(--rule); margin: 3.5rem 0; }

/* ============================================
   Hero (home)
   ============================================ */
.hero { padding: 5rem 0 4rem; }
.hero h1 { max-width: 14ch; }
.hero p.lede { margin-top: 1.5rem; }
.hero-links { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; }
.hero-links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
}
.hero-links a:hover { border-color: var(--brass); color: var(--brass); }

/* Entry cards on home */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  margin: 2rem 0 5rem;
}
.entry-card {
  background: var(--bg);
  padding: 2.2rem 1.8rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: background 0.25s ease;
}
.entry-card:hover { background: var(--bg-raised); }
.entry-card .num { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); }
.entry-card h3 { color: var(--text); }
.entry-card p { font-size: 0.95rem; margin: 0; }

@media (max-width: 760px) {
  .entry-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Gallery
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
  background: var(--rule);
  margin: 3rem 0;
}
.gallery-item {
  background: var(--bg-alt);
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item .placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-align: center;
  padding: 1rem;
  border: 1px dashed var(--rule);
}
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.9rem 1rem;
  background: linear-gradient(to top, rgba(20,18,15,0.92), transparent);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text);
}

/* ============================================
   Ideas
   ============================================ */
.idea-block {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}
.idea-block:last-of-type { border-bottom: none; }
.idea-block .num { font-family: var(--mono); color: var(--accent-bright); font-size: 0.85rem; }
.idea-block h2 { margin-top: 0.6rem; max-width: 20ch; }
.idea-block .status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  border: 1px solid var(--brass);
  padding: 0.2rem 0.6rem;
  margin-top: 1rem;
}
.idea-block .body { margin-top: 1.5rem; max-width: 68ch; }
.idea-block .body p { color: var(--text-dim); }

/* ============================================
   Essays
   ============================================ */
.essay-list { margin: 3rem 0; }
.essay-entry {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.essay-entry .date { font-family: var(--mono); font-size: 0.78rem; color: var(--text-faint); padding-top: 0.3rem; }
.essay-entry h3 { color: var(--text); margin-bottom: 0.4rem; }
.essay-entry p { margin: 0; font-size: 0.95rem; }
@media (max-width: 560px) {
  .essay-entry { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ============================================
   About
   ============================================ */
.about-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  padding: 4rem 0;
  align-items: start;
}
.about-portrait {
  aspect-ratio: 3/4;
  background: var(--bg-alt);
  border: 1px dashed var(--rule);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-align: center;
  padding: 1rem;
}
.about-text p.lede { margin-top: 0; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.contact-list li { margin-bottom: 0.6rem; font-family: var(--mono); font-size: 0.9rem; }
.contact-list a { text-decoration: none; color: var(--text-dim); border-bottom: 1px solid var(--rule); }
.contact-list a:hover { color: var(--brass); border-color: var(--brass); }

@media (max-width: 760px) {
  .about-layout { grid-template-columns: 1fr; }
}

/* ============================================
   Footer
   ============================================ */
footer {
  max-width: var(--max-w);
  margin: 4rem auto 0;
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 1rem;
}
