/* ============================================================
   SIRÇA — stil sistemi
   Karanlık, mahrem, zarif. Arayüz camın önünde bir fısıltıdır;
   asıl sahne arkadaki canvas'tır.
   ============================================================ */

:root {
  --bg: #08080d;
  --bg-soft: #0d0d15;
  --ink: #e8e4dd;
  --ink-dim: #9a958c;
  --ink-faint: #5a564f;
  --amber: #ffb36b;
  --ember: #ff7a45;
  --cool: #7a8fb3;
  --violet: #8b7ab8;
  --line: rgba(232, 228, 221, 0.14);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Cam (canvas) ---------- */
#glass {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* ---------- Kenar nabzı (haptik fallback) ---------- */
#edge-pulse {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 90px 22px rgba(255, 179, 107, 0.55);
  transition: opacity 140ms ease-out;
}
#edge-pulse.cool { box-shadow: inset 0 0 90px 22px rgba(122, 143, 179, 0.5); }

/* ---------- Görünüm iskeleti ---------- */
.view {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 22px) 26px calc(var(--safe-bottom) + 26px);
  text-align: center;
  animation: view-in 700ms ease both;
}
.view[hidden] { display: none; }
.view-clear { pointer-events: none; justify-content: flex-start; }
.view-clear > * { pointer-events: auto; }

.view { animation: view-in 850ms cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); filter: blur(6px); }
  60% { filter: blur(0); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

.v-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
.v-top { padding-top: 8px; }
.v-bottom { padding-bottom: 4px; }
.v-scroll {
  flex: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}

/* ---------- Tipografi ---------- */
.brand {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(58px, 17vw, 86px);
  letter-spacing: 0.04em;
  line-height: 1;
  background: linear-gradient(160deg, #f4efe6 20%, #d8b28a 60%, #8b7ab8 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-dim);
  margin-top: -12px;
  letter-spacing: 0.06em;
}

.lede {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-dim);
  max-width: 300px;
}

.ritual-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 5.6vw, 25px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.5;
  max-width: 320px;
  text-wrap: balance;
}

.hint {
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.7;
  max-width: 280px;
  letter-spacing: 0.02em;
}

.foot-note {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
}

/* ---------- Butonlar ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(232, 228, 221, 0.04);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.22em;
  padding: 15px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 300ms ease, border-color 300ms ease, transform 150ms ease, opacity 300ms;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn:active { transform: scale(0.965); }
.btn:hover { background: rgba(232, 228, 221, 0.09); border-color: rgba(232, 228, 221, 0.3); }
.btn:focus-visible { outline: 1px solid var(--amber); outline-offset: 3px; }

.btn-primary {
  border-color: rgba(255, 179, 107, 0.45);
  background: linear-gradient(140deg, rgba(255, 179, 107, 0.16), rgba(139, 122, 184, 0.12));
  box-shadow: 0 0 34px rgba(255, 156, 88, 0.12);
}
.btn-primary:hover { border-color: rgba(255, 179, 107, 0.75); box-shadow: 0 0 44px rgba(255, 156, 88, 0.2); }

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  font-size: 12px;
}
.btn-ghost:hover { color: var(--ink-dim); background: transparent; border-color: var(--line); }

/* ---------- Mühür ---------- */
.seal {
  position: relative;
  width: min(46vw, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: none;
}
.seal-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.seal-track { fill: none; stroke: rgba(232, 228, 221, 0.1); stroke-width: 1.5; }
.seal-fill {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
  filter: drop-shadow(0 0 6px rgba(255, 179, 107, 0.7));
}
.seal-core {
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, rgba(232, 228, 221, 0.14), rgba(139, 122, 184, 0.08) 55%, transparent 75%);
  border: 1px solid rgba(232, 228, 221, 0.1);
  animation: seal-breathe 4.2s ease-in-out infinite;
  transition: transform 300ms ease;
}
.seal-core-warm {
  background: radial-gradient(circle at 42% 38%, rgba(255, 179, 107, 0.22), rgba(255, 122, 69, 0.08) 55%, transparent 75%);
  border-color: rgba(255, 179, 107, 0.2);
}
.seal.holding .seal-core {
  animation: none;
  transform: scale(0.9);
  box-shadow: 0 0 44px rgba(255, 179, 107, 0.22), inset 0 0 26px rgba(255, 179, 107, 0.12);
  border-color: rgba(255, 190, 130, 0.35);
  transition: transform 600ms cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 900ms ease, border-color 900ms ease;
}
.seal.holding .seal-fill { filter: drop-shadow(0 0 12px rgba(255, 179, 107, 0.9)); }

.seal.done .seal-core { animation: seal-done 1s cubic-bezier(0.22, 1, 0.36, 1) both; }
.seal.done .seal-ring { animation: seal-ring-done 1s ease-out both; }

@keyframes seal-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes seal-done {
  0% { transform: scale(0.9); box-shadow: 0 0 44px rgba(255, 179, 107, 0.25); }
  45% { transform: scale(1.14); box-shadow: 0 0 90px rgba(255, 210, 160, 0.55), inset 0 0 40px rgba(255, 200, 150, 0.3); }
  100% { transform: scale(1.04); box-shadow: 0 0 54px rgba(255, 179, 107, 0.3); }
}

@keyframes seal-ring-done {
  0% { transform: rotate(-90deg) scale(1); opacity: 1; }
  100% { transform: rotate(-90deg) scale(1.22); opacity: 0; }
}

/* ---------- Davet kartı ---------- */
.invite-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 20px;
  background: rgba(13, 13, 21, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.invite-label {
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.invite-link {
  font-size: 15px;
  color: var(--amber);
  word-break: break-all;
  line-height: 1.5;
  font-weight: 400;
  -webkit-user-select: all;
  user-select: all;
}

.invite-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.invite-actions .btn { padding: 11px 20px; font-size: 11.5px; }

.qr-wrap {
  padding: 14px;
  border-radius: 16px;
  background: rgba(232, 228, 221, 0.05);
  border: 1px solid var(--line);
}
.qr-wrap img { width: 164px; height: 164px; display: block; }

.waiting-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-dim);
}

.dots i { animation: dot-fade 1.8s infinite; font-style: normal; }
.dots i:nth-child(2) { animation-delay: 0.3s; }
.dots i:nth-child(3) { animation-delay: 0.6s; }
@keyframes dot-fade { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* ---------- Oturum arayüzü ---------- */
.session-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fade-in 1.4s ease both;
}

.presence { display: flex; align-items: center; gap: 8px; }
.presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background 600ms ease, box-shadow 600ms ease;
}
.presence-dot.here {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 179, 107, 0.8);
  animation: presence-breathe 3.4s ease-in-out infinite;
}
.presence-dot.away { background: var(--cool); box-shadow: 0 0 8px rgba(122, 143, 179, 0.5); animation: none; }
.presence-dot.gone { background: var(--ink-faint); box-shadow: none; animation: none; }

@keyframes presence-breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

.presence-text { font-size: 11px; letter-spacing: 0.16em; color: var(--ink-dim); }

.session-tools { display: flex; gap: 6px; }
.tool {
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-faint);
  font-size: 15px;
  cursor: pointer;
  transition: color 300ms, border-color 300ms;
}
.tool:hover { color: var(--ink-dim); border-color: var(--line); }
.tool.on { color: var(--amber); }

/* ---------- Fısıltı ---------- */
.whisper {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(19px, 5.4vw, 24px);
  color: var(--ink);
  text-shadow: 0 0 24px rgba(8, 8, 13, 0.9);
  opacity: 0;
  transform: translateX(-50%) translateY(10px) scale(0.98);
  transition: opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1), transform 1100ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  width: max-content;
  max-width: 86vw;
  text-align: center;
  text-wrap: balance;
  letter-spacing: 0.03em;
  z-index: 12;
}
.whisper.show {
  opacity: 0.94;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ---------- Mod çubuğu ---------- */
.modes {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 18px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(13, 13, 21, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 700ms ease, transform 700ms ease;
  z-index: 11;
}
.modes.faded { opacity: 0.06; transform: translateX(-50%) translateY(6px); }

.mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 400ms, background 400ms;
  white-space: nowrap;
}
.mode-btn.active { color: var(--ink); background: rgba(255, 179, 107, 0.13); }

/* ---------- Özet ---------- */
.summary-stats {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 12px;
  background: rgba(13, 13, 21, 0.5);
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  color: var(--amber);
  margin-bottom: 4px;
}
.stat span { font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-faint); text-transform: uppercase; }

.keepsake { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#keepsake-canvas {
  width: min(64vw, 250px);
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.summary-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-bottom: 8px; }

/* ---------- Perde & bildirim ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(8, 8, 13, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fade-in 600ms ease both;
}
.overlay[hidden] { display: none; }

.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 86px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(13, 13, 21, 0.85);
  border: 1px solid var(--line);
  padding: 10px 20px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  animation: toast-in 300ms ease both;
  max-width: 84vw;
  text-align: center;
}
.toast[hidden] { display: none; }

@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Erişilebilirlik ---------- */
@media (prefers-reduced-motion: reduce) {
  .seal-core, .presence-dot.here, .dots i { animation: none !important; }
  .view { animation-duration: 1ms; }
}

/* Masaüstü ipucu: deneyim dar bir dikey çerçevede yaşar */
@media (min-width: 900px) {
  .foot-note::after { content: ' — masaüstünde fare de iş görür'; }
}
