/* ─── Variables ────────────────────────────────────────────────────────── */

:root {
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --ink: #1a1a1a;
  --ink-soft: #333;
  --ink-mute: #666;
  --rule: #e2e2e2;
  --rule-soft: #f0f0f0;
  --bg: #fff;
  --bg-soft: #faf8f4;     /* warm newsprint */
  --accent: #b6131a;       /* NYT-ish red */
  --link: #326891;
}

/* ─── Base ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

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

[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; color: var(--ink); }

p { margin-bottom: 1.1rem; }

/* ─── Header / Nav ─────────────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  transition: transform 0.3s ease;
}

header.hidden { transform: translateY(-100%); }

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.site-name:hover { text-decoration: none; }

nav { display: flex; flex-wrap: wrap; gap: 1.75rem; }

nav a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

nav a:hover, nav a.active {
  color: var(--accent);
  text-decoration: none;
}

.menu-toggle, .nav-close, .nav-backdrop { display: none; }

/* ─── Page transitions ─────────────────────────────────────────────────── */

.page-content { animation: page-enter 0.5s ease-out 0.1s both; }
.page-content.leaving { animation: page-leave 0.2s ease-out forwards; }
@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-leave { to { opacity: 0; } }

.scroll-fade { transition: opacity 0.6s ease-out; }

/* ─── Home: Nameplate ──────────────────────────────────────────────────── */

.nameplate {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.nameplate-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

.nameplate-tagline {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ─── Home: Hero ───────────────────────────────────────────────────────── */

.home-hero {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  position: relative;
}

.home-hero img {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  opacity: 0;
  animation: hero-fade-in 1.4s ease-out 0.4s forwards;
}

@keyframes hero-fade-in { to { opacity: 1; } }

/* ─── About page ──────────────────────────────────────────────────────── */

.about-band {
  padding: 5rem 1.5rem;
}

.about-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 4rem;
  align-items: flex-start;
}

.portrait { flex-shrink: 0; }

.portrait img {
  width: 380px;
  height: 470px;
  object-fit: cover;
  filter: grayscale(0.1);
}

.bio-text {
  flex: 1;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.bio-text p { margin-bottom: 1.25rem; }
.bio-text p:last-child { margin-bottom: 0; }
.bio-text strong { font-weight: 700; color: var(--ink); }

.bio-text a {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--accent);
  transition: padding 0.2s ease, color 0.2s ease;
}

.bio-text a:hover {
  text-decoration: none;
  padding-left: 0.4rem;
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.bio-text p:has(> a:only-child) {
  margin-bottom: 0.6rem;
}

/* ─── Writing (homepage) intro ─────────────────────────────────────────── */

.writing-intro {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
  text-align: center;
}

.writing-intro .page-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-mute);
  max-width: 560px;
  margin: 0 auto;
}

.writing-intro .page-intro p { margin-bottom: 0.4rem; }

/* ─── Page heads (Stories, Photos, Newsletter, Contact) ────────────────── */

.page-head {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.page-kicker {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.page-intro {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-mute);
  max-width: 560px;
  margin: 0 auto;
}

.page-intro p { margin-bottom: 0.6rem; }

/* ─── Stories ──────────────────────────────────────────────────────────── */

.stories {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.story {
  display: grid;
  gap: 1.5rem;
}

.story-image {
  display: block;
  overflow: hidden;
  background: var(--rule-soft);
  aspect-ratio: 16 / 10;
}

.story-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-image:hover img { transform: scale(1.02); }

.story-kicker {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.story-title {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 0.7rem;
}

.story-title a {
  color: var(--ink);
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.25s ease;
  padding-bottom: 2px;
}

.story-title a:hover {
  color: var(--ink);
  background-size: 100% 1px;
  text-decoration: none;
}

.story-dek {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-bottom: 0.8rem;
}

.story-byline {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 0;
}

.story-pub { font-weight: 600; color: var(--ink-soft); }

.story-co {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-mute);
  margin-top: 0.3rem;
  margin-bottom: 0;
}

/* Featured: large, image left + text right on desktop */
.story-featured {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 3rem;
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

/* Featured without an image: single column, centered, larger headline */
.story-featured:not(:has(.story-image)) {
  grid-template-columns: 1fr;
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.story-featured:not(:has(.story-image)) .story-dek {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.story-featured .story-title { font-size: clamp(28px, 3.6vw, 44px); }
.story-featured .story-dek { font-size: 19px; }

.story-featured .story-image { aspect-ratio: 4 / 3; }

/* Grid of follow-up stories: 3 columns on wide, 2 on medium, 1 on narrow */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2rem;
}

.story-grid .story {
  grid-template-columns: 1fr;
}

.story-grid .story-title { font-size: 22px; }
.story-grid .story-dek { font-size: 16px; }

@media (max-width: 980px) {
  .story-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .story-featured {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .story-grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

.stories-empty {
  text-align: center;
  font-style: italic;
  color: var(--ink-mute);
  padding: 4rem 0;
}

/* ─── Photos: image grid + lightbox ────────────────────────────────────── */

.image-grid {
  max-width: 1100px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-item {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: block;
  background: var(--rule-soft);
}

.grid-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.grid-item:hover img { transform: scale(1.03); }

@media (max-width: 700px) {
  .image-grid { grid-template-columns: 1fr; gap: 0.5rem; }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1.5rem;
}

.lightbox[hidden] { display: none; }
body:has(.lightbox:not([hidden])) header { visibility: hidden; }

.lb-image { max-width: 100%; max-height: 100%; }
.lb-image img { max-width: 100%; max-height: 86vh; object-fit: contain; }

.lb-close, .lb-prev, .lb-next {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--serif);
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem;
  line-height: 1;
}

.lb-close { position: absolute; top: 1.5rem; right: 2rem; font-size: 48px; }
.lb-prev, .lb-next { font-size: 64px; flex-shrink: 0; }

.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: #fff; }

@media (max-width: 700px) {
  .lightbox { padding: 1rem; }
  .lb-prev, .lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
  }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
}

/* ─── Newsletter ───────────────────────────────────────────────────────── */

.newsletter {
  max-width: 600px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.substack-embed iframe {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--rule);
  background: var(--bg);
}

/* ─── Contact ──────────────────────────────────────────────────────────── */

.contact-simple {
  max-width: 580px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.contact-intro {
  text-align: center;
}

.contact-intro p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
}

.contact-thanks {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.contact-thanks p {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--ink-soft);
  margin: 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Honeypot — invisible to humans, catches bots that fill every field */
.contact-form .hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

.contact-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.contact-form .field-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 0.75rem 0.9rem;
  width: 100%;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--ink-soft);
}

.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

.recaptcha-slot {
  margin: 0.25rem 0;
}

.contact-submit {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.85rem 1.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.contact-submit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* ─── Footer ───────────────────────────────────────────────────────────── */

footer {
  max-width: 1100px;
  margin: 4rem auto 0;
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  border-top: 1px solid var(--rule);
}

.back-to-top {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--rule);
}

.back-to-top:hover {
  text-decoration: none;
  border-color: var(--ink-soft);
  color: var(--ink);
}

.back-to-top span { font-size: 0.9em; margin-left: 0.4em; }

.copyright {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2rem;
  margin-bottom: 0;
  letter-spacing: 0.04em;
}

/* ─── Mobile ───────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  body { font-size: 17px; }

  .header-inner { padding: 0.9rem 1.25rem; }
  .site-name { font-size: 22px; }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }

  .menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ink);
  }

  nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 70%;
    max-width: 320px;
    padding: 5rem 1.5rem 2rem;
    background: var(--bg);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    border-left: 1px solid var(--rule);
  }

  body.nav-open nav { transform: translateX(0); }

  nav a { font-size: 16px; }

  .nav-close {
    display: block;
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .nameplate { padding: 2.5rem 1.25rem 1.5rem; }

  .about-band { padding: 3rem 1.25rem; }

  .about-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.75rem;
  }

  .portrait { align-self: center; }
  .portrait img { width: 260px; height: 320px; }

  .page-head { padding: 2.5rem 1.25rem 1.5rem; }

  .stories { padding: 2rem 1.25rem; }

  .writing-intro { padding: 1.75rem 1.25rem 0; }

  .contact-simple { padding: 1.5rem 1.25rem 4rem; }
  .contact-submit { align-self: stretch; }
}
