/* ==========================================================================
   Quiet editorial portfolio — paper, ink, hairlines.
   ========================================================================== */

:root {
  --paper: #faf9f6;
  --ink: #1a1916;
  --ink-soft: #57534c;
  --ink-faint: #8a857c;
  --hairline: rgba(26, 25, 22, 0.14);
  --hairline-soft: rgba(26, 25, 22, 0.08);
  --hover-wash: rgba(26, 25, 22, 0.035);

  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max: 1080px;
  --pad: clamp(20px, 5vw, 64px);
}

[data-theme="dark"] {
  --paper: #131311;
  --ink: #ebe8e1;
  --ink-soft: #a8a399;
  --ink-faint: #6e6a61;
  --hairline: rgba(235, 232, 225, 0.18);
  --hairline-soft: rgba(235, 232, 225, 0.09);
  --hover-wash: rgba(235, 232, 225, 0.045);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 450;
  line-height: 1.65;
  transition: background-color 0.4s ease, color 0.4s ease;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Underlined inline links */
.text-link {
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.text-link:hover { color: var(--ink); border-color: var(--ink); }

/* ==========================================================================
   NAV
   ========================================================================== */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--pad);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline-soft);
}

.nav-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.8rem);
}

.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--ink); }

.theme-toggle {
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
  border: 1px solid var(--ink);
  transition: transform 0.4s ease;
}
[data-theme="dark"] .theme-dot { transform: rotate(180deg); }

/* ==========================================================================
   PAGE & HERO
   ========================================================================== */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.hero {
  min-height: 88vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  padding-top: 5rem;
}

.hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.6rem;
}

.hero-title {
  font-family: var(--sans);
  font-size: clamp(2.4rem, 6.5vw, 4.8rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}
.hero-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

.hero-bio {
  max-width: 48ch;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 1.8rem;
}

.hero-meta {
  display: flex;
  gap: 1.4rem;
  margin-top: 2rem;
}

.hero-photo {
  max-width: 420px;
  justify-self: end;
  width: 100%;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 13 / 14;
  object-fit: cover;
}

.hero-photo figcaption {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding-top: 0.6rem;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section { padding: clamp(4rem, 10vh, 7rem) 0 0; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 0.5rem;
}

.section-num {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.005em;
}

.section-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-faint);
  padding: 1.2rem 0 0.4rem;
}

/* Two columns flowing side by side — work + research */
.duo {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.duo-col { min-width: 0; }

/* ==========================================================================
   WORK INDEX
   ========================================================================== */

.index { list-style: none; }

.index-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.4rem;
  padding: 1.5rem 0.6rem;
  margin: 0 -0.6rem;
  border-bottom: 1px solid var(--hairline-soft);
  transition: background-color 0.25s ease;
}
.index-row:hover { background: var(--hover-wash); }

.index-year {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  padding-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.index-body h3 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.index-body p {
  font-size: 0.86rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin-top: 0.4rem;
}

.index-body .text-link {
  display: inline-block;
  margin-top: 0.7rem;
}

.index-place {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

/* ==========================================================================
   PUBLICATIONS
   ========================================================================== */

.pubs { list-style: none; }

.pub-row {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1.05rem 0.6rem;
  margin: 0 -0.6rem;
  border-bottom: 1px solid var(--hairline-soft);
  transition: background-color 0.25s ease;
}
.pub-row:hover { background: var(--hover-wash); }

.pub-title {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  flex: 1;
}

.pub-tag {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.pub-arrow {
  font-size: 0.85rem;
  color: var(--ink-faint);
  transition: transform 0.25s ease, color 0.25s ease;
}
.pub-row:hover .pub-arrow {
  transform: translate(2px, -2px);
  color: var(--ink);
}

/* ==========================================================================
   PHOTOS
   ========================================================================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding-top: 1.6rem;
}

.photo { position: relative; }

.photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: grayscale(1) contrast(1.02);
  transition: filter 0.5s ease;
}
.photo:hover img { filter: grayscale(0) contrast(1); }

.photo figcaption {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  padding-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact-lede {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.4;
  padding: 2.2rem 0 0;
  max-width: 30ch;
}

.contact-email {
  font-style: italic;
  border-bottom: 1px solid var(--hairline);
  transition: border-color 0.2s ease;
  white-space: nowrap;
}
.contact-email:hover { border-color: var(--ink); }

.contact-form {
  max-width: 560px;
  padding-top: 3rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
}

.contact-form label {
  display: block;
  margin-bottom: 1.6rem;
}

.contact-form label span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  padding: 0.4rem 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--ink); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.contact-form button {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.65rem 2rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.contact-form button:hover {
  background: transparent;
  color: var(--ink);
}
.contact-form button:disabled {
  opacity: 0.4;
  cursor: wait;
}

.form-status { font-size: 0.8rem; color: var(--ink-faint); }
.form-status.ok { color: #3f8f5f; }
.form-status.err { color: #c05a4e; }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 5rem var(--pad) 2.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.footer-links { display: flex; gap: 1.4rem; }
.footer-links a { transition: color 0.2s ease; }
.footer-links a:hover { color: var(--ink); }

/* ==========================================================================
   REVEAL ANIMATION
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

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

  .duo {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .duo-col + .duo-col { padding-top: clamp(4rem, 10vh, 7rem); }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    align-items: start;
    gap: 2.5rem;
    padding-top: 7rem;
    padding-bottom: 1rem;
  }

  .hero-photo {
    justify-self: start;
    max-width: 360px;
  }
}

@media (max-width: 600px) {

  .nav-links a:not(:last-of-type) { display: none; }

  .index-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.4rem 0.6rem;
  }

  .form-grid { grid-template-columns: 1fr; gap: 0; }

  .footer {
    flex-direction: column;
    gap: 0.8rem;
  }
}
