/* =====================================================================
   The Bright After - thebrightafter.shop
   A warm "morning light" almanac for the second half of life.
   Display: DM Serif Display · Body: Spectral · served via fonts.bunny.net
   ===================================================================== */

:root {
  /* Morning-light palette */
  --paper:        #fbf6ee;   /* warm linen */
  --paper-deep:   #f3e8d6;   /* deeper sand for banded sections */
  --paper-glow:   #fdf9f1;
  --ink:          #2b2420;   /* warm espresso */
  --ink-soft:     #5d5247;
  --ink-faint:    #8a7d6e;
  --amber:        #c26b3d;   /* sunrise terracotta - primary accent */
  --amber-deep:   #a4542b;
  --gold:         #d99a4e;   /* low-sun gold */
  --sage:         #7e8a6a;   /* secondary accent */
  --line:         rgba(73, 56, 40, 0.16);
  --line-soft:    rgba(73, 56, 40, 0.09);

  --shadow-soft:  0 22px 48px -28px rgba(60, 40, 24, 0.45);
  --shadow-card:  0 12px 30px -20px rgba(60, 40, 24, 0.5);

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --display: "DM Serif Display", Georgia, serif;

  --measure: 68rem;
  --measure-prose: 44rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  /* faint sunrise glow rising from the bottom + paper grain */
  background-image:
    radial-gradient(120% 70% at 50% 118%, rgba(217, 154, 78, 0.16), transparent 60%),
    radial-gradient(90% 50% at 85% -10%, rgba(194, 107, 61, 0.07), transparent 55%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.075rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--amber-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--amber); }

::selection { background: rgba(217, 154, 78, 0.32); color: var(--ink); }

/* ---- Layout frame ---- */
.frame {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}
.frame--prose { max-width: var(--measure-prose); }

/* ---- Skip link ---- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 100; border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; }

/* =====================================================================
   Masthead + header
   ===================================================================== */
.masthead {
  background: var(--ink);
  color: var(--paper-glow);
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.masthead__row {
  display: flex; justify-content: space-between; align-items: center;
  padding-block: 0.5rem;
}
.masthead__edition { color: var(--gold); }
.masthead__date { color: rgba(251, 246, 238, 0.72); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 246, 238, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.5rem; padding-block: 1rem;
}
.wordmark {
  display: inline-flex; flex-direction: column; gap: 0.1rem;
  font-family: var(--display);
  font-size: 1.6rem; line-height: 1; color: var(--ink);
  text-decoration: none; letter-spacing: 0.01em;
}
.wordmark:hover { color: var(--ink); }
.wordmark::first-line { color: var(--ink); }
.wordmark__sub {
  font-family: var(--serif);
  font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--amber-deep); font-weight: 500;
}
.nav { display: flex; gap: clamp(1rem, 2.6vw, 2.1rem); }
.nav a {
  font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; font-weight: 500;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav a:hover { color: var(--amber-deep); border-color: var(--amber); }
@media (max-width: 760px) { .nav { display: none; } }

/* =====================================================================
   Hero - with a rising sun
   ===================================================================== */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(4.5rem, 11vw, 8.5rem) clamp(3.5rem, 8vw, 6rem);
  text-align: center;
}
.hero__sun {
  position: absolute; left: 50%; bottom: 0;
  width: min(150%, 60rem); aspect-ratio: 2 / 1;
  transform: translate(-50%, 38%);
  background:
    radial-gradient(closest-side, rgba(217, 154, 78, 0.55), rgba(217, 154, 78, 0.12) 70%, transparent);
  pointer-events: none; z-index: 0;
}
.hero .frame { position: relative; z-index: 1; }
.hero__eyebrow {
  font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--amber-deep); font-weight: 600; margin: 0 0 1.4rem;
}
.hero__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6.4vw, 4.6rem);
  line-height: 1.04; letter-spacing: -0.01em;
  margin: 0 auto; max-width: 18ch; color: var(--ink);
}
.hero__title em { font-style: italic; color: var(--amber-deep); }
.hero__lede {
  margin: 1.6rem auto 0; max-width: 40rem;
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.66; color: var(--ink-soft);
}
.hero__signature {
  margin-top: 1.8rem;
  font-family: var(--display); font-style: italic;
  font-size: 1.15rem; color: var(--ink);
}
.hero__signature::before { content: ""; }

/* ---- Ornamental sunrise divider ---- */
.ornament {
  display: flex; justify-content: center;
  color: var(--amber); padding-block: 1.5rem;
}
.ornament svg { width: 132px; height: auto; opacity: 0.9; }

/* =====================================================================
   Sections
   ===================================================================== */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--line-soft); }
.section--first { border-top: none; }
.section--paper-deep {
  background: var(--paper-deep);
  border-top: 1px solid var(--line);
  background-image: radial-gradient(80% 60% at 50% 0%, rgba(217,154,78,0.12), transparent 60%);
}

.section__head {
  display: flex; gap: 1.25rem; align-items: baseline;
  margin-bottom: 2.6rem; max-width: var(--measure-prose);
}
.section__num {
  font-family: var(--display); font-size: 2.2rem; line-height: 1;
  color: var(--amber); flex: none;
}
.section__kicker {
  display: block;
  font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin-bottom: 0.5rem;
}
.section__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.7rem, 3.6vw, 2.55rem); line-height: 1.12;
  margin: 0; color: var(--ink);
}

/* ---- Editor's letter ---- */
.editor-letter {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(1.75rem, 4vw, 3.25rem);
  align-items: start;
}
@media (max-width: 760px) { .editor-letter { grid-template-columns: 1fr; } }

.editor-letter__portrait { margin: 0; position: relative; }
.editor-letter__portrait img {
  width: 100%; border-radius: 4px;
  box-shadow: var(--shadow-soft);
  filter: saturate(1.02);
}
.editor-letter__portrait::after {
  content: ""; position: absolute; inset: 10px -10px -10px 10px;
  border: 1px solid var(--amber); border-radius: 4px; z-index: -1;
}
.editor-letter__caption {
  margin-top: 0.9rem; font-size: 0.82rem; font-style: italic;
  color: var(--ink-faint); line-height: 1.5;
}
.editor-letter__body > p { margin: 0 0 1.1rem; }
.editor-letter__body > p:first-child::first-letter {
  font-family: var(--display);
  font-size: 3.5rem; line-height: 0.74; float: left;
  padding: 0.18em 0.12em 0 0; color: var(--amber-deep);
}
.editor-letter__signature {
  font-family: var(--display); font-style: italic;
  font-size: 1.5rem; color: var(--ink); margin-top: 0.4rem !important;
}

/* ---- Pull quote ---- */
.pull-quote {
  margin: 0 auto; max-width: 52rem; text-align: center;
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(1.45rem, 3.2vw, 2.25rem); line-height: 1.32;
  color: var(--ink); position: relative; padding-block: 1rem;
}
.pull-quote::before {
  content: "\201C"; display: block;
  font-family: var(--display); font-size: 4rem; line-height: 0.4;
  color: var(--gold); margin-bottom: 0.6rem;
}
.pull-quote cite {
  display: block; margin-top: 1.4rem;
  font-family: var(--serif); font-style: normal;
  font-size: 0.76rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---- Topics grid ---- */
.topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
@media (max-width: 680px) { .topics { grid-template-columns: 1fr; } }
.topic {
  background: var(--paper-glow);
  border: 1px solid var(--line);
  border-radius: 6px; padding: 1.9rem 1.75rem;
  position: relative; overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.topic::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--amber), var(--gold));
  transform: scaleY(0); transform-origin: top; transition: transform 0.3s var(--ease);
}
.topic:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card); border-color: rgba(194,107,61,0.4);
}
.topic:hover::before { transform: scaleY(1); }
.topic__num {
  font-family: var(--display); font-style: italic;
  font-size: 1.1rem; color: var(--amber);
}
.topic__title {
  font-family: var(--display); font-weight: 400;
  font-size: 1.32rem; line-height: 1.2; margin: 0.4rem 0 0.7rem; color: var(--ink);
}
.topic__body { margin: 0; font-size: 0.98rem; color: var(--ink-soft); line-height: 1.62; }

/* ---- Archive ---- */
.archive { display: grid; gap: 0; }
.archive__card {
  padding: 1.9rem 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; align-items: start;
}
.archive__card:first-child { border-top: none; }
@media (max-width: 620px) { .archive__card { grid-template-columns: 1fr; gap: 0.5rem; } }
.archive__date {
  font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--amber-deep); font-weight: 600; padding-top: 0.35rem;
}
.archive__title {
  font-family: var(--display); font-weight: 400;
  font-size: 1.35rem; line-height: 1.24; margin: 0 0 0.55rem;
}
.archive__title a { color: var(--ink); text-decoration: none; }
.archive__title a:hover { color: var(--amber-deep); }
.archive__excerpt { margin: 0 0 0.7rem; color: var(--ink-soft); font-size: 0.99rem; }
.archive__read {
  font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 600; text-decoration: none; color: var(--amber-deep);
}
.archive__read::after { content: " \2192"; transition: margin 0.2s var(--ease); }
.archive__read:hover::after { margin-left: 0.25rem; }

/* ---- Letterbox ---- */
.letterbox {
  text-align: center; max-width: 40rem; margin-inline: auto;
  background: var(--paper-glow); border: 1px solid var(--line);
  border-radius: 8px; padding: clamp(2rem, 5vw, 3.25rem);
  box-shadow: var(--shadow-card);
}
.letterbox__title {
  font-family: var(--display); font-weight: 400;
  font-size: 1.9rem; margin: 0 0 0.9rem; color: var(--ink);
}
.letterbox__body { margin: 0 auto 1.6rem; color: var(--ink-soft); max-width: 34rem; }
.letterbox__email {
  display: inline-block;
  font-family: var(--display); font-size: 1.35rem;
  color: var(--amber-deep); text-decoration: none;
  border-bottom: 2px solid var(--gold); padding-bottom: 2px;
}
.letterbox__email:hover { color: var(--amber); }
.letterbox__small { margin-top: 1.4rem; font-size: 0.85rem; color: var(--ink-faint); font-style: italic; }

/* =====================================================================
   Prose (terms / privacy)
   ===================================================================== */
.prose { padding-block: clamp(3rem, 7vw, 5rem); }
.prose__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.08;
  margin: 0 0 0.4rem; color: var(--ink);
}
.prose__meta {
  display: block; margin-bottom: 2.5rem;
  font-size: 0.76rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
}
.prose h2 {
  font-family: var(--display); font-weight: 400;
  font-size: 1.5rem; line-height: 1.2; margin: 2.6rem 0 0.9rem; color: var(--ink);
}
.prose h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: 1.08rem; margin: 1.6rem 0 0.5rem; color: var(--ink);
}
.prose__section-num { color: var(--amber); font-style: italic; margin-right: 0.4rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--amber); }
.prose strong { color: var(--ink); }

/* =====================================================================
   404
   ===================================================================== */
.notfound { text-align: center; padding-block: clamp(5rem, 14vw, 9rem); }
.notfound__num {
  font-family: var(--display); font-size: clamp(5rem, 18vw, 9rem);
  line-height: 1; color: var(--amber); opacity: 0.85;
}
.notfound__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0.5rem 0 1rem; color: var(--ink);
}
.notfound__lede { max-width: 38rem; margin-inline: auto; color: var(--ink-soft); }

/* =====================================================================
   Colophon / footer
   ===================================================================== */
.colophon {
  background: var(--ink); color: rgba(251, 246, 238, 0.82);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  font-size: 0.92rem;
}
.colophon__cols {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(251, 246, 238, 0.14);
}
@media (max-width: 680px) { .colophon__cols { grid-template-columns: 1fr; gap: 1.75rem; } }
.colophon h4 {
  font-family: var(--serif); font-weight: 600;
  font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 0.9rem;
}
.colophon p { margin: 0; line-height: 1.6; color: rgba(251, 246, 238, 0.7); }
.colophon ul { list-style: none; margin: 0; padding: 0; }
.colophon li { margin-bottom: 0.55rem; }
.colophon a { color: rgba(251, 246, 238, 0.82); text-decoration: none; }
.colophon a:hover { color: var(--gold); }

.disclaimer {
  margin: 2.25rem 0 0; padding-top: 1.75rem;
  font-size: 0.82rem; line-height: 1.65; color: rgba(251, 246, 238, 0.6) !important;
}
.disclaimer strong {
  display: block; color: var(--gold); margin-bottom: 0.5rem;
  font-weight: 600; letter-spacing: 0.04em;
}
.copyright {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 2rem !important; padding-top: 1.5rem;
  border-top: 1px solid rgba(251, 246, 238, 0.14);
  font-size: 0.78rem; color: rgba(251, 246, 238, 0.55) !important;
}
.copyright__seal { font-style: italic; color: rgba(251, 246, 238, 0.45); }

/* =====================================================================
   Cookie notice
   ===================================================================== */
.cookie {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 200%);
  width: min(40rem, calc(100% - 2rem)); z-index: 60;
  background: var(--paper-glow); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: transform 0.4s var(--ease);
}
.cookie.is-open { transform: translate(-50%, 0); }
.cookie p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
.cookie a { color: var(--amber-deep); }
.cookie button {
  flex: none; cursor: pointer; border: none;
  background: var(--ink); color: var(--paper);
  font-family: var(--serif); font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.08em; padding: 0.55rem 1.1rem; border-radius: 6px;
  transition: background 0.2s var(--ease);
}
.cookie button:hover { background: var(--amber-deep); }

/* =====================================================================
   Entrance animations
   ===================================================================== */
.rise { opacity: 0; transform: translateY(16px); animation: rise 0.8s var(--ease) forwards; }
.d-1 { animation-delay: 0.1s; }
.d-2 { animation-delay: 0.22s; }
.d-3 { animation-delay: 0.34s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rise { opacity: 1; transform: none; }
}
