/* Source Serif 4 for running text, headings and the figures drawn on canvas; IBM Plex Sans for the interface. */
@font-face { font-family: "NSerif"; src: url("../fonts/SourceSerif4-VF.ttf"); font-weight: 200 900; font-style: normal; }
@font-face { font-family: "NSerif"; src: url("../fonts/SourceSerif4-Italic-VF.ttf"); font-weight: 200 900; font-style: italic; }
@font-face { font-family: "Plex"; src: url("../fonts/IBMPlexSans-VF.ttf"); font-weight: 100 700; }
@font-face { font-family: "Naskh"; src: url("../fonts/NotoNaskhArabic-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Naskh"; src: url("../fonts/NotoNaskhArabic-Bold.ttf"); font-weight: 700; }
@font-face { font-family: "Mono"; src: url("../fonts/DejaVuSansMono.ttf"); }

/* The simulations read these variables, so keep the names. */
:root {
  --bg: #fbfaf7;
  --bg2: #efede7;
  --ink: #1e1e1e;
  --ink2: #5e5c57;
  --accent: #b0412a;
  --accent2: #2b5f7c;
  --line: #d9d6ce;
  --panel: #ffffff;
  --serif: "NSerif", Georgia, "Times New Roman", serif;
  --sans: "Plex", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --arabic: "Naskh", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --mono: "Mono", "DejaVu Sans Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-kerning: normal;
  counter-reset: station plate trial;
}
a { color: var(--accent2); }
.ar { font-family: var(--arabic); direction: rtl; font-size: 1.15em; }
.mono { font-family: var(--mono); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
.lab > h4, .debate h4, footer h3 { font-family: var(--sans); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } body { font-size: 17px; } }

/* ---------- page header ---------- */
header.hero { padding: 52px 0 28px; border-bottom: 1px solid var(--line); }
header.hero h1 { font-size: clamp(38px, 5.5vw, 54px); margin: 0 0 8px; letter-spacing: -.015em; }
header.hero h1 + .q { margin-top: 20px; }
header.hero .sub { font-size: 21px; font-style: italic; color: var(--ink2); margin: 0 0 24px; }
header.hero .q { max-width: 44em; margin: 0; padding: 12px 16px; background: var(--bg2); border-radius: 4px; }

/* ---------- timeline ---------- */
nav.timeline {
  position: sticky; top: 0; z-index: 50;
  background: #fbfaf7f0;
  border-bottom: 1px solid var(--line);
  display: flex; overflow-x: auto; scrollbar-width: none;
  font-family: var(--sans); font-size: 14px;
  padding: 0 12px;
}
nav.timeline::-webkit-scrollbar { display: none; }
nav.timeline a { color: var(--ink); text-decoration: none; padding: 10px 10px; white-space: nowrap; border-bottom: 2px solid transparent; }
nav.timeline a b { font-weight: 400; color: var(--ink2); margin-right: 5px; }
nav.timeline a:hover { color: var(--accent2); }
nav.timeline a.active { border-bottom-color: var(--accent); }

/* ---------- intro ---------- */
section.intro { padding: 36px 0 12px; }
/* full-width wrap so the left edge lines up with the stations; the text column stays narrow */
.wrap.text { max-width: 1140px; }
.wrap.text > * { max-width: 44em; }
section.intro h2 { font-size: 24px; margin: 0 0 12px; }
.threads { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0 8px; }
.thread-card { border: 1px solid var(--line); border-radius: 4px; padding: 14px 18px 4px; background: var(--panel); }
.thread-card h3 { margin: 0 0 6px; font-size: 17px; }
.thread-card h3 .thread-tag { display: block; margin-bottom: 2px; }
@media (max-width: 760px) { .threads { grid-template-columns: 1fr; } }

/* ---------- stations ---------- */
section.station { padding: 40px 0 48px; border-top: 1px solid var(--line); counter-increment: station; }
.station-head { margin-bottom: 22px; }
.station-head h2 { font-size: clamp(24px, 3vw, 30px); margin: 0; }
.station-head h2::before { content: counter(station) ". "; color: var(--ink2); font-weight: 400; }
.station-head .place { font-family: var(--sans); font-size: 15px; color: var(--ink2); margin-top: 4px; }

.thread-tag { font-family: var(--sans); font-size: 13px; color: var(--ink2); margin-right: 12px; }

.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: start; }
.cols.rev { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
@media (max-width: 920px) { .cols, .cols.rev { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

.text { max-width: 40em; }
.text p { margin: 0 0 .85em; }
.text h3 { font-size: 18px; margin: 1.4em 0 .35em; }

blockquote { margin: 1.2em 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); font-style: italic; }
blockquote cite { display: block; font-style: normal; font-family: var(--sans); font-size: 13px; color: var(--ink2); margin-top: 6px; }

.src { font-size: 14px; line-height: 1.5; color: var(--ink2); margin-top: 20px; }
.src b { color: var(--ink); }

.note { font-size: 15px; color: var(--ink2); }

.debate { background: var(--bg2); border-radius: 4px; padding: 12px 16px; margin: 1.4em 0; font-size: 16px; }
.debate h4 { margin: 0 0 4px; font-size: 15px; }

/* ---------- simulations ---------- */
.lab {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 16px;
  counter-increment: plate;
  min-width: 0; overflow-x: auto;
  font-size: 16px;
}
.lab + .lab { margin-top: 20px; }
.lab > h4 {
  order: 99; margin: 12px 0 0;
  font-size: 14px; font-weight: 400; color: var(--ink2);
}
.lab > h4::before { content: "Simülasyon " counter(plate) ": "; font-weight: 600; color: var(--ink); }
.lab.try { counter-increment: trial; }
.lab.try > h4::before { content: "Deneme " counter(trial) ": "; }
.lab canvas, .lab svg { width: 100%; height: auto; display: block; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-family: var(--sans); font-size: 14px; }
.controls label { display: flex; gap: 6px; align-items: center; }

button, select, input[type=text], input[type=number] {
  font-family: var(--sans); font-size: 14px;
  background: #fff; color: var(--ink);
  border: 1px solid #bdb9b0; border-radius: 4px;
  padding: 5px 10px;
}
input[type=text] { min-width: 0; flex: 1; }
input[type=number] { width: 76px; }
input[type=range] { accent-color: var(--accent2); }
button { cursor: pointer; }
button:hover { background: var(--bg2); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent2); color: #fff; border-color: var(--accent2); }
button.primary:hover { background: #224d65; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent2); outline-offset: 1px; }

.readout { font-family: var(--mono); font-size: 13px; white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin-top: 10px; max-height: 320px; overflow: auto; }
.big-out { font-size: 22px; margin-top: 10px; min-height: 1.6em; }
.steplog { font-size: 15px; margin-top: 10px; }
.steplog .cur { background: var(--accent); color: #fff; padding: 0 5px; border-radius: 3px; }

/* ---------- interpretation + bibliography ---------- */
#yorum h2 { font-size: clamp(24px, 3vw, 30px); }
footer { padding: 36px 0 72px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
footer h2 { font-size: 26px; }
footer h3 { font-size: 16px; margin: 1.6em 0 .5em; }
footer ol { max-width: 50em; padding-left: 1.6em; }
footer ol li { margin-bottom: 6px; }

.print-link { font-size: 15px; display: inline-block; margin-top: 8px; }
