/* ═══════════════════════════════════════════════════════════════
   OTOKOD · core.css
   Tasarım belirteçleri (token), sıfırlama, tipografi, tema.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Sıfırlama ───────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-synthesis-weight: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }

input, button, textarea, select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

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

a { color: inherit; text-decoration: none; }

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

h1, h2, h3, h4, h5 {
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.021em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

:target { scroll-margin-top: 96px; }

::selection {
  background: color-mix(in oklab, var(--accent) 34%, transparent);
  color: var(--text);
}

/* ── 2. Belirteçler ─────────────────────────────────────────── */
:root {
  /* Tipografi — iOS'ta SF Pro, Android'de Roboto, Windows'ta Segoe */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
             "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue",
             system-ui, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono",
               "JetBrains Mono", Consolas, monospace;

  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md:   1.0625rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.625rem;
  --fs-2xl:  2.125rem;
  --fs-3xl:  clamp(2.25rem, 1.4rem + 3.6vw, 4rem);

  /* Aralık ölçeği (4px tabanlı) */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.25rem;  --s-6: 1.5rem;   --s-7: 1.75rem;  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;    --s-16: 4rem;    --s-20: 5rem;    --s-24: 6rem;

  /* Köşe yarıçapları — iOS'un "sürekli köşe" hissi için cömert */
  --r-xs: 8px;   --r-sm: 12px;  --r-md: 18px;
  --r-lg: 24px;  --r-xl: 32px;  --r-2xl: 42px;
  --r-pill: 999px;

  /* Kap genişlikleri */
  --w-page: 1320px;
  --w-narrow: 780px;
  --w-gutter: clamp(16px, 4vw, 40px);

  /* Katmanlar */
  --z-base: 1;
  --z-sticky: 50;
  --z-header: 100;
  --z-dock: 110;
  --z-overlay: 500;
  --z-modal: 600;
  --z-toast: 900;

  /* Hareket — iOS yay eğrileri */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-slow: 420ms;

  /* Cam yoğunluğu (yönetim panelinden ayarlanır) */
  --blur: 26px;
  --blur-strong: 44px;
  --glass-sat: 180%;
}

/* Cam yoğunluk kademeleri */
[data-glass="1"] { --blur: 14px; --blur-strong: 24px; --glass-sat: 140%; }
[data-glass="2"] { --blur: 26px; --blur-strong: 44px; --glass-sat: 180%; }
[data-glass="3"] { --blur: 40px; --blur-strong: 64px; --glass-sat: 210%; }

/* ── 3. Koyu tema (varsayılan) ──────────────────────────────── */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #07080B;
  --bg-deep:   #050608;
  --bg-raise:  #0C0E14;

  --surface:      rgba(255, 255, 255, 0.045);
  --surface-2:    rgba(255, 255, 255, 0.075);
  --surface-3:    rgba(255, 255, 255, 0.115);
  --surface-solid:#11141B;

  --stroke:        rgba(255, 255, 255, 0.085);
  --stroke-strong: rgba(255, 255, 255, 0.17);
  --stroke-accent: color-mix(in oklab, var(--accent) 45%, transparent);

  --text:   #EEF0F5;
  --text-2: #A5ADBF;
  --text-3: #6C7486;
  --text-on-accent: #04110C;

  --sheen-top:    rgba(255, 255, 255, 0.16);
  --sheen-bottom: rgba(0, 0, 0, 0.32);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 28px 70px -28px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 0 1px var(--stroke-accent), 0 12px 40px -16px var(--accent-glow);

  --track:     rgba(255, 255, 255, 0.13);
  --grid-line: rgba(255, 255, 255, 0.032);
  --overlay:   rgba(4, 5, 8, 0.72);
}

/* ── 4. Açık tema ───────────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;

  --bg:        #EFF1F6;
  --bg-deep:   #E6E9F0;
  --bg-raise:  #FFFFFF;

  --surface:      rgba(255, 255, 255, 0.66);
  --surface-2:    rgba(255, 255, 255, 0.84);
  --surface-3:    rgba(255, 255, 255, 0.95);
  --surface-solid:#FFFFFF;

  --stroke:        rgba(9, 14, 28, 0.09);
  --stroke-strong: rgba(9, 14, 28, 0.17);

  --text:   #0E1119;
  --text-2: #4D5668;
  --text-3: #6B7486;
  --text-on-accent: #FFFFFF;

  --sheen-top:    rgba(255, 255, 255, 0.9);
  --sheen-bottom: rgba(9, 14, 28, 0.06);

  --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.07);
  --shadow-md: 0 12px 28px -12px rgba(16, 24, 40, 0.22);
  --shadow-lg: 0 30px 70px -30px rgba(16, 24, 40, 0.34);

  --track:     rgba(9, 14, 28, 0.13);
  --grid-line: rgba(9, 14, 28, 0.035);
  --overlay:   rgba(226, 230, 238, 0.7);
}

/* ── 5. Vurgu renkleri ──────────────────────────────────────── */
:root,
.accent-mint   { --accent: #2FDFA0; --accent-2: #17B7D6; --accent-glow: rgba(47, 223, 160, 0.42); }
.accent-violet { --accent: #9B7CFF; --accent-2: #5D7BFF; --accent-glow: rgba(155, 124, 255, 0.42); }
.accent-amber  { --accent: #FFB43D; --accent-2: #FF7A45; --accent-glow: rgba(255, 180, 61, 0.42); }
.accent-coral  { --accent: #FF6B5E; --accent-2: #FF3D8B; --accent-glow: rgba(255, 107, 94, 0.42); }
.accent-azure  { --accent: #49A6FF; --accent-2: #4ADEDE; --accent-glow: rgba(73, 166, 255, 0.42); }
.accent-rose   { --accent: #FF6FA5; --accent-2: #B06BFF; --accent-glow: rgba(255, 111, 165, 0.42); }
.accent-lime   { --accent: #B5E425; --accent-2: #38D98A; --accent-glow: rgba(181, 228, 37, 0.42); }
.accent-slate  { --accent: #9EB0CC; --accent-2: #6F8AB0; --accent-glow: rgba(158, 176, 204, 0.38); }

.accent-violet, .accent-coral, .accent-rose, .accent-slate { --text-on-accent: #0A0A14; }

/*
 * Açık temada aynı tonlar beyaz zeminde zayıf kalıyor: hem metin olarak
 * okunmuyorlar hem de düğme dolgusunda kontrast düşüyor. Bu yüzden açık
 * temada her vurgu için bir kademe koyu varyant kullanılır ve düğme
 * metni beyaza döner.
 */
[data-theme="light"] .accent-mint,   [data-theme="light"].accent-mint,
[data-theme="light"]:not(.accent-violet):not(.accent-amber):not(.accent-coral):not(.accent-azure):not(.accent-rose):not(.accent-lime):not(.accent-slate) {
  --accent: #0B8560; --accent-2: #0E7E96; --accent-glow: rgba(11, 133, 96, 0.34);
}
[data-theme="light"] .accent-violet, [data-theme="light"].accent-violet {
  --accent: #6D46EE; --accent-2: #3F5BE0; --accent-glow: rgba(109, 70, 238, 0.32);
}
[data-theme="light"] .accent-amber,  [data-theme="light"].accent-amber {
  --accent: #A96806; --accent-2: #B54F1B; --accent-glow: rgba(169, 104, 6, 0.3);
}
[data-theme="light"] .accent-coral,  [data-theme="light"].accent-coral {
  --accent: #D33726; --accent-2: #C91C64; --accent-glow: rgba(211, 55, 38, 0.3);
}
[data-theme="light"] .accent-azure,  [data-theme="light"].accent-azure {
  --accent: #1568CC; --accent-2: #0E8A9B; --accent-glow: rgba(21, 104, 204, 0.3);
}
[data-theme="light"] .accent-rose,   [data-theme="light"].accent-rose {
  --accent: #CE2F72; --accent-2: #8A46D6; --accent-glow: rgba(206, 47, 114, 0.3);
}
[data-theme="light"] .accent-lime,   [data-theme="light"].accent-lime {
  --accent: #5C7A05; --accent-2: #12925C; --accent-glow: rgba(92, 122, 5, 0.3);
}
[data-theme="light"] .accent-slate,  [data-theme="light"].accent-slate {
  --accent: #55698A; --accent-2: #3F5573; --accent-glow: rgba(85, 105, 138, 0.3);
}

[data-theme="light"] { --text-on-accent: #FFFFFF; }

/* Durum renkleri */
:root {
  --ok:    #2FDFA0;
  --warn:  #FFB43D;
  --error: #FF6B6B;
  --info:  #49A6FF;
  --gold:  #FFC94B;
}

/* ── 6. Sahne arka planı ────────────────────────────────────── */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Yumuşak ışık lekeleri — sayfaya derinlik verir */
body::before {
  background:
    radial-gradient(60rem 36rem at 12% -8%,  color-mix(in oklab, var(--accent) 16%, transparent), transparent 62%),
    radial-gradient(52rem 32rem at 92% 4%,   color-mix(in oklab, var(--accent-2) 13%, transparent), transparent 60%),
    radial-gradient(70rem 40rem at 50% 108%, color-mix(in oklab, var(--accent) 9%, transparent),  transparent 66%);
  opacity: 0.9;
  transition: opacity var(--t-slow) var(--ease-out);
}

/* İnce tanecik dokusu — düz yüzeylerdeki "plastik" hissi kırar */
body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
}

[data-theme="light"] body::after { opacity: 0.05; mix-blend-mode: multiply; }

/* ── 7. Kap ve yardımcılar ──────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--w-page);
  margin-inline: auto;
  padding-inline: var(--w-gutter);
  position: relative;
  z-index: var(--z-base);
}

.wrap--narrow { max-width: var(--w-narrow); }
.wrap--wide   { max-width: 1560px; }

.stack > * + * { margin-top: var(--flow, var(--s-4)); }

.row {
  display: flex;
  align-items: center;
  gap: var(--gap, var(--s-3));
}

.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }

.muted    { color: var(--text-2); }
.dim      { color: var(--text-3); }
.tnum     { font-variant-numeric: tabular-nums; }
.mono     { font-family: var(--font-mono); }
.nowrap   { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.clamp-2, .clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100px; left: var(--s-4);
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 650;
  transition: top var(--t-fast) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }

/* Odak halkası — klavye kullanıcıları için net, fare için sessiz */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ── 8. Kaydırma çubuğu ─────────────────────────────────────── */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: var(--r-pill);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--stroke-strong); background-clip: content-box; }
}

html { scrollbar-color: var(--surface-3) transparent; scrollbar-width: thin; }

/* Yatay kaydırma şeritleri */
.scroller {
  display: flex;
  gap: var(--s-4);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--w-gutter);
  padding-block: var(--s-2) var(--s-4);
  margin-inline: calc(var(--w-gutter) * -1);
  padding-inline: var(--w-gutter);
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ── 9. Hareket tercihi ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

[data-motion="0"] *,
[data-motion="0"] *::before,
[data-motion="0"] *::after {
  animation: none !important;
  transition: none !important;
}

/* ── 10. Yazdırma ───────────────────────────────────────────── */
@media print {
  body::before, body::after,
  .site-header, .dock, .site-footer, .fab { display: none !important; }
  body { background: #fff; color: #000; }
}
