/* ==========================================================================
   Gülcan için — shared styles
   Scene-specific CSS lives in each scene module (injected <style>, selectors
   prefixed with #scene-{id}). Only truly shared stuff belongs here.
   ========================================================================== */

:root {
  /* palette */
  --night: #070a1c;
  --navy: #0b1130;
  --indigo: #1a1650;
  --violet: #5b3fa0;
  --lavender: #b7a6e0;
  --rose: #ff8fab;
  --pink: #f4b6cf;
  --peach: #ffc9a3;
  --gold: #ffd98a;
  --cream: #fff4e3;
  --aqua: #8fe3e0;
  --teal: #4fb8c0;
  --plum: #3d1a38;
  --ink: #1d1530;
  --fur: #8a5a3c;

  /* sky gradient stops (animated by main.js) */
  --sky-a: #05070f;
  --sky-b: #080c1c;
  --sky-c: #0b1126;

  /* text on dark / light */
  --text: #fff4e3;
  --text-dim: rgba(255, 244, 227, .72);

  /* fonts */
  --f-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --f-script: "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --f-ui: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* layout */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --pad: clamp(20px, 6vw, 40px);

  --ease-soft: cubic-bezier(.22, .8, .24, 1);
}

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

html, body {
  margin: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--night);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button { font: inherit; color: inherit; }
img, svg, canvas { max-width: 100%; }

/* ---------- background layers ---------- */
#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 70% at 50% 108%, rgba(255, 255, 255, .05), transparent 60%),
    linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 55%, var(--sky-c) 100%);
}
#sky::after { /* soft vignette so text always has quiet edges */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 100% at 50% 50%, transparent 55%, rgba(5, 4, 20, .28) 100%);
  pointer-events: none;
}

#fx {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
}

/* ---------- stage + scenes ---------- */
#stage {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#stage::-webkit-scrollbar { display: none; }
#stage.locked { overflow-y: hidden; touch-action: none; }

.scene {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overflow: clip; /* clip wins where supported: unlike hidden, it can't be scrolled programmatically */
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

/* ---------- fixed chrome ---------- */
.chrome {
  opacity: 0;
  pointer-events: none;
  transition: opacity .9s var(--ease-soft), transform .9s var(--ease-soft);
}
body.unlocked .chrome { opacity: 1; }
body.unlocked .sound-btn { pointer-events: auto; }

.sound-btn {
  position: fixed;
  z-index: 20;
  top: calc(var(--safe-t) + 12px);
  right: calc(var(--safe-r) + 12px);
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 244, 227, .22);
  background: rgba(20, 14, 44, .38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--cream);
  cursor: pointer;
}
.sound-btn .mute-x { opacity: 0; transition: opacity .3s; }
.sound-btn.is-muted .mute-x { opacity: 1; }
.sound-btn.is-muted .wave { opacity: 0; }
.sound-btn .wave { transition: opacity .3s; }

.dots {
  position: fixed;
  z-index: 20;
  top: 50%;
  right: calc(var(--safe-r) + 8px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
body.unlocked .dots { transform: translateY(-50%); }
.dots i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 244, 227, .3);
  transition: background .5s, transform .5s var(--ease-soft), box-shadow .5s;
}
.dots i.on {
  background: var(--gold);
  transform: scale(1.5);
  box-shadow: 0 0 8px rgba(255, 217, 138, .7);
}

.hint {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(var(--safe-b) + 22px);
  max-width: calc(100vw - 48px);
  padding: 9px 20px;
  border-radius: 999px;
  font-family: var(--f-ui);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--cream);
  background: rgba(20, 14, 44, .42);
  border: 1px solid rgba(255, 244, 227, .2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .6s var(--ease-soft), transform .6s var(--ease-soft);
}
.hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
  animation: hint-bob 2.4s ease-in-out .6s infinite;
}
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}

/* ---------- typography helpers ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  font-variation-settings: "opsz" 96;
  letter-spacing: -.01em;
  line-height: 1.12;
  text-wrap: balance;
}
.display em, .display i { font-style: italic; font-weight: 300; }
.script {
  font-family: var(--f-script);
  font-weight: 500;
  line-height: 1.25;
}
.soft {
  font-family: var(--f-ui);
  font-weight: 400;
  color: var(--text-dim);
}
.eyebrow {
  font-family: var(--f-ui);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- components ---------- */
.glass {
  background: linear-gradient(160deg, rgba(255, 244, 227, .13), rgba(255, 244, 227, .05));
  border: 1px solid rgba(255, 244, 227, .2);
  border-radius: 22px;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(5, 4, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.tap-target {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* centered column used by most scenes */
.scene-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: calc(var(--safe-t) + 56px) var(--pad) calc(var(--safe-b) + 64px);
  text-align: center;
}

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

/* ---------- reusable keyframes ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float-rot { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 217, 138, .5)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 217, 138, .95)); }
}
@keyframes pulse-scale { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.anim-fade-up { animation: fade-up .9s var(--ease-soft) both; }
.anim-float { animation: float-y 4.6s ease-in-out infinite; }
.anim-twinkle { animation: twinkle 2.8s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hint.show { animation: none; }
}
