
/* Koyu (varsayılan tokenlar); html[data-theme="light"] ile gündüz */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --card: #161b22;
  --card2: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #c9d1d9;
  --muted: #8b949e;
  --accent: #2f81f7;
  --accent-2: #58a6ff;
  --ok: #3fb950;
  --warn: #d29922;
  --hero-mid: #1c2128;
  --hero-spot: rgba(47, 129, 247, 0.2);
  --pre-bg: #010409;
  --badge-bg: rgba(22, 27, 34, 0.88);
  --media-chrome: rgba(255, 255, 255, 0.04);
  --media-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
  --toolbar-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f7;
  --card: #ffffff;
  --card2: #f0f3f9;
  --border: #cfd7e1;
  --text: #1a1f26;
  --text-dim: #3a4450;
  --muted: #5c6670;
  --accent: #0969da;
  --accent-2: #0550ae;
  --hero-mid: #ffffff;
  --hero-spot: rgba(9, 105, 218, 0.12);
  --pre-bg: #f6f8fa;
  --badge-bg: rgba(255, 255, 255, 0.95);
  --media-chrome: #ffffff;
  --media-shadow: 0 4px 18px rgba(26, 31, 38, 0.1);
  --toolbar-shadow: 0 2px 12px rgba(26, 31, 38, 0.12);
}

* { box-sizing: border-box; }
.site-body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
code { background: var(--card2); padding: 0.15rem 0.4rem; border-radius: 4px; border: 1px solid var(--border); }

.site-shell {
  width: 100%;
  max-width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 clamp(0.5rem, 2.5vw, 1rem);
  padding-bottom: 2rem;
  box-sizing: border-box;
}
.shell-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 0 0.25rem;
  position: sticky;
  top: 0;
  z-index: 150;
  background: linear-gradient(180deg, var(--bg) 88%, transparent);
}
.shell-topbar .repo-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--toolbar-shadow);
}
.shell-topbar .repo-link:hover {
  color: var(--accent-2);
  border-color: var(--accent);
  text-decoration: none;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--toolbar-shadow);
  font-family: inherit;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.layout-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
@media (min-width: 1100px) {
  .layout-wrap { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); align-items: start; }
}
aside.sidenav {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: clamp(0.85rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.25rem);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: clamp(0.78rem, 2.2vw, 0.82rem);
}
@media (min-width: 1100px) {
  aside.sidenav {
    border-right: 1px solid var(--border);
    border-bottom: none;
    min-height: 100vh;
    align-self: start;
  }
}
aside.sidenav strong { display: block; margin-bottom: 0.65rem; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
aside.sidenav a { display: block; padding: 0.35rem 0; color: var(--text-dim); border-left: 2px solid transparent; padding-left: 0.5rem; margin-left: -0.5rem; }
aside.sidenav a:hover { color: var(--accent-2); border-left-color: var(--accent); text-decoration: none; }

header.hero {
  padding: clamp(1.15rem, 3vw, 2rem) 0 clamp(1rem, 2.5vw, 1.65rem);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  background: radial-gradient(ellipse 120% 80% at 20% -20%, var(--hero-spot), transparent 55%),
              linear-gradient(180deg, var(--hero-mid) 0%, var(--bg) 100%);
}
header.hero .inner { max-width: min(52rem, 100%); margin: 0 auto; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.badge {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.25rem 0.55rem; border-radius: 999px; border: 1px solid var(--border);
  color: var(--muted); background: var(--badge-bg);
}
.badge.accent { border-color: rgba(47, 129, 247, 0.45); color: var(--accent-2); }
html[data-theme="light"] .badge.accent { border-color: rgba(5, 80, 174, 0.35); }
header.hero h1 { margin: 0 0 0.65rem; font-size: clamp(1.6rem, 5vw, 2.35rem); font-weight: 700; letter-spacing: -0.02em; }
header.hero .lead { margin: 0 0 1.25rem; color: var(--text-dim); font-size: clamp(0.98rem, 2.8vw, 1.05rem); max-width: 48rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }
.btn-pill {
  display: inline-block; padding: 0.55rem 1.1rem; border-radius: 8px; font-weight: 600; font-size: 0.92rem;
  background: var(--accent); color: #fff !important; border: 1px solid transparent;
}
.btn-pill:hover { filter: brightness(1.08); text-decoration: none; }
.btn-pill.outline {
  background: transparent; color: var(--text) !important; border-color: var(--border);
}
.btn-pill.outline:hover { border-color: var(--accent); color: var(--accent-2) !important; }

nav.toc-inline {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem 0.65rem;
  row-gap: 0.45rem;
  padding: clamp(0.55rem, 1.8vw, 0.75rem) 0;
  margin: 0 0 0.35rem;
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-size: clamp(0.76rem, 2.2vw, 0.85rem);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
nav.toc-inline a {
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.2rem 0;
}
nav.toc-inline a:hover { color: var(--accent-2); }
@media (min-width: 960px) {
  nav.toc-inline {
    flex-wrap: wrap;
    overflow-x: visible;
    padding: clamp(0.65rem, 2vw, 0.8rem) 0;
  }
}

main.content {
  padding: clamp(0.85rem, 2.5vw, 1.35rem) 0 clamp(1rem, 3vw, 1.5rem);
  max-width: min(860px, 100%);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

section.block {
  margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
  padding: clamp(1rem, 3vw, 1.65rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
section.block h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
section.block h3 { margin: 1.35rem 0 0.5rem; font-size: 1.02rem; color: var(--text); }
section.block .lead-in { color: var(--text-dim); margin: 0 0 1rem; font-size: 0.98rem; }

.callout {
  margin: 1rem 0; padding: 0.85rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card2); font-size: 0.9rem; color: var(--text-dim);
}
.callout strong { color: var(--text); }

.metrics-grid {
  display: grid; gap: 0.65rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr));
  margin: 1rem 0;
}
.metric-card {
  padding: 0.75rem 0.85rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card2);
}
.metric-card .k { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.metric-card .v { font-size: 1.1rem; font-weight: 600; margin-top: 0.2rem; }
.metric-empty-hint { font-size: 0.84rem; color: var(--muted); margin: -0.25rem 0 1rem; line-height: 1.45; }
.training-fig-grid { margin-top: 0.35rem; }

table.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 1rem 0;
}
table.data-table th, table.data-table td {
  border: 1px solid var(--border); padding: 0.55rem 0.65rem; text-align: left;
}
table.data-table th { background: var(--card2); color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.data-table td { color: var(--text-dim); }
table.data-table td.highlight-val { color: var(--ok); font-weight: 700; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.table-scroll table.data-table { margin: 0; min-width: min(480px, 100%); }
@media (max-width: 600px) {
  .table-scroll { margin-left: 0; margin-right: 0; border-radius: 6px; }
  .table-scroll table.data-table { font-size: 0.8rem; min-width: 0; }
  .table-scroll table.data-table th,
  .table-scroll table.data-table td {
    padding: 0.45rem 0.5rem;
    word-break: break-word;
    hyphens: auto;
  }
}
.table-scroll table.data-table th:first-child,
.table-scroll table.data-table td:first-child { padding-left: 0.75rem; }
.table-scroll table.data-table th:last-child,
.table-scroll table.data-table td:last-child { padding-right: 0.75rem; }

.flow-steps {
  display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; counter-reset: step;
}
.flow-steps .step {
  display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 0.65rem 0.85rem; border-radius: 8px; border: 1px solid var(--border); background: var(--card2);
  font-size: 0.9rem; color: var(--text-dim);
}
.flow-steps .step::before {
  counter-increment: step; content: counter(step);
  flex-shrink: 0; width: 1.65rem; height: 1.65rem; border-radius: 6px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}

details.expand {
  margin: 0.75rem 0; border: 1px solid var(--border); border-radius: 8px; background: var(--card2);
}
details.expand summary {
  cursor: pointer; padding: 0.65rem 1rem; font-weight: 600; color: var(--text-dim);
}
details.expand .inner { padding: 0 1rem 1rem; color: var(--text-dim); font-size: 0.9rem; }

.grid2 {
  display: grid;
  gap: clamp(0.85rem, 2vw, 1.25rem);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 700px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

figure.media { margin: 1rem 0 0; }
figure.media img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--media-chrome);
  box-shadow: var(--media-shadow);
}
figure.media figcaption { font-size: clamp(0.78rem, 2vw, 0.82rem); color: var(--muted); margin-top: 0.45rem; line-height: 1.45; }

pre.json {
  background: var(--pre-bg);
  padding: clamp(0.75rem, 2vw, 1rem) clamp(0.85rem, 2vw, 1.15rem);
  border-radius: 8px;
  overflow: auto;
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  line-height: 1.45;
  border: 1px solid var(--border);
  color: var(--text-dim);
  max-width: 100%;
}

.flow-diagram {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.5rem 0 0;
}
.flow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.45rem 0.55rem;
}
.flow-node {
  flex: 1 1 140px;
  min-width: min(100%, 140px);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: clamp(0.8rem, 2.2vw, 0.88rem);
  color: var(--text-dim);
  line-height: 1.45;
}
.flow-node strong { color: var(--accent-2); margin-right: 0.25rem; }
.flow-arr {
  color: var(--accent-2);
  font-weight: 700;
  align-self: center;
  user-select: none;
  padding: 0 0.15rem;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .flow-arr { display: none; }
  .flow-row { flex-direction: column; }
  .flow-node { min-width: 100%; }
}

footer.site-ft {
  padding: clamp(1.1rem, 2.5vw, 1.65rem) 0;
  margin-top: 1rem;
  color: var(--muted);
  font-size: clamp(0.76rem, 2vw, 0.82rem);
  text-align: center;
  border-top: 1px solid var(--border);
  background: transparent;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: center; align-items: center;
}

/* --- Topbar nav --- */
.topbar-nav { display: flex; gap: 0.5rem; margin-right: auto; margin-left: 0.75rem; }
.topbar-nav a {
  font-size: 0.76rem; font-weight: 600; color: var(--muted); padding: 0.3rem 0.6rem;
  border-radius: 6px; border: 1px solid transparent;
}
.topbar-nav a:hover { color: var(--accent-2); border-color: var(--border); text-decoration: none; }

/* --- Hero metrics strip --- */
.hero-metrics-strip {
  display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 0 0 1.25rem;
}
.hm {
  display: flex; flex-direction: column; align-items: center; padding: 0.65rem 1rem;
  border-radius: 10px; background: var(--card); border: 1px solid var(--border);
  min-width: 80px;
}
.hm-val { font-size: 1.3rem; font-weight: 700; color: var(--accent-2); line-height: 1.2; }
.hm-key { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 0.15rem; }

/* --- Pipeline grid --- */
.pipeline-grid {
  display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: stretch; margin: 1rem 0;
}
.pipe-node {
  flex: 1 1 120px; min-width: min(100%, 120px);
  display: flex; align-items: flex-start; gap: 0.55rem;
  padding: 0.65rem 0.75rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card2);
}
.pipe-node.pipe-data { border-left: 3px solid var(--ok); }
.pipe-node.pipe-process { border-left: 3px solid var(--accent); }
.pipe-node.pipe-model { border-left: 3px solid var(--warn); }
.pipe-node.pipe-result { border-left: 3px solid #a371f7; }
.pipe-num {
  flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}
.pipe-body { display: flex; flex-direction: column; gap: 0.1rem; }
.pipe-body strong { font-size: 0.82rem; color: var(--text); }
.pipe-body span { font-size: 0.75rem; color: var(--muted); line-height: 1.35; }
.pipe-arrow {
  flex-shrink: 0; width: 16px; align-self: center;
  background: linear-gradient(90deg, var(--accent) 40%, transparent 100%);
  height: 2px; border-radius: 1px;
}
@media (max-width: 600px) {
  .pipeline-grid { flex-direction: column; }
  .pipe-arrow { width: 2px; height: 12px; align-self: flex-start; margin-left: 1.3rem;
    background: linear-gradient(180deg, var(--accent) 40%, transparent 100%); }
}

/* --- Stats bar --- */
.stats-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; justify-content: center;
}
.stat-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.45rem 0.85rem; border-radius: 8px;
  background: var(--card2); border: 1px solid var(--border); min-width: 70px;
}
.stat-val { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* --- Metrics grid 8 --- */
.metrics-grid-8 {
  display: grid; gap: 0.55rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr));
  margin: 1rem 0;
}
.metrics-grid-8 .metric-card { text-align: center; }
.metrics-grid-8 .metric-card .desc { font-size: 0.68rem; color: var(--muted); margin-top: 0.15rem; }
.metric-card.primary { border-color: var(--accent); }
.metric-card.primary .v { color: var(--accent-2); }
.metric-card.highlight { border-color: var(--ok); background: rgba(63, 185, 80, 0.08); }
.metric-card.highlight .v { color: var(--ok); }
html[data-theme="light"] .metric-card.highlight { background: rgba(63, 185, 80, 0.06); }

/* --- Label chips --- */
.label-chip {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.label-chip.pos { background: rgba(63, 185, 80, 0.15); color: var(--ok); border: 1px solid rgba(63, 185, 80, 0.3); }
.label-chip.neg { background: rgba(210, 153, 34, 0.12); color: var(--warn); border: 1px solid rgba(210, 153, 34, 0.3); }
html[data-theme="light"] .label-chip.pos { background: rgba(26, 127, 55, 0.1); color: #1a7f37; }
html[data-theme="light"] .label-chip.neg { background: rgba(154, 103, 0, 0.1); color: #9a6700; }

/* --- Ranked table --- */
.ranked-table td:nth-child(5) { font-variant-numeric: tabular-nums; }
.ranked-table code { font-size: 0.82em; }

/* --- Two col info --- */
.two-col-info { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1rem 0; }
@media (min-width: 600px) { .two-col-info { grid-template-columns: 1fr 1fr; } }
.two-col-info ul { margin: 0.35rem 0 0 1.1rem; padding: 0; font-size: 0.9rem; color: var(--text-dim); }

/* --- Viewer embed --- */
.viewer-embed-wrap {
  margin: 1rem 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: #fff;
}
.viewer-iframe {
  width: 100%; height: 420px; border: none; display: block;
}
@media (min-width: 700px) { .viewer-iframe { height: 500px; } }

/* --- Accent callout --- */
.accent-callout { border-left: 3px solid var(--accent); }

/* --- Compact table --- */
table.data-table.compact { font-size: 0.84rem; }
table.data-table.compact td { padding: 0.4rem 0.55rem; }

/* --- Method diagram --- */
.method-diagram {
  display: flex; flex-direction: column; align-items: center; gap: 0; margin: 1.25rem 0;
}
.md-phase {
  width: 100%; max-width: 520px; border-radius: 12px; padding: 0.85rem 1rem;
  border: 1px solid var(--border); background: var(--card2); position: relative;
}
.md-phase[data-phase="veri"] { border-left: 3px solid var(--ok); }
.md-phase[data-phase="split"] { border-left: 3px solid var(--accent); }
.md-phase[data-phase="model"] { border-left: 3px solid var(--warn); }
.md-phase[data-phase="rapor"] { border-left: 3px solid #a371f7; }
.md-phase-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 0.5rem;
}
.md-nodes { display: flex; flex-direction: column; gap: 0; }
.md-node {
  padding: 0.45rem 0.6rem; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; display: flex; flex-direction: column; gap: 0.1rem;
}
.md-node strong { font-size: 0.88rem; color: var(--text); }
.md-node span { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.md-node em { color: var(--accent-2); font-style: normal; font-weight: 600; }
.md-arrow-v {
  width: 2px; height: 14px; background: var(--accent); margin: 0 auto; border-radius: 1px;
}
.md-connector-v {
  width: 2px; height: 18px; background: var(--accent); margin: 0 auto; border-radius: 1px;
}

/* --- Lightbox --- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88); display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; cursor: zoom-out;
}
.lightbox-img {
  max-width: 95vw; max-height: 90vh; border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5); cursor: default;
  object-fit: contain;
}
.lightbox-close {
  position: absolute; top: 1rem; right: 1.5rem; font-size: 2.2rem; color: #fff;
  background: none; border: none; cursor: pointer; line-height: 1; z-index: 10000;
  opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }

/* --- Viewer responsive --- */
.viewer-responsive {
  position: relative; width: 100%; aspect-ratio: 16/10;
  min-height: 420px; max-height: 600px;
  border-radius: 12px; overflow: hidden;
  border: 2px solid var(--border);
  background: var(--card);
  margin: 1rem 0; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.viewer-responsive iframe {
  width: 100%; height: 100%; border: none; display: block;
}
@media (max-width: 600px) {
  .viewer-responsive { min-height: 300px; aspect-ratio: 4/3; border-radius: 8px; }
}
