/* İçtihat.app · şov tasarımı · temel katman
   Yazı tipleri yerel (varlik/yazi), CDN yok. Renkler iki cilt (koyu/açık) olarak
   anlamsal değişkenlerle tanımlı; bölümler .koyu / .acik ile cilt değiştirir.
   Hareket yalnız transform + opacity. prefers-reduced-motion: her şey durur. */

@font-face {
  font-family: "Newsreader";
  src: url("../yazi/newsreader-var.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("../yazi/plex-sans-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../yazi/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../yazi/plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --yazi-serif: "Newsreader", "Iowan Old Style", "Times New Roman", Georgia, serif;
  --yazi-sans: "Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --yazi-mono: "Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --t-dev: clamp(2.875rem, 1.6rem + 4vw, 4.85rem);
  --t-h2: clamp(1.875rem, 1.3rem + 2.3vw, 3.25rem);
  --t-h3: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --t-lead: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --t-govde: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --t-kucuk: 0.9375rem;
  --t-mini: 0.8125rem;
  --t-sayi: clamp(2.5rem, 1.6rem + 3.4vw, 4.75rem);

  --b-1: 0.25rem; --b-2: 0.5rem; --b-3: 0.75rem; --b-4: 1rem; --b-5: 1.5rem;
  --b-6: 2rem; --b-7: 3rem; --b-8: 4rem; --b-9: 6rem; --b-10: 8rem;
  --bolum: clamp(4.5rem, 3rem + 6vw, 9rem);
  --oluk: clamp(1.125rem, 0.6rem + 2.6vw, 2.5rem);
  --kap: 78rem;
  --kap-dar: 44rem;

  --r-1: 4px; --r-2: 8px; --r-3: 14px; --r-4: 22px; --r-tam: 999px;

  --sure-1: 160ms; --sure-2: 320ms; --sure-3: 640ms; --sure-4: 1100ms;
  --egri: cubic-bezier(0.2, 0.7, 0.2, 1);
  --egri-cikis: cubic-bezier(0.16, 1, 0.3, 1);
  --hedef: 2.75rem;

  /* belge: her ciltte kâğıt kalır (gerçek doküman hissi) */
  --belge: #FBF8F1;
  --belge-2: #F3EEE3;
  --belge-murekkep: #1A222D;
  --belge-murekkep-2: #4B5563;
  --belge-murekkep-3: #5E6874;
  --belge-cizgi: rgba(26, 34, 45, 0.14);
  --belge-vurgu: #7A2E2E;
  --belge-dogru: #256A4C;
  --belge-dikkat: #7E5A0E;
  --belge-hata: #A3352F;
}

/* ---- Koyu cilt (kürsü) ---- */
.koyu, [data-cilt="koyu"] {
  --zemin: #0C121B;
  --zemin-2: #121A26;
  --zemin-3: #192432;
  --zemin-kart: #131C28;
  --murekkep: #F2ECDF;
  --murekkep-2: #CBC4B6;
  --murekkep-3: #A19B90;
  --vurgu: #D9B96E;
  --vurgu-2: #B79654;
  --vurgu-metin: #0C121B;
  --dogru: #86CFA5;
  --dikkat: #E9C36F;
  --hata: #EE9A90;
  --hata-zemin: rgba(238, 154, 144, 0.10);
  --dogru-zemin: rgba(134, 207, 165, 0.12);
  --dikkat-zemin: rgba(233, 195, 111, 0.12);
  --cizgi: rgba(242, 236, 223, 0.14);
  --cizgi-2: rgba(242, 236, 223, 0.26);
  --sahne: #F8F3E9;
  --sahne-2: #FFFDF8;
  --sahne-murekkep: #1A222D;
  --sahne-murekkep-2: #4B5563;
  --sahne-cizgi: rgba(26, 34, 45, 0.14);
  --golge: 0 30px 80px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.35);
  --golge-kucuk: 0 8px 24px rgba(0, 0, 0, 0.35);
  --odak: #F2ECDF;
  --secim: rgba(217, 185, 110, 0.35);
  color: var(--murekkep);
  background: var(--zemin);
}

/* ---- Açık cilt (kâğıt) ---- */
.acik, [data-cilt="acik"] {
  --zemin: #F6F1E7;
  --zemin-2: #FFFDF8;
  --zemin-3: #EEE7D8;
  --zemin-kart: #FFFDF8;
  --murekkep: #16202B;
  --murekkep-2: #465060;
  --murekkep-3: #5F6975;
  --vurgu: #7A2E2E;
  --vurgu-2: #5E2323;
  --vurgu-metin: #FFFDF8;
  --dogru: #256A4C;
  --dikkat: #7E5A0E;
  --hata: #A3352F;
  --hata-zemin: rgba(163, 53, 47, 0.08);
  --dogru-zemin: rgba(37, 106, 76, 0.10);
  --dikkat-zemin: rgba(126, 90, 14, 0.10);
  --cizgi: rgba(22, 32, 43, 0.14);
  --cizgi-2: rgba(22, 32, 43, 0.28);
  --sahne: #0F1722;
  --sahne-2: #151F2C;
  --sahne-murekkep: #F2ECDF;
  --sahne-murekkep-2: #C4BDAF;
  --sahne-cizgi: rgba(242, 236, 223, 0.16);
  --golge: 0 24px 60px rgba(22, 32, 43, 0.16), 0 2px 6px rgba(22, 32, 43, 0.08);
  --golge-kucuk: 0 8px 20px rgba(22, 32, 43, 0.10);
  --odak: #7A2E2E;
  --secim: rgba(122, 46, 46, 0.18);
  color: var(--murekkep);
  background: var(--zemin);
}

/* ---- Sıfırlama ---- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html[data-cilt="koyu"] { background: #0C121B; }
html[data-cilt="acik"] { background: #F6F1E7; }
body {
  margin: 0;
  font-family: var(--yazi-sans);
  font-size: var(--t-govde);
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--yazi-serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.05; font-optical-sizing: auto; }
h1 { font-size: var(--t-dev); font-weight: 400; letter-spacing: -0.025em; line-height: 0.98; }
h2 { font-size: var(--t-h2); line-height: 1.04; }
h3 { font-size: var(--t-h3); line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--secim); }
:focus-visible { outline: 2px solid var(--odak); outline-offset: 3px; border-radius: 2px; }
.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; }
.atla { position: absolute; left: var(--b-4); top: -4rem; z-index: 100; padding: var(--b-2) var(--b-4); background: var(--murekkep); color: var(--zemin); border-radius: var(--r-2); }
.atla:focus { top: var(--b-4); }

/* ---- Yapı ---- */
.kap { width: min(100% - 2 * var(--oluk), var(--kap)); margin-inline: auto; }
.kap-dar { width: min(100% - 2 * var(--oluk), var(--kap-dar)); margin-inline: auto; }
.bolum { padding-block: var(--bolum); position: relative; }
.goz {
  font-family: var(--yazi-mono); font-weight: 500; font-size: var(--t-mini);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--murekkep-3);
  display: block; line-height: 1.5;
}
.goz::before { content: ""; display: inline-block; vertical-align: middle; width: 1.75rem; height: 1px; margin-right: var(--b-3); background: var(--vurgu); }
.goz--sade::before { display: none; }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--murekkep-2); max-width: 36rem; text-wrap: pretty; }
.govde { color: var(--murekkep-2); max-width: 40rem; text-wrap: pretty; }
.mono { font-family: var(--yazi-mono); font-weight: 500; letter-spacing: 0.01em; }
.tnum { font-variant-numeric: tabular-nums; }
.baslik-kume { display: grid; gap: var(--b-4); max-width: 46rem; }
.baslik-kume h2 { text-wrap: balance; }

/* ---- Düğmeler ---- */
.dugme {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--b-2);
  min-height: 3.25rem; padding: 0 1.5rem; border-radius: var(--r-2);
  font-weight: 500; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: transform var(--sure-1) var(--egri), background-color var(--sure-1) var(--egri), color var(--sure-1) var(--egri), box-shadow var(--sure-1) var(--egri);
}
.dugme:hover { transform: translateY(-1px); }
.dugme:active { transform: translateY(0); }
.dugme--birincil { background: var(--vurgu); color: var(--vurgu-metin); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 10px 30px -10px var(--vurgu); }
.dugme--birincil:hover { background: var(--vurgu-2); color: var(--vurgu-metin); }
.koyu .dugme--birincil:hover { color: var(--vurgu-metin); }
.dugme--ikincil { background: transparent; color: var(--murekkep); box-shadow: inset 0 0 0 1px var(--cizgi-2); }
.dugme--ikincil:hover { box-shadow: inset 0 0 0 1px var(--murekkep); }
.dugme--kucuk { min-height: 2.5rem; padding: 0 1rem; font-size: var(--t-kucuk); }
.dugme svg { width: 1.125rem; height: 1.125rem; }
.baglanti { display: inline-flex; align-items: center; gap: var(--b-2); min-height: var(--hedef); font-weight: 500; text-decoration: underline; text-underline-offset: 0.25em; text-decoration-color: var(--cizgi-2); }
.baglanti:hover { text-decoration-color: currentColor; }

/* ---- Rozetler ---- */
.rozet {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 1.75rem; padding: 0 0.6rem;
  border-radius: var(--r-tam); font-family: var(--yazi-mono); font-size: var(--t-mini); font-weight: 600;
  letter-spacing: 0.04em; line-height: 1; white-space: nowrap;
}
.rozet--dogru { color: var(--dogru); background: var(--dogru-zemin); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dogru) 40%, transparent); }
.rozet--dikkat { color: var(--dikkat); background: var(--dikkat-zemin); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dikkat) 40%, transparent); }
.rozet--hata { color: var(--hata); background: var(--hata-zemin); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hata) 40%, transparent); }
.rozet--notr { color: var(--murekkep-2); box-shadow: inset 0 0 0 1px var(--cizgi-2); }

/* ---- Atmosfer ---- */
.doku::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  opacity: 0.08; mix-blend-mode: overlay;
}
.koyu.doku::before { opacity: 0.16; }
.doku > * { position: relative; z-index: 1; }

/* ---- Hareket: giriş ---- */
.js-hareket [data-gir] { opacity: 0; transform: translateY(22px); will-change: transform, opacity; }
.js-hareket [data-gir].gorunur { opacity: 1; transform: none; transition: opacity var(--sure-3) var(--egri-cikis), transform var(--sure-3) var(--egri-cikis); transition-delay: calc(var(--sira, 0) * 90ms); }
.js-hareket [data-gir].bitti { will-change: auto; }
[data-gir-kume] > * { --sira: 0; }

@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; }
  .js-hareket [data-gir] { opacity: 1; transform: none; }
}

/* Mobil menu acikken arka sayfa kaymasin; panel uzunsa kendi icinde kaysin (30.09 mobil QA #24) */
html.menu-acik, html.menu-acik body { overflow: hidden; }
html.menu-acik .ustbar__panel, html.menu-acik .pbar__panel { max-height: calc(100dvh - 4.5rem); overflow-y: auto; overscroll-behavior: contain; }
