/* =====================================================================
   1 YEAR — editorial cinematic
   warm cream + deep ink + terracotta
   ===================================================================== */

:root {
  --cream:        #f3e8d2;
  --cream-soft:   #efe1c4;
  --cream-deep:   #e6d4ae;
  --paper:        #f7eedb;
  --ink:          #1b1813;
  --ink-soft:     #3a3328;
  --muted:        #8a7d65;
  --line:         rgba(27, 24, 19, 0.12);
  --line-soft:    rgba(27, 24, 19, 0.06);
  --accent:       #b25a3c;
  --accent-soft:  #d8866a;

  /* iMessage-ish */
  --bubble-blue:  #1f7df0;
  --bubble-blue-2:#5aa4ff;
  --bubble-grey:  #ece1c8;
  --bubble-grey-ink: #2a241c;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max:   980px;
  --col:   640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(178, 90, 60, 0.06), transparent 60%),
    radial-gradient(1000px 700px at 90% 110%, rgba(178, 90, 60, 0.05), transparent 60%),
    var(--cream);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* film-grain — very subtle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

a { color: inherit; }

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

/* ---------- shared layout ---------- */
.col {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 28px;
}

.wide {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.rule {
  display: block;
  width: 56px;
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
  margin: 28px auto;
}

/* ---------- entry animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1.1s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes typing {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40%           { opacity: 1; transform: translateY(-3px); }
}

/* ===================================================================
   HERO
   =================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 60px;
  position: relative;
}

.hero .label {
  margin-bottom: 36px;
}

.hero-stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  max-width: 360px;
  margin: 0 auto 56px;
}

.hero-meta {
  text-align: center;
  font-style: italic;
  color: var(--muted);
  font-size: 16px;
  margin-top: 24px;
  letter-spacing: 0.01em;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  text-align: center;
  margin: 0;
  color: var(--ink);
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.hero-sub {
  text-align: center;
  font-style: italic;
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--ink-soft);
  margin: 16px auto 0;
  max-width: 520px;
  line-height: 1.5;
}

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  animation: drift 3.4s ease-in-out infinite;
}
.scroll-cue::after {
  content: "";
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--muted), transparent);
}

/* ===================================================================
   MESSAGE BUBBLES (iMessage-styled)
   =================================================================== */
.bubble-row {
  display: flex;
  width: 100%;
}
.bubble-row.michael {
  justify-content: flex-end;
}
.bubble-row.christina {
  justify-content: flex-start;
}

.bubble {
  position: relative;
  max-width: 78%;
  padding: 9px 15px;
  border-radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 15.5px;
  line-height: 1.42;
  letter-spacing: -0.005em;
  font-weight: 400;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.bubble .editable-text {
  display: inline;
  min-width: 1ch;
}
.bubble.michael {
  background: linear-gradient(180deg, var(--bubble-blue-2), var(--bubble-blue));
  color: white;
  border-bottom-right-radius: 6px;
}
.bubble.christina {
  background: var(--bubble-grey);
  color: var(--bubble-grey-ink);
  border-bottom-left-radius: 6px;
}

.bubble-meta {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 6px 0 -2px;
  opacity: 0.75;
}

/* typing indicator inside a christina bubble */
.bubble.typing {
  display: inline-flex;
  gap: 5px;
  padding: 13px 16px;
  align-items: center;
}
.bubble.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(60, 50, 35, 0.42);
  animation: typing 1.3s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.18s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.36s; }

/* a tiny bubble appearance animation */
@keyframes pop-in {
  0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.bubble-row.pop {
  animation: pop-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ===================================================================
   CHAPTERS
   =================================================================== */
.chapter {
  position: relative;
  padding: 140px 0 100px;
}

.chapter-header {
  text-align: center;
  padding-bottom: 56px;
}

.chapter-roman {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.chapter-month {
  font-family: var(--serif);
  font-size: clamp(72px, 10vw, 132px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.chapter-month em {
  font-style: italic;
  font-weight: 400;
}

.chapter-year {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 18px;
}

.chapter-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 400;
  color: var(--accent);
  line-height: 1.25;
  max-width: 620px;
  margin: 28px auto 0;
}

.chapter-epigraph {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 480px;
  margin: 14px auto 0;
  line-height: 1.5;
}

/* tiny month stat row under the header */
.chapter-stats {
  display: flex;
  gap: 36px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.chapter-stats .stat {
  text-align: center;
}
.chapter-stats .stat-num {
  font-family: var(--serif);
  font-size: 32px;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
}
.chapter-stats .stat-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

/* body text — editorial */
.chapter-body {
  margin-top: 64px;
}
.chapter-body p {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.65;
  margin: 0 0 1.1em;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.chapter-body p:first-of-type::first-line {
  font-variant: small-caps;
  letter-spacing: 0.06em;
}
.chapter-body p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 4.2em;
  float: left;
  line-height: 0.85;
  padding: 0.06em 0.12em 0 0;
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}

.chapter-body em {
  font-style: italic;
  color: var(--ink);
}

/* a featured-message group */
.feature-block {
  margin: 70px auto;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-block .bubble-row + .bubble-row {
  margin-top: 4px;
}

.feature-caption {
  text-align: center;
  font-style: italic;
  color: var(--muted);
  font-size: 16px;
  margin-top: 20px;
  line-height: 1.5;
}

/* ---------- pull quotes ---------- */
.pull {
  margin: 64px auto;
  max-width: 720px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.25;
  color: var(--accent);
  letter-spacing: -0.005em;
  position: relative;
  text-wrap: balance;
}
.pull::before, .pull::after {
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  background: var(--accent);
  margin: 24px auto;
  opacity: 0.4;
}

/* ---------- chapter divider ornament ---------- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto;
  padding: 60px 0;
  color: var(--accent);
  opacity: 0.6;
}
.divider .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: breathe 4.6s ease-in-out infinite;
}
.divider .dot:nth-child(2) { animation-delay: 0.6s; }
.divider .dot:nth-child(3) { animation-delay: 1.2s; }
.divider .line {
  width: 80px;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
}

/* ===================================================================
   DAY-RHYTHM CONSTELLATION (the artful viz)
   =================================================================== */
.constellation {
  margin: 80px auto 0;
  width: 100%;
  max-width: 800px;
  padding: 0 12px;
}
.constellation-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  padding: 0 4px;
}
.constellation-title em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.01em;
  text-transform: none;
}

.constellation svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.constellation .day-arc {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 0.5;
  opacity: 0.18;
}
.constellation .day-dot.michael { fill: var(--bubble-blue); }
.constellation .day-dot.christina { fill: var(--accent); }

.constellation-legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.constellation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.constellation-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.constellation-legend i.michael { background: var(--bubble-blue); }
.constellation-legend i.christina { background: var(--accent); }

/* ===================================================================
   FLOATING TIMELINE NAV
   =================================================================== */
.rail {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 10px;
  border-radius: 32px;
  background: rgba(247, 238, 219, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-soft);
}

.rail-item {
  appearance: none;
  background: none;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.4s ease, opacity 0.4s ease;
  opacity: 0.8;
}
.rail-item:hover { color: var(--ink); opacity: 1; }
.rail-item .rail-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  transition: width 0.4s ease, height 0.4s ease, background 0.4s ease;
}
.rail-item .rail-label {
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: width 0.5s ease, opacity 0.4s ease;
}
.rail-item:hover .rail-label,
.rail-item.active .rail-label {
  width: 56px;
  opacity: 1;
}
.rail-item.active {
  color: var(--accent);
  opacity: 1;
}
.rail-item.active .rail-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(178, 90, 60, 0.18);
}

/* progress line behind rail */
.rail::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: var(--line);
  z-index: -1;
}

@media (max-width: 760px) {
  .rail { right: 8px; padding: 10px 6px; }
  .rail-item .rail-label { display: none; }
  .rail-item:hover .rail-label,
  .rail-item.active .rail-label { display: none; }
}

/* ===================================================================
   FOOTER / CODA
   =================================================================== */
.coda {
  padding: 160px 0 200px;
  text-align: center;
}
.coda .label {
  margin-bottom: 28px;
}
.coda h2 {
  font-family: var(--serif);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  font-style: italic;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.coda p {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 28px auto 0;
}

.coda-heart {
  margin: 56px auto 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  animation: breathe 3.2s ease-in-out infinite;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .col { padding: 0 22px; }
  .chapter { padding: 110px 0 80px; }
  .chapter-month { font-size: clamp(60px, 14vw, 96px); }
  .chapter-body p { font-size: 19px; }
  .feature-block { max-width: 100%; padding: 0 12px; }
  .pull { font-size: clamp(24px, 6vw, 36px); padding: 0 16px; }
}

/* loading state */
.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
