/* ==========================================================
   Kablodan Boşluğa: görsel sistem
   "Mavi baskı + ölçü aleti": Prusya mavisi teknik çizim kâğıdı,
   ince ızgara, VNA ekranı gibi sahneler, koaks bakırı vurgu.
   Renk bir sözlüktür ve bütün sitede sabittir:
   ileri dalga = sodyum sarısı, yansıyan = camgöbeği, toplam = beyaz,
   E = gül, H = çivit, R = kemik, +X = mor, −X = turkuaz.
   ========================================================== */

:root {
  --bg: #0b1f33;          /* mavi baskı kâğıdı */
  --bg-deep: #081726;
  --stage: #0e2740;       /* ölçü ekranı */
  --panel: #13314f;       /* düğme yüzeyi */
  --line: #21466a;        /* çizim çizgisi */
  --line-2: #2e5a82;
  --grid: rgba(150, 196, 235, 0.07);
  --ink: #eaf1f4;         /* tebeşir beyazı */
  --ink-2: #a9bfcf;
  --muted: #6f8aa2;
  --copper: #ee8f5f;      /* koaks bakırı: arayüz vurgusu */
  --fwd: #ffd257;         /* ileri giden dalga */
  --ref: #5ad1ff;         /* yansıyan dalga */
  --tot: #f7f7f2;         /* toplam / duran dalga */
  --e: #ff5d8f;           /* elektrik alanı */
  --hf: #7d8cff;          /* manyetik alan */
  --r: #e6d3a3;           /* direnç */
  --xp: #c58cff;          /* endüktif reaktans (+X) */
  --xn: #2fd5b5;          /* kapasitif reaktans (−X) */
  --ok: #8fe08a;
  --bad: #ff6a5c;

  --f-display: "Archivo", "Arial Narrow", sans-serif;
  --f-body: "Literata", Georgia, serif;
  --f-num: "JetBrains Mono", ui-monospace, monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --bar-h: 66px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: clamp(15px, 0.66vw + 6.8px, 18px);
  line-height: 1.62;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
/* teknik çizim kâğıdı: 8 mm'lik ana ızgara ve 1,6 mm'lik ara çizgiler */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(110% 80% at 75% 35%, rgba(90, 160, 220, 0.07), transparent 65%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 80px 80px,
    linear-gradient(rgba(150, 196, 235, 0.025) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(90deg, rgba(150, 196, 235, 0.025) 1px, transparent 1px) 0 0 / 16px 16px;
}

button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; border-radius: 3px; }
.tnum, output, .val { font-variant-numeric: tabular-nums; }

/* ---------- Slayt kabı ---------- */
#deck { position: fixed; inset: 0 0 var(--bar-h) 0; z-index: 1; }
.slide {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) 1.26fr;
  gap: clamp(20px, 3vw, 52px);
  padding: clamp(22px, 4.2vh, 52px) var(--gutter) clamp(14px, 2.6vh, 28px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.2,.7,.2,1), visibility 0s linear 0.5s;
  transform: translateX(24px);
}
.slide.before { transform: translateX(-24px); }
.slide.active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.2,.7,.2,1), visibility 0s;
}
.slide.wide { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.slide.center { grid-template-columns: 1fr; place-items: center; text-align: center; }
body.text-hidden .slide:not(.center) { grid-template-columns: 0 1fr; gap: 0; }
body.text-hidden .slide:not(.center) .text { display: none; }

/* ---------- Metin sütunu ---------- */
.text {
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  max-width: 58ch;
  align-self: start;
  max-height: 100%;
}
/* bölüm etiketi: teknik çizimin antet kutusundaki pafta numarası gibi */
.chapter-tag {
  font-family: var(--f-display);
  font-weight: 500;
  font-stretch: 112%;
  font-size: 0.86rem;
  color: var(--ink-2);
  margin: 0 0 0.8rem;
  display: inline-flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line-2);
  border-radius: 2px;
}
.chapter-tag b {
  display: inline-grid; place-items: center;
  min-width: 2em; padding: 0.1em 0.45em;
  border-right: 1px solid var(--line-2);
  color: var(--copper); font-weight: 700; font-family: var(--f-num); font-size: 0.92em;
}
.chapter-tag { line-height: 1.6; padding-right: 0.7em; }
.chapter-tag b { margin-right: 0.6em; }

h1, h2, h3 { font-family: var(--f-display); margin: 0 0 0.9rem; }
h1 {
  font-size: clamp(3.2rem, 7.6vw, 8rem); font-weight: 800; font-stretch: 125%;
  line-height: 0.9; letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(2.05rem, 3.3vw, 3.5rem); font-weight: 700; font-stretch: 118%;
  line-height: 1.02; letter-spacing: -0.015em;
}
h3 { font-size: 1.2rem; font-weight: 700; font-stretch: 110%; margin: 1.4rem 0 0.4rem; }
.text p { margin: 0 0 0.9em; color: var(--ink-2); }
.text p.lead { color: var(--ink); font-size: 1.1em; line-height: 1.52; }
.text strong { color: var(--ink); font-weight: 600; }
.text em { color: var(--ink); }
.text ul, .text ol { padding-left: 1.15em; margin: 0 0 1em; color: var(--ink-2); }
.text li { margin-bottom: 0.35em; }
.text li::marker { color: var(--copper); }
.text a { color: var(--ink); text-decoration-color: var(--muted); text-underline-offset: 3px; }
.text a:hover { text-decoration-color: var(--copper); }
.num, .text code, .text .mono { font-family: var(--f-num); font-size: 0.88em; font-variant-numeric: tabular-nums; }
.text code { background: rgba(255,255,255,.05); padding: 0 .3em; border-radius: 3px; }

/* renk dili: metin içinde de aynı anlam */
.c-fwd { color: var(--fwd); font-weight: 600; }
.c-ref { color: var(--ref); font-weight: 600; }
.c-tot { color: var(--tot); font-weight: 600; }
.c-e { color: var(--e); font-weight: 600; }
.c-h { color: var(--hf); font-weight: 600; }
.c-r { color: var(--r); font-weight: 600; }
.c-xp { color: var(--xp); font-weight: 600; }
.c-xn { color: var(--xn); font-weight: 600; }
.c-cu { color: var(--copper); font-weight: 600; }

/* "Daha fazla": formüller ve ayrıntı */
details.more {
  margin: 1.1rem 0 0.6rem;
  border-left: 1px solid var(--line-2);
  padding: 0.1rem 0 0.1rem 1rem;
}
details.more summary {
  cursor: pointer;
  font-family: var(--f-display); font-weight: 600; font-stretch: 110%; font-size: 0.98rem;
  color: var(--ink);
  list-style: none;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: inline-block; width: 1.1em; color: var(--copper); font-family: var(--f-num); }
details.more[open] summary::before { content: "−"; }
details.more p, details.more ul { margin-top: 0.6rem; font-size: 0.95em; }
.formula {
  display: block; margin: 0.5rem 0 0.8rem; padding: 0.5rem 0.8rem;
  border: 1px solid var(--line); border-left: 2px solid var(--copper);
  background: rgba(8, 23, 38, 0.55);
  font-family: var(--f-num); font-size: 0.86em; font-variant-numeric: tabular-nums;
  color: var(--ink); white-space: nowrap; overflow-x: auto;
}

/* "Dene" kutusu */
.try {
  margin-top: 1.1rem;
  padding: 0.7rem 1rem;
  border-radius: var(--r-sm);
  background: rgba(238, 143, 95, 0.07);
  border: 1px solid rgba(238, 143, 95, 0.32);
  color: var(--ink);
  font-size: 0.95em;
}
.try::before { content: "Dene: "; font-family: var(--f-display); font-weight: 700; font-stretch: 112%; color: var(--copper); }

aside.notes { display: none; }

/* ---------- Sahne: ölçü aleti ekranı ---------- */
.stage {
  position: relative;
  min-height: 0; min-width: 0;
  border-radius: var(--r-md);
  background:
    radial-gradient(90% 80% at 50% 45%, rgba(90, 160, 220, 0.07), transparent 75%),
    var(--stage);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 0 0 4px rgba(8, 23, 38, 0.6), inset 0 0 0 5px var(--line), 0 24px 60px rgba(2, 10, 20, 0.45);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.stage.bare { background: transparent; border: 0; box-shadow: none; }
.stage canvas { display: block; }
.stage .fill { flex: 1; min-height: 0; position: relative; }
.stage .fill > canvas, .stage .fill > svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.controls {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 18px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: rgba(8, 23, 38, 0.6);
  font-family: var(--f-display);
  font-size: 0.88rem;
}
.controls.top { border-top: 0; border-bottom: 1px solid var(--line); }
.controls .spacer { flex: 1; }
.controls label, .controls .lab { color: var(--ink-2); }
label.sl { display: inline-flex; align-items: center; gap: 9px; }

.btn {
  font-family: var(--f-display); font-weight: 600; font-stretch: 108%; font-size: 0.88rem;
  padding: 0.45em 1em;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--copper); color: #1f0d03; border-color: var(--copper); }
.btn.primary:hover { background: #f6a376; }
.btn.on { border-color: var(--copper); color: var(--copper); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.ghost { background: rgba(8, 23, 38, 0.6); }
.btn.big { font-size: 1.02rem; padding: 0.75em 1.35em; display: inline-flex; align-items: center; gap: 0.55em; }
.btn.big svg { width: 1.2em; height: 1.2em; }

/* segment seçici: ölçü aletinin kademe anahtarı */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-deep); padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 0.3em 0.8em; border-radius: 3px; cursor: pointer;
  font-family: var(--f-display); font-weight: 600; font-size: 0.84rem; color: var(--ink-2);
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg-deep); }

/* aç/kapa düğmesi: küçük gösterge lambası */
.tog {
  display: inline-flex; align-items: center; gap: 0.5em;
  border: 1px solid var(--line-2); background: var(--bg-deep); color: var(--ink-2);
  border-radius: var(--r-sm); padding: 0.3em 0.8em 0.3em 0.6em; cursor: pointer;
  font-family: var(--f-display); font-weight: 600; font-size: 0.84rem;
}
.tog::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--line-2); transition: background .15s, box-shadow .15s; }
.tog[aria-pressed="true"] { color: var(--ink); border-color: var(--ink-2); }
.tog[aria-pressed="true"]::before { background: var(--copper); box-shadow: 0 0 8px var(--copper); }
.tog.c-fwd[aria-pressed="true"]::before { background: var(--fwd); box-shadow: 0 0 8px var(--fwd); }
.tog.c-ref[aria-pressed="true"]::before { background: var(--ref); box-shadow: 0 0 8px var(--ref); }
.tog.c-tot[aria-pressed="true"]::before { background: var(--tot); box-shadow: 0 0 8px var(--tot); }
.tog.c-e[aria-pressed="true"]::before { background: var(--e); box-shadow: 0 0 8px var(--e); }
.tog.c-h[aria-pressed="true"]::before { background: var(--hf); box-shadow: 0 0 8px var(--hf); }
.tog[class*="c-"] { font-weight: 600; }

/* kaydırıcı: ince ölçü cetveli, bakır topuz */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 140px; height: 24px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: var(--line-2); }
input[type="range"]::-moz-range-track { height: 2px; border-radius: 1px; background: var(--line-2); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--copper); margin-top: -6.5px; border: 3px solid var(--bg-deep);
  box-shadow: 0 0 0 1px var(--copper);
}
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--copper); border: 3px solid var(--bg-deep); box-shadow: 0 0 0 1px var(--copper); }
/* renkli kaydırıcılar: seçici özgüllüğü genel kuralı yenmeli */
input[type="range"].c-fwd::-webkit-slider-thumb { background: var(--fwd); box-shadow: 0 0 0 1px var(--fwd); }
input[type="range"].c-ref::-webkit-slider-thumb { background: var(--ref); box-shadow: 0 0 0 1px var(--ref); }
input[type="range"].c-r::-webkit-slider-thumb { background: var(--r); box-shadow: 0 0 0 1px var(--r); }
input[type="range"].c-xp::-webkit-slider-thumb { background: var(--xp); box-shadow: 0 0 0 1px var(--xp); }
input[type="range"].c-xn::-webkit-slider-thumb { background: var(--xn); box-shadow: 0 0 0 1px var(--xn); }
input[type="range"].c-e::-webkit-slider-thumb { background: var(--e); box-shadow: 0 0 0 1px var(--e); }
input[type="range"].c-h::-webkit-slider-thumb { background: var(--hf); box-shadow: 0 0 0 1px var(--hf); }
input[type="range"].c-fwd::-moz-range-thumb { background: var(--fwd); }
input[type="range"].c-ref::-moz-range-thumb { background: var(--ref); }
input[type="range"].c-r::-moz-range-thumb { background: var(--r); }
input[type="range"].c-xp::-moz-range-thumb { background: var(--xp); }
input[type="range"].c-xn::-moz-range-thumb { background: var(--xn); }
input[type="range"].c-e::-moz-range-thumb { background: var(--e); }
input[type="range"].c-h::-moz-range-thumb { background: var(--hf); }
.val { font-family: var(--f-num); font-size: 0.82rem; color: var(--ink); min-width: 4.6em; display: inline-block; }

/* ---------- Alt çubuk: iletim hattı ---------- */
#bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--bar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
  z-index: 5;
  font-family: var(--f-display);
  font-size: 0.86rem;
  color: var(--ink-2);
  background: linear-gradient(180deg, transparent, rgba(8, 23, 38, 0.75) 35%);
}
#bar .chapter-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 230px; font-weight: 500; font-stretch: 108%; font-size: 0.95rem; }
#bar .chapter-name b { color: var(--copper); font-weight: 700; font-family: var(--f-num); font-size: 0.9em; }
/* hat: iki ince iletken, bölümler arasında konnektör çizgisi, slaytlar çentik */
#progress {
  position: relative;
  flex: 1; min-width: 0;
  display: flex; gap: 0; align-items: stretch;
  height: 40px;
  padding: 0 8px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
#progress::-webkit-scrollbar { display: none; }
#progress::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 9px; height: 5px;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  pointer-events: none;
}
#progress .ch {
  display: flex; flex-direction: column; justify-content: flex-start;
  flex: var(--n) 1 0; min-width: max(calc(var(--n) * 12px), 4.6em);
  position: relative;
  padding: 0 3px;
}
#progress .ch::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 3px; height: 15px;
  background: var(--line-2); border-radius: 1px;
}
#progress .ch:first-of-type::before { display: none; }
#progress .ticks { display: flex; height: 23px; align-items: center; }
#progress .dot {
  flex: 1; height: 100%; min-width: 8px; border: 0; padding: 0; cursor: pointer; background: transparent; position: relative;
}
#progress .dot::after {
  content: ""; position: absolute; left: 50%; top: 9px; width: 1px; height: 5px; background: rgba(169, 191, 207, 0.4);
  transition: background .2s, height .2s, top .2s;
}
#progress .dot.seen::after { background: var(--fwd); opacity: 0.55; }
#progress .dot:hover::after { top: 5px; height: 13px; background: var(--ink); opacity: 1; }
#progress .band {
  font-weight: 500; font-stretch: 100%; font-size: 0.76rem;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; padding: 2px 0 0 4px;
}
/* geçerli slayt: hat üzerinde ilerleyen sarı darbe */
#dial-needle {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; pointer-events: none;
  transition: transform 0.6s cubic-bezier(.3,.8,.25,1);
}
#dial-needle::before {
  content: ""; position: absolute; left: -9px; top: 6px; width: 18px; height: 11px;
  background: radial-gradient(50% 50% at 50% 50%, var(--fwd) 0 30%, rgba(255, 210, 87, 0.35) 60%, transparent 72%);
  filter: drop-shadow(0 0 6px rgba(255, 210, 87, 0.7));
}
#bar .counter { font-family: var(--f-num); font-size: 0.8rem; min-width: 4.6em; text-align: right; color: var(--ink); }
.iconbtn {
  width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; color: var(--ink);
}
.iconbtn:hover { border-color: var(--ink-2); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn.on { border-color: var(--copper); color: var(--copper); }

/* ---------- Notlar paneli ---------- */
#notes {
  position: fixed; right: var(--gutter); bottom: calc(var(--bar-h) + 10px);
  width: min(460px, calc(100vw - 32px)); max-height: 45vh; overflow: auto;
  background: #eaf1f4; color: #10263b;
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-size: 1rem; line-height: 1.5;
  z-index: 6;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: none;
}
#notes.open { display: block; }
#notes h4 { margin: 0 0 6px; font-family: var(--f-display); font-weight: 700; font-size: 0.9rem; color: #a2481d; }
#notes ul { margin: 0; padding-left: 1.1em; }

/* ---------- Genel bakış ---------- */
#overview {
  position: fixed; inset: 0; z-index: 8;
  background: rgba(8, 23, 38, 0.97);
  overflow: auto;
  padding: 40px var(--gutter) 60px;
  display: none;
}
#overview.open { display: block; }
#overview h2 { font-size: 2.2rem; margin-bottom: 1.4rem; }
#overview .ov-ch { margin-bottom: 26px; }
#overview .ov-ch h3 { margin: 0 0 10px; color: var(--ink-2); font-size: 1.1rem; }
#overview .ov-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
#overview .ov-item {
  text-align: left; padding: 9px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--stage); cursor: pointer;
  font-family: var(--f-display); font-size: 0.92rem; color: var(--ink);
  display: flex; gap: 10px;
}
#overview .ov-item:hover { border-color: var(--ink-2); }
#overview .ov-item span { color: var(--muted); font-family: var(--f-num); font-size: 0.8rem; padding-top: 1px; min-width: 1.6em; }
#overview .ov-item.cur { border-color: var(--copper); }
#overview .keys { color: var(--ink-2); font-size: 0.92rem; margin-top: 24px; }
kbd {
  font-family: var(--f-num); font-size: 0.8em; border: 1px solid var(--line-2); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 6px; background: var(--panel); color: var(--ink);
}

/* ---------- Kapak ---------- */
.cover { padding: 0; }
.cover .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover .stage { position: absolute; inset: 0; border-radius: 0; }
.cover .cover-text {
  position: relative; z-index: 2; pointer-events: none;
  text-align: left; align-self: end; justify-self: start;
  padding: 0 var(--gutter) 5vh;
  max-width: 1100px;
}
.cover .cover-text > * { pointer-events: auto; }
.cover h1 { margin-bottom: 1rem; text-shadow: 0 6px 50px rgba(8, 23, 38, 0.95); }
.cover .sub { font-size: 1.28rem; color: var(--ink); max-width: 44ch; margin: 0 0 0.6rem; text-shadow: 0 2px 20px rgba(8,23,38,.9); }
.cover p { font-size: 1.04rem; color: var(--ink-2); max-width: 52ch; margin: 0 0 1.3rem; text-shadow: 0 2px 20px rgba(8,23,38,.9); }
.cover .byline { font-family: var(--f-display); font-weight: 600; font-stretch: 115%; font-size: 1.15rem; color: var(--ink); margin-bottom: 1.3rem; }
.cover-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 1.1rem; }
.cover .hint { font-size: 0.9rem; color: var(--muted); }

/* ---------- Duyarlı ---------- */
@media (max-width: 860px) {
  :root { --bar-h: 60px; }
  body { overflow: auto; }
  #deck { position: relative; inset: auto; }
  .slide {
    position: relative; inset: auto; display: none;
    grid-template-columns: 1fr !important; grid-auto-rows: auto;
    padding: 22px 16px 100px; transform: none !important;
  }
  .slide.active { display: grid; }
  .text { max-height: none; overflow: visible; padding-right: 0; }
  .stage { min-height: 72vh; }
  .cover { min-height: calc(100svh - var(--bar-h)); }
  .cover .cover-text { padding-bottom: 4vh; }
  #bar { gap: 8px; background: var(--bg-deep); border-top: 1px solid var(--line); padding: 0 10px; }
  #bar .chapter-name, #bar .counter { display: none; }
  #bar #btn-text, #bar #btn-notes { display: none; }
  .iconbtn { width: 34px; height: 34px; }
  body.text-hidden .slide .text { display: block; }
  .controls { padding: 10px 12px; gap: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .slide, .slide.active { transition: opacity 0.2s; transform: none; }
  #dial-needle { transition: none; }
}

/* ---------- Sözlük balonları ---------- */
.term {
  color: inherit;
  text-decoration: underline dotted rgba(238, 143, 95, 0.75);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: help;
  border-radius: 3px;
}
.term:hover, .term:focus-visible { background: rgba(238, 143, 95, 0.12); text-decoration-color: var(--copper); outline: none; }
#gloss {
  position: fixed; z-index: 20;
  width: min(330px, calc(100vw - 24px));
  padding: 12px 14px;
  background: #102b47;
  border: 1px solid var(--line-2);
  border-top: 2px solid var(--copper);
  border-radius: var(--r-sm);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-family: var(--f-body); font-size: 0.9rem; line-height: 1.45; color: var(--ink-2);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
#gloss.open { opacity: 1; transform: none; pointer-events: auto; }
#gloss h4 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 700; font-size: 1rem; color: var(--ink); }
#gloss p { margin: 0 0 8px; }
#gloss a { font-family: var(--f-display); font-size: 0.82rem; font-weight: 600; color: var(--copper); text-decoration: none; }
#gloss a:hover { text-decoration: underline; }

/* ---------- Sesli anlatım çubuğu ---------- */
#narrator {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 8px); z-index: 7;
  transform: translate(-50%, 12px);
  width: min(640px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px 7px 7px;
  background: rgba(16, 43, 71, 0.95);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  font-family: var(--f-display); font-size: 0.82rem; color: var(--ink-2);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#narrator.open { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.np-play {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--copper); color: #1f0d03; display: grid; place-items: center;
}
.np-play svg { width: 18px; height: 18px; }
.np-track { flex: 1; min-width: 60px; height: 4px; border-radius: 2px; background: var(--line-2); cursor: pointer; position: relative; }
.np-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--fwd); box-shadow: 0 0 8px rgba(255,210,87,.5); }
.np-time { font-family: var(--f-num); font-size: 0.76rem; color: var(--ink); white-space: nowrap; }
.np-auto { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.np-auto input { accent-color: var(--copper); }
.np-status:empty { display: none; }
.np-status { color: var(--copper); white-space: nowrap; }
.np-close { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 6px; }
.np-close:hover { color: var(--ink); }
@media (max-width: 860px) {
  #narrator { flex-wrap: wrap; }
  .np-auto { order: 5; }
}
body.narrating #deck { bottom: calc(var(--bar-h) + 58px); transition: bottom .2s; }
@media (max-width: 860px) { body.narrating #deck { bottom: auto; padding-bottom: 90px; } }

/* ---------- Deney rehberi ---------- */
#ghost-hand {
  position: fixed; left: 0; top: 0; z-index: 30; width: 34px; height: 34px;
  pointer-events: none; opacity: 0; transition: opacity .25s;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.5));
}
#ghost-hand svg { width: 100%; height: 100%; transition: transform .12s; transform-origin: 34% 12%; }
#ghost-hand.on { opacity: .95; }
#ghost-hand.down svg { transform: scale(.86); }
.ghost-ripple {
  position: fixed; z-index: 29; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 2px solid var(--copper); pointer-events: none; animation: ghostRipple .6s ease-out forwards;
}
@keyframes ghostRipple { to { transform: scale(3.6); opacity: 0; } }
#guide-ring {
  position: fixed; z-index: 6; pointer-events: none; border: 2px solid var(--copper); opacity: 0;
}
#guide-ring.on { animation: guidePulse 1.3s ease-out 3; }
#guide-ring.on.still { animation: none; opacity: 1; box-shadow: 0 0 0 4px rgba(238,143,95,.18), 0 0 22px rgba(238,143,95,.35); }
@keyframes guidePulse {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(238,143,95,.55); }
  70% { opacity: .9; box-shadow: 0 0 0 14px rgba(238,143,95,0); }
  100% { opacity: 0; box-shadow: 0 0 0 14px rgba(238,143,95,0); }
}
.try.try-live { cursor: pointer; position: relative; padding-right: 92px; transition: background .2s, border-color .2s; }
.try.try-live:hover, .try.try-live:focus-visible { background: rgba(238,143,95,.14); border-color: rgba(238,143,95,.6); outline: none; }
.try-cta {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-display); font-weight: 700; font-size: 0.8rem; color: #1f0d03;
  background: var(--copper); border-radius: var(--r-sm); padding: 4px 11px 4px 9px;
}
.try-cta::before { content: ""; width: 0; height: 0; border-left: 7px solid #1f0d03; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
#guide-toast {
  position: fixed; left: 50%; top: 22px; transform: translate(-50%, -10px); z-index: 40;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 16px;
  font-family: var(--f-display); font-size: .88rem; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#guide-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #guide-ring.on { animation: none; opacity: 1; } }
