:root {
  --ink: #080c1a;
  --night: #101936;
  --night-soft: #18254a;
  --paper: #eee9dc;
  --star: #e7d59f;
  --mist: #b7bfd6;
  --violet: #9189d4;
  --rose: #a74650;
  --cinnabar: #963842;
  --line: rgba(208, 215, 242, 0.14);
  --display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: #eef0fa;
  background: linear-gradient(180deg, #080c1a 0%, #0b1123 48%, #080c1a 100%);
  font-family: var(--body);
  overflow-x: hidden;
}
body.gate-locked { overflow: hidden; }

button, a { font: inherit; }
a { color: inherit; }

.grain {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 20;
  background: linear-gradient(90deg, var(--violet), var(--star), var(--rose));
  transform: scaleX(0);
  transform-origin: left;
}

.festival-gate {
  display: none;
}
.js .festival-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f4efe4;
  background:
    radial-gradient(circle at 72% 24%, rgba(231, 213, 159, .11), transparent 22%),
    linear-gradient(145deg, #090d1b 0%, #111a35 58%, #1b101b 100%);
  transition: opacity .9s ease, visibility .9s ease;
}
.festival-gate.is-open { opacity: 0; visibility: hidden; }
.gate-moon {
  position: absolute;
  top: clamp(70px, 10vh, 120px);
  right: clamp(34px, 10vw, 150px);
  width: clamp(100px, 14vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e6d9af;
  box-shadow: 0 0 80px rgba(230, 217, 175, .16);
  opacity: .72;
}
.gate-moon::after {
  content: "";
  position: absolute;
  inset: -7% 18% 7% -8%;
  border-radius: 50%;
  background: #0e1429;
}
.gate-copy {
  position: relative;
  z-index: 2;
  width: min(1080px, calc(100% - 48px));
}
.gate-copy h2 {
  max-width: 720px;
  font-size: clamp(50px, 7.5vw, 104px);
  line-height: 1.2;
}
.gate-copy > p:not(.eyebrow) {
  margin: 32px 0 0;
  color: rgba(244, 239, 228, .62);
  font-size: 14px;
  letter-spacing: .08em;
}
.gate-button {
  margin-top: 44px;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid rgba(231, 213, 159, .55);
  color: var(--star);
  background: transparent;
  cursor: pointer;
}
.gate-button span { margin-right: 14px; letter-spacing: .15em; }
.gate-button i { font-style: normal; }
.gate-button:hover, .gate-button:focus-visible { color: #fff; border-color: #fff; outline: none; }
.gate-date {
  position: absolute;
  top: 46px;
  left: clamp(24px, 5vw, 78px);
  color: rgba(244, 239, 228, .48);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .28em;
  writing-mode: vertical-rl;
}
.gate-thread {
  position: absolute;
  right: -4vw;
  bottom: 14vh;
  width: 58vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 70, 80, .85));
  transform: rotate(-10deg);
  transform-origin: right;
}
.gate-thread span {
  position: absolute;
  left: 52%;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 22px rgba(167, 70, 80, .7);
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 82px;
  padding: 0 clamp(24px, 5vw, 78px);
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(238, 240, 250, .62);
}

.topbar > :last-child { justify-self: end; }
.seal {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 223, 158, .55);
  color: var(--star);
  text-decoration: none;
  font-family: var(--display);
  font-size: 16px;
  transform: rotate(-5deg);
}

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 120px clamp(24px, 7vw, 116px) 74px;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5, 9, 19, .86) 0%, rgba(5, 9, 19, .5) 52%, rgba(5, 9, 19, .18) 100%), linear-gradient(0deg, rgba(5, 9, 19, .64), transparent 44%);
}

.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(.72) contrast(.94); }
.hero-copy { width: min(1180px, 100%); position: relative; z-index: 2; }
.eyebrow {
  margin: 0 0 28px;
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--star);
}

h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; }
h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(44px, 6.4vw, 88px);
  line-height: 1.16;
  letter-spacing: -.035em;
  font-weight: 500;
}
h1 span, h1 em { display: block; }
h1 span:nth-child(2) { margin-left: .35em; }
h1 em {
  margin-left: .72em;
  color: var(--star);
  font-style: normal;
  font-weight: 400;
}

.hero-note {
  max-width: 410px;
  margin: 34px 0 0 0;
  color: rgba(238, 240, 250, .76);
  font-size: 14px;
  line-height: 2;
}

.open-letter {
  width: auto;
  height: auto;
  margin: 34px 0 0;
  padding: 13px 0;
  border: 1px solid rgba(245, 223, 158, .42);
  border-width: 0 0 1px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--star);
  text-decoration: none;
  font-size: 13px;
  transition: color .3s, border-color .3s;
}
.open-letter i { font-size: 16px; font-style: normal; }
.open-letter:hover, .open-letter:focus-visible {
  color: #fff;
  border-color: #fff;
  outline: none;
}

.page-section { padding: clamp(100px, 14vw, 210px) clamp(24px, 7vw, 116px); }
.prologue {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, .82fr) 1fr;
  gap: clamp(52px, 9vw, 140px);
  align-items: center;
}
.prologue-photo { margin: 0; }
.prologue-photo img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(.72) contrast(.95);
}
.prologue-photo figcaption {
  margin-top: 15px;
  color: rgba(238, 240, 250, .42);
  font-size: 10px;
  letter-spacing: .12em;
}
h2 {
  margin: 0;
  font-size: clamp(34px, 4.8vw, 66px);
  line-height: 1.36;
  letter-spacing: -.025em;
  font-weight: 500;
}
.body-copy {
  max-width: 600px;
  margin: 42px 0 0 auto;
  color: rgba(238, 240, 250, .68);
  font-size: 15px;
  line-height: 2.1;
}

.memories { background: rgba(18, 28, 55, .32); }
.section-heading { max-width: 920px; }
.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 74px;
  align-items: start;
}
.memory-card {
  position: relative;
  min-height: 360px;
  padding: 30px;
  border: 1px solid var(--line);
  background: rgba(10, 15, 31, .52);
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.memory-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(155, 145, 255, .18);
  border-radius: 50%;
  right: -70px;
  bottom: -70px;
}
.memory-card-high { margin-top: 48px; }
.card-index { font-size: 11px; letter-spacing: .18em; color: var(--star); }
.card-time { margin: 86px 0 18px; color: var(--mist); font-size: 12px; }
.memory-card h3 { margin: 0 0 22px; font-size: 25px; font-weight: 500; }
.memory-card > p:last-of-type { color: rgba(238, 240, 250, .6); line-height: 1.85; font-size: 14px; }
.card-star { position: absolute; right: 32px; top: 30px; color: var(--violet); }

.qixi-verse {
  position: relative;
  min-height: 52vh;
  display: grid;
  place-items: center;
  padding: 100px 24px;
  text-align: center;
  overflow: hidden;
}
.qixi-verse::before,
.qixi-verse::after {
  content: "";
  position: absolute;
  top: 50%;
  width: min(22vw, 260px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 70, 80, .5));
}
.qixi-verse::before { left: 0; }
.qixi-verse::after { right: 0; transform: scaleX(-1); }
.qixi-verse span {
  position: absolute;
  top: 72px;
  color: rgba(238, 240, 250, .42);
  font-size: 9px;
  letter-spacing: .3em;
}
.qixi-verse p {
  margin: 0;
  color: #e9e3d5;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 56px);
  letter-spacing: .12em;
}
.qixi-verse i {
  position: absolute;
  bottom: 68px;
  color: var(--rose);
  font-family: var(--display);
  font-size: 12px;
  font-style: normal;
  letter-spacing: .28em;
}

.myth-interlude {
  --scene-progress: 0;
  position: relative;
  height: 150vh;
  background: var(--ink);
}
.myth-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.myth-stage > img {
  position: absolute;
  inset: -4%;
  z-index: -3;
  width: 108%;
  height: 108%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.68) contrast(.96) brightness(.86);
  transform: scale(calc(1.075 - var(--scene-progress) * .075));
  transform-origin: center;
  will-change: transform;
}
.myth-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 9, 19, .74) 0%, rgba(5, 9, 19, .22) 53%, rgba(5, 9, 19, .52) 100%),
    linear-gradient(0deg, rgba(5, 9, 19, .7) 0%, transparent 38%, rgba(5, 9, 19, .2) 100%);
}
.myth-copy {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 10vh;
  opacity: calc(.5 + var(--scene-progress) * .5);
  transform: translateY(calc(34px - var(--scene-progress) * 34px));
  will-change: transform, opacity;
}
.myth-copy blockquote {
  margin: 0;
  max-width: 760px;
  color: #f2f0e9;
  font-family: var(--display);
  font-size: clamp(38px, 5.5vw, 76px);
  font-weight: 500;
  font-style: normal;
  line-height: 1.38;
  letter-spacing: -.025em;
  text-shadow: 0 3px 30px rgba(0, 0, 0, .5);
}
.myth-copy em { color: var(--star); font-style: normal; }
.myth-index {
  position: absolute;
  right: clamp(24px, 5vw, 78px);
  bottom: 34px;
  color: rgba(238, 240, 250, .46);
  font-size: 9px;
  letter-spacing: .22em;
}

.constellation {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  gap: 8vw;
  min-height: 100vh;
}
.constellation-map { position: relative; }
.constellation-map svg { width: 100%; overflow: visible; }
.constellation-map path {
  fill: none;
  stroke: rgba(245, 223, 158, .4);
  stroke-width: 1;
  stroke-dasharray: 4 8;
}
.constellation-map circle { fill: var(--star); filter: drop-shadow(0 0 8px var(--star)); }
.map-note { position: absolute; font-size: 10px; letter-spacing: .18em; color: rgba(238, 240, 250, .5); }
.note-one { left: 4%; bottom: 17%; }
.note-two { left: 41%; top: 45%; }
.note-three { right: 2%; top: 14%; }
.constellation-copy h2 { font-size: clamp(35px, 4.7vw, 66px); }

.letter { position: relative; }
.letter-heading { max-width: 780px; margin-bottom: 70px; }
.letter-paper {
  position: relative;
  width: min(820px, 100%);
  margin-left: auto;
  padding: clamp(48px, 8vw, 102px);
  color: #25202a;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
  font-family: var(--display);
  overflow: hidden;
}
.letter-paper::after {
  content: "柒夕";
  position: absolute;
  right: 38px;
  bottom: 38px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(156, 50, 58, .55);
  color: rgba(156, 50, 58, .72);
  font-size: 15px;
  letter-spacing: .1em;
  transform: rotate(-8deg);
}
.letter-paper p { margin: 0 0 28px; font-size: clamp(17px, 2vw, 21px); line-height: 2; }
.letter-paper .letter-to { margin-bottom: 42px; }
.letter-emphasis { border-bottom: 1px solid rgba(156, 50, 58, .35); }
.letter-paper .letter-sign { margin: 54px 0 0; text-align: right; font-size: 16px; }
.fold { position: absolute; pointer-events: none; background: rgba(90, 70, 70, .08); }
.fold-one { top: 0; bottom: 0; left: 38%; width: 1px; }
.fold-two { left: 0; right: 0; top: 63%; height: 1px; }

.finale {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 100px 24px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.finale::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(5, 9, 19, .5), rgba(5, 9, 19, .2)), linear-gradient(0deg, rgba(5, 9, 19, .75), transparent 60%);
}
.finale-media { position: absolute; inset: 0; z-index: -2; }
.finale-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(.66) brightness(.72); }
.finale-content { position: relative; z-index: 2; }
.finale h2 { font-size: clamp(40px, 5.8vw, 76px); text-shadow: 0 2px 28px rgba(0, 0, 0, .46); }
.promise-button {
  width: 126px;
  height: 126px;
  margin-top: 62px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(245, 223, 158, .55);
  border-radius: 50%;
  color: var(--star);
  background: rgba(8, 12, 26, .68);
  cursor: pointer;
  transition: transform .4s, background .4s, color .4s;
}
.promise-button:hover, .promise-button:focus-visible {
  transform: scale(1.06);
  color: var(--ink);
  background: var(--star);
  outline: none;
}
.promise-button i { font-style: normal; }
.promise-answer {
  min-height: 32px;
  margin: 32px 0 0;
  color: var(--star);
  font-family: var(--display);
  font-size: 18px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .7s, transform .7s;
}
.promise-answer.shown { opacity: 1; transform: translateY(0); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 28px clamp(24px, 5vw, 78px);
  border-top: 1px solid var(--line);
  color: rgba(238, 240, 250, .42);
  font-size: 9px;
  letter-spacing: .2em;
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (max-width: 820px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 68px; }
  .topbar-title { display: none; }
  .gate-moon { top: 12vh; right: -22px; }
  .gate-copy { align-self: end; padding-bottom: 16vh; }
  .gate-copy h2 { font-size: clamp(50px, 15vw, 72px); }
  .gate-copy > p:not(.eyebrow) { max-width: 280px; line-height: 1.9; }
  .gate-thread { bottom: 11vh; width: 74vw; }
  h1 { font-size: clamp(40px, 11.5vw, 66px); }
  h1 span:nth-child(2) { margin-left: .25em; }
  h1 em { margin-left: .55em; }
  .hero-note { margin-top: 36px; }
  .open-letter { margin-top: 28px; }
  .prologue { grid-template-columns: 1fr; align-content: center; }
  .prologue-photo { width: min(78vw, 430px); }
  .body-copy { margin-left: 0; }
  .memory-grid { grid-template-columns: 1fr; margin-top: 60px; }
  .memory-card { min-height: 330px; }
  .memory-card-high { margin-top: 0; }
  .card-time { margin-top: 74px; }
  .qixi-verse { min-height: 44vh; }
  .qixi-verse p { font-size: clamp(25px, 7vw, 36px); letter-spacing: .08em; }
  .qixi-verse::before, .qixi-verse::after { width: 10vw; }
  .myth-interlude { height: 128vh; }
  .myth-stage > img { object-position: 54% center; }
  .myth-copy { width: calc(100% - 48px); padding-top: 18vh; }
  .myth-copy blockquote { font-size: clamp(31px, 8.4vw, 42px); line-height: 1.52; }
  .constellation { grid-template-columns: 1fr; }
  .constellation-copy { order: -1; }
  .letter-paper { transform: none; padding: 48px 28px 72px; }
  .finale-media img { object-position: 42% center; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .myth-stage > img, .myth-copy { transform: none; }
  .festival-gate { transition: none; }
}
