/* =====================================================================
   TEMEL: sıfırlama, tipografi, odak, erişilebilirlik, kabuk, gezinme
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--sans); min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--disp); line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; } h3 { font-size: 1.2rem; font-weight: 600; } h4 { font-size: 1rem; font-weight: 600; }
p { margin: .6em 0; } ul, ol { padding-left: 1.3em; margin: .6em 0; } li { margin: .25em 0; }
a { color: var(--accent); text-underline-offset: 3px; } a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
b, strong { font-weight: 600; } small, .small { font-size: .8125rem; } .muted { color: var(--muted); } .ok-t { color: var(--ok); }
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s4); top: -64px; z-index: 100; background: var(--accent); color: var(--onaccent); padding: var(--s3) var(--s4); border-radius: var(--r1); font-weight: 600; text-decoration: none; }
.skip:focus { top: var(--s2); }
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- üst çubuk ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { height: 100%; display: flex; align-items: center; gap: var(--s3); padding: 0 max(var(--s4), env(safe-area-inset-left)); max-width: 1500px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand svg { flex: none; } .brand-name { font: 700 1.0625rem var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.prog { display: flex; align-items: center; gap: var(--s2); font: 500 .75rem var(--mono); color: var(--muted); }
.prog-bar { width: 84px; height: 6px; border-radius: var(--rp); background: var(--raise); overflow: hidden; }
.prog-bar i { display: block; height: 100%; background: var(--accent); border-radius: var(--rp); transition: width var(--t2); }
.lvl { display: flex; align-items: center; gap: var(--s2); font: 500 .75rem var(--mono); }
.lv-n { background: var(--amber-soft); color: var(--amber); border-radius: var(--rp); padding: 2px 9px; font-weight: 600; }
.lv-t { color: var(--muted); } .lv-bar { width: 56px; height: 5px; border-radius: var(--rp); background: var(--raise); overflow: hidden; } .lv-bar i { display: block; height: 100%; background: var(--amber); }
.icon-btn { border: 1px solid var(--line); background: var(--panel); min-width: 44px; height: 44px; padding: 0 var(--s3); border-radius: var(--r1); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: 500 .75rem var(--mono); color: var(--ink); }
.icon-btn:hover { background: var(--panel2); }
#streak { font: 500 .75rem var(--mono); color: var(--amber); }

/* ---------- kabuk ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: calc(100vh - var(--top)); max-width: 1500px; margin: 0 auto; }
.rail { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); padding: var(--s4) var(--s2); display: flex; flex-direction: column; gap: var(--s1); border-right: 1px solid var(--line); }
.rl { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: var(--r2); text-decoration: none; color: var(--muted); font: 500 .75rem var(--sans); min-height: 56px; }
.rl:hover { background: var(--panel2); color: var(--ink); }
.rl.on { background: var(--accent-soft); color: var(--accent); }
.rl svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.main { min-width: 0; padding: var(--s6) var(--s5) var(--s8); }
.main:focus { outline: none; }
.page { max-width: 860px; margin: 0 auto; } .page.wide { max-width: 1120px; } .page.home { max-width: 1180px; }
.tabbar { display: none; }
.site-foot { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: center; margin: var(--s7) 0 var(--s4); font-size: .8125rem; color: var(--muted); }
.site-foot a { color: var(--muted); }
.stack { display: grid; gap: var(--s4); }
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .main { padding: var(--s5) var(--s4) calc(var(--tab) + var(--s7)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); }
  .tabbar .rl { border-radius: 0; min-height: var(--tab); padding: 8px 2px; justify-content: center; }
  .prog, .lv-t, .lv-bar { display: none; }
  .brand-name { font-size: 1rem; }
}
body.focus .rail, body.focus .tabbar, body.focus .top { display: none; }
body.focus .shell { grid-template-columns: minmax(0, 1fr); }
body.focus .main { padding: 0; }
