/* The Birth of Eden. The water is the stage (canvas, fixed); the words float in it.
   One easing curve, transform + opacity only, strict CSP (no inline styles in the markup). */
@font-face { font-family: Cormorant; src: url(fonts/cormorant-400-italic.woff2) format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
[hidden] { display: none !important; }
:root {
  --deep: #03080b; --ink: #f4efe6; --ink-2: #cfd8d6; --mute: #8fa3a6;
  --pearl: #e9f3f1; --coral: #e2566a; --gold: #e3c27e; --line: rgba(233, 243, 241, .18);
  --ease: cubic-bezier(.22, .61, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--deep); color: var(--ink); font: 300 17px/1.6 Inter, system-ui, sans-serif; overflow-x: hidden; }

#water, .poster, .grain { position: fixed; inset: 0; width: 100%; height: 100%; }
#water { z-index: 0; display: none; }
.gl #water { display: block; }
.poster { z-index: 0; background: var(--deep) center / cover no-repeat url(/img/md/eden-034.webp); transition: background-image 1.2s var(--ease); }
.poster::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 30%, rgba(3, 8, 11, .85)); opacity: calc(.6 + var(--dark, 0) * .4); }
.poster.moon { background: radial-gradient(circle at 50% 45%, #d9d4cc 0 13vmin, rgba(220, 215, 205, .25) 14vmin, transparent 22vmin), var(--deep); }
.gl .poster { display: none; }
.grain { z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: repeating-radial-gradient(circle at 17% 32%, #fff 0 .5px, transparent .5px 2px), repeating-radial-gradient(circle at 71% 63%, #000 0 .5px, transparent .5px 2.5px); }

.top { position: fixed; z-index: 5; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) clamp(18px, 4vw, 44px) 0; pointer-events: none; }
.mark { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/1 Inter, sans-serif; letter-spacing: .34em; text-transform: uppercase; color: var(--pearl); }
.mark svg { width: 18px; height: 18px; fill: var(--pearl); opacity: .9; }
.lang { pointer-events: auto; display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; backdrop-filter: blur(10px); background: rgba(3, 8, 11, .25); }
.lang button { background: none; border: 0; color: var(--mute); font: 500 11px/1 Inter, sans-serif; letter-spacing: .12em; padding: 8px 11px; border-radius: 999px; cursor: pointer; }
.lang button.on { color: var(--deep); background: var(--pearl); }

.dots { position: fixed; z-index: 5; right: clamp(10px, 2vw, 22px); top: 50%; transform: translateY(-50%); display: grid; gap: 9px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--pearl); opacity: .25; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.dots i.on { opacity: .95; transform: scale(1.6); }

main { position: relative; z-index: 2; }
.ch { min-height: 120svh; display: grid; align-content: center; padding: 18vh clamp(22px, 7vw, 120px); }
.ch.tall { min-height: 160svh; }

/* arrival */
.arrive { min-height: 100svh; justify-items: center; text-align: center; align-content: end; padding-bottom: 16vh; }
.eyebrow { font: 500 11px/1 Inter, sans-serif; letter-spacing: .42em; text-transform: uppercase; color: var(--pearl); opacity: .8; margin: 0 0 22px; }
.title { font: 400 italic clamp(58px, 11vw, 168px)/.92 Cormorant, Georgia, serif; letter-spacing: -.01em; margin: 0; max-width: 11ch; text-wrap: balance;
  text-shadow: 0 0 60px rgba(160, 225, 230, .35), 0 2px 30px rgba(0, 0, 0, .5); }
.hint { margin: 28px 0 0; font-size: 13px; letter-spacing: .14em; color: var(--ink-2); opacity: .75; }
.drop { margin-top: 34px; width: 1px; height: 64px; background: linear-gradient(var(--pearl), transparent); animation: fall 2.6s var(--ease) infinite; }
@keyframes fall { 0% { transform: scaleY(0); transform-origin: top; opacity: 0; } 40% { transform: scaleY(1); opacity: 1; } 100% { transform: translateY(40px) scaleY(.2); opacity: 0; } }
.js .arrive > * { animation: surface 2.2s var(--ease) both; }
.js .arrive .title { animation-delay: .3s; } .js .arrive .hint { animation-delay: 1.4s; } .js .arrive .drop { animation: surface 1s 2s var(--ease) both, fall 2.6s 3s var(--ease) infinite; }
@keyframes surface { from { opacity: 0; transform: translateY(26px); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }

/* the lines: they surface one by one when the chapter arrives */
.say { display: grid; gap: .25em; max-width: 19ch; font: 400 italic clamp(34px, 5.4vw, 76px)/1.08 Cormorant, Georgia, serif; text-wrap: balance;
  text-shadow: 0 2px 34px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .3); }
.say.right { justify-self: end; text-align: right; }
.say.center, .small.center { justify-self: center; text-align: center; }
.say.low { align-self: end; }
.say.big { font-size: clamp(42px, 7vw, 108px); max-width: 14ch; }
.line { display: block; }
.say { position: relative; }
.say::before { content: ""; position: absolute; inset: -18% -22%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(3, 8, 11, .62), rgba(3, 8, 11, .3) 60%, transparent); filter: blur(6px); }
.wordsay { position: relative; }
.wordsay::before { content: ""; position: absolute; inset: -10% -40%; z-index: -1; background: radial-gradient(closest-side, rgba(3, 8, 11, .55), transparent); }
.moonch { align-content: end; padding-bottom: 22vh; }
.js .say .line { opacity: 0; transform: translateY(28px); filter: blur(8px); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease);
  transition-delay: calc(var(--i) * .9s + .15s); }
.js .in .say .line { opacity: 1; transform: none; filter: none; }
.say .line:last-child { color: var(--pearl); }
.small { font-size: 15px; color: var(--ink-2); max-width: 46ch; margin: 30px 0 0; text-shadow: 0 1px 14px rgba(0, 0, 0, .7); }
.js .moonch .small { opacity: 0; transition: opacity 1.6s 2.2s var(--ease); }
.js .moonch.in .small { opacity: 1; }

/* the five words: each breathes in, then the next */
.words { justify-items: center; text-align: center; }
.wordsay { display: grid; gap: .1em; font: 400 italic clamp(40px, 8vw, 120px)/1.05 Cormorant, Georgia, serif; }
.js .wordsay .w { opacity: 0; transform: scale(.94); filter: blur(12px); transition: opacity 1.6s var(--ease), transform 1.6s var(--ease), filter 1.6s var(--ease);
  transition-delay: calc(var(--i) * 1.1s); }
.js .in .wordsay .w { opacity: 1; transform: none; filter: none; }
.wordsay .w:nth-child(1) { color: #ffd9de; } .wordsay .w:nth-child(3) { color: var(--pearl); } .wordsay .w:nth-child(5) { color: var(--gold); }

/* panels */
.card, .home .head, .series .head { max-width: 640px; }
.card { justify-self: center; text-align: center; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--line); border-radius: 28px;
  background: rgba(3, 8, 11, .42); backdrop-filter: blur(18px) saturate(1.2); }
h2 { font: 400 italic clamp(40px, 5.6vw, 78px)/1 Cormorant, Georgia, serif; margin: 0 0 18px; text-wrap: balance; }
.body { color: var(--ink-2); font-size: clamp(16px, 1.4vw, 19px); max-width: 52ch; margin: 0 auto; }
.js .panel .card, .js .home .head, .js .series .head { opacity: 0; transform: translateY(30px); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
.js .in .card, .js .in .head { opacity: 1; transform: none; }

/* the series: a river of moments */
.series { min-height: 140svh; align-content: center; gap: 34px; padding-left: 0; padding-right: 0; }
.series .head { padding: 0 clamp(22px, 7vw, 120px); }
.river { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding: 10px clamp(22px, 7vw, 120px) 26px; scrollbar-width: none; }
.river::-webkit-scrollbar { display: none; }
.tile { flex: none; height: clamp(180px, 34vh, 340px); aspect-ratio: var(--r); border: 0; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer;
  scroll-snap-align: center; background: #0a1418; box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .8); transform: translateY(calc(sin(var(--i) * 1rad) * 14px));
  transition: transform .7s var(--ease), box-shadow .7s var(--ease); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease), filter 1.2s var(--ease); filter: saturate(.9) brightness(.92); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.06); filter: none; }
.tile:hover, .tile:focus-visible { box-shadow: 0 24px 60px -18px rgba(150, 220, 225, .35); outline: none; }

/* the collection */
.home { gap: 30px; justify-items: center; text-align: center; min-height: 140svh; }
.home .head { text-align: center; }
.tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); width: min(980px, 100%); }
.tier { display: grid; gap: 4px; padding: 20px 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(3, 8, 11, .45); backdrop-filter: blur(14px); }
.js .tier { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i) * .12s + .4s); }
.js .in .tier { opacity: 1; transform: none; }
.tier strong { font: 400 italic 38px/1 Cormorant, Georgia, serif; color: var(--pearl); }
.tier span { font-size: 13px; letter-spacing: .08em; color: var(--ink-2); }
.tier.live { grid-column: 1 / -1; border-color: rgba(227, 194, 126, .55); background: linear-gradient(120deg, rgba(227, 194, 126, .14), rgba(226, 86, 106, .1)); }
.tier.live strong { color: var(--gold); font-size: 48px; }
.tier em { font-style: normal; font-size: 14px; color: var(--ink); }
.soon { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 16px 30px; font: 500 15px/1 Inter, sans-serif; letter-spacing: .03em;
  text-decoration: none; cursor: pointer; border: 1px solid var(--line); color: var(--ink); background: rgba(3, 8, 11, .3); backdrop-filter: blur(10px);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn.gold { color: #1c1408; border-color: transparent; background: linear-gradient(120deg, #c9a45c, #f6e4b5 45%, #e3c27e 65%, #b48a3e); box-shadow: 0 14px 44px -14px rgba(227, 194, 126, .6); }

/* focus: one picture becomes the whole world */
.focus { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.focus .x, .focus-bar { pointer-events: auto; }
.focus .x { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(3, 8, 11, .4); color: var(--ink); font-size: 24px; cursor: pointer; backdrop-filter: blur(10px); }
.focus-bar { position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; justify-content: center; padding: 10px; border-radius: 999px; background: rgba(3, 8, 11, .45); backdrop-filter: blur(14px); border: 1px solid var(--line); }
.fname { font: 400 italic 22px/1 Cormorant, Georgia, serif; padding: 0 10px; }
.focus-bar .btn { padding: 12px 20px; font-size: 14px; }
body.focused main, body.focused .dots, body.focused .foot { opacity: 0; pointer-events: none; }
main, .dots, .foot { transition: opacity .8s var(--ease); }

.foot { position: relative; z-index: 2; padding: 40px clamp(22px, 7vw, 120px) max(28px, env(safe-area-inset-bottom)); text-align: center;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }

@media (max-width: 640px) {
  .ch { padding-left: 24px; padding-right: 24px; }
  .say { max-width: 100%; }
  .dots { display: none; }
  .tier.live strong { font-size: 40px; }
  .focus-bar { border-radius: 22px; width: calc(100% - 32px); }
  .fname { width: 100%; text-align: center; padding: 6px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; animation-delay: 0s !important; }
}
