/* Theme: each persona only overrides these variables (see [data-theme] blocks). */
:root {
  --bg: #0d0b0c;
  --text: #f1ebe4;
  --muted: #a89f97;
  --accent: #7a1e2b;
  --accent-hi: #902536;
  --accent-text: #fbf3ee;
  --line: rgba(241, 235, 228, 0.16);
  --glow: rgba(122, 30, 43, 0.34);
  --grain: 0.055;

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-theme="nessa"] {
  --bg: #06141d;
  --text: #e6f2f4;
  --muted: #8fb0bb;
  --accent: #1d6f8f;
  --accent-hi: #2381a6;
  --accent-text: #f2fbfd;
  --line: rgba(230, 242, 244, 0.16);
  --glow: rgba(35, 129, 166, 0.32);
  --grain: 0.045;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(48px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: var(--bg);
  isolation: isolate;
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Film grain: static SVG noise, nudged around so it reads as film, not texture. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain);
  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='.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); }
}

/* Full-screen photo, darkened toward the bottom so the buttons stay readable. */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    color-mix(in srgb, var(--bg) 70%, transparent) 72%,
    var(--bg) 100%
  );
}

.card {
  width: 100%;
  max-width: 400px;
  margin-top: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.actions {
  width: 100%;
  display: grid;
  gap: 12px;
}

.btn {
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: 0;
  border-radius: 14px;
  font: 500 1rem/1.25 var(--font-body);
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms var(--ease), background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.btn:active { transform: scale(0.97); }

.btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.btn--primary {
  min-height: 62px;
  font-size: 1.06rem;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 32px -12px var(--glow);
}

.btn--secondary {
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 0.93rem;
  box-shadow: inset 0 0 0 1px var(--line);
}

@media (hover: hover) {
  .btn--primary:hover { background: var(--accent-hi); transform: translateY(-1px); }
  .btn--secondary:hover { box-shadow: inset 0 0 0 1px var(--muted); }
  .btn:active { transform: scale(0.97); }
}

/* Entrance */
.reveal {
  animation: rise 800ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Age gate (markup is created by app.js) */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade 240ms ease both;
}

.gate[hidden] { display: none; }

.gate__panel {
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: rise 360ms var(--ease) both;
}

.gate__mark {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 0 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--accent);
  font: 600 1.35rem/1 var(--font-display);
  color: var(--text);
}

.gate__title {
  margin: 0 0 12px;
  font: 500 1.9rem/1.15 var(--font-display);
}

.gate__text {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.95rem;
}

.gate .actions { gap: 10px; }

@keyframes fade { from { opacity: 0; } }

body.is-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .reveal,
  .gate,
  .gate__panel { animation-duration: 1ms; animation-delay: 0ms; }
  .btn { transition: none; }
}
