/* ════════════════════════════════════════════════════════════
   CodeVocab — ortak temel: renkler, tema, tipografi, butonlar
   Hem sohbet uygulaması (app.css) hem içerik sayfaları (site.css)
   bu dosyanın üstüne kurulur.
   ════════════════════════════════════════════════════════════ */

:root,
[data-theme="dark"] {
  --bg: #000;
  --bg-elev: #09090a;
  --surface: #111113;
  --surface-2: #19191c;
  --surface-3: #222226;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f5f5f6;
  --text-2: #a3a3ab;
  --text-3: #6a6a73;
  --invert: #fff;
  --invert-text: #000;
  --accent: #ff3fa4;
  --accent-2: #ff8ad0;
  --accent-soft: rgba(255, 63, 164, 0.14);
  --good: #4ade80;
  --info: #60a5fa;
  --warn: #fbbf24;
  --bad: #f87171;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.45);
  --dot: rgba(255, 255, 255, 0.07);
  --glow-1: rgba(255, 63, 164, 0.16);
  --glow-2: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-elev: #f3f3f4;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --surface-3: #e9e9ec;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --text: #0a0a0a;
  --text-2: #52525b;
  --text-3: #8b8b94;
  --invert: #0a0a0a;
  --invert-text: #fff;
  --accent: #e3268b;
  --accent-2: #f472b6;
  --accent-soft: rgba(227, 38, 139, 0.1);
  --good: #16a34a;
  --info: #2563eb;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.06);
  --dot: rgba(0, 0, 0, 0.07);
  --glow-1: rgba(227, 38, 139, 0.1);
  --glow-2: rgba(0, 0, 0, 0.03);
  color-scheme: light;
}

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

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: #fff;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

img {
  max-width: 100%;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

a {
  color: inherit;
}

code,
kbd,
.mono {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ───────── Logo: koyu temada beyaz, açık temada orijinal ───────── */

[data-theme="dark"] .logo-light,
[data-theme="light"] .logo-dark {
  display: none !important;
}

/* ───────── Butonlar ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}

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

.btn-primary {
  background: var(--invert);
  color: var(--invert-text);
}

.btn-primary:hover {
  opacity: 0.86;
}

.btn-outline {
  border: 1px solid var(--border-strong);
}

.btn-outline:hover {
  background: var(--surface-2);
}

.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-2);
  transition: background 0.12s, color 0.12s;
}

.icon-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(8px);
  font-size: 13px;
  color: var(--text-2);
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ───────── Arka plan efekti: maskeli nokta ızgara + yumuşak ışık ───────── */

.bg-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 75%);
}

.bg-fx::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -260px;
  width: 900px;
  height: 520px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, var(--glow-1), transparent 70%),
    radial-gradient(closest-side at 70% 60%, var(--glow-2), transparent 70%);
  filter: blur(20px);
  animation: breathe 9s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.65;
    transform: translateX(-50%) scale(1.06);
  }
}

/* ───────── Toast ───────── */

.toast-stack {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--invert);
  color: var(--invert-text);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

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