/* ==========================================================
   Poetic Reflections — stylesheet
   Colors and fonts live at the top. Every page uses this file.
   ========================================================== */

:root {
  --paper: #f6f1e9;
  --paper-deep: #ede5d8;
  --ink: #2a2420;
  --muted: #857a6e;
  --accent: #8e3f28;
  --rule: #ddd3c3;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1917;
    --paper-deep: #24211e;
    --ink: #ebe4d9;
    --muted: #9b9084;
    --accent: #db8d6a;
    --rule: #3a3530;
  }
}

* { box-sizing: border-box; }
html { font-size: 19px; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 36rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}
.site-name { font-size: 1.3rem; font-style: italic; color: var(--ink); }
.site-name:hover { text-decoration: none; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; }
.site-nav a {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }

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

.hero { padding: 7rem 0 5rem; text-align: center; }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}
.hero h1 {
  font-size: clamp(3rem, 9vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 1.5rem;
}
.hero h1 em { color: var(--accent); }
.hero .lede {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--muted);
  max-width: 30rem;
  margin: 0 auto 2.5rem;
}

.buttons { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; }
.btn {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- Dividers & section headings ---------- */

.divider {
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.6em;
  margin: 0;
  padding: 1rem 0;
}

.section { padding-top: 4.5rem; padding-bottom: 4.5rem; }
.section-head { text-align: center; margin-bottom: 3.5rem; }
.section-head h2 { font-size: 2.4rem; font-weight: 400; margin: 0 0 0.4rem; }
.section-head p { font-style: italic; color: var(--muted); margin: 0; font-size: 1.1rem; }

/* ---------- Poems ---------- */

.poem { margin: 0 auto 4.5rem; max-width: 34rem; }
.poem h3 {
  font-size: 1.8rem;
  font-weight: 400;
  font-style: italic;
  margin: 0 0 1.5rem;
}
/* Line breaks inside a stanza show exactly as typed. */
.stanza {
  white-space: pre-line;
  font-size: 1.15rem;
  line-height: 1.75;
  margin: 0 0 1.6rem;
}
.poem .tag {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.poem .tag::before { content: "— "; }

.more { text-align: center; font-family: var(--sans); font-size: 0.85rem; }

/* ---------- Essays ---------- */

.essay-list { list-style: none; padding: 0; margin: 0; }
.essay-list li { padding: 1.6rem 0; border-top: 1px solid var(--rule); }
.essay-list li:last-child { border-bottom: 1px solid var(--rule); }
.essay-list time {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.essay-list h3 { font-size: 1.5rem; font-weight: 400; margin: 0.2rem 0 0.3rem; }
.essay-list h3 a { color: var(--ink); }
.essay-list h3 a:hover { color: var(--accent); text-decoration: none; }
.essay-list p { margin: 0; color: var(--muted); }

/* ---------- Art ---------- */

.art { background: var(--paper-deep); }
.art blockquote {
  margin: 0 auto;
  max-width: 32rem;
  text-align: center;
  font-size: 1.6rem;
  font-style: italic;
  line-height: 1.45;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}
.gallery figure { margin: 0; }
.gallery img { width: 100%; display: block; }
.gallery figcaption {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

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

.contact-form { display: grid; gap: 1.1rem; }
.contact-form label {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: grid;
  gap: 0.4rem;
}
.contact-form input, .contact-form textarea {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0;
  border-radius: 0;
}
.contact-form textarea { min-height: 8rem; resize: vertical; border: 1px solid var(--rule); padding: 0.7rem; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .btn { justify-self: start; margin-top: 0.5rem; }
.hidden-field { position: absolute; left: -9999px; }   /* spam trap */

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 3rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
}
.site-footer .site-name { display: inline-block; margin-bottom: 0.6rem; font-family: var(--serif); font-size: 1.2rem; }

/* ---------- Archive page ---------- */

.page-head { padding: 5rem 0 2rem; text-align: center; }
.page-head h1 { font-size: 2.8rem; font-weight: 400; margin: 0 0 0.4rem; }
.page-head p { font-style: italic; color: var(--muted); margin: 0; }
.toc { list-style: none; padding: 0; margin: 2rem auto 4rem; max-width: 34rem; text-align: center; }
.toc li { margin: 0.3rem 0; font-size: 1.2rem; }

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  html { font-size: 17px; }
  .hero { padding: 4.5rem 0 3.5rem; }
  .site-header .wrap { justify-content: center; }
}

/* Poem lines (set up by poems.js): wrapped lines get a hanging indent */
.stanza.lined { white-space: normal; }
.stanza .line { display: block; padding-left: 1.4em; text-indent: -1.4em; }

/* ---------- Home: the three doors ---------- */

.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
}
.door {
  display: block;
  border: 1px solid var(--rule);
  padding: 2rem 1.5rem;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.door:hover { border-color: var(--ink); background: var(--paper-deep); text-decoration: none; }
.door h2 { font-size: 1.8rem; font-weight: 400; margin: 0 0 0.5rem; }
.door p { font-style: italic; color: var(--muted); margin: 0 0 1.5rem; }
.door span {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Reflections page ---------- */

.reflection { padding-top: 3rem; margin-bottom: 2rem; }
.reflection time {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.reflection h2 { font-size: 2rem; font-weight: 400; margin: 0.3rem 0 1.2rem; }
.reflection p { font-size: 1.15rem; margin: 0 0 1.2rem; }

/* ---------- Art page ---------- */

.page-art { padding: 0 0 5rem; }
.page-art .page-head { padding-bottom: 1.5rem; }
.art-placeholder {
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  border: 1px dashed var(--rule);
  background: var(--paper-deep);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.gallery { margin-top: 0; }
