/* Geri sayım sayfası: siyah, dramatik bir gece. Tek renk vurgusu ay ışığının soğuk gümüşü. */
:root {
  --ink: #f2f0ea;
  --ink-soft: rgba(242, 240, 234, 0.62);
  --silver: #d9dbe2;
  --moon: #efe6cf;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(18px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ---------- gökyüzü ---------- */
.sky, #clouds, .shade, .grain { position: fixed; inset: 0; pointer-events: none; }
.sky {
  z-index: 0;
  /* koyu ama doygun gece mavisi: tepede neredeyse siyah lacivert, ufka doğru canlı ultramarin;
     ay çevresinde soğuk mavi ışıltı, ufukta çok hafif bir mor */
  background:
    radial-gradient(ellipse 45% 38% at 78% 14%, rgba(90, 130, 255, 0.22), rgba(40, 70, 200, 0.06) 45%, transparent 72%),
    radial-gradient(ellipse 95% 50% at 50% 110%, rgba(60, 50, 190, 0.38), transparent 72%),
    linear-gradient(180deg, #000208 0%, #01071d 28%, #031446 58%, #052070 82%, #0a2a8a 100%);
}
.sky__stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky__moon { position: absolute; top: 9vh; right: 12vw; }
.sky__moon-disc { width: 170px; height: 170px; }
.sky__moon-disc svg { display: block; width: 100%; height: 100%; overflow: visible; }
#clouds { z-index: 1; width: 100%; height: 100vh; height: 100lvh; bottom: auto; }

/* metin okunurluğu ve sinematik kadraj: kenarlar ve alt kısım derin siyaha iner */
.shade {
  z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(1, 3, 12, 0.6) 100%),
    linear-gradient(180deg, rgba(1, 3, 12, 0.25) 0%, transparent 30%, transparent 58%, rgba(2, 4, 16, 0.7) 100%);
}
.grain {
  inset: -10%;
  z-index: 3;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-1%, 3%); }
}

/* ---------- sahne ---------- */
.stage {
  position: relative; z-index: 4;
  height: 100vh; height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  padding: 0 var(--gutter) max(5vh, env(safe-area-inset-bottom));
  text-align: center;
}
.title {
  align-self: center;
  margin: 0;
  display: grid; justify-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  line-height: 0.88;
  color: #fbfaf6;
  text-shadow: 0 0 40px rgba(220, 225, 240, 0.28), 0 4px 70px rgba(0, 0, 0, 0.9);
}
.title__line { font-size: clamp(2rem, 6vw, 5.4rem); color: var(--silver); letter-spacing: 0.02em; }
.title__line--big { font-size: clamp(4.2rem, 16vw, 15rem); color: #fbfaf6; letter-spacing: -0.01em; }
.title .ch {
  display: inline-block;
  animation: breathe 7s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.42s);
}
@keyframes breathe {
  0%, 100% { opacity: 0.82; text-shadow: 0 0 18px rgba(220, 225, 240, 0.1); }
  50% { opacity: 1; text-shadow: 0 0 42px rgba(220, 225, 240, 0.45); }
}

/* ---------- geri sayım ---------- */
.count { display: grid; justify-items: center; gap: 22px; margin-bottom: 4vh; }
.count__clock { display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); }
.count__clock[hidden] { display: none; }
.unit { display: grid; justify-items: center; gap: 6px; min-width: 3.2ch; }
.unit__n {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  color: #fbfaf6;
}
.unit__l {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink-soft);
}
.sep { width: 1px; height: clamp(34px, 6vw, 56px); background: linear-gradient(transparent, rgba(220, 225, 240, 0.35), transparent); }

/* ---------- müzik ---------- */
.sound {
  position: fixed; z-index: 6;
  right: var(--gutter); bottom: max(22px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(220, 225, 240, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-soft);
  font: 500 10px/1 var(--sans);
  letter-spacing: 0.3em; text-transform: uppercase;
  cursor: pointer;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.sound:hover, .sound[aria-pressed="true"] { color: var(--ink); border-color: rgba(220, 225, 240, 0.5); }
.sound:focus-visible { outline: 1px solid var(--silver); outline-offset: 3px; }
.sound__bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sound__bars i { width: 2px; height: 3px; border-radius: 1px; background: currentColor; }
.is-playing .sound__bars i { animation: bars 1.1s ease-in-out infinite; }
.is-playing .sound__bars i:nth-child(2) { animation-delay: 0.2s; }
.is-playing .sound__bars i:nth-child(3) { animation-delay: 0.45s; }
.is-playing .sound__bars i:nth-child(4) { animation-delay: 0.1s; }
@keyframes bars { 0%, 100% { height: 3px; } 50% { height: 11px; } }

/* YouTube oynatıcısı her zaman görünmez durur (oynatma için en az 200×200 olmalı). */
.player {
  position: fixed; z-index: 7;
  right: var(--gutter); bottom: calc(max(22px, env(safe-area-inset-bottom)) + 52px);
  width: 200px; height: 200px;
  opacity: 0.001;
  pointer-events: none;
  border-radius: 14px;
  overflow: hidden;
  transition: opacity 0.6s var(--ease);
}
.player iframe { display: block; width: 100%; height: 100%; }

/* ---------- mobil ---------- */
@media (max-width: 720px) {
  .sky__moon { top: 8vh; right: 7vw; }
  .sky__moon-disc { width: 104px; height: 104px; }
  .count { gap: 16px; margin-bottom: 3vh; }
  .unit__l { font-size: 9px; letter-spacing: 0.2em; }
  /* altta sayaçla çakışmasın: müzik düğmesi sol üstte */
  .sound { top: max(16px, env(safe-area-inset-top)); bottom: auto; left: var(--gutter); right: auto; }
  .player { top: calc(max(16px, env(safe-area-inset-top)) + 50px); bottom: auto; left: var(--gutter); right: auto; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .title__line--big { font-size: 20vh; }
  .count { gap: 10px; margin-bottom: 1vh; }
  .unit__n { font-size: 9vh; }
  .sky__moon-disc { width: 80px; height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .title .ch { animation: none; }
}
