/* Retirement site: entry + scroll scene. No remote fonts; system stacks only. */

:root {
  --ink: #1f2633;
  --ink-soft: #4b5566;
  --paper: rgba(250, 247, 242, 0.9);
  --paper-edge: rgba(46, 62, 92, 0.38);
  --blue-glow: 150, 190, 255;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: max(16px, 4vw);
  --stage-h: 100vh;
  color-scheme: light;
}
@supports (height: 100svh) { :root { --stage-h: 100svh; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #dfe3e3;
  color: var(--ink);
  font: 16px/1.5 var(--font-ui);
}
html.is-entry, html.is-entry body { overflow: hidden; height: 100%; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ entry */
.entry {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.entry.is-shattering { background: transparent; cursor: default; }
.entry.is-shattering .entry__button,
.entry.is-shattering .entry__invite { visibility: hidden; }
.entry.is-fading { opacity: 0; transition: opacity 0.45s ease; }

.deck-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.entry__button {
  position: relative;
  display: block;
  width: min(38vh * 0.6027, 56vw, 440px * 0.6027);
  aspect-ratio: 804 / 1334;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 14px;
}
.entry__button:focus-visible { outline: 2px solid rgba(var(--blue-glow), 0.9); outline-offset: 14px; }

.entry__glow {
  position: absolute;
  inset: -45% -70%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(210, 228, 255, 0.5),
    rgba(var(--blue-glow), 0.22) 45%,
    rgba(80, 120, 255, 0.07) 70%,
    rgba(80, 120, 255, 0) 100%);
  animation: entry-glow 5.6s ease-in-out infinite;
  will-change: transform, opacity;
  pointer-events: none;
}
.entry__chevron {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(205, 225, 255, 0.55)) drop-shadow(0 0 34px rgba(var(--blue-glow), 0.35));
  animation: entry-breathe 5.6s ease-in-out infinite;
  will-change: transform;
}
.entry__invite {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(8vh, 36px);
  margin: 0;
  padding-inline: var(--gutter);
  text-align: center;
  color: rgba(214, 226, 250, 0.7);
  font: 500 12px/1.4 var(--font-ui);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: entry-invite 5.6s ease-in-out infinite;
}

@keyframes entry-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}
@keyframes entry-glow {
  0%, 100% { transform: scale(0.94); opacity: 0.55; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes entry-invite {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.9; }
}

/* ------------------------------------------------------------------ world */
.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100vh;
  background: #dfe3e3;
}
@supports (height: 100lvh) { .world { height: 100lvh; } }

.world-fallback { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #cfdbe4; }
.world-fallback img { position: absolute; display: block; }
.wf-sky { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wf-treeline, .wf-trees, .wf-branches { left: 50%; transform: translateX(-50%); min-width: 100%; }
.wf-treeline { bottom: 18%; width: 160vw; }
.wf-trees { bottom: -12%; width: 150vw; }
.wf-branches { top: 0; width: max(100vw, 178vh); }

/* ------------------------------------------------------------------ story */
.story { position: relative; z-index: 1; outline: none; }

.chapter {
  position: relative;
  height: var(--chapter-h, 180vh);
}
.chapter__stage {
  position: sticky;
  top: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  height: var(--stage-h);
  padding-inline: var(--gutter);
  padding-block: 72px;
}
@media (min-width: 900px) {
  .chapter[data-align="left"] .chapter__stage { justify-items: start; padding-left: max(6vw, 48px); }
  .chapter[data-align="right"] .chapter__stage { justify-items: end; padding-right: max(6vw, 48px); }
}

.scroll-cue {
  align-self: end;
  margin: 0 0 4vh;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: rgba(40, 46, 60, 0.72);
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.6);
}
.scroll-cue::after {
  content: "";
  width: 1px;
  height: 44px;
  background: linear-gradient(rgba(40, 46, 60, 0.7), rgba(40, 46, 60, 0));
  transform-origin: top;
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(12px); opacity: 0; }
}

/* ------------------------------------------------------------------ placeholders (next pass fills [data-fill]) */
.placeholder-card,
.guestbook-area {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(520px, 100%);
  min-height: min(56vh, 520px);
  max-height: calc(var(--stage-h) - 144px);
  overflow: auto;
  padding: 22px 24px 24px;
  background: var(--paper);
  border: 1.5px dashed var(--paper-edge);
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(30, 40, 60, 0.18);
  opacity: 0.35;
  transform: translate3d(0, 14px, 0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.placeholder-card--wide { width: min(1080px, 100%); }
.guestbook-area { width: min(760px, 100%); min-height: min(68vh, 640px); }
.chapter.is-current .placeholder-card,
.chapter.is-current .guestbook-area,
.chapter.is-current .video-frame { opacity: 1; transform: none; }

.placeholder-card__tag {
  align-self: flex-start;
  margin: 0;
  padding: 3px 8px;
  border-radius: 3px;
  background: #2b3a55;
  color: #eef2fa;
  font: 600 10.5px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.placeholder-card__label {
  margin: 0;
  font: 600 clamp(22px, 2.4vw, 30px)/1.15 var(--font-display);
  color: var(--ink);
}
.placeholder-card__note { margin: 0; color: var(--ink-soft); font-size: 14px; }
.placeholder-card__fill,
.guestbook-area__fill {
  flex: 1;
  min-height: 160px;
  border: 1px dashed rgba(46, 62, 92, 0.28);
  border-radius: 4px;
  background: repeating-linear-gradient(135deg, rgba(46, 62, 92, 0.04) 0 10px, transparent 10px 20px);
}

.video-frame {
  position: relative;
  margin: 0;
  width: min(1040px, 100%);
  padding: clamp(8px, 1.2vw, 14px);
  background: rgba(24, 30, 42, 0.92);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(20, 28, 44, 0.35);
  opacity: 0.35;
  transform: translate3d(0, 14px, 0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.video-frame__screen {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  aspect-ratio: 16 / 9;
  padding: 18px;
  border: 1.5px dashed rgba(220, 228, 245, 0.35);
  border-radius: 3px;
  background: #0d1119;
}
.video-frame__screen .placeholder-card__tag { background: #e8edf7; color: #1b2436; }
.video-frame__screen .placeholder-card__label { color: #e8edf7; }

/* ?scene-only: judge the artwork alone. Sections keep their heights, so the camera timing is unchanged. */
.scene-only .chapter__stage > * { visibility: hidden; }

/* ------------------------------------------------------------------ reduced motion: static */
@media (prefers-reduced-motion: reduce) {
  .entry__glow, .entry__chevron, .entry__invite, .scroll-cue::after { animation: none; }
  .entry__glow { opacity: 0.8; }
  .placeholder-card, .guestbook-area, .video-frame { transition: none; transform: none; }
}
