/* Welcome and landing pages: the scene behind them, and their scroll effects. */
:root { --accent: #e5345a; --tint-a: rgba(22,14,48,.1); --tint-b: rgba(12,9,20,.55); --hero-fade: 1; }

@view-transition { navigation: auto; }

/* ---------------------------------------------------------------- the scene */
.amb {
  position: absolute; inset: 0; overflow: hidden; isolation: isolate; background: #07060b;
  --px: 0; --py: 0; --sy: 0;
}
.amb-media {
  position: absolute; will-change: transform;
  transform: translate3d(calc(var(--px) * -18px), calc(var(--sy) * 0.32px + var(--py) * -12px), 0) scale(1.06);
  opacity: 0; transition: opacity 1.8s ease;
}
.amb.ready .amb-media { opacity: 1; }
.amb-drift { position: absolute; inset: 0; animation: amb-drift 60s ease-in-out infinite alternate; transform-origin: 62% 35%; }
@keyframes amb-drift { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, .6%); } }
.amb-img { width: 100%; height: 100%; display: block; }

/* The ruby heart in the picture beats: thump-thump, then a slow swell. */
.amb-pulse {
  position: absolute; width: 7%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255,120,140,.95) 0%, rgba(229,52,90,.55) 22%, rgba(229,52,90,0) 62%);
  animation: heartbeat 1.7s ease-out infinite;
}
@keyframes heartbeat {
  0%   { opacity: .25; transform: translate(-50%, -50%) scale(.85); }
  7%   { opacity: .95; transform: translate(-50%, -50%) scale(1.25); }
  15%  { opacity: .45; transform: translate(-50%, -50%) scale(1); }
  22%  { opacity: .85; transform: translate(-50%, -50%) scale(1.15); }
  45%  { opacity: .5;  transform: translate(-50%, -50%) scale(1.5); }
  100% { opacity: .25; transform: translate(-50%, -50%) scale(.85); }
}

.amb-tint { position: absolute; inset: 0; background: linear-gradient(180deg, var(--tint-a) 0%, var(--tint-b) 100%); }
.amb-weather {
  position: absolute; inset: -4%; width: 108%; height: 108%; pointer-events: none;
  transform: translate3d(calc(var(--px) * -34px), calc(var(--py) * -20px), 0);
}
.amb-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 55% 40%, transparent 45%, rgba(4,3,8,.75) 100%);
}

/* Film grain over everything: quiet, but it takes the digital edge off. */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%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)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* A thin violet-crimson seam, the rift that opens the book. */
.rift {
  display: block; height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, #7a3cff 20%, var(--accent) 55%, #ffd1dc 70%, transparent);
  box-shadow: 0 0 14px rgba(229,52,90,.5);
  transform-origin: 0 50%;
}

/* ---------------------------------------------------------------- static top menu bar */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 10px;
  background: rgba(9, 7, 14, 0.5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.site-nav-inner {
  width: 100%; max-width: 56rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
}
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.nav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px; border-radius: 999px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: rgba(243,237,228,.88);
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.nav-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.36); background: rgba(255, 255, 255, 0.1); }
.nav-btn:active { transform: scale(.98); }
.nav-btn[aria-current="page"],
.nav-btn[aria-expanded="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 6px 22px rgba(229, 52, 90, 0.35);
}
.nav-btn svg { width: 15px; height: 15px; flex: none; }
.nav-btn .nav-heart {
  width: 16px; height: 17px; stroke: none;
  filter: drop-shadow(0 0 6px rgba(229, 52, 90, 0.55));
}

@media (max-width: 600px) {
  .site-nav { padding: max(8px, env(safe-area-inset-top)) 10px 8px; }
  .site-nav-inner { justify-content: center; gap: 6px; }
  .nav-links { justify-content: center; gap: 6px; }
  .nav-btn { min-height: 36px; padding: 0 11px; font-size: 12.5px; gap: 6px; }
}

/* ---------------------------------------------------------------- reveals */
[data-reveal] {
  opacity: 0; transform: translateY(28px); filter: blur(6px);
  transition: opacity 1s ease, transform 1.1s cubic-bezier(.2,.75,.2,1), filter 1s ease;
  transition-delay: calc(var(--i, 0) * 90ms);
}
[data-reveal].in { opacity: 1; transform: none; filter: none; }
.rift[data-reveal] { transform: scaleX(0); filter: none; transition: transform 1.6s cubic-bezier(.6,0,.2,1), opacity .4s; }
.rift[data-reveal].in { transform: scaleX(1); }
[data-words] .word {
  display: inline-block; opacity: 0; transform: translateY(.4em); filter: blur(4px);
  transition: opacity .8s ease, transform .9s ease, filter .8s ease;
  transition-delay: calc(var(--i) * 70ms);
}
[data-words].in .word { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-words] .word { opacity: 1 !important; transform: none !important; filter: none !important; }
  .grain { animation: none; }
}
