/* ───────────── Fonts (self-hosted) ───────────── */
@font-face { font-family: "Cormorant"; src: url(/fonts/cormorant-300-normal.woff2) format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(/fonts/cormorant-300-italic.woff2) format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(/fonts/cormorant-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(/fonts/cormorant-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(/fonts/cormorant-500-normal.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(/fonts/cormorant-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(/fonts/cormorant-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-var.woff2) format("woff2-variations"), url(/fonts/inter-var.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* ───────────── Tokens ───────────── */
:root {
  --night-0: #04050b;
  --night-1: #080b1a;
  --night-2: #0e1328;
  --ink: #f1ebe0;
  --ink-2: rgba(241, 235, 224, .74);
  --ink-3: rgba(241, 235, 224, .5);
  --line: rgba(241, 235, 224, .12);
  --line-2: rgba(241, 235, 224, .22);
  --gold: #f3c77a;
  --gold-2: #ffe2a8;
  --ember: #f29a6b;
  --spigot: #9fc4ff;
  --card: rgba(14, 19, 40, .55);
  --serif: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1180px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--night-0);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(243, 199, 122, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--gold); color: #111; border-radius: 8px; text-decoration: none; font-weight: 600; transition: top .2s; }
.skip:focus { top: 16px; }
.muted { color: var(--ink-3); }
.small { font-size: .9rem; }

/* ───────────── Sky background ───────────── */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.nebula {
  position: fixed; inset: -20vh -20vw; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40vmax 30vmax at 78% 18%, rgba(110, 76, 180, .20), transparent 70%),
    radial-gradient(36vmax 28vmax at 12% 62%, rgba(40, 110, 160, .16), transparent 70%),
    radial-gradient(30vmax 22vmax at 70% 88%, rgba(242, 154, 107, .10), transparent 70%),
    radial-gradient(120vmax 80vmax at 50% 0%, #0b1030 0%, transparent 60%),
    linear-gradient(180deg, var(--night-1), var(--night-0) 60%);
  transform: translate3d(0, calc(var(--scroll, 0) * -60px), 0);
  will-change: transform;
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .footer, .topbar { position: relative; z-index: 2; }

/* ───────────── Top bar ───────────── */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  transition: background .5s var(--ease), padding .5s var(--ease), border-color .5s;
  border-bottom: 1px solid transparent;
}
.topbar.is-scrolled {
  padding-block: 12px;
  background: rgba(5, 7, 16, .62);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-family: var(--serif); font-size: 1.5rem; letter-spacing: .04em; }
.mark i { font-style: normal; font-size: .7rem; color: var(--gold); animation: twinkle 3.2s ease-in-out infinite; }
.topbar nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 30px); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.topbar nav a { text-decoration: none; color: var(--ink-2); transition: color .25s; position: relative; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a:not(.nav-cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.topbar nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta { padding: 8px 14px; border: 1px solid rgba(243, 199, 122, .45); border-radius: 999px; color: var(--gold-2) !important; }
.nav-cta:hover { background: rgba(243, 199, 122, .1); }
@media (max-width: 820px) {
  .topbar nav a:not(.nav-cta) { display: none; }
}

/* ───────────── Hero ───────────── */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px var(--gutter) 110px;
  position: relative;
}
.eyebrow {
  margin: 0 0 18px;
  font-size: .74rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold);
  display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow .num { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .08em; color: var(--ink-2); text-transform: none; font-style: italic; }

.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(4.2rem, 13.5vw, 11.5rem);
  line-height: .86;
  letter-spacing: -.025em;
}
.name .word { display: block; white-space: nowrap; }
.name .word:nth-child(2) { padding-left: .42em; font-style: italic; }
.name .ch {
  display: inline-block;
  background: linear-gradient(176deg, #fffaf0 10%, #f1e4c8 55%, #d9b779 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; filter: blur(14px); transform: translateY(.18em);
  animation: chIn 1.4s var(--ease) forwards;
  animation-delay: calc(.25s + var(--i) * .07s);
  padding-right: .02em;
}
@keyframes chIn { to { opacity: 1; filter: blur(0); transform: none; } }

.years {
  display: flex; align-items: center; gap: 18px;
  margin: 28px 0 0;
  font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 400; letter-spacing: .12em;
  color: var(--ink-2);
}
.years-line { position: relative; width: clamp(60px, 10vw, 120px); height: 1px; background: var(--line-2); overflow: visible; }
.years-line i { position: absolute; top: -2px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px 2px rgba(243, 199, 122, .7); animation: travel 6s ease-in-out infinite; }
@keyframes travel { 0%, 100% { left: 0; } 50% { left: calc(100% - 5px); } }

.tagline { margin: 22px 0 0; font-family: var(--serif); font-size: clamp(1.35rem, 2.4vw, 1.85rem); line-height: 1.35; max-width: 26ch; color: var(--ink); }
.tagline em { font-style: italic; }
.t-friend { color: var(--ember); }
.t-role { text-decoration: underline; text-decoration-color: rgba(241, 235, 224, .45); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.t-leader { background: linear-gradient(transparent 58%, rgba(243, 199, 122, .32) 58%); padding: 0 .12em; }
.alias { margin: 18px 0 0; color: var(--ink-3); font-size: .95rem; }
.alias a { color: var(--ink); text-decoration-color: rgba(243, 199, 122, .6); text-underline-offset: 4px; }
.alias a:hover { color: var(--gold-2); }

.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 36px; }
.btn-star {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 24px 14px 18px;
  border-radius: 999px; border: 1px solid rgba(243, 199, 122, .55);
  background: radial-gradient(120% 160% at 0% 50%, rgba(243, 199, 122, .22), rgba(243, 199, 122, .04) 60%);
  color: var(--gold-2); cursor: pointer; font-size: .95rem; letter-spacing: .02em;
  transition: transform .3s var(--ease), box-shadow .4s, background .4s;
  box-shadow: 0 0 0 0 rgba(243, 199, 122, 0);
}
.btn-star:hover { transform: translateY(-2px); box-shadow: 0 10px 40px -10px rgba(243, 199, 122, .55); }
.btn-star:active { transform: translateY(0) scale(.98); }
.btn-star-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(243, 199, 122, .16); font-size: .9rem; animation: twinkle 2.6s ease-in-out infinite; }
.btn-star.is-lit .btn-star-icon { background: var(--gold); color: #1a1408; animation: none; box-shadow: 0 0 18px 4px rgba(243, 199, 122, .6); }
.star-count { margin: 0; color: var(--ink-3); font-size: .9rem; }
.star-count b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }

.reveal-hero { opacity: 0; transform: translateY(16px); animation: fadeUp 1.2s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes fadeUp { to { opacity: 1; transform: none; } }

/* portrait */
.portrait { position: relative; margin: 0; justify-self: center; width: min(100%, 420px); aspect-ratio: 817 / 1120; }
.arch {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 50% 50% 28px 28px / 36% 36% 28px 28px;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(243, 199, 122, .28);
  isolation: isolate;
}
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.08); animation: slowZoom 18s ease-in-out infinite alternate; }
.arch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 5, 11, 0) 55%, rgba(4, 5, 11, .55)); pointer-events: none; }
@keyframes slowZoom { to { transform: scale(1.0); } }
.portrait::before {
  content: ""; position: absolute; inset: -14px; z-index: -1;
  border-radius: 50% 50% 40px 40px / 36% 36% 40px 40px;
  border: 1px solid rgba(243, 199, 122, .18);
}
.halo {
  position: absolute; inset: -18% -30%; z-index: -2;
  background: radial-gradient(closest-side, rgba(243, 199, 122, .30), rgba(242, 154, 107, .10) 45%, transparent 72%);
  filter: blur(10px);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
.orbit { position: absolute; left: 50%; top: 50%; width: 160%; height: auto; transform: translate(-50%, -50%); overflow: visible; pointer-events: none; z-index: 1; }
.orbit ellipse { fill: none; stroke: rgba(243, 199, 122, .22); stroke-width: 1; stroke-dasharray: 2 6; }

.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-3); font-size: .68rem; letter-spacing: .3em; text-transform: uppercase; opacity: 0; animation: fadeUp 1s var(--ease) 2.4s forwards; }
.scroll-cue i { width: 1px; height: 44px; background: linear-gradient(var(--gold), transparent); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: #fff; animation: drip 2.2s ease-in-out infinite; }
@keyframes drip { to { top: 110%; } }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 96px; text-align: left; gap: 48px; }
  .portrait { order: -1; width: min(72vw, 330px); justify-self: center; }
  .scroll-cue { display: none; }
}

/* ───────────── Sections ───────────── */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 13vw, 170px) var(--gutter); }
.section-head { margin-bottom: clamp(36px, 6vw, 64px); }
.section-head h2, .story-text h2, .leave-intro h2 {
  margin: 0; font-family: var(--serif); font-weight: 300;
  font-size: clamp(2.6rem, 6.4vw, 5rem); line-height: 1; letter-spacing: -.015em;
}
h2 em { font-style: italic; color: var(--gold-2); }
.section-sub { margin: 22px 0 0; max-width: 58ch; color: var(--ink-2); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* Remembering */
.lede { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.3; font-weight: 300; max-width: 30ch; margin: 0 0 clamp(56px, 9vw, 110px); }
.lede strong { font-weight: 500; color: var(--gold-2); }
.big-quote { position: relative; margin: 0 auto clamp(64px, 10vw, 120px); max-width: 920px; text-align: center; padding: 0 8px; }
.big-quote .qmark { display: block; font-family: var(--serif); font-size: clamp(6rem, 14vw, 10rem); line-height: .5; color: var(--gold); opacity: .55; margin-bottom: 8px; }
.big-quote p { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(1.9rem, 4.6vw, 3.4rem); line-height: 1.18; }
.big-quote footer { margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--ink-3); font-size: .95rem; flex-wrap: wrap; }
.big-quote footer b { color: var(--ink-2); font-weight: 500; }
.cite-line { width: 40px; height: 1px; background: var(--gold); }

.facets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.facet {
  position: relative; padding: clamp(24px, 3vw, 36px);
  border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 26, 54, .55), rgba(10, 13, 28, .35));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  overflow: hidden;
  transition: border-color .4s, transform .5s var(--ease);
}
.facet::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), rgba(243, 199, 122, .14), transparent 60%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.facet:hover { border-color: rgba(243, 199, 122, .3); transform: translateY(-4px); }
.facet:hover::before { opacity: 1; }
.facet-glyph { width: 44px; height: 44px; margin-bottom: 18px; }
.facet-glyph svg { width: 100%; height: 100%; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.facet h3 { margin: 0 0 18px; font-family: var(--serif); font-weight: 400; font-size: 1.85rem; }
.facet blockquote { margin: 0 0 18px; padding-left: 16px; border-left: 1px solid var(--line-2); }
.facet blockquote:last-child { margin-bottom: 0; }
.facet blockquote p { margin: 0 0 6px; color: var(--ink-2); font-size: .98rem; }
.facet cite { font-style: normal; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
@media (max-width: 900px) { .facets { grid-template-columns: 1fr; } }

/* Ribbon */
.ribbon { position: relative; z-index: 2; overflow: hidden; padding: 26px 0; border-block: 1px solid var(--line); background: rgba(6, 8, 18, .4); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ribbon-track { display: flex; width: max-content; gap: 0; animation: marquee 90s linear infinite; }
.ribbon:hover .ribbon-track { animation-play-state: paused; }
.ribbon-track span { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.9rem); white-space: nowrap; color: var(--ink-2); padding: 0 28px; display: inline-flex; align-items: center; gap: 56px; }
.ribbon-track span::after { content: "✦"; font-style: normal; font-size: .7rem; color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Moments */
.gallery { columns: 3 260px; column-gap: clamp(14px, 2vw, 24px); }
.shot { break-inside: avoid; margin: 0 0 clamp(14px, 2vw, 24px); position: relative; }
.shot button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 16px; overflow: hidden; position: relative; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); }
.shot button::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(241, 235, 224, .1); transition: box-shadow .4s; }
.shot img { width: 100%; transition: transform 1.2s var(--ease), filter .6s; filter: saturate(.92) brightness(.95); }
.shot:hover img { transform: scale(1.045); filter: saturate(1.05) brightness(1.02); }
.shot:hover button::after { box-shadow: inset 0 0 0 1px rgba(243, 199, 122, .5); }
.shot figcaption { margin-top: 10px; font-family: var(--serif); font-style: italic; font-size: 1.12rem; color: var(--ink-2); padding-left: 2px; }
.avatars { margin-top: clamp(40px, 6vw, 70px); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 22px 26px; border: 1px solid var(--line); border-radius: 999px; width: fit-content; max-width: 100%; background: rgba(10, 13, 28, .45); }
.avatars-label { margin: 0; font-size: .74rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.avatar-row { display: flex; gap: 14px; }
.avatar-row img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(241, 235, 224, .1); transition: transform .4s var(--ease), box-shadow .4s; }
.avatar-row img:hover { transform: translateY(-4px) rotate(-4deg); box-shadow: 0 0 0 2px var(--gold), 0 10px 30px -10px rgba(243, 199, 122, .6); }
@media (max-width: 560px) { .avatars { border-radius: 22px; } .avatar-row img { width: 54px; height: 54px; } }

/* Story */
.story-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 90px); align-items: center; }
.story-text h2 { margin-bottom: 30px; }
.story-text p { color: var(--ink-2); max-width: 54ch; }
.story-text p strong { color: var(--ink); font-weight: 600; }
.link-arrow { display: inline-flex; gap: 8px; align-items: baseline; margin-top: 18px; text-decoration: none; color: var(--gold-2); border-bottom: 1px solid rgba(243, 199, 122, .4); padding-bottom: 4px; transition: border-color .3s, gap .3s; flex-wrap: wrap; }
.link-arrow:hover { border-color: var(--gold); gap: 12px; }
.candle-photo { margin: 0; position: relative; }
.candle-photo img { border-radius: 50% 50% 22px 22px / 34% 34% 22px 22px; box-shadow: 0 40px 100px -30px rgba(242, 154, 107, .35), 0 0 0 1px var(--line); }
.candle-photo figcaption { margin-top: 14px; font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 1.1rem; text-align: center; }
.candle-photo::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 8%; height: 40%; background: radial-gradient(closest-side, rgba(242, 154, 107, .35), transparent); filter: blur(30px); z-index: -1; animation: flicker 4s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: .7; } 30% { opacity: 1; } 55% { opacity: .8; } 70% { opacity: .95; } }
@media (max-width: 860px) { .story-grid { grid-template-columns: 1fr; } .candle-photo { max-width: 420px; justify-self: center; } }

/* Messages: galaxy */
.galaxy-wrap { position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: clamp(460px, 82vh, 820px); }
#galaxy { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: pan-y; }
#galaxy:focus-visible { outline: none; }
.galaxy-wrap::before, .galaxy-wrap::after { content: ""; position: absolute; left: 0; right: 0; height: 90px; z-index: 1; pointer-events: none; }
.galaxy-wrap::before { top: 0; background: linear-gradient(var(--night-0), transparent); opacity: .0; }
.galaxy-tip {
  position: absolute; z-index: 3; pointer-events: none;
  padding: 8px 14px; border-radius: 12px;
  background: rgba(8, 11, 26, .86); border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: .85rem; white-space: nowrap; transform: translate(-50%, calc(-100% - 16px));
  opacity: 0; transition: opacity .2s;
}
.galaxy-tip.is-on { opacity: 1; }
.galaxy-tip b { font-weight: 600; }
.galaxy-tip span { color: var(--ink-3); margin-left: 8px; }
.galaxy-legend { position: absolute; left: var(--gutter); bottom: 18px; z-index: 2; display: flex; gap: 18px; flex-wrap: wrap; font-size: .78rem; color: var(--ink-3); letter-spacing: .04em; }
.galaxy-legend span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-site { background: #fff4df; box-shadow: 0 0 8px 2px rgba(255, 244, 223, .6); }
.dot-spigot { background: var(--spigot); box-shadow: 0 0 8px 2px rgba(159, 196, 255, .6); }
.dot-new { background: var(--gold); box-shadow: 0 0 8px 2px rgba(243, 199, 122, .8); }
.galaxy-random { position: absolute; right: var(--gutter); bottom: 12px; z-index: 2; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(8, 11, 26, .6); color: var(--ink); cursor: pointer; font-size: .85rem; transition: border-color .3s, background .3s; }
.galaxy-random:hover { border-color: var(--gold); background: rgba(243, 199, 122, .08); }
@media (max-width: 600px) {
  .galaxy-legend { bottom: auto; top: 6px; }
  .galaxy-random { left: 50%; right: auto; transform: translateX(-50%); bottom: 10px; white-space: nowrap; }
}

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(40px, 6vw, 70px) 0; border-block: 1px solid var(--line); }
.stats div { padding: 26px 18px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); order: 2; line-height: 1.4; }
.stats dd { margin: 0 0 6px; font-family: var(--serif); font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 300; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.stats div { display: flex; flex-direction: column; justify-content: flex-start; }
.stats dd { order: 1; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats div:nth-child(3) { border-left: 0; } .stats div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* list tools */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; }
.search input { width: 100%; padding: 14px 18px 14px 46px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(8, 11, 26, .6); color: var(--ink); font: inherit; font-size: .95rem; transition: border-color .3s, box-shadow .3s; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: rgba(243, 199, 122, .6); box-shadow: 0 0 0 4px rgba(243, 199, 122, .1); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: .85rem; color: var(--ink-2); transition: all .25s; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-on { background: var(--ink); color: #0a0c18; border-color: var(--ink); }
.tool-groups { display: flex; gap: 12px 18px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.seg button { padding: 6px 14px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-size: .82rem; color: var(--ink-3); transition: all .25s; }
.seg button:hover { color: var(--ink); }
.seg button.is-on { background: rgba(243, 199, 122, .16); color: var(--gold-2); }

/* cards */
.cards { display: flex; gap: 20px; align-items: flex-start; }
.cards-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.card {
  margin: 0; padding: 26px 26px 22px;
  border-radius: 20px; border: 1px solid var(--line);
  background: var(--card);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  cursor: pointer; text-align: left; width: 100%; display: block;
  transition: border-color .35s, transform .45s var(--ease), background .35s;
  animation: cardIn .7s var(--ease) both;
  animation-delay: calc(var(--k, 0) * 40ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } }
.card:hover { border-color: rgba(243, 199, 122, .35); transform: translateY(-3px); background: rgba(18, 24, 50, .65); }
.card-text { margin: 0 0 18px; color: var(--ink); font-size: .98rem; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.card.is-long .card-text { display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .8rem; }
.card-author { font-family: var(--serif); font-size: 1.2rem; font-style: italic; color: var(--gold-2); overflow-wrap: anywhere; }
.card-meta { color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.card-meta .src { width: 6px; height: 6px; border-radius: 50%; background: #fff4df; }
.card-meta .src.spigot { background: var(--spigot); }
.card.is-new { border-color: rgba(243, 199, 122, .6); box-shadow: 0 0 40px -10px rgba(243, 199, 122, .5); }
.card mark { background: rgba(243, 199, 122, .3); color: inherit; border-radius: 3px; padding: 0 2px; }
.list-title { margin: 0 0 22px; font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.2rem); display: flex; align-items: baseline; gap: 12px; }
.list-title span { font-family: var(--sans); font-size: .8rem; letter-spacing: .14em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wall-block { margin-top: clamp(56px, 8vw, 96px); }
.wall { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: baseline; gap: 10px; max-width: 100%;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(14, 19, 40, .5); cursor: pointer; text-align: left;
  font-size: .9rem; line-height: 1.35; color: var(--ink);
  transition: border-color .3s, background .3s, transform .3s var(--ease);
  animation: cardIn .6s var(--ease) both; animation-delay: calc(var(--k, 0) * 8ms);
}
.pill:hover { border-color: rgba(243, 199, 122, .45); background: rgba(22, 28, 58, .7); transform: translateY(-2px); }
.pill-text { overflow-wrap: anywhere; }
.pill-author { font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--gold-2); white-space: nowrap; }
.pill.spigot .pill-author { color: #c4d9ff; }
.pill.is-new { border-color: rgba(243, 199, 122, .6); box-shadow: 0 0 30px -8px rgba(243, 199, 122, .6); }
.pill mark { background: rgba(243, 199, 122, .3); color: inherit; border-radius: 3px; }
.cards-empty { text-align: center; color: var(--ink-3); margin: 40px 0; }
.more-wrap { display: flex; justify-content: center; margin-top: 18px; }
.btn-ghost { padding: 14px 28px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--ink); transition: border-color .3s, background .3s; }
.btn-ghost:hover { border-color: var(--gold); background: rgba(243, 199, 122, .06); }

/* Leave */
.leave-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 90px); align-items: start; }
.leave-intro h2 { margin-bottom: 26px; }
.leave-intro p { color: var(--ink-2); max-width: 46ch; }
.leave-form {
  position: relative; padding: clamp(24px, 4vw, 44px); border-radius: 28px;
  border: 1px solid var(--line-2);
  background: linear-gradient(160deg, rgba(22, 28, 60, .7), rgba(9, 12, 26, .6));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 50px 120px -50px rgba(0, 0, 0, .9);
}
.leave-form::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(243, 199, 122, .55), transparent 40%, transparent 70%, rgba(159, 196, 255, .35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.field { position: relative; margin-bottom: 22px; }
.field label { display: block; margin-bottom: 8px; font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line-2); background: rgba(4, 5, 11, .5);
  color: var(--ink); font: inherit; font-size: 1rem; resize: vertical;
  transition: border-color .3s, box-shadow .3s;
}
.field textarea { min-height: 160px; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: none; border-color: rgba(243, 199, 122, .65); box-shadow: 0 0 0 4px rgba(243, 199, 122, .1); }
.count { position: absolute; right: 12px; bottom: 10px; font-size: .72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; pointer-events: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn-send {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 17px 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(100deg, #f7d79a, var(--gold) 45%, #e8a873);
  color: #1b1307; font-weight: 600; font-size: 1rem; letter-spacing: .02em;
  box-shadow: 0 16px 40px -14px rgba(243, 199, 122, .7);
  transition: transform .3s var(--ease), box-shadow .3s, filter .3s;
}
.btn-send:hover { transform: translateY(-2px); box-shadow: 0 22px 50px -14px rgba(243, 199, 122, .85); }
.btn-send:disabled { filter: grayscale(.4) brightness(.8); cursor: progress; transform: none; }
.form-status { min-height: 1.6em; margin: 14px 0 0; font-size: .92rem; text-align: center; color: var(--ink-2); }
.form-status.is-error { color: #ffb4a0; }
.form-status.is-ok { color: var(--gold-2); }
@media (max-width: 860px) { .leave-grid { grid-template-columns: 1fr; } }

/* Footer */
.footer { padding: clamp(80px, 12vw, 160px) var(--gutter) 60px; text-align: center; }
.footer-inner { max-width: 640px; margin: 0 auto; }
.footer-note { color: var(--ink-3); font-size: .95rem; }
.footer-note a { color: var(--ink-2); text-underline-offset: 4px; }
.farewell { margin: 54px 0 6px; font-family: var(--serif); font-size: clamp(1.8rem, 4.4vw, 2.8rem); font-weight: 300; font-style: italic; }
.signature { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 3.4vw, 2.1rem); color: var(--gold-2); }
.fineprint { margin-top: 70px; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(241, 235, 224, .32); }

/* Reader dialog */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(2, 3, 8, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.reader { width: min(640px, calc(100vw - 32px)); }
.reader[open] .reader-card { animation: pop .5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.reader-card {
  position: relative; padding: clamp(28px, 5vw, 48px);
  border-radius: 28px; border: 1px solid var(--line-2);
  background: radial-gradient(120% 80% at 50% 0%, rgba(40, 46, 90, .95), rgba(10, 13, 28, .97) 70%);
  box-shadow: 0 60px 140px -40px rgba(0, 0, 0, 1), 0 0 80px -30px rgba(243, 199, 122, .35);
  max-height: calc(100svh - 48px); overflow-y: auto;
}
.reader-close, .lb-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(4, 5, 11, .5); cursor: pointer; font-size: 1.4rem; line-height: 1; color: var(--ink-2); transition: color .2s, border-color .2s; z-index: 2; }
.reader-close:hover, .lb-close:hover { color: var(--ink); border-color: var(--ink-3); }
.reader-meta { margin: 0 0 22px; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.reader-meta .sep { margin: 0 10px; color: var(--ink-3); }
.reader-text { margin: 0; font-family: var(--serif); font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.45; font-weight: 400; white-space: pre-line; overflow-wrap: anywhere; }
.reader-author { margin: 26px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--gold-2); }
.reader-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .85rem; }
.reader-nav button { background: none; border: 0; cursor: pointer; color: var(--ink-2); padding: 6px 0; transition: color .2s; }
.reader-nav button:hover { color: var(--gold-2); }

/* Lightbox */
.lightbox { width: 100vw; height: 100svh; display: none; align-items: center; justify-content: center; }
.lightbox[open] { display: flex; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 64px 16px 32px; }
.lightbox img { max-width: min(92vw, 1000px); max-height: calc(100svh - 150px); width: auto; height: auto; border-radius: 14px; box-shadow: 0 40px 120px -20px rgba(0, 0, 0, 1); animation: pop .5s var(--ease); }
.lightbox figcaption { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink-2); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(4, 5, 11, .55); cursor: pointer; font-size: 1.8rem; line-height: 1; color: var(--ink); z-index: 2; }
.lb-nav:hover { border-color: var(--gold); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
@media (max-width: 600px) { .lb-nav { top: auto; bottom: 18px; transform: none; } }

/* Comet used when lighting a star */
.comet { position: fixed; z-index: 30; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fffaf0; box-shadow: 0 0 14px 6px rgba(243, 199, 122, .9), 0 0 40px 14px rgba(243, 199, 122, .4); pointer-events: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .name .ch, .reveal-hero, .scroll-cue { opacity: 1; filter: none; transform: none; }
  .reveal { opacity: 1; transform: none; }
  .orbit .orb { display: none; }
}
