/* ── Design tokens ── */

:root {
  --ink: #2a2520;
  --paper: #f4ede0;
  --paper-deep: #ebe1cf;
  --whisper: rgba(42, 37, 32, 0.65);
}

/* Section theme override — uncomment and tune when The Work migrates in */
/*
[data-section="work"] {
  --paper: #e8eef4;
  --paper-deep: #dce6ef;
  --ink: #1e2a35;
  --whisper: rgba(30, 42, 53, 0.45);
}
*/

/* ── Reset ── */

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

/* ── Base ── */

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Cormorant Garamond", serif;
  position: relative;
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(180, 140, 90, 0.08), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(120, 100, 70, 0.06), transparent 55%);
}

/* Paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(42, 37, 32, 0.015) 0, rgba(42, 37, 32, 0.015) 1px, transparent 1px, transparent 3px),
    repeating-radial-gradient(circle at 80% 70%, rgba(42, 37, 32, 0.02) 0, rgba(42, 37, 32, 0.02) 1px, transparent 1px, transparent 4px);
  pointer-events: none;
  z-index: 1;
}

/* Vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(42, 37, 32, 0.12) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ── Homepage ── */

html:has(body.home) {
  height: 100%;
}

body.home {
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 2rem;
  max-width: 720px;
}

.ornament {
  font-family: "Cormorant Unicase", serif;
  font-size: 1.5rem;
  color: var(--whisper);
  letter-spacing: 0.8em;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fade-in 2s ease-out 0.3s forwards;
}

blockquote {
  font-size: clamp(1.75rem, 4.5vw, 3.25rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: 0.005em;
  font-style: italic;
}

blockquote .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: rise 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

/* stanza 1 — children 1–4 */
.word:nth-child(1)  { animation-delay: 0.40s; }
.word:nth-child(2)  { animation-delay: 0.55s; }
.word:nth-child(3)  { animation-delay: 0.70s; }
.word:nth-child(4)  { animation-delay: 0.85s; }
/* child 5 is <br> */
/* stanza 2 — children 6–10, pause after stanza 1 */
.word:nth-child(6)  { animation-delay: 1.45s; }
.word:nth-child(7)  { animation-delay: 1.60s; }
.word:nth-child(8)  { animation-delay: 1.75s; }
.word:nth-child(9)  { animation-delay: 1.90s; }
.word:nth-child(10) { animation-delay: 2.05s; }
/* child 11 is <br> */
/* stanza 3 — children 12–15, pause after stanza 2 */
.word:nth-child(12) { animation-delay: 2.65s; }
.word:nth-child(13) { animation-delay: 2.80s; }
.word:nth-child(14) { animation-delay: 2.95s; }
.word:nth-child(15) { animation-delay: 3.10s; }
/* child 16 is <br> */
/* stanza 4 — children 17–21, pause after stanza 3 */
.word:nth-child(17) { animation-delay: 3.70s; }
.word:nth-child(18) { animation-delay: 3.85s; }
.word:nth-child(19) { animation-delay: 4.00s; }
.word:nth-child(20) { animation-delay: 4.15s; }
.word:nth-child(21) { animation-delay: 4.30s; }

.attribution {
  margin-top: 3rem;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--whisper);
  opacity: 0;
  animation: fade-in 1.5s ease-out 5.0s forwards;
}

.attribution::before,
.attribution::after {
  content: "—";
  margin: 0 1rem;
  opacity: 0.6;
}

.home-nav {
  margin-top: 3.5rem;
  font-family: "Cormorant Unicase", serif;
  font-size: 0.8rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--whisper);
  opacity: 0;
  animation: fade-in 1.5s ease-out 6.0s forwards;
}

.home-nav a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: rgba(42, 37, 32, 0.25);
  transition: text-decoration-color 0.4s ease;
}

.home-nav a:hover {
  text-decoration-color: var(--ink);
}

.home-nav .sep {
  margin: 0 1.2em;
  opacity: 0.5;
}

/* Returners: skip the intro animation */
body.home.visited .word,
body.home.visited .ornament,
body.home.visited .attribution,
body.home.visited .home-nav {
  animation: none;
  opacity: 1;
}

/* ── Animations ── */

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 0.7; }
}

.ornament.breathing {
  animation: breathe 6s ease-in-out infinite;
}

/* ── Section index ── */

.section-page {
  position: relative;
  z-index: 3;
  max-width: 680px;
  margin: 0 auto;
  padding: 5rem 2rem 6rem;
}

.section-back {
  font-family: "Cormorant Unicase", serif;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: rgba(42, 37, 32, 0.25);
  display: inline-block;
  margin-bottom: 4rem;
  transition: text-decoration-color 0.3s ease;
}

.section-back:hover {
  text-decoration-color: var(--ink);
}

.section-title {
  font-family: "Cormorant Unicase", serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.section-description {
  font-size: 1.15rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: var(--whisper);
  margin-bottom: 4rem;
  max-width: 50ch;
}

.post-list {
  list-style: none;
  border-top: 1px solid var(--paper-deep);
}

.post-list li {
  border-bottom: 1px solid var(--paper-deep);
  padding: 1.5rem 0;
}

.post-list a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: rgba(42, 37, 32, 0.25);
  font-size: 1.25rem;
  font-weight: 300;
  display: block;
  transition: text-decoration-color 0.3s ease;
}

.post-list a:hover {
  text-decoration-color: var(--ink);
}

.post-date {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--whisper);
  margin-top: 0.35rem;
}

.section-external {
  margin-top: 2rem;
  font-size: 1rem;
  font-style: italic;
  color: var(--whisper);
  line-height: 1.7;
}

.section-external a {
  color: var(--ink);
  text-underline-offset: 3px;
}

/* ── Post ── */

.post-page {
  position: relative;
  z-index: 3;
  max-width: 65ch;
  margin: 0 auto;
  padding: 5rem 2rem 8rem;
}

@media (min-width: 768px) {
  .post-page {
    max-width: 80ch;
  }
}

.post-back {
  font-family: "Cormorant Unicase", serif;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-color: rgba(42, 37, 32, 0.25);
  display: inline-block;
  margin-bottom: 4rem;
  transition: text-decoration-color 0.3s ease;
}

.post-back:hover {
  text-decoration-color: var(--ink);
}

.post-header {
  margin-bottom: 3.5rem;
}

.post-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

.post-meta {
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--whisper);
}

.post-body {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.8;
}

.post-body p {
  margin-bottom: 1.5em;
}

.post-body h2 {
  font-family: "Cormorant Unicase", serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 2.5em 0 1em;
  color: var(--ink);
}

.post-body h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 300;
  font-style: italic;
  margin: 2em 0 0.5em;
  color: var(--ink);
}

.post-body blockquote {
  margin: 2em 0;
  padding-left: 1.5em;
  border-left: 1px solid var(--paper-deep);
  font-style: italic;
  color: var(--whisper);
  font-size: 1.1em;
}

.post-body a {
  color: var(--ink);
  text-underline-offset: 3px;
}

/* ── Subscribe block ── */

.subscribe-block {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(42, 37, 32, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.subscribe-label {
  font-family: "Cormorant Unicase", serif;
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--whisper);
  margin-bottom: 1.25rem;
}

.subscribe-block iframe {
  display: block;
  margin: 0 auto;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .ornament { font-size: 1.1rem; letter-spacing: 0.6em; margin-bottom: 2rem; }
  blockquote { font-size: 1.6rem; }
  .attribution { font-size: 0.7rem; letter-spacing: 0.3em; }
  .attribution::before, .attribution::after { margin: 0 0.5rem; }
  .section-page, .post-page { padding: 3rem 1.25rem 4rem; }
}
