/* self-hosted fonts (restored after polish strip) */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-400-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-400-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-600-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-600-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-400-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-400-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-500-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-500-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-600-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-600-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-700-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-700-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-800-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/JetBrainsMono-800-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================
   Çark Defteri — rulet mekaniği bilgilendirme sitesi
   Design DNA: kareli defter + grafik kâğıt, bilimsel serif + mono
   ========================================================= */

:root {
  --bg: #F2F4EF;
  --surface: #FFFFFF;
  --surface-2: #E9ECE3;
  --surface-3: #1B2A4A;
  --ink: #1B2A4A;
  --ink-soft: #46506B;
  --ink-faint: #5C6579;
  --accent: #C0392B;
  --accent-text: #A02a1e;
  --accent2: #2E7D6B;
  --accent2-text: #216355;
  --line: #D4D8CC;
  --line-strong: #B7BCAC;
  --grid-fine: rgba(27, 42, 74, 0.055);
  --grid-bold: rgba(27, 42, 74, 0.11);
  --grid-blue: rgba(46, 125, 107, 0.16);

  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "URW Palladio L", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Consolas", "Liberation Mono", "Courier New", monospace;

  --maxw: 1180px;
  --header-h: 72px;
  --sec-pad: clamp(56px, 8vw, 104px);
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  interpolate-size: allow-keywords;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  max-width: 100%;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px),
    linear-gradient(var(--grid-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px);
  background-size: 22px 22px, 22px 22px, 110px 110px, 110px 110px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { position: relative; z-index: 1; }

figure, figcaption, blockquote { margin: 0; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.15rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
h4 { font-size: 1.08rem; letter-spacing: 0; }

p { margin: 0 0 1rem; color: var(--ink-soft); }
a { color: var(--accent2-text); }
strong { color: var(--ink); }

.eyebrow {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent2-text);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: .6em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--accent);
  display: inline-block;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 32px);
  padding-right: clamp(16px, 4vw, 32px);
}

section { padding-block: var(--sec-pad); position: relative; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 62ch; }
.section-head { max-width: 64ch; margin-bottom: clamp(28px, 4vw, 46px); }
.word-safe { word-break: break-word; overflow-wrap: anywhere; }

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: var(--radius);
  z-index: 2000; transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===================== Header / Nav ===================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1080;
  background: rgba(242, 244, 239, 0.92);
  backdrop-filter: saturate(1.3) blur(8px);
  border-bottom: 1px solid var(--line);
  transition: background .24s var(--ease), box-shadow .24s var(--ease), height .24s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(242, 244, 239, 0.98);
  box-shadow: 0 8px 24px -16px rgba(27, 42, 74, 0.35);
  height: 62px;
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 700; font-size: 1.22rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px; flex: none;
  border: 2px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .66rem; font-weight: 700;
  color: var(--accent-text);
  background:
    linear-gradient(var(--grid-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px);
  background-size: 6px 6px;
}
.brand-mark span { background: var(--surface); padding: 0 1px; }

.nav-desktop { display: none; }
@media (min-width: 1024px) {
  .nav-desktop { display: flex; align-items: center; gap: 26px; }
  .nav-desktop a {
    position: relative;
    font-size: .95rem;
    color: var(--ink-soft);
    text-decoration: none;
    padding: 6px 0;
    transition: color .2s;
  }
  .nav-desktop a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
    height: 2px; background: var(--accent);
    transition: right .24s var(--ease);
  }
  .nav-desktop a:hover, .nav-desktop a.is-active { color: var(--ink); }
  .nav-desktop a:hover::after, .nav-desktop a.is-active::after { right: 0; }

  .nav-desktop a.nav-cta,
  header a.nav-cta {
    padding: 10px 20px;
    color: var(--surface);
    background: var(--ink);
    border-radius: var(--radius);
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600;
    transition: background .2s, color .2s, transform .2s;
  }
  .nav-desktop a.nav-cta::after { display: none; }
  .nav-desktop a.nav-cta:hover,
  .nav-desktop a.nav-cta:focus-visible,
  header a.nav-cta:hover {
    background: var(--accent);
    color: var(--surface);
    transform: translateY(-2px);
  }
}

.nav-toggle {
  position: relative; width: 46px; height: 46px; padding: 0;
  display: inline-block; z-index: 1100;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.nav-toggle span {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 2.5px; translate: -50% -50%;
  background: currentColor; border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s;
}
.nav-toggle span:nth-child(1) { transform: translateY(-7px); }
.nav-toggle span:nth-child(3) { transform: translateY(7px); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); opacity: 1; }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); opacity: 1; }
@media (min-width: 1024px) { .nav-toggle { display: none; } }

/* ===================== Drawer ===================== */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 1040;
  background: rgba(27, 42, 74, 0.55);
  opacity: 0; visibility: hidden;
  transition: opacity .24s var(--ease), visibility .24s;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px, 92vw); z-index: 1050;
  background: var(--ink);
  transform: translateX(100%);
  transition: transform .32s var(--ease);
  padding: calc(var(--header-h) + 18px) 26px 26px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer a {
  color: #E7EAF2; text-decoration: none;
  font-family: var(--serif); font-size: 1.22rem;
  padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.12);
  transition: color .2s, padding-left .2s;
}
.drawer a:hover, .drawer a.is-active { color: #fff; padding-left: 8px; }
.drawer a.is-active { color: #F3A79B; }
.drawer .drawer-cta {
  margin-top: 18px; border: 0; text-align: center;
  background: var(--accent); color: #fff;
  border-radius: var(--radius); font-family: var(--sans); font-size: 1rem;
}
.drawer .drawer-cta:hover { background: #d44636; padding-left: 0; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-size: .98rem; font-weight: 600;
  padding: 13px 24px; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
  line-height: 1.2;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: #a7281b; color: #fff; transform: translateY(-2px); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover, .btn-ink:focus-visible { background: #0f1c37; color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn .arr { font-family: var(--mono); font-weight: 400; }

/* ===================== Trust strip ===================== */
.trust-strip {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px;
}
.trust-badge {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px;
}
.trust-badge::before { content: ""; width: 7px; height: 7px; background: var(--accent2); border-radius: 50%; }

/* ===================== Hero ===================== */
.hero {
  padding-top: calc(var(--header-h) + clamp(32px, 6vw, 70px));
  padding-bottom: var(--sec-pad);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid; gap: clamp(32px, 5vw, 60px);
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}
.hero h1 { margin-bottom: 1rem; }
.hero .lede { margin-bottom: 1.6rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.ruler {
  position: relative; height: 26px; margin-bottom: 22px;
  border-left: 2px solid var(--ink); border-bottom: 1px solid var(--line-strong);
  color: var(--ink-faint);
}
.ruler::before {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 11px);
}
.ruler span {
  position: absolute; bottom: 12px; font-family: var(--mono); font-size: .62rem;
  letter-spacing: .05em;
}

.hero-figure {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 30px 60px -40px rgba(27,42,74,0.5);
}
.hero-figure .fig-label {
  position: absolute; top: -11px; left: 18px;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-faint);
  background: var(--surface); padding: 0 8px; border: 1px solid var(--line);
}
.hero-canvas-wrap {
  position: relative;
  background:
    linear-gradient(var(--grid-blue) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-blue) 1px, transparent 1px);
  background-size: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.hero-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.hero-cap {
  font-family: var(--mono); font-size: .68rem; color: var(--ink-faint);
  margin-top: 10px; display: flex; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.hero-cap .lim { color: var(--accent-text); }

/* ===================== Generic paper panel ===================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
  position: relative;
}
.panel-grid {
  background-image:
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 22px 22px;
}
.tag {
  display: inline-block; font-family: var(--mono); font-size: .66rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent2-text);
  border: 1px solid var(--line-strong); border-radius: 2px;
  padding: 4px 9px; margin-bottom: 14px;
}

/* ===================== Two-col text+figure ===================== */
.split {
  display: grid; gap: clamp(28px, 4vw, 54px); align-items: center;
}
@media (min-width: 880px) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split.wide-left { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .split.wide-right { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
  .split.start { align-items: start; }
}
.split figure img {
  width: 100%; max-height: 520px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line-strong);
}
.fig-note {
  font-family: var(--mono); font-size: .72rem; color: var(--ink-faint);
  margin-top: 10px; padding-left: 14px; border-left: 2px solid var(--accent2);
}

/* ===================== Figure photo frame ===================== */
.photo {
  position: relative; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px; box-shadow: 0 24px 50px -40px rgba(27,42,74,0.45);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.photo:hover { transform: translateY(-3px); box-shadow: 0 30px 56px -38px rgba(27,42,74,0.55); }
.photo img { border-radius: 2px; }
.photo .corner {
  position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--accent);
  transition: width .3s var(--ease), height .3s var(--ease), top .3s var(--ease), left .3s var(--ease), right .3s var(--ease), bottom .3s var(--ease);
}
.photo .corner.tl { top: 4px; left: 4px; border-top: 2px solid; border-left: 2px solid; }
.photo .corner.br { bottom: 4px; right: 4px; border-bottom: 2px solid; border-right: 2px solid; }
/* registration marks reach toward the frame edges on hover */
.photo:hover .corner { width: 22px; height: 22px; }
.photo:hover .corner.tl { top: 2px; left: 2px; }
.photo:hover .corner.br { bottom: 2px; right: 2px; }
@media (prefers-reduced-motion: reduce) {
  .photo, .photo .corner { transition: none; }
  .photo:hover { transform: none; }
}

/* ===================== Wheel / diagrams ===================== */
.diagram-wrap {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: clamp(16px, 3vw, 26px);
  position: relative;
}
.diagram-wrap svg,
.diagram-wrap canvas { display: block; width: 100%; height: auto; }
.legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px;
  font-family: var(--mono); font-size: .74rem; color: var(--ink-soft);
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

/* ===================== System cards ===================== */
.systems { display: grid; gap: 22px; }
@media (min-width: 760px) { .systems { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sys-card {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: clamp(20px, 2.6vw, 28px);
  display: flex; flex-direction: column;
  transition: transform .24s var(--ease), box-shadow .24s var(--ease);
}
.sys-card:hover { transform: translateY(-4px); box-shadow: 0 24px 44px -30px rgba(27,42,74,0.4); }
.sys-card .no {
  font-family: var(--mono); font-size: .8rem; color: var(--accent-text);
  letter-spacing: .1em; margin-bottom: 10px;
}
.sys-card h3 { margin-bottom: .4em; }
.sys-formula {
  font-family: var(--mono); font-size: .9rem; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 2px; padding: 10px 12px; margin: 14px 0;
  overflow-x: auto;
}
.sys-card ul { margin: 6px 0 0; padding: 0; list-style: none; }
.sys-card li {
  position: relative; padding-left: 20px; margin-bottom: 8px;
  color: var(--ink-soft); font-size: .95rem;
}
.sys-card li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 7px; height: 7px; background: var(--accent2); border-radius: 50%;
}

/* ===================== Mini progression sparkline (inline svg) ===================== */
.spark { display: block; width: 100%; height: auto; margin-top: 12px; }

/* ===================== Simulator ===================== */
.sim {
  background: var(--ink);
  color: #E7EAF2;
  position: relative;
  overflow: hidden;
}
.sim::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 26px 26px;
}
.sim .container { position: relative; z-index: 1; }
.sim h2, .sim h3 { color: #fff; }
.sim .eyebrow { color: #7FD4C2; }
.sim .eyebrow::before { background: var(--accent); }
.sim p { color: #C4CBDA; }
.sim-layout { display: grid; gap: clamp(22px, 3vw, 34px); align-items: start; }
@media (min-width: 940px) { .sim-layout { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); } }

.sim-controls {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius); padding: 22px;
}
.ctrl { margin-bottom: 18px; }
.ctrl label {
  display: block; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .08em; text-transform: uppercase; color: #9FA9BF;
  margin-bottom: 7px;
}
.ctrl select, .ctrl input[type="number"] {
  width: 100%; font-family: var(--mono); font-size: 1rem;
  background: #0F1C37; color: #fff;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 2px;
  padding: 11px 12px; appearance: none;
}
.ctrl select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%237FD4C2' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.ctrl select:focus, .ctrl input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ctrl .hint { font-size: .72rem; color: #9EA8BC; margin-top: 5px; font-family: var(--mono); }
.sim-run {
  width: 100%; margin-top: 4px; border: 0;
  background: var(--accent); color: #fff; font-weight: 600;
  padding: 14px; border-radius: var(--radius); cursor: pointer;
  font-family: var(--sans); font-size: 1rem;
  transition: background .2s, transform .2s;
}
.sim-run:hover { background: #d44636; transform: translateY(-2px); }

.sim-canvas-wrap {
  position: relative;
  background: #0F1C37;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius); padding: 14px;
}
.sim-canvas-inner {
  position: relative;
  background-image:
    linear-gradient(rgba(127,212,194,0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127,212,194,0.14) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid rgba(255,255,255,0.12);
}
.sim-canvas-inner canvas { display: block; width: 100%; height: auto; }
.sim-result {
  margin-top: 16px; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.sim-stat {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2px; padding: 14px;
}
.sim-stat .k { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: #9FA9BF; text-transform: uppercase; }
.sim-stat .v { font-family: var(--mono); font-size: 1.5rem; color: #fff; font-variant-numeric: tabular-nums; margin-top: 4px; }
.sim-stat .v.warn { color: #F3A79B; }
.sim-note { font-family: var(--mono); font-size: .74rem; color: #9EA8BC; margin-top: 14px; }

/* ===================== Band (accent/ink contrast section) ===================== */
.band {
  background: var(--surface-3); color: #E7EAF2;
}
.band h2 { color: #fff; }
.band p { color: #C4CBDA; }
.band .eyebrow { color: #7FD4C2; }

/* ===================== Revision log / editor note ===================== */
.log-list { list-style: none; margin: 0; padding: 0; }
.log-list li {
  display: grid; grid-template-columns: auto 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px dashed var(--line-strong);
  align-items: baseline;
}
.log-list time {
  font-family: var(--mono); font-size: .78rem; color: var(--accent-text);
  white-space: nowrap;
}
.log-list p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.editor-note {
  background: var(--surface-2); border-left: 3px solid var(--accent2);
  border-radius: 2px; padding: 20px 22px; margin-top: 24px;
  font-style: italic; color: var(--ink-soft);
}

/* ===================== Callout / disclaimer ===================== */
.callout {
  background: var(--surface); border: 1px solid var(--accent);
  border-left-width: 4px; border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px);
}
.callout h3 { color: var(--accent-text); }
.callout ul { margin: 12px 0 0; padding-left: 0; list-style: none; }
.callout li { position: relative; padding-left: 24px; margin-bottom: 10px; color: var(--ink-soft); }
.callout li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono);
}

/* ===================== Tables ===================== */
.table-scroll {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 18px 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.table-scroll > table { margin: 0 !important; min-width: 480px; width: 100%; border-collapse: collapse; }
:where(*:has(> .table-scroll), *:has(> * > .table-scroll), *:has(> * > * > .table-scroll)) { min-width: 0; }
table { font-family: var(--mono); font-size: .9rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-2); color: var(--ink); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
caption { caption-side: bottom; font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); padding-top: 10px; text-align: left; }

/* ===================== FAQ ===================== */
.faq { display: grid; gap: 12px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); overflow: hidden;
}
.faq details { transition: border-color .24s var(--ease), box-shadow .24s var(--ease); }
.faq details:hover { border-color: var(--line-strong); box-shadow: 0 18px 34px -30px rgba(27,42,74,0.5); }
.faq details[open] { border-color: var(--accent); box-shadow: 0 18px 34px -30px rgba(192,57,43,0.35); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px clamp(18px, 3vw, 24px);
  font-family: var(--serif); font-weight: 700; font-size: 1.08rem; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.faq summary:hover { color: var(--accent-text); background: var(--surface-2); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.4rem; color: var(--accent-text);
  transition: transform .3s var(--ease); flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer {
  height: 0; padding: 0 clamp(18px, 3vw, 24px); overflow: hidden;
  transition: height .36s cubic-bezier(.4,0,.2,1), padding-block-end .36s cubic-bezier(.4,0,.2,1);
}
.faq details[open] .answer { height: auto; padding-block-end: 22px; }
.faq .answer p { margin: 0 0 .8rem; }
.faq .answer p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .faq .answer { transition: none; } }

/* ===================== Contact cards ===================== */
.contact-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.contact-card {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 22px;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.contact-card:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -32px rgba(27,42,74,0.4); }
.contact-card .ck {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2); color: var(--accent-text);
  display: grid; place-items: center; font-family: var(--mono); font-size: 1.1rem;
  margin-bottom: 14px; border: 1px solid var(--line);
  transition: background .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease), transform .24s var(--ease);
}
.contact-card:hover .ck {
  background: var(--accent); color: #fff; border-color: var(--accent);
  transform: scale(1.06) rotate(-4deg);
}
@media (prefers-reduced-motion: reduce) {
  .contact-card, .contact-card .ck { transition: none; }
  .contact-card:hover { transform: none; }
  .contact-card:hover .ck { transform: none; }
}
.contact-card h4 { margin-bottom: 4px; }
.contact-card a, .contact-card p { display: block; color: var(--ink-soft); text-decoration: none; margin: 2px 0; word-break: break-word; }
.contact-card a:hover { color: var(--accent2-text); }
.contact-card .sub { font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); margin-top: 8px; }

.hours-grid { display: grid; gap: 8px; }
.hours-grid .row {
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: .9rem; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--surface);
}
.hours-grid .row.today { border-color: var(--accent); background: #fcf1ef; }
.hours-grid .row span:first-child { color: var(--ink); }
.hours-grid .row span:last-child { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ===================== Forms ===================== */
.form-wrap {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: clamp(22px, 3.4vw, 36px);
}
.form-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 2px; padding: 12px 13px;
  width: 100%; transition: border-color .2s, background .2s;
}
.field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23216355' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); background-color: var(--surface);
}
.field.kvkk { flex-direction: row; align-items: flex-start; gap: 11px; }
.field.kvkk label { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: .92rem; color: var(--ink-soft); }
.field input[type="checkbox"] {
  appearance: auto; -webkit-appearance: auto;
  width: 18px; height: 18px; min-width: 18px; min-height: 18px;
  padding: 0; border: 0; margin: 3px 0 0; accent-color: var(--accent);
}
.form-wrap button[type="submit"] { width: 100%; }
@media (min-width: 640px) { .form-wrap button[type="submit"] { width: auto; } }

/* ===================== Footer ===================== */
.site-footer {
  background: var(--ink); color: #B9C0D1;
  padding-block: clamp(44px, 6vw, 70px) 26px;
  position: relative; z-index: 1;
  border-top: 3px solid var(--accent);
}
.footer-top { display: grid; gap: 34px; }
@media (min-width: 760px) { .footer-top { grid-template-columns: 1.6fr 1fr 1fr; } }
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand .brand .brand-mark { border-color: #fff; color: #F3A79B; }
.footer-brand .brand .brand-mark span { background: var(--ink); }
.footer-brand p { color: #9BA3B8; font-size: .92rem; max-width: 40ch; }
.footer-col h4 { color: #fff; font-family: var(--mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.footer-col a { display: block; color: #B9C0D1; text-decoration: none; padding: 6px 0; font-size: .94rem; transition: color .2s, padding-left .2s; }
.footer-col a:hover { color: #fff; padding-left: 5px; }
.footer-legalbox {
  margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.14);
  font-family: var(--mono); font-size: .76rem; color: #9EA8BC; line-height: 1.8;
}
.footer-legalbox b { color: #B9C0D1; font-weight: 600; }
.footer-legalbox a { color: #C7CEDD; text-decoration: none; word-break: break-word; }
.footer-legalbox a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.14);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center;
}
.footer-bottom .legal-links a { display: inline; color: #B9C0D1; text-decoration: none; margin-right: 16px; font-size: .86rem; }
.footer-bottom .legal-links a:hover { color: #fff; }
.footer-disclaimer {
  margin-top: 16px; font-family: var(--mono); font-size: .76rem; color: #F3A79B;
  background: rgba(192,57,43,0.14); border: 1px solid rgba(192,57,43,0.4);
  border-radius: 2px; padding: 11px 14px; text-align: center;
}

/* ===================== Cookie banner ===================== */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 520px;
  margin: 0 auto; z-index: 1030;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: 0 30px 60px -30px rgba(27,42,74,0.6);
  transform: translateY(140%); opacity: 0;
  transition: transform .28s var(--ease), opacity .24s;
}
.cookie-banner.is-visible { transform: translateY(0); opacity: 1; }
/* keep banner out of the way while the mobile drawer is open */
html.nav-open .cookie-banner,
body:has(.drawer.is-open) .cookie-banner { display: none; }
@media (min-width: 720px) { .cookie-banner { left: 24px; right: auto; max-width: 420px; } }
.cookie-banner h4 { margin-bottom: 8px; }
.cookie-banner p { font-size: .88rem; margin-bottom: 14px; }
.cookie-banner p a { color: var(--accent2-text); }
.cookie-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.cookie-actions button {
  flex: 1 1 auto; min-height: 44px; padding: 11px 14px; border-radius: 2px;
  font-family: var(--sans); font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
/* Accept & reject carry equal visual weight (no dark-pattern nudge) */
.cookie-actions button[data-consent="accept"],
.cookie-actions button[data-consent="reject"] {
  flex: 1 1 140px; background: var(--ink); color: #fff; border-color: var(--ink);
}
.cookie-actions button[data-consent="accept"]:hover,
.cookie-actions button[data-consent="accept"]:focus-visible {
  background: var(--accent); border-color: var(--accent); transform: translateY(-2px);
}
.cookie-actions button[data-consent="reject"]:hover,
.cookie-actions button[data-consent="reject"]:focus-visible {
  background: var(--accent2); border-color: var(--accent2); transform: translateY(-2px);
}
/* Settings is the tertiary, lower-commitment option */
.cookie-actions button[data-consent="settings"] {
  flex: 1 1 100%; background: transparent; border-color: var(--line-strong); color: var(--ink-soft);
}
.cookie-actions button[data-consent="settings"]:hover,
.cookie-actions button[data-consent="settings"]:focus-visible { background: var(--surface-2); border-color: var(--ink); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .cookie-actions button:hover { transform: none; } }

/* ===================== Doc / legal pages ===================== */
.doc-hero { padding-top: calc(var(--header-h) + 52px); padding-bottom: 20px; }
.doc { max-width: 760px; }
.doc h2 { margin-top: 2.2rem; }
.doc h3 { margin-top: 1.6rem; }
.doc p, .doc li { color: var(--ink-soft); }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 1rem; }
.doc li { margin-bottom: 7px; }
.doc .meta { font-family: var(--mono); font-size: .8rem; color: var(--ink-faint); }

/* ===================== Thank you / 404 ===================== */
.center-stage {
  min-height: calc(100vh - var(--header-h));
  display: grid; place-items: center; text-align: center;
  padding: calc(var(--header-h) + 40px) 0 60px;
}
.center-stage .inner { max-width: 560px; }
.center-stage .big {
  font-family: var(--mono); font-size: clamp(3.5rem, 12vw, 7rem);
  color: var(--accent-text); line-height: 1; margin-bottom: 10px;
}

/* ===================== Reveal ===================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
html.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* decorative tick animation on headings */
@keyframes tick-blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; animation: tick-blink 2.4s infinite var(--ease); }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ===================== Utilities ===================== */
.mt-0 { margin-top: 0; }
.grid-2 { display: grid; gap: 22px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.grid-3 { display: grid; gap: 20px; }
@media (min-width: 820px) { .grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.stack-sm > * + * { margin-top: 10px; }

/* ===================== Responsive ===================== */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .log-list li { grid-template-columns: 1fr; gap: 4px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

.scroll-progress{position:fixed;top:0;left:0;height:3px;width:100%;transform:scaleX(0);transform-origin:0 50%;will-change:transform;background:var(--accent);z-index:9998;transition:transform 80ms linear;pointer-events:none}
