/* PROJECT LUNA // mission-control x moonlight */
:root {
  --bg: #04060b;
  --navy: #0a1124;
  --ink: #e8ecf4;
  --silver: #a9b3c4;
  --dim: #5d677b;
  --line: rgba(200, 212, 235, 0.14);
  --glow: rgba(214, 226, 255, 0.55);
  --ok: #b9f0d6;
  --err: #ff8f8f;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #0b1430 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
  min-height: 100dvh;
}

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 33%{transform:translate(-3%,2%)} 66%{transform:translate(2%,-3%)} 100%{transform:translate(0,0)} }

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(14px + var(--safe-top)) 18px 26px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--silver);
  background: linear-gradient(to bottom, rgba(4,6,11,0.97) 0%, rgba(4,6,11,0.92) 62%, rgba(4,6,11,0) 100%);
  animation: fadeIn 1.2s ease both;
}
.hud[hidden] { display: none; }
.hud-left { display: flex; gap: 10px; align-items: center; }
#hud-moon { width: 28px; height: 28px; filter: drop-shadow(0 0 6px rgba(220,230,255,0.35)); }
.hud-title { color: var(--ink); font-weight: 500; }
.hud-phase { color: var(--dim); margin-top: 3px; }
.hud-right { text-align: right; }
.hud-label { color: var(--dim); }
.hud-count { color: var(--ink); font-size: 15px; margin-top: 3px; letter-spacing: 0.08em; transition: text-shadow .6s; }
.hud-count.bump { animation: bump 0.9s ease; }
.hud-count.infinite { font-size: 24px; line-height: 1; text-shadow: 0 0 14px var(--glow); }
.hud-cap { color: var(--silver); margin-top: 4px; min-height: 1em; }
@keyframes bump { 0%{text-shadow:0 0 0 transparent} 30%{text-shadow:0 0 18px #fff; color:#fff} 100%{text-shadow:0 0 0 transparent} }

/* ---------- footer ---------- */
.foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px calc(12px + var(--safe-bot));
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--dim);
  background: linear-gradient(to top, rgba(4,6,11,0.9), rgba(4,6,11,0));
}
.mute { all: unset; cursor: pointer; padding: 6px 0; color: var(--dim); }
.mute:focus-visible { outline: 1px solid var(--silver); }

/* ---------- stage ---------- */
.stage {
  position: relative; z-index: 5;
  min-height: 100dvh;
  max-width: 520px; margin: 0 auto;
  padding: calc(92px + var(--safe-top)) 24px calc(84px + var(--safe-bot));
  display: flex; flex-direction: column; justify-content: center;
  overflow-x: clip;
}
.scene { display: flex; flex-direction: column; gap: 18px; animation: sceneIn 0.9s ease both; }
.scene.out { animation: sceneOut 0.6s ease both; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sceneOut { to { opacity: 0; transform: translateY(-8px); filter: blur(4px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.center { align-items: center; text-align: center; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; line-height: 1.8; color: var(--silver); }
.mono.ink { color: var(--ink); }
.mono.dim { color: var(--dim); }
.mono.ok { color: var(--ok); }
.mono.err { color: var(--err); }
.label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; color: var(--dim); text-transform: uppercase; }
.title { font-family: var(--sans); font-weight: 200; font-size: clamp(28px, 8vw, 40px); letter-spacing: 0.32em; margin: 0; text-indent: 0.32em; }
.lead { font-size: 19px; line-height: 1.55; font-weight: 300; margin: 0; color: var(--ink); }
.lead.soft { color: var(--silver); }
.quote { font-size: 18px; line-height: 1.6; font-weight: 300; font-style: italic; color: var(--ink); margin: 0; }
.big { font-size: clamp(24px, 6.8vw, 32px); line-height: 1.35; font-weight: 200; margin: 0; }
.caret::after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 2px; color: var(--silver); }
@keyframes blink { 50% { opacity: 0; } }

.rule { height: 1px; background: var(--line); border: 0; margin: 4px 0; width: 100%; }

/* ---------- moon ---------- */
.moon-wrap { position: relative; display: grid; place-items: center; margin: 0 auto; }
.moon-wrap canvas { display: block; position: relative; z-index: 2; }
.moon-wrap::before {
  content: ""; position: absolute; inset: -30%; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle, rgba(200,215,255,var(--halo, 0.12)) 0%, rgba(200,215,255,0) 62%);
  transition: opacity 1.5s;
}
.moon-wrap.rise { animation: rise 3.5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(60px) scale(0.92); } to { opacity: 1; transform: none; } }
.moon-wrap.breathe canvas { animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { filter: drop-shadow(0 0 28px rgba(220,230,255,0.45)); } }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid rgba(220,230,250,0.4); background: rgba(10,17,36,0.4);
  color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: 0.28em;
  padding: 16px 22px; border-radius: 2px; cursor: pointer; text-transform: uppercase;
  transition: background .3s, border-color .3s, box-shadow .3s, opacity .3s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  min-height: 52px; width: 100%;
}
.btn:hover, .btn:focus-visible { border-color: #fff; box-shadow: 0 0 24px rgba(210,225,255,0.2); outline: none; }
.btn:active { background: rgba(220,230,255,0.12); }
.btn.ghost { border-color: var(--line); color: var(--silver); }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-row { display: flex; gap: 12px; width: 100%; }
.btn-row .btn { flex: 1; padding-left: 8px; padding-right: 8px; letter-spacing: 0.18em; }
.appear { animation: sceneIn 0.8s ease both; }

/* ---------- input ---------- */
.field { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.field label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--silver); line-height: 1.7; }
.input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(220,230,250,0.35);
  color: var(--ink); font-family: var(--mono); font-size: 18px; letter-spacing: 0.08em;
  padding: 12px 2px; border-radius: 0; outline: none; transition: border-color .3s;
}
.input:focus { border-color: #fff; }
.input::placeholder { color: var(--dim); }
.shake { animation: shake 0.45s; }
@keyframes shake { 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }
.status { min-height: 1.8em; }
.hint { border-left: 1px solid var(--silver); padding: 4px 0 4px 12px; }

/* ---------- panels / photos ---------- */
.panel {
  border: 1px solid var(--line); background: rgba(10,17,36,0.45); padding: 16px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); position: relative;
}
.panel::before, .panel::after { content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--silver); border-style: solid; }
.panel::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.photo-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0a0e18; overflow: hidden; border: 1px solid var(--line); }
.photo-frame canvas, .photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-frame .scan { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 0%, rgba(210,225,255,0.12) 50%, transparent 100%); background-size: 100% 30%; background-repeat: no-repeat; animation: scan 3s linear infinite; pointer-events: none; }
@keyframes scan { from { background-position: 0 -30%; } to { background-position: 0 130%; } }
.photo-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--dim); margin-top: 8px; }

.timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tl-item { all: unset; position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.tl-item .thumb { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; border: 1px solid var(--line); transition: border-color .3s, filter .3s, transform .3s; filter: grayscale(0.4) brightness(0.85); display: block; }
.tl-item.sel .thumb { border-color: #fff; filter: none; transform: translateY(-3px); }
.tl-item .badge { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; background: rgba(4,6,11,0.8); border: 1px solid var(--silver); opacity: 0; transition: opacity .3s; }
.tl-item.sel .badge { opacity: 1; }
.tl-item .date { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--dim); text-align: center; }
.timeline.done .tl-item .date { color: var(--ink); }
.timeline.done .tl-item .thumb { filter: none; border-color: rgba(255,255,255,0.5); }

/* ---------- radar (fiziksel bekleme) ---------- */
.radar { position: relative; width: 180px; height: 180px; margin: 0 auto; border-radius: 50%; border: 1px solid var(--line); overflow: hidden; }
.radar::before, .radar::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--line); }
.radar::before { inset: 25%; }
.radar::after { inset: 45%; background: var(--ink); box-shadow: 0 0 12px var(--glow); border: 0; }
.radar .sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(210,225,255,0.35), rgba(210,225,255,0) 25%); animation: spin 3.2s linear infinite; }
.radar .ping { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; animation: ping 3.2s ease-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0%,60% { opacity: 0; } 70% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- terminal (Beril.exe) ---------- */
.term { font-family: var(--mono); font-size: 14px; line-height: 2; letter-spacing: 0.04em; }
.term .row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed rgba(200,212,235,0.08); }
.term .row .k { color: var(--ink); }
.term .row .v { color: var(--ok); }
.term .row.locked .k { color: var(--dim); letter-spacing: 0; }
.term .row.locked .v { color: var(--dim); }
.term .meta { color: var(--dim); font-size: 11px; line-height: 1.8; }

.hold { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.hold .fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: rgba(220,230,255,0.18); pointer-events: none; }

/* ---------- progress ---------- */
.bar { width: 100%; height: 2px; background: var(--line); position: relative; overflow: hidden; }
.bar > i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--ink); box-shadow: 0 0 10px var(--glow); }

/* ---------- glitch ---------- */
.glitch { position: relative; color: var(--err); animation: glitch 2.4s infinite; }
@keyframes glitch {
  0%, 92%, 100% { transform: none; text-shadow: none; }
  93% { transform: translate(-2px, 1px); text-shadow: 2px 0 #7fd3ff, -2px 0 #ff7a9c; }
  95% { transform: translate(2px, -1px); text-shadow: -2px 0 #7fd3ff, 2px 0 #ff7a9c; }
  97% { transform: translate(-1px, 0); }
}
.flash { position: fixed; inset: 0; z-index: 50; background: #fff; pointer-events: none; animation: flash 1.2s ease-out both; }
@keyframes flash { from { opacity: 0.85; } to { opacity: 0; } }

/* ---------- empty file ---------- */
.void { position: relative; aspect-ratio: 4 / 3; border: 1px dashed rgba(220,230,250,0.25); display: grid; place-items: center; overflow: hidden; }
.void canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.18; }
.void span { position: relative; font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--silver); }

/* ---------- instax ---------- */
.instax {
  width: min(78vw, 300px); margin: 0 auto; background: #f4f2ec; padding: 14px 14px 0;
  aspect-ratio: 54 / 86; display: flex; flex-direction: column; border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(210,225,255,0.12);
  animation: eject 2.2s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes eject { from { opacity: 0; transform: translateY(-40px) rotate(-3deg) scale(0.96); clip-path: inset(0 0 100% 0); } 50% { opacity: 1; } to { opacity: 1; transform: rotate(-1.5deg); clip-path: inset(0 0 0 0); } }
.instax .img { position: relative; aspect-ratio: 46 / 62; width: 100%; background: #0b0d12; overflow: hidden; }
.instax .img .dev { position: absolute; inset: 0; background: radial-gradient(80% 70% at 50% 40%, #d9e3f7 0%, #8e9bb8 35%, #2a3348 75%, #141824 100%); opacity: 0; animation: develop 9s ease 2.4s both; }
.instax .img .dev::after { content: ""; position: absolute; left: 50%; top: 40%; width: 28%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #f7f9ff; box-shadow: 0 0 40px 10px rgba(255,255,255,0.5); opacity: 0.9; }
@keyframes develop { 0% { opacity: 0; filter: blur(14px) saturate(0); } 100% { opacity: 1; filter: blur(0) saturate(1); } }
.instax .cap { flex: 1; display: grid; place-items: center; color: #23262e; font-family: "Caveat", "Bradley Hand", "Segoe Print", cursive; font-size: clamp(17px, 5vw, 21px); letter-spacing: 0.02em; padding: 6px 0; text-align: center; }
.instax .cap small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: #8b8e96; margin-top: 2px; }

/* ---------- countdown ---------- */
.count { display: flex; gap: 14px; justify-content: center; font-family: var(--mono); }
.count div { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 56px; }
.count b { font-weight: 300; font-size: 34px; color: var(--ink); letter-spacing: 0.04em; }
.count span { font-size: 9px; letter-spacing: 0.24em; color: var(--dim); }

/* ---------- dev panel ---------- */
.dev { position: fixed; left: 8px; bottom: calc(40px + var(--safe-bot)); z-index: 60; display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; font-family: var(--mono); font-size: 10px; }
.dev button { all: unset; cursor: pointer; padding: 4px 6px; border: 1px solid #ff8f8f66; color: #ff8f8f; background: #04060bcc; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

.title.sm { font-size: clamp(19px, 6.2vw, 28px); letter-spacing: 0.22em; text-indent: 0.22em; line-height: 1.3; }
@media (max-width: 360px) {
  .stage { padding-left: 18px; padding-right: 18px; }
  .hud { padding-left: 14px; padding-right: 14px; }
  .btn { letter-spacing: 0.18em; }
  .btn-row { flex-direction: column; }
}
.hud-left { flex-shrink: 0; }
.hud-phase, .hud-title { white-space: nowrap; }
.hud-right { padding-left: 12px; }
.hud-cap { font-size: 9px; line-height: 1.5; }
.title:not(.sm) { white-space: nowrap; font-size: clamp(22px, 7vw, 40px); letter-spacing: 0.26em; text-indent: 0.26em; }
.scene > * { scroll-margin-top: 90px; scroll-margin-bottom: 90px; }
.field-row { display: flex; flex-direction: column; gap: 2px; }
.field-row label { display: flex; justify-content: space-between; }
.field-row .mark.ok { color: var(--ok); }
.field-row .mark.err { color: var(--err); }

/* Finaldeki arşiv: kutu, fışkıran fotoğraflar */
.burst { position: fixed; inset: 0; z-index: 30; pointer-events: none; perspective: 700px; opacity: 0; }
.vault-back, .vault-front, .vault-lid { position: absolute; left: 50%; width: 230px; transform-origin: top center; }
.vault-back { top: 56%; height: 150px; margin-left: -115px; background: #0b111d; border: 1px solid var(--line); box-shadow: inset 0 18px 30px rgba(0,0,0,.7), 0 0 50px rgba(160,190,255,.08); }
.vault-front { top: calc(56% + 34px); height: 116px; margin-left: -115px; background: linear-gradient(#121a2a, #0d1422); border: 1px solid rgba(220,230,250,.22); display: grid; place-items: center; }
.vault-front span, .vault-lid span { font-family: var(--mono); font-size: 10px; letter-spacing: .28em; color: var(--dim); }
.vault-lid { top: 56%; height: 34px; margin-left: -115px; background: #172033; border: 1px solid rgba(220,230,250,.28); display: grid; place-items: center; backface-visibility: hidden; }
.burst-cards { position: absolute; inset: 0; }
.burst-card { position: absolute; left: 0; top: 0; width: 58px; padding: 4px 4px 13px; background: #f3f0e8; border-radius: 2px; box-shadow: 0 6px 16px rgba(0,0,0,.55); will-change: transform; }
.burst-card img { display: block; width: 100%; aspect-ratio: 46 / 62; object-fit: cover; background: #222; }
.burst-count { position: absolute; z-index: 2; text-shadow: 0 0 6px #000, 0 0 12px #000; left: 0; right: 0; top: calc(56% + 176px); text-align: center; font-family: var(--mono); font-size: 12px; letter-spacing: .22em; color: var(--ink); }
.burst-count.ok { color: var(--ok); }
