/* ==========================================================================
   The Documentary Portrait — jackradcliffe.org
   Theme: "Silver Gelatin" — darkroom editorial
   Deep charcoal ground, warm paper-white type, safelight-red accent.
   Handcrafted CSS, no framework. Fonts: Fraunces (display), Source Serif 4
   (body), Archivo (interface) via Google Fonts CDN.
   ========================================================================== */

:root {
  /* Ground */
  --ink-950: #101213;
  --ink-900: #15181a;
  --ink-850: #1b1f21;
  --ink-800: #22272a;
  --hairline: #2e3437;

  /* Paper */
  --paper: #eae6dd;
  --paper-dim: #b3ada1;
  --paper-faint: #847f75;

  /* Safelight */
  --safelight: #c8553d;
  --safelight-bright: #e07a5f;

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, serif;
  --font-ui: "Archivo", Arial, Helvetica, sans-serif;

  --measure: 68ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--hairline);
  background: var(--ink-950);
  padding: 2.5rem 1.25rem 0;
  text-align: center;
}

.masthead-title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: clamp(0.95rem, 2.6vw, 1.45rem);
  letter-spacing: 0.52em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
  text-indent: 0.52em; /* balance the tracking */
}

.masthead-title a {
  color: var(--paper);
  text-decoration: none;
}

.masthead-title a:hover { color: var(--safelight-bright); }

.masthead-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--paper-dim);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  margin: 0 0 1.6rem;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.site-nav {
  border-top: 1px solid var(--hairline);
}

.nav-toggle {
  display: none;
  margin: 0.6rem auto;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 0.55rem 1.4rem;
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--safelight); color: var(--safelight-bright); }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0.9rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.1rem 1.9rem;
}

.nav-list a {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--paper-dim);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.nav-list a:hover { color: var(--paper); border-bottom-color: var(--safelight); }

.nav-list a[aria-current="page"] {
  color: var(--safelight-bright);
  border-bottom-color: var(--safelight);
}

/* --------------------------------------------------------------------------
   Hero figure
   -------------------------------------------------------------------------- */

.hero-figure {
  margin: 0;
  position: relative;
  max-height: 62vh;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  background: var(--ink-950);
}

.hero-figure img {
  width: 100%;
  max-height: 62vh;
  object-fit: cover;
  filter: grayscale(18%) contrast(1.02);
}

.hero-figure figcaption {
  position: absolute;
  right: 0; bottom: 0;
  font-family: var(--font-ui);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
  background: rgba(16, 18, 19, 0.78);
  padding: 0.45rem 0.9rem;
}

/* --------------------------------------------------------------------------
   Article / content
   -------------------------------------------------------------------------- */

main { display: block; }

.article {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4.5rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.18;
  letter-spacing: 0.005em;
  margin: 0 0 1.4rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 2.8rem 0 0.9rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline);
}

h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.12rem;
  margin: 1.8rem 0 0.6rem;
}

p { margin: 0 0 1.25rem; }

p.lede {
  font-size: 1.22rem;
  line-height: 1.65;
  color: var(--paper);
  font-weight: 400;
}

p.lede::first-letter {
  font-family: var(--font-display);
  color: var(--safelight-bright);
}

a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--safelight);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover { color: var(--safelight-bright); }

ul, ol { margin: 0 0 1.4rem; padding-left: 1.3rem; }
li { margin-bottom: 0.6rem; }
li::marker { color: var(--safelight); }

strong { color: var(--paper); }
em { font-style: italic; }

/* Inline essay figure */
.essay-figure {
  margin: 2.4rem -1.5rem;
  background: var(--ink-950);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.essay-figure img {
  width: 100%;
  filter: grayscale(18%) contrast(1.02);
}

.essay-figure figcaption {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-faint);
  padding: 0.6rem 1.5rem 0.8rem;
}

/* --------------------------------------------------------------------------
   Section index (homepage essay directory)
   -------------------------------------------------------------------------- */

.essay-index {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.essay-index li { margin: 0; background: var(--ink-850); }

.essay-index a {
  display: block;
  padding: 1.1rem 1.2rem 1.2rem;
  text-decoration: none;
  height: 100%;
}

.essay-index a:hover { background: var(--ink-800); }

.essay-index .kicker {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--safelight-bright);
  margin-bottom: 0.35rem;
}

.essay-index .name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--paper);
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Contact form
   -------------------------------------------------------------------------- */

.contact-form {
  margin: 2.5rem 0 1rem;
  display: grid;
  gap: 1rem;
}

.contact-form label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--paper-dim);
  display: block;
  margin-bottom: 0.35rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--ink-850);
  border: 1px solid var(--hairline);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
}

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

.contact-form button {
  justify-self: start;
  background: var(--safelight);
  color: var(--ink-950);
  border: none;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.contact-form button:hover { background: var(--safelight-bright); }

.form-note {
  font-size: 0.85rem;
  color: var(--paper-faint);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.notfound {
  text-align: center;
  padding: 6rem 1.5rem 7rem;
}

.notfound .code {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(4rem, 12vw, 7rem);
  color: var(--safelight);
  line-height: 1;
  margin: 0 0 1rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--ink-950);
  padding: 3rem 1.5rem 2.2rem;
  margin-top: 2rem;
}

.footer-grid {
  max-width: 64rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-grid h4 {
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin: 0 0 0.9rem;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 0 0 0.45rem; }

.footer-grid a {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--paper-dim);
  text-decoration: none;
}

.footer-grid a:hover { color: var(--safelight-bright); }

.footer-colophon {
  max-width: 64rem;
  margin: 2.6rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--paper-faint);
  text-align: center;
  line-height: 1.9;
}

.footer-colophon a { color: var(--paper-dim); text-decoration: none; }
.footer-colophon a:hover { color: var(--safelight-bright); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .nav-toggle { display: block; }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0 1.2rem;
  }

  .nav-list.open { display: flex; }

  .essay-index { grid-template-columns: 1fr; }

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

  .essay-figure { margin-left: -1.5rem; margin-right: -1.5rem; }
}

@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
  .masthead-title { letter-spacing: 0.34em; text-indent: 0.34em; }
}
