/* ============================================================
   kaguya.day — a daybook, written by hand
   Warm-earthy parchment, oversized Fraunces, hand-drawn paths
   ============================================================ */

:root {
  --parchment: #f4ead2;
  --wheaten: #e8d4a8;
  --terracotta: #c97b4a;
  --chestnut: #7a4a26;
  --umber: #3d2817;
  --sage: #8aa05a;
  --hayfield: #d8c19e;
  --cream: #fff8e7;

  --measure-prose: clamp(36ch, 58ch, 64ch);
  --measure-display: min(960px, 92vw);

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --prose: "Gentium Plus", Georgia, "Times New Roman", serif;
  --smallcaps: "Alegreya Sans SC", "Gill Sans", "Trebuchet MS", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--parchment);
  color: var(--chestnut);
  font-family: var(--prose);
  font-size: 1.125rem;
  line-height: 1.7;
  font-variant-numeric: oldstyle-nums;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

/* paper-grain overlay — subtle SVG noise at ~3% alpha */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

/* ---------- shared ---------- */
.datestamp {
  font-family: var(--smallcaps);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--terracotta);
  text-align: center;
}

.draw-path {
  /* JS sets dasharray/dashoffset; this is the drawn-target transition */
  transition: stroke-dashoffset 1.6s cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============================================================
   1. SUNRISE BAND
   ============================================================ */
.sunrise {
  min-height: 100vh;
  width: var(--measure-display);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0;
}

.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'WONK' 1;
  font-size: clamp(5rem, 18vw, 14rem);
  line-height: 0.85;
  letter-spacing: -0.035em;
  color: var(--umber);
  filter: drop-shadow(0 1px 0 rgba(216, 193, 158, 0.55));
}

.wordmark-underline {
  width: min(720px, 88vw);
  margin-top: 0.4rem;
}
.wordmark-underline svg { width: 100%; height: auto; display: block; }

.sunrise-tag {
  font-family: var(--smallcaps);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--chestnut);
  margin-top: 2.4rem;
  opacity: 0.8;
}

/* ============================================================
   2. TODAY'S ENTRY
   ============================================================ */
.today {
  margin-top: 8rem;
  width: var(--measure-prose);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
}

.today-frame {
  position: relative;
  max-width: 48ch;
  padding: 3.5rem 2.5rem;
}
.today-line {
  font-family: var(--prose);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.6;
  text-align: center;
  color: var(--chestnut);
  max-width: 48ch;
}
.diag {
  position: absolute;
  display: block;
  line-height: 0;
}
.diag svg { display: block; }
.diag-tl { top: -0.4rem; left: -0.6rem; transform: rotate(-8deg); }
.diag-tr { top: 0.2rem; right: -0.8rem; transform: rotate(7deg); }
.diag-bl { bottom: 0.4rem; left: -0.4rem; transform: rotate(6deg); }
.diag-br { bottom: -0.6rem; right: -0.6rem; transform: rotate(-9deg); }

/* ============================================================
   3 & 5. PATH-DRAW INTERLUDES
   ============================================================ */
.interlude {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.interlude svg { display: block; max-width: 96vw; height: auto; }

.interlude-river {
  margin-top: 12rem;
  min-height: 60vh;
}
.interlude-river svg { width: 1200px; }

.interlude-sprig {
  margin-top: 9rem;
  min-height: 320px;
}
.interlude-sprig svg { width: 200px; }

/* ============================================================
   4. ALMANAC ENTRIES
   ============================================================ */
.almanac {
  margin-top: 3rem;
  width: var(--measure-prose);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.entry {
  width: 100%;
  max-width: 54ch;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* breath-cycle gaps between entries */
.entry + .entry { margin-top: 8rem; }
#entry-2 { margin-top: 3rem; }
#entry-3 { margin-top: 12rem; }
#entry-4 { margin-top: 5rem; }
#entry-5 { margin-top: 9rem; }
#entry-6 { margin-top: 4rem; }
#entry-1 { margin-top: 2rem; }

.entry .datestamp { margin-bottom: 1.6rem; }

.entry-body {
  font-family: var(--prose);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--chestnut);
  text-align: left;
  max-width: 54ch;
}
.entry-body .dropcap {
  font-family: var(--display);
  font-weight: 600;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 144, 'SOFT' 80, 'WONK' 1;
  font-size: 7rem;
  line-height: 0.78;
  float: left;
  color: var(--terracotta);
  margin: 0.35rem 0.6rem -0.1rem 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.entry.is-visible .dropcap { opacity: 1; }

.inline-icon {
  display: inline-block;
  vertical-align: -0.32em;
  margin: 0 0.18em;
  line-height: 0;
}
.inline-icon svg { display: inline-block; }

/* ============================================================
   6. SEASONAL INDEX
   ============================================================ */
.index {
  margin-top: 4rem;
  width: var(--measure-prose);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.index-head { margin-bottom: 3.2rem; }

.month-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.month-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}
.month-name {
  font-family: var(--display);
  font-weight: 600;
  font-optical-sizing: auto;
  font-variation-settings: 'opsz' 90, 'SOFT' 60, 'WONK' 0;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--umber);
  min-width: 6.4em;
  text-align: right;
}
.month-div { display: block; width: 60px; height: 12px; flex: none; }
.month-div .draw-path { transition: stroke-dashoffset 0.8s cubic-bezier(0.65, 0, 0.35, 1); }
.month-icon { line-height: 0; flex: none; }
.month-icon svg { display: block; }

/* ============================================================
   7. COLOPHON
   ============================================================ */
.colophon {
  margin-top: 9rem;
  margin-bottom: 6rem;
  width: var(--measure-prose);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  text-align: center;
}
.colophon-flourish { display: block; }
.colophon-flourish .draw-path { transition: stroke-dashoffset 1.2s cubic-bezier(0.65, 0, 0.35, 1); }
.colophon-line {
  font-family: var(--smallcaps);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  font-size: 0.95rem;
  color: var(--chestnut);
  border-top: 1px solid var(--hayfield);
  padding-top: 1.6rem;
}

/* ---------- reduced motion: paths present, no fades ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .draw-path { transition: none !important; stroke-dashoffset: 0 !important; }
  .entry .dropcap { opacity: 1 !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .today-frame { padding: 4.5rem 0.5rem; }
  .diag-tl { left: -0.2rem; }
  .diag-tr { right: -0.2rem; }
  .diag-bl { left: -0.2rem; }
  .diag-br { right: -0.2rem; }
  .month-name { font-size: 1.7rem; min-width: 0; text-align: center; }
  .month-row { gap: 0.6rem; }
  .entry-body .dropcap { font-size: 5rem; }
}
