/* ============================================================================
   Mikrofab Kullanim Kilavuzu — Acik tema (LIGHT ONLY)
   Marka paleti, app/gui/shell/shell_theme.py LIGHT token'lariyla hizalidir.
   ========================================================================== */
:root {
  --mfbar-h: 60px;
  --accent: #1f6fe0;
  --accent-d: #15529c;
  --brand-wash: #eaf1fd;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-2: #fbfcfd;
  --border: #e4e7ec;
  --line-2: #d3d8df;
  --ink: #161a1f;
  --soft: #454b53;
  --muted: #737a83;
  --faint: #9aa1aa;
  --ok: #1f9d57;
  --ok-wash: #e7f6ee;
  --amber: #d98a0b;
  --amber-wash: #fdf3e1;
  --estop: #c92a2a;
  --estop-wash: #fbeaea;
  --chip: #eef2f8;

  --sidebar-w: 312px;
  --toc-w: 232px;
  --maxw: 980px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ----------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* ----------------------------------------------------------------- sidebar */
.sidebar {
  position: sticky; top: var(--mfbar-h); align-self: start;
  height: calc(100vh - var(--mfbar-h)); overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 0;
}
.sidebar::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel); z-index: 5;
}
.brand .logo {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-d));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand .brand-title { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.brand .brand-sub { font-size: 11.5px; color: var(--muted); }

.nav-search { padding: 14px 18px 6px; }
.nav-search input {
  width: 100%; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.nav-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--brand-wash); }

nav.toc { padding: 6px 12px 40px; }
nav.toc .group { margin: 6px 0 2px; }
nav.toc .group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); padding: 12px 12px 6px;
}
nav.toc a {
  display: block; padding: 7px 12px; margin: 1px 0; border-radius: 7px;
  color: var(--soft); text-decoration: none; font-size: 13.7px; font-weight: 500;
  border-left: 2.5px solid transparent; transition: background .12s, color .12s;
}
nav.toc a:hover { background: var(--panel-2); color: var(--ink); }
nav.toc a.active { background: var(--brand-wash); color: var(--accent-d); border-left-color: var(--accent); font-weight: 600; }
nav.toc a .num { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 8px; font-size: 12px; }
nav.toc a.active .num { color: var(--accent); }

/* ----------------------------------------------------------------- main */
.main { min-width: 0; }
.topbar {
  position: sticky; top: var(--mfbar-h); z-index: 4;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 32px; background: rgba(247,248,250,.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .crumb { font-size: 13px; color: var(--muted); }
.topbar .crumb b { color: var(--soft); font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .pill { font-size: 12px; color: var(--accent-d); background: var(--brand-wash); padding: 4px 11px; border-radius: 20px; font-weight: 600; }

.content-wrap { display: grid; grid-template-columns: minmax(0,1fr) var(--toc-w); gap: 40px; padding: 0 32px; }
@media (max-width: 1180px) { .content-wrap { grid-template-columns: minmax(0,1fr); } .pagetoc { display: none; } }

article.content { max-width: var(--maxw); margin: 0 auto; padding: 30px 0 90px; width: 100%; }

/* ----------------------------------------------------------------- typography */
article h1 { font-size: 32px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 6px; }
article h2 {
  font-size: 23px; font-weight: 750; letter-spacing: -.01em; margin: 44px 0 14px;
  padding-bottom: 9px; border-bottom: 1px solid var(--border); scroll-margin-top: 80px;
}
article h3 { font-size: 18.5px; font-weight: 700; margin: 30px 0 10px; scroll-margin-top: 80px; }
article h4 { font-size: 15.5px; font-weight: 700; color: var(--soft); margin: 22px 0 8px; text-transform: none; }
article p { margin: 12px 0; color: var(--ink); }
article a { color: var(--accent-d); text-decoration: none; border-bottom: 1px solid transparent; }
article a:hover { border-bottom-color: var(--accent); }
article ul, article ol { margin: 12px 0; padding-left: 26px; }
article li { margin: 6px 0; }
article strong { font-weight: 700; color: var(--ink); }
article hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.lead { font-size: 18px; color: var(--soft); line-height: 1.6; margin: 4px 0 22px; }

code, kbd {
  font-family: var(--mono); font-size: .87em;
  background: var(--chip); padding: 2px 6px; border-radius: 5px; color: var(--accent-d);
  border: 1px solid var(--border);
}
kbd { background: #fff; box-shadow: 0 1.5px 0 var(--line-2); color: var(--soft); font-weight: 600; }
pre {
  background: #0f1620; color: #e8edf2; padding: 16px 18px; border-radius: var(--radius);
  overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6;
  box-shadow: var(--shadow-sm); margin: 16px 0;
}
pre code { background: none; border: 0; color: inherit; padding: 0; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--panel); }
thead th {
  background: var(--panel-2); text-align: left; font-weight: 700; color: var(--soft);
  padding: 11px 14px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fcfdfe; }
tbody tr:hover { background: var(--brand-wash); }
table code { white-space: nowrap; }

/* ----------------------------------------------------------------- figures */
figure { margin: 24px 0; }
figure img {
  width: 100%; height: auto; display: block; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); background: var(--panel);
}
figure figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
figure figcaption b { color: var(--soft); }
.figrow { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .figrow { grid-template-columns: 1fr; } }
.zoomable { cursor: zoom-in; }

/* ----------------------------------------------------------------- callouts */
.callout {
  display: flex; gap: 13px; margin: 18px 0; padding: 14px 16px;
  border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm);
  background: var(--panel); box-shadow: var(--shadow-sm); font-size: 14.5px;
}
.callout .ico { flex: none; font-size: 18px; line-height: 1.5; }
.callout .body { min-width: 0; }
.callout .body > :first-child { margin-top: 0; }
.callout .body > :last-child { margin-bottom: 0; }
.callout.note { border-left-color: var(--accent); background: var(--brand-wash); }
.callout.tip { border-left-color: var(--ok); background: var(--ok-wash); }
.callout.warn { border-left-color: var(--amber); background: var(--amber-wash); }
.callout.danger { border-left-color: var(--estop); background: var(--estop-wash); }
.callout b.tag { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.callout.note b.tag { color: var(--accent-d); }
.callout.tip b.tag { color: var(--ok); }
.callout.warn b.tag { color: var(--amber); }
.callout.danger b.tag { color: var(--estop); }

/* ----------------------------------------------------------------- cards / metrics */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; margin: 20px 0; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-2); }
.card .card-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.card h4 { margin: 6px 0 4px; font-size: 15.5px; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.card a.stretch::after { content: ""; position: absolute; inset: 0; }
.card.link { position: relative; }

.metricstrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; margin: 18px 0; }
.metric { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.metric .k { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.metric .u { font-size: 12px; color: var(--faint); margin-left: 3px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 14px; border: 1px solid transparent; }
.badge.ok { color: var(--ok); background: var(--ok-wash); border-color: #bfe6cf; }
.badge.warn { color: var(--amber); background: var(--amber-wash); border-color: #f0dcb4; }
.badge.bad { color: var(--estop); background: var(--estop-wash); border-color: #efc9c9; }
.badge.accent { color: var(--accent-d); background: var(--brand-wash); border-color: #c9dcf8; }

/* primer — beginner-friendly "what is this for / why we do it" teaching box */
.primer {
  position: relative;
  margin: 18px 0 22px;
  padding: 16px 18px 14px 18px;
  background: linear-gradient(180deg, #eafaf7 0%, #f3fbfa 100%);
  border: 1px solid #bfe9e2;
  border-left: 4px solid #0d9488;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.primer .primer-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 750; color: #0b7a70; margin-bottom: 6px;
}
.primer .primer-head .ico { font-size: 18px; }
.primer .primer-head span { color: var(--soft); font-weight: 600; }
.primer > p { margin: 6px 0; color: #134e4a; }
.primer ul.primer-points { margin: 8px 0 2px; padding-left: 0; list-style: none; }
.primer ul.primer-points > li {
  position: relative; padding: 4px 0 4px 24px; margin: 0; color: #134e4a; font-size: 14.5px;
}
.primer ul.primer-points > li::before {
  content: ""; position: absolute; left: 6px; top: 12px; width: 7px; height: 7px;
  border-radius: 50%; background: #0d9488;
}
.primer ul.primer-points > li b { color: #0b7a70; }
.primer .analogy { font-style: italic; color: #0b7a70; }

/* howto — "how is this calculated from the graph" (slope / tangent / extrapolation) box */
.howto {
  position: relative;
  margin: 18px 0 22px;
  padding: 16px 18px 14px 18px;
  background: linear-gradient(180deg, #f3effc 0%, #f8f5fd 100%);
  border: 1px solid #d8c9f0;
  border-left: 4px solid #6d28d9;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.howto .howto-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 750; color: #5b21b6; margin-bottom: 6px;
}
.howto .howto-head .ico { font-size: 18px; }
.howto .howto-head span { color: var(--soft); font-weight: 600; }
.howto > p { margin: 7px 0; color: #3b2a63; }
.howto ol, .howto ul { margin: 8px 0 4px; padding-left: 22px; }
.howto ol > li, .howto ul > li { margin: 5px 0; color: #3b2a63; }
.howto b { color: #5b21b6; }
.howto .term { font-style: italic; color: #6d28d9; font-weight: 600; }
.howto figure { margin: 14px 0 6px; }
.howto figure img { border-color: #d8c9f0; }

/* formula block */
.formula {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 13px 18px; margin: 16px 0;
  font-family: var(--mono); font-size: 14px; color: var(--ink); overflow-x: auto;
}
.formula .label { font-family: var(--font); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 4px; }

/* steps */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 18px 0; }
ol.steps > li { position: relative; padding: 2px 0 14px 46px; margin: 0; }
ol.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
ol.steps > li::after { content: ""; position: absolute; left: 14.5px; top: 32px; bottom: 0; width: 1.5px; background: var(--border); }
ol.steps > li:last-child::after { display: none; }

/* pager */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { flex: 1; max-width: 48%; text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; background: var(--panel); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.pager a:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.pager .dir { font-size: 12px; color: var(--muted); }
.pager .ttl { font-weight: 700; color: var(--accent-d); }
.pager a.next { text-align: right; margin-left: auto; }

/* page-level TOC (right rail) */
.pagetoc { position: sticky; top: calc(var(--mfbar-h) + 24px); align-self: start; height: max-content; padding: 28px 0; font-size: 13px; }
.pagetoc .ttl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin-bottom: 10px; }
.pagetoc a { display: block; padding: 4px 10px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--border); }
.pagetoc a:hover { color: var(--ink); }
.pagetoc a.h3 { padding-left: 22px; font-size: 12.5px; }
.pagetoc a.active { color: var(--accent-d); border-left-color: var(--accent); font-weight: 600; }

footer.foot { color: var(--muted); font-size: 12.5px; text-align: center; padding: 28px; border-top: 1px solid var(--border); }
footer.foot a { color: var(--accent-d); text-decoration: none; }

/* lightbox */
.lb { position: fixed; inset: 0; background: rgba(15,22,32,.86); display: none; place-items: center; z-index: 100; padding: 4vh 4vw; cursor: zoom-out; }
.lb.open { display: grid; }
.lb img { max-width: 100%; max-height: 92vh; border-radius: 8px; box-shadow: var(--shadow-lg); }

/* hide-on-mobile sidebar toggle */
.menu-btn { display: none; }
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: var(--mfbar-h); bottom: 0; width: 86%; max-width: 340px; z-index: 50; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); cursor: pointer; }
  .content-wrap { padding: 0 18px; }
  .topbar { padding: 12px 18px; }
}

/* cover (index hero) */
.hero { padding: 56px 0 30px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.hero h1 { font-size: 44px; line-height: 1.08; margin: 10px 0 14px; letter-spacing: -.025em; }
.hero .lead { font-size: 19px; max-width: 760px; }
.hero .meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero .meta .pill { font-size: 12.5px; color: var(--soft); background: var(--panel); border: 1px solid var(--border); padding: 6px 13px; border-radius: 20px; box-shadow: var(--shadow-sm); }

@media print {
  .sidebar, .topbar, .pagetoc, .pager, .menu-btn, .lb { display: none !important; }
  .layout, .content-wrap { display: block; }
  article.content { max-width: 100%; }
  figure img { box-shadow: none; }
  body { font-size: 11pt; }
}

/* ===================================================================== */
/* Site üst gezinme barı (ana site nav'i kılavuz/manual sayfalarında)    */
/* ===================================================================== */
a.brand { text-decoration: none; color: inherit; }
a.brand:hover .brand-title { color: var(--accent-d); }

.mfbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.mfbar-in {
  display: flex; align-items: center; gap: 14px;
  height: var(--mfbar-h); max-width: 1280px; margin: 0 auto; padding: 0 24px;
}
.mfbar-brand {
  display: flex; align-items: center; gap: 10px; flex: none;
  font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none;
}
.mfbar-brand img { width: 32px; height: 32px; border-radius: 8px; display: block; }
.mfbar-brand span { display: flex; flex-direction: column; line-height: 1.15; }
.mfbar-brand small { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.mfbar-links {
  display: flex; align-items: center; gap: 2px; margin-left: auto;
  min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.mfbar-links::-webkit-scrollbar { height: 0; display: none; }
.mfbar-links a {
  padding: 7px 11px; border-radius: 8px; color: var(--soft);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
}
.mfbar-links a:hover { background: var(--panel-2); color: var(--ink); }
.mfbar-links a.cur { color: var(--accent-d); }
.mfbar-cta { background: var(--accent); color: #fff !important; padding: 8px 14px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.mfbar-cta:hover { background: var(--accent-d); }

@media (max-width: 940px) {
  :root { --mfbar-h: 54px; }
  .mfbar-in { padding: 0 12px; gap: 8px; }
  .mfbar-brand small { display: none; }
  .mfbar-brand { font-size: 15px; }
}

/* ===== Mobile: wrap long inline code so it can't overflow the page (2026-06-30) ===== */
code, kbd { overflow-wrap:anywhere; word-break:break-word; }
pre, pre code { overflow-wrap:normal; word-break:normal; }
