/* ============================================
   Jamie Holdcroft — personal site
   Theme: "ocean at night" — deep navy + teal + indigo
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500;1,9..144,600&display=swap');

:root {
  /* Editorial light — clean white, warm ink, sienna accent.
     A professional writing/poetry portfolio look. */
  --bg: #ffffff;
  --bg-alt: #faf8f5;
  --bg-elevated: #f4f1ec;
  --text: #1c1917;
  --text-muted: #6b645c;
  --border: #e8e3db;

  --accent: #a18d6c;      /* muted tan / greige */
  --accent-2: #7c6a4b;    /* deep muted tan */
  --accent-gradient: linear-gradient(135deg, #b8a888 0%, #8c7a58 100%);

  /* Warm dark-brown block — shared by the writing masthead & footer
     so the site reads as one coherent palette. */
  --block-bg: #2c2419;
  --block-fg: #f5efe4;
  --block-muted: #b8ac9a;
  --block-accent: #c2a373;

  --shadow: 0 10px 30px rgba(40, 30, 20, 0.08);
  --shadow-sm: 0 2px 10px rgba(40, 30, 20, 0.05);
  --radius: 8px;
  --radius-sm: 5px;
  --max-width: 980px;

  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-literary: 'Fraunces', 'Source Serif 4', Georgia, serif;
}

/* Photography — pure gallery white (photos read best on true white). */
.light-page {
  --bg: #ffffff;
  --bg-alt: #ffffff;
  --bg-elevated: #f6f6f6;
  --text: #141414;
  --text-muted: #5a5a5a;
  --border: #eceae6;
}

/* Writing/poetry — same clean editorial palette as the rest of the site;
   the .paper-page class stays only as a hook for the reading-room LAYOUT
   (centered masthead, drop caps) and to hide the (now removed) toggle. */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 600;
}

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

p { color: var(--text-muted); margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Header / Nav ----------
   Brown nav bar site-wide — bookends with the brown footer. Local var
   overrides recolor the logo, links, and mobile dropdown for the dark bar. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  --bg: var(--block-bg);
  --text: var(--block-fg);
  --text-muted: var(--block-muted);
  --border: rgba(245, 239, 228, 0.16);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--block-bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}
.logo:hover { color: var(--block-accent); }
.main-nav a.active { color: var(--block-fg); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; color: var(--accent); }

.main-nav {
  display: flex;
  gap: 28px;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.main-nav a:hover { color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-alt);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-sm); }

.btn-primary {
  border: none;
  /* soft, light tan — not a dark/extreme gradient */
  background: linear-gradient(135deg, #cfc2a4 0%, #b7a684 100%);
  color: #3a3120;
  font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  position: relative;
}

/* Two-column hero: intro text + profile photo on the right */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.hero-photo { margin: 0; display: flex; justify-content: flex-start; }
.hero-photo img {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 26% 40%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.5fr 0.9fr; gap: 60px; }
  .hero-photo { justify-content: flex-end; }
}

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  display: inline-block;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.02em;
  max-width: 18ch;
}

/* Explicit "arty" heading treatment -- opt-in only (Writing, Photography),
   not the site-wide default. Higher specificity than .hero h1 by design. */
h1.literary-heading {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 600;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 14px 0 24px;
  max-width: 22ch;
}

.hero-lede {
  font-size: 1.15rem;
  max-width: 56ch;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 40px; }

.social-row { display: flex; gap: 16px; }
.social-row a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}
.social-row a:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }

/* ---------- Section headings ---------- */
.section { padding: 56px 0; }
.section-head { margin-bottom: 36px; }
.section-head .eyebrow { margin-bottom: 10px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
.section-head p { max-width: 60ch; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }

.card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: block;
}

.card-links { display: flex; gap: 16px; margin-top: 12px; }
.card-links a { font-size: 0.88rem; font-weight: 500; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* ---------- Nav cards (homepage) ---------- */
.nav-card {
  display: block;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.nav-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}
.nav-card:hover::before { transform: scaleX(1); }
.nav-card:hover { text-decoration: none; }
.nav-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nav-card .arrow { color: var(--text-muted); font-weight: 600; transition: color 0.2s ease, transform 0.2s ease; display: inline-block; }
.nav-card:hover .arrow { color: var(--accent); transform: translateX(4px); }

/* ---------- CV ---------- */
/* CV — date rail on the left, content on the right (modern academic look) */
.cv-entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 36px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.cv-entry:last-child { border-bottom: none; }
.cv-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding-top: 0.35em;
  line-height: 1.5;
}
.cv-content h3 { font-size: 1.1rem; margin-bottom: 3px; line-height: 1.35; }
.cv-org {
  display: block;
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.cv-content > p { margin: 0 0 6px; }
.cv-content ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-muted); }
.cv-content ul li { margin-bottom: 6px; line-height: 1.55; }

@media (max-width: 640px) {
  .cv-entry { grid-template-columns: 1fr; gap: 8px; }
  .cv-date { padding-top: 0; }
}

.skills-list { display: flex; flex-wrap: wrap; gap: 10px; }

.skills-list { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Publications list ----------
   A clean academic list — one paper per row, thin dividers, no boxes.
   Left column = venue/status, right column = title, authors, links. */
.pub-list { margin-top: 4px; }
.pub-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:first-child { border-top: 1px solid var(--border); }
.pub-venue-name {
  display: block;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}
.pub-status {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 3px;
}
.pub-title { font-size: 1.12rem; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.pub-authors { color: var(--text-muted); font-size: 0.94rem; line-height: 1.55; margin-bottom: 12px; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-links { display: flex; gap: 20px; flex-wrap: wrap; }
.pub-links a { font-size: 0.9rem; font-weight: 500; }
.pub-links a[href="#"] { color: var(--text-muted); pointer-events: none; opacity: 0.6; }

@media (max-width: 640px) {
  .pub-item { grid-template-columns: 1fr; gap: 6px; }
  .pub-venue { margin-bottom: 8px; }
}

/* ---------- News list ----------
   Dated announcements — date column on the left, text on the right. */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.news-item:first-child { border-top: 1px solid var(--border); }
.news-date {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
  white-space: nowrap;
}
.news-text { color: var(--text); }

@media (max-width: 640px) {
  .news-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Writing — "The Masthead" ----------
   A dark warm-ink hero band (the page's one moment of drama), then a
   numbered editorial index on white. Fraunces literary type throughout. */
.writing-column { max-width: 74ch; margin: 0 auto; }

/* Thick dark masthead block — the page's moment of drama. */
.writing-hero {
  background: var(--block-bg);
  color: var(--block-fg);
  padding: 104px 0 88px;
}
.writing-hero .eyebrow {
  color: var(--block-accent);
  display: block;
  margin-bottom: 22px;
}
.writing-hero h1 {
  font-family: var(--font-literary);
  font-style: italic;            /* slightly cursive — nice */
  font-weight: 500;
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: #faf6ee;
}
/* Plain ampersand — a normal Georgia "&", not Fraunces's decorative one. */
.writing-hero h1 .amp {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: normal;
  font-weight: 400;
  padding: 0 0.06em;
}
.writing-hero .amp-rule {
  width: 52px;
  height: 3px;
  border: 0;
  background: var(--accent-gradient);
  margin: 30px 0 0;
}

/* Tabs — minimal, literary, sitting above the index */
.writing-toggle {
  display: flex;
  gap: 38px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.writing-toggle button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-literary);
  font-style: italic;
  font-size: 1.15rem;
  padding: 0 0 16px;
  cursor: pointer;
  position: relative;
}
.writing-toggle button.active { color: var(--text); }
.writing-toggle button.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent-gradient);
}

.writing-group { display: none; }
.writing-group.active { display: block; counter-reset: idx; }

/* Numbered editorial index */
.writing-list-item {
  counter-increment: idx;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: baseline;
  padding: 30px 4px;
  border-bottom: 1px solid var(--border);
  color: inherit;
  transition: padding-left 0.25s ease;
}
.writing-list-item:hover { text-decoration: none; padding-left: 14px; }
.writing-list-item::before {
  content: counter(idx, decimal-leading-zero);
  font-family: var(--font-literary);
  font-size: 0.95rem;
  color: var(--accent);
  padding-top: 0.6em;
}
.writing-list-title {
  font-family: var(--font-literary);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.15rem);
  line-height: 1.06;
  color: var(--text);
  transition: color 0.2s ease;
}
.writing-list-item:hover .writing-list-title { color: var(--accent); }
.writing-list-teaser {
  font-family: var(--font-literary);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 8px 0 0;
  white-space: pre-wrap;
}
.writing-list-date {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
  padding-top: 0.8em;
}

@media (max-width: 640px) {
  .writing-list-item { grid-template-columns: auto 1fr; gap: 18px; }
  .writing-list-date { grid-column: 2; padding-top: 4px; }
}

/* Entry pages (poem / essay) — Fraunces title, drop cap, generous measure */
article.prose {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.85;
  max-width: 66ch;
  margin: 0 auto;
}
article.prose p { color: var(--text); }
article.prose h1 {
  font-family: var(--font-literary);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 6px;
}
article.prose .card-meta { color: var(--accent); }
.entry-rule {
  width: 48px; height: 2px; border: 0;
  background: var(--accent-gradient);
  margin: 22px 0 36px;
}

/* Poems: each stanza is its own <p> (split on blank lines server-side). */
.poem-body .poem-stanza {
  white-space: pre-wrap;
  font-style: italic;
  line-height: 1.7;
  margin: 0 0 1.5em;
}
.poem-body .poem-stanza:last-child { margin-bottom: 0; }

/* Drop cap for essays only */
article.prose.essay > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-literary);
  font-size: 3.4em;
  line-height: 0.72;
  font-weight: 600;
  margin: 8px 12px 0 0;
  color: var(--accent);
}

.back-link { display: inline-block; margin-bottom: 28px; font-size: 0.9rem; color: var(--text-muted); }

/* ---------- Photography ----------
   Full white portfolio page (see .light-page). Sharp-edged photo tiles,
   generous gutters, masonry-arranged via CSS columns, caption on hover.
   Heading/eyebrow typography now lives in the shared .hero/.eyebrow
   rules above, applied site-wide for a consistent feel. */

.gallery {
  column-count: 3;
  column-gap: 28px;
}
.gallery-item {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 28px;
  cursor: pointer;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.gallery-item:hover { box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14); transform: translateY(-2px); }
.gallery-item img { width: 100%; height: auto; display: block; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.03); }

.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  color: #fff;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.gallery-item:hover .gallery-caption { opacity: 1; transform: translateY(0); }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(6, 8, 14, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.lightbox-close {
  position: absolute;
  top: 24px; right: 32px;
  background: none; border: none;
  color: #fff; font-size: 1.6rem;
  cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--block-bg);
  color: var(--block-fg);
  padding: 52px 0;
  margin-top: 80px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner p { margin: 0; font-size: 0.85rem; color: var(--block-muted); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { font-size: 0.85rem; color: var(--block-muted); }
.footer-links a:hover { color: var(--block-accent); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .gallery { column-count: 2; }

  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle {
    display: inline-flex;
  }
}

@media (max-width: 480px) {
  .gallery { column-count: 1; }
}
