:root {
  --bg: #07060a;
  --bg-2: #100d14;
  --ink: #f3eadc;
  --muted: #b9a994;
  --dim: #7d7268;
  --line: rgba(212, 184, 148, 0.22);
  --gold: #d4b48c;
  --gold-2: #e8c9a0;
  --moon: #f0b58a;
  --ember: #c45c42;
  --hair: #c43a28;
  --hers: rgba(196, 90, 66, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 300;
  letter-spacing: 0.01em;
}

body {
  overflow-x: hidden;
}

::selection {
  background: var(--ember);
  color: #fff;
}

#gate[hidden] {
  display: none !important;
}

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

.grain,
.vignette,
#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.grain {
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.vignette {
  z-index: 41;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

#stars {
  z-index: 0;
}

.gate {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.moon {
  position: absolute;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  right: -12%;
  top: -8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #ffe7c8 0%, var(--moon) 22%, #c56b48 48%, #6a2a28 72%, #14080c 100%);
  box-shadow:
    0 0 80px 20px rgba(232, 140, 90, 0.28),
    0 0 180px 40px rgba(196, 60, 40, 0.18);
  animation: moon-breathe 8s ease-in-out infinite;
}

@keyframes moon-breathe {
  0%,
  100% {
    transform: scale(1);
    filter: saturate(1);
  }
  50% {
    transform: scale(1.03);
    filter: saturate(1.08);
  }
}

.gate-card {
  position: relative;
  width: min(420px, 100%);
  text-align: center;
  padding: 36px 28px 32px;
  border: 1px solid var(--line);
  background: rgba(7, 6, 10, 0.62);
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.xo {
  margin: 0 0 10px;
  font-family: Outfit, sans-serif;
  font-weight: 500;
  letter-spacing: 0.42em;
  font-size: 0.72rem;
  color: var(--gold);
}

.xo.big {
  font-size: 1.4rem;
  letter-spacing: 0.55em;
  margin-bottom: 18px;
}

.gate-card h1,
.chapter-head h2,
.intro-copy h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin: 0;
}

.gate-card h1 {
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-style: italic;
}

.gate-sub,
.kicker,
.hint,
.note,
.chapter-head p,
figcaption,
cite,
.fragments small,
.end-line,
.end-name {
  color: var(--muted);
}

.gate-sub {
  margin: 8px 0 28px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
}

#login-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

#login-form label span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

#login-form input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px 12px;
  outline: none;
  letter-spacing: 0.08em;
  transition: border-color 0.3s var(--ease);
}

#login-form input:focus {
  border-color: var(--gold);
}

#login-form button,
.next,
.close-lb {
  appearance: none;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 14px 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

#login-form button {
  margin-top: 10px;
  width: 100%;
}

#login-form button:hover,
.next:hover,
.close-lb:hover {
  background: var(--gold);
  color: #14080c;
}

.error {
  margin: 0;
  color: var(--ember);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.gate.shake .gate-card {
  animation: shake 0.42s var(--ease);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

.gift {
  position: relative;
  z-index: 1;
}

.gift.is-open {
  animation: rise 1.15s var(--ease);
}

@keyframes rise {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: none;
  }
}

.progress {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ember), var(--gold));
}

.panel,
.chapter {
  position: relative;
  padding: 72px 22px 88px;
  max-width: 980px;
  margin: 0 auto;
}

.intro {
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding: 0;
  max-width: none;
}

.intro-photo {
  position: absolute;
  inset: 0;
}

.intro-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.16);
  filter: brightness(0.62) saturate(0.92);
  animation: ken 22s var(--ease) infinite alternate;
}

@keyframes ken {
  from {
    transform: scale(1.16) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.24) translate3d(0, -2%, 0);
  }
}

.intro-copy {
  position: relative;
  z-index: 2;
  padding: 48px 24px calc(48px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(7, 6, 10, 0.92) 55%);
}

.kicker,
.chapter-head span {
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.intro-copy h2 {
  font-size: clamp(4rem, 16vw, 8rem);
  line-height: 0.85;
  font-style: italic;
  margin: 8px 0 6px;
}

.lede {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  margin: 0 0 18px;
}

.hint {
  font-size: 0.86rem;
  max-width: 28ch;
  line-height: 1.55;
}

.chapter-head {
  margin-bottom: 36px;
}

.chapter-head h2 {
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  line-height: 1.02;
  margin: 10px 0 14px;
}

.chapter-head p,
.note {
  max-width: 48ch;
  line-height: 1.7;
  font-size: 0.98rem;
}

.frame {
  overflow: hidden;
  background: #110d12;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  cursor: zoom-in;
  transition: transform 0.8s var(--ease), filter 0.8s var(--ease);
  filter: saturate(0.96) contrast(1.04);
}

.frame:hover img {
  transform: scale(1.07);
  filter: saturate(1.05) contrast(1.08);
}

.gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.gallery figure {
  margin: 0;
  aspect-ratio: 4 / 5;
}

.gallery .hero,
.gallery .wide {
  grid-column: 1 / -1;
}

.gallery .hero {
  aspect-ratio: 4 / 5;
}

.gallery .wide {
  aspect-ratio: 16 / 10;
}

.gallery.concert.second figure {
  aspect-ratio: 4 / 5;
}

.gallery.concert.second .wide {
  aspect-ratio: 4 / 5;
}

.night-label {
  margin: 40px 0 16px;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

figcaption {
  padding: 10px 4px 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.wish {
  max-width: 22em;
  margin: 0 0 28px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.55rem, 4.2vw, 2.15rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--ink);
}

.show-note {
  margin: 48px 0 0;
  max-width: 38em;
  padding: 32px 0 8px;
  border-top: 1px solid var(--line);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.18rem, 2.4vw, 1.42rem);
  line-height: 1.75;
}

.show-note p {
  margin: 0 0 1.15em;
}

.show-note p:first-child {
  font-style: italic;
  font-size: 1.08em;
  color: var(--gold-2);
}

.show-note em {
  font-style: italic;
  color: var(--gold-2);
}

.said-line {
  margin: 0 0 36px;
  padding: 0;
}

.said-you {
  margin: 0;
  font-family: Outfit, sans-serif;
  font-weight: 300;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.said-you::before {
  content: "“";
}

.said-you::after {
  content: "”";
}

.said-line figcaption {
  padding: 6px 0 0;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.dates {
  display: flex;
  gap: 28px;
  margin: 0 0 32px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  letter-spacing: 0.08em;
  color: var(--gold-2);
}

.dates p {
  margin: 0;
}

.quote p {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-style: italic;
  margin: 0 0 8px;
  line-height: 1.25;
}

cite {
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.note {
  margin-top: 28px;
}

.since {
  margin: 8px 0 0;
  padding: 8px 0 24px;
  text-align: center;
}

.since-date {
  margin: 0 0 28px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
}

.clock {
  display: flex;
  justify-content: center;
  gap: 18px 28px;
  flex-wrap: wrap;
}

.clock-cell {
  min-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.clock-cell strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.clock-cell span {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

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

.line li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  padding: 0 0 32px 22px;
  position: relative;
}

.line li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--ember);
}

.line time {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  padding-top: 4px;
}

.line h3 {
  margin: 0 0 6px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.line p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.said {
  display: grid;
  gap: 28px;
}

.said h3 {
  margin: 0 0 14px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
}

.fragments {
  display: grid;
  gap: 12px;
}

.fragments article {
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  background: rgba(16, 13, 20, 0.55);
}

.fragments article.hers {
  background: var(--hers);
  border-color: rgba(196, 90, 66, 0.28);
}

.fragments small {
  display: block;
  margin-bottom: 8px;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.fragments p {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.28rem;
  line-height: 1.4;
}

.nick-board {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.nick-board li {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: baseline;
  gap: 12px;
  padding: 12px 4px 12px 0;
  border-bottom: 1px solid var(--line);
}

.nick-board .who {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.nick-board .who.hers { color: #e7b3a4; }
.nick-board .who.his { color: var(--gold); }
.nick-board .who.both { color: var(--muted); }

.nick-board strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

.nick-board b {
  font-family: Outfit, sans-serif;
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--gold-2);
  min-width: 2.2ch;
  text-align: right;
}

.nick-board small {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.names-note {
  max-width: 36em;
  margin: 8px auto 40px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.18rem, 2.6vw, 1.42rem);
  font-style: italic;
  line-height: 1.7;
  color: var(--ink);
}

.names-note em {
  font-style: italic;
  color: var(--gold-2);
}

.names-sub {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 8px 0 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.chips span {
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(16, 13, 20, 0.45);
  opacity: 0;
  transform: translateY(16px);
}

.chapter.letter {
  max-width: 820px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.deck {
  position: relative;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at top, rgba(196, 90, 66, 0.08), transparent 46%),
    linear-gradient(180deg, rgba(18, 12, 16, 0.78), rgba(7, 6, 10, 0.92));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35);
  min-height: min(78svh, 720px);
  display: grid;
  grid-template-rows: 1fr auto;
}

.slide {
  display: none;
  padding: 40px 8vw 24px;
  overflow-y: auto;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.08rem, 2.1vw, 1.26rem);
  line-height: 1.8;
}

.slide.is-on {
  display: block;
  animation: appear 0.55s var(--ease);
}

.slide p {
  margin: 0 0 1.1em;
}

.slide em {
  font-style: italic;
  color: var(--gold-2);
  background: linear-gradient(transparent 62%, rgba(212, 180, 140, 0.18) 62%);
}

.letter-title {
  text-align: center;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-style: italic;
  letter-spacing: 0.04em;
  margin: 0 0 0.3em !important;
  color: var(--gold-2);
}

.letter-hello {
  text-align: center;
  font-size: 1.35rem;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 1.6em !important;
}

.letter-close {
  text-align: center;
  margin: 1.6em 0 0 !important;
  font-style: italic;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--gold-2);
}

.deck-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.deck-index {
  margin: 0;
  text-align: center;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--muted);
}

.deck-btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-2);
  font: inherit;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.62rem;
  padding: 12px 14px;
  cursor: pointer;
}

.deck-btn:first-child { justify-self: start; }
.deck-btn:last-child { justify-self: end; }

.deck-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.deck-btn:not(:disabled):hover {
  background: var(--gold);
  color: #14080c;
}

.reveal {
  animation: appear 0.9s var(--ease) forwards;
}

@keyframes appear {
  to {
    opacity: 1;
    transform: none;
  }
}

.sign {
  margin-top: 2em;
  font-style: italic;
  color: var(--gold-2);
}

.end {
  min-height: 70svh;
  display: grid;
  place-content: center;
  text-align: center;
  padding-bottom: 120px;
}

.end-line {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
  margin: 0 0 10px;
}

.end-name {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  padding: 24px;
}

.lightbox img {
  max-width: min(92vw, 980px);
  max-height: 86svh;
  object-fit: contain;
  transform: none;
}

.close-lb {
  position: absolute;
  top: 18px;
  right: 18px;
}

.ambient {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(7, 6, 10, 0.72);
  color: var(--gold-2);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.62rem;
  padding: 12px 16px 12px 14px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.ambient:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.ambient-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  width: 12px;
}

.ambient-eq i {
  display: block;
  width: 2px;
  height: 4px;
  background: var(--gold);
  transform-origin: bottom;
}

.ambient.is-playing .ambient-eq i:nth-child(1) {
  animation: eq 1.1s ease-in-out infinite;
}

.ambient.is-playing .ambient-eq i:nth-child(2) {
  animation: eq 0.9s ease-in-out 0.12s infinite;
}

.ambient.is-playing .ambient-eq i:nth-child(3) {
  animation: eq 1.25s ease-in-out 0.2s infinite;
}

@keyframes eq {
  0%,
  100% {
    height: 3px;
  }
  50% {
    height: 12px;
  }
}

.gift[hidden],
.lightbox[hidden],
.error[hidden] {
  display: none !important;
}

@media (min-width: 820px) {
  .gallery.night,
  .gallery.sun {
    grid-template-columns: 1.2fr 1fr 1fr;
  }

  .gallery.night .hero,
  .gallery.sun .hero {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    aspect-ratio: auto;
    min-height: 640px;
  }

  .gallery.night .wide {
    grid-column: 1 / -1;
  }

  .gallery.sun .wide {
    grid-column: 2 / -1;
    aspect-ratio: 16 / 8;
  }

  .said {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .said .fragments {
    grid-template-columns: 1fr;
  }

  .fragments {
    grid-template-columns: 1fr 1fr;
  }

  .panel,
  .chapter {
    padding-left: 40px;
    padding-right: 40px;
  }

  .intro-copy {
    padding-left: 56px;
    padding-right: 56px;
  }
}
