:root {
  --page: oklch(0.95 0.012 14);
  --paper: oklch(0.978 0.006 25);
  --ink: oklch(0.3 0.027 28);
  --muted: oklch(0.5 0.03 24);
  --rose: oklch(0.57 0.06 17);
  --line: oklch(0.79 0.025 17 / 0.62);
  --dusk: oklch(0.67 0.08 22);
  --dusk-deep: oklch(0.33 0.055 333);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

a { color: inherit; }

.story-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) clamp(18px, 5vw, 54px) max(44px, env(safe-area-inset-bottom));
}

.story-heading {
  max-width: 780px;
  padding: clamp(38px, 10vw, 108px) 0 clamp(54px, 10vw, 96px);
}

.quiet-home-link,
.chapter-topnav a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.story-heading > p {
  margin: 56px 0 20px;
  color: var(--rose);
  font-family: "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

.story-heading h1 {
  max-width: 8em;
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 1.16;
  font-weight: 400;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.story-heading-copy {
  display: flex;
  gap: 8px 32px;
  flex-wrap: wrap;
  margin-top: 34px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.story-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.timeline-entry {
  border-bottom: 1px solid var(--line);
}

.timeline-entry a {
  display: grid;
  grid-template-columns: 52px minmax(132px, 0.55fr) minmax(220px, 1.2fr) minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: clamp(26px, 5vw, 46px) 2px;
  text-decoration: none;
  transition: color 180ms ease-out, padding-left 180ms ease-out;
}

.timeline-entry a:hover {
  color: var(--rose);
  padding-left: 10px;
}

.timeline-order,
.timeline-meta,
.timeline-open {
  color: var(--muted);
  font-family: "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 0.78rem;
}

.timeline-entry strong {
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 500;
}

.timeline-summary {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.75;
}

.timeline-open { justify-self: end; }

.timeline-ending {
  padding: clamp(46px, 8vw, 82px) 2px;
}

.timeline-ending span {
  color: var(--rose);
  font-size: 1.2rem;
}

.timeline-ending p {
  margin: 12px 0 0;
  color: var(--muted);
}

.chapter-topnav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.meeting-hero {
  min-height: min(820px, 92svh);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(34px, 7vw, 88px);
  align-items: center;
  padding: clamp(64px, 10vw, 118px) 0;
}

.meeting-title > span {
  display: inline-block;
  padding-bottom: 7px;
  color: var(--rose);
  border-bottom: 1px solid var(--line);
  font-family: "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}

.meeting-title h1 {
  max-width: 7em;
  margin: 26px 0 24px;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.meeting-title p {
  max-width: 31rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.9;
  text-wrap: pretty;
}

.meeting-art { margin: 0; }

.meeting-art--flower img {
  display: block;
  width: min(100%, 510px);
  max-height: 720px;
  margin-left: auto;
  object-fit: cover;
  object-position: center 53%;
  box-shadow: 0 4px 10px oklch(0.34 0.035 20 / 0.09);
}

.meeting-art--dusk {
  width: min(100%, 520px);
  margin-left: auto;
}

.dusk-window {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(180deg, oklch(0.79 0.08 43), oklch(0.66 0.11 20) 48%, var(--dusk-deep));
  box-shadow: 0 4px 10px oklch(0.28 0.04 330 / 0.12);
}

.dusk-window::before,
.dusk-window::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: 1px;
  background: oklch(0.96 0.02 35 / 0.35);
}

.dusk-window::before { left: 34%; }
.dusk-window::after { right: 22%; }

.dusk-sun {
  position: absolute;
  top: 27%;
  right: 16%;
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: oklch(0.88 0.09 60 / 0.88);
}

.dusk-horizon {
  position: absolute;
  right: 0;
  bottom: 31%;
  left: 0;
  height: 1px;
  background: oklch(0.92 0.035 42 / 0.35);
}

.dusk-night {
  position: absolute;
  right: -8%;
  bottom: -11%;
  width: 76%;
  height: 42%;
  background: oklch(0.27 0.045 331 / 0.7);
  transform: rotate(-8deg);
}

.meeting-art--dusk figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.meeting-art--dusk figcaption small {
  max-width: 18rem;
  font-family: "PingFang SC", "Helvetica Neue", sans-serif;
}

.meeting-letter {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 84px) clamp(24px, 7vw, 64px);
  background-color: oklch(0.978 0.006 25 / 0.96);
  background-image: url("../assets/paper-texture.png");
  background-size: 540px auto;
  box-shadow: 0 3px 8px oklch(0.35 0.025 20 / 0.065);
}

.meeting-letter-body {
  max-width: 68ch;
  margin: 0 auto;
  font-size: clamp(1.04rem, 3.8vw, 1.18rem);
  line-height: 2.08;
  text-wrap: pretty;
}

.meeting-letter-body p { margin: 0; }
.meeting-letter-body p + p { margin-top: 1.08em; }

.chapter-transition {
  display: block;
  margin-top: clamp(54px, 9vw, 78px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.chapter-transition span {
  display: block;
  margin-bottom: 13px;
  color: var(--rose);
  font-size: 1.12rem;
}

.chapter-transition strong {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 500;
}

.chapter-transition:not(.chapter-transition--ending):hover strong { color: var(--rose); }

.chapter-bottomnav {
  width: min(720px, 100%);
  margin: 34px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.chapter-bottomnav a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.theme-dusk { --page: oklch(0.91 0.025 22); --rose: oklch(0.5 0.075 18); }
.theme-flower { --page: oklch(0.95 0.012 14); }

@media (max-width: 760px) {
  .timeline-entry a {
    grid-template-columns: 38px 1fr;
    gap: 8px 16px;
  }

  .timeline-order { grid-row: 1 / 5; }
  .timeline-meta,
  .timeline-entry strong,
  .timeline-summary,
  .timeline-open { grid-column: 2; }
  .timeline-open { justify-self: start; margin-top: 8px; }

  .meeting-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 58px 48px;
  }

  .meeting-title h1 {
    max-width: 6.2em;
    font-size: clamp(2.55rem, 12vw, 4.2rem);
  }

  .meeting-art--flower img,
  .meeting-art--dusk {
    width: min(94%, 480px);
    margin-inline: auto;
  }

  .chapter-bottomnav {
    align-items: center;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .timeline-entry a { transition: none; }
}
