:root {
  color-scheme: dark;

  --cocoa-950: #0c0807;
  --cocoa-900: #140d0a;
  --cocoa-800: #1f1510;
  --brick: #503d35;
  --cream: #f3e9df;
  --cream-dim: rgba(243, 233, 223, 0.66);
  --cream-faint: rgba(243, 233, 223, 0.12);
  --wine: #6a1628;
  --wine-deep: #33080f;
  --blue: #2b2fe0;
  --blue-violet: #3b31cb;

  --serif: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* One phone-shaped column; on a phone it is simply the full width. */
  --col: min(100vw, calc(100svh * 9 / 16));
  --gutter: 20px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Driven by main.js */
  --p: 0;
  --shade: 0;
  --dim: 0;
}

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

html {
  background: var(--cocoa-950);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--cocoa-950);
  color: var(--cream);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }

/* ---------- Fixed layers ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  overflow: hidden;
}
.backdrop canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: blur(40px) saturate(1.3) brightness(0.62);
  transform: scale(1.2);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(12, 8, 7, 0.85) 100%);
}
@media (min-aspect-ratio: 10/16) {
  .backdrop { display: block; }
}

.stage {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 1;
  width: var(--col);
  /* Largest viewport, so no gap shows when the browser toolbar collapses. */
  height: 100vh;
  height: 100lvh;
  transform: translateX(-50%);
  overflow: hidden;
  background: var(--cocoa-900) url("../frames/f000.webp") center / cover no-repeat;
}
/* The poster only covers the gap before the first frame is painted. */
.drawn .stage { background-image: none; }
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* Bottom-up cocoa shade so the links read over the dress, then a full dim for the gallery. */
.shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 30%, rgba(12, 8, 7, 0.55) 52%, rgba(12, 8, 7, 0.94) 100%);
  opacity: var(--shade);
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cocoa-950);
  opacity: var(--dim);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.09;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* Static on purpose: an animated blended layer flickers in iOS Safari while scrolling. */
}

/* ---------- Header ---------- */

.top {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 5;
  width: var(--col);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) var(--gutter) 16px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top::before {
  content: "";
  position: absolute;
  inset: 0 0 -24px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(12, 8, 7, 0.92) 40%, transparent);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.past .top::before { opacity: 1; }

.top-mark {
  font: 400 15px/1 var(--serif);
  letter-spacing: 0.42em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.6s var(--ease);
}
.face .top-mark { opacity: 0; }

.lang {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(12, 8, 7, 0.38);
  border: 1px solid var(--cream-faint);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.lang button {
  min-width: 38px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--cream-dim);
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.lang button[aria-pressed="true"] {
  background: var(--cream);
  color: var(--cocoa-950);
}
.lang button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Column ---------- */

.column {
  position: relative;
  z-index: 2;
  width: var(--col);
  margin: 0 auto;
}

/* Scroll distance that scrubs the reel from heels to face. */
.reveal { height: 220svh; }

.reveal-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
  opacity: calc(1 - var(--p) * 5);
  pointer-events: auto;
}
.hint-line {
  position: relative;
  width: 1px;
  height: 40px;
  overflow: hidden;
  background: rgba(243, 233, 223, 0.25);
}
.hint-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cream);
  animation: drip 1.8s var(--ease) infinite;
}
@keyframes drip {
  0%   { transform: translateY(-100%); }
  60%  { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

/* Sits over the last 100svh of .reveal, so it is in place the moment the face arrives. */
.intro {
  position: relative;
  margin-top: -100svh;
  min-height: 100svh;
  padding: 36svh var(--gutter) 40px;
}

.js .reveal-item {
  opacity: 0;
  transform: translateY(18px);
  visibility: hidden;
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease),
    visibility 0s linear 0.8s,
    border-color 0.35s,
    box-shadow 0.35s;
}
html.face .reveal-item {
  opacity: 1;
  transform: none;
  visibility: visible;
  /* Stagger the entrance only; hover glow stays instant. */
  transition-delay: calc(var(--i) * 70ms), calc(var(--i) * 70ms), 0s, 0s, 0s;
}

.lockup {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-weight: 400;
  line-height: 0.86;
}
.lockup-name {
  font: 400 calc(var(--col) * 0.25) / 0.86 var(--serif);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}
.lockup-sub {
  align-self: flex-end;
  margin-top: -0.12em;
  margin-right: 0.2em;
  font: italic 400 calc(var(--col) * 0.085) / 1 var(--serif);
  color: var(--cream);
  text-shadow: 0 0 18px rgba(59, 49, 203, 0.9), 0 0 2px rgba(43, 47, 224, 0.8);
}

.tagline {
  margin: 14px 0 4px;
  font: italic 400 19px/1.3 var(--serif);
}
.bio {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

/* ---------- Links ---------- */

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link {
  display: grid;
  grid-template-columns: 40px 1fr 20px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 16px 9px 10px;
  border-radius: 18px;
  border: 1px solid var(--cream-faint);
  background: rgba(20, 13, 10, 0.45);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  color: var(--cream);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.link:hover,
.link:focus-visible {
  outline: none;
  border-color: rgba(59, 49, 203, 0.9);
  box-shadow: 0 0 0 1px rgba(43, 47, 224, 0.6), 0 10px 36px -10px rgba(43, 47, 224, 0.75);
}
html.face .link:active { transform: scale(0.985); transition-delay: 0s; }

.link--featured {
  border-color: rgba(243, 233, 223, 0.2);
  background: linear-gradient(120deg, var(--wine) 0%, var(--wine-deep) 100%);
  box-shadow: 0 12px 40px -14px rgba(106, 22, 40, 0.95);
}

.link-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(243, 233, 223, 0.08);
}
.link--featured .link-icon { background: rgba(243, 233, 223, 0.14); }

.link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.link svg .fill { fill: currentColor; stroke: none; }

.link-text { display: flex; flex-direction: column; min-width: 0; }
.link-label { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.link-meta { font-size: 12px; color: var(--cream-dim); }

.link-arrow { opacity: 0.6; transition: transform 0.35s var(--ease), opacity 0.35s; }
.link:hover .link-arrow { opacity: 1; transform: translate(2px, -2px); }

.link[aria-disabled="true"] { cursor: default; }
.link[aria-disabled="true"] .link-arrow { opacity: 0.25; }

/* ---------- Gallery ---------- */

.gallery { padding: 30svh 0 24px; }

.gallery h2 {
  margin: 0 var(--gutter) 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.gallery-track {
  display: flex;
  gap: 10px;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gallery-track::-webkit-scrollbar { display: none; }

.gallery figure {
  flex: 0 0 74%;
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--cocoa-800);
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.9);
}
.gallery img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.foot {
  padding: 28px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--cream-dim);
}

/* ---------- Reduced motion: skip the scrub, land on the face ---------- */

@media (prefers-reduced-motion: reduce) {
  .reveal { height: 100svh; }
  .hint { display: none; }
  .js .reveal-item { transition: none; }
}
