/* ==========================================================================
   BASE — reset, tipografi, container, section, yardımcılar, harita dili
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: clip;
  min-height: 100dvh;
}
body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; height: auto; }
img { font-style: italic; color: var(--c-ink-4); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p a:not([class]), .prose li a:not([class]), .acc-content a:not([class]) {
  color: var(--c-accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
hr { border: 0; border-top: var(--bw) solid var(--c-line); margin: var(--sp-8) 0; }
address { font-style: normal; }
::selection { background: var(--c-accent); color: #fff; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
/* Programatik odak alan başlıklar (wizard adımı, başarı ekranı) görsel halka göstermez */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  z-index: var(--z-toast);
  background: var(--c-ink); color: #fff;
  padding: .6rem 1rem; border-radius: var(--r-sm);
  font-weight: var(--fw-medium);
}
.skip-link:focus { top: var(--sp-4); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Tipografi ---------- */
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: var(--fw-semibold); color: var(--c-ink); text-wrap: balance; }
.t-display { font-size: var(--fs-display); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: var(--fw-semibold); }
.t-h1, h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); }
.t-h2, h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: var(--ls-tight); }
.t-h3, h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: var(--ls-snug); }
.t-h4, h4 { font-size: var(--fs-h4); line-height: 1.3; letter-spacing: var(--ls-snug); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.t-lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--c-ink-2); text-wrap: pretty; }
.t-body { font-size: var(--fs-body); }
.t-sm { font-size: var(--fs-body-sm); }
.t-caption { font-size: var(--fs-caption); color: var(--c-ink-3); }
.t-muted { color: var(--c-ink-3); }
.t-muted-2 { color: var(--c-ink-4); }
.t-accent { color: var(--c-accent-ink); }
.t-medium { font-weight: var(--fw-medium); }
.t-semibold { font-weight: var(--fw-semibold); }
.t-balance { text-wrap: balance; }
.t-pretty { text-wrap: pretty; }
.t-center { text-align: center; }

/* Teknik etiket: mono, geniş harf aralığı, küçük */
.t-mono, .label-tech {
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--c-ink-3);
  font-weight: var(--fw-medium);
}
.label-tech { display: inline-flex; align-items: center; gap: .55rem; }
.label-tech::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-accent); flex: none;
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}
.label-tech.is-plain::before { display: none; }

/* Prose: okunabilir metin genişliği */
.prose { max-width: var(--container-prose); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; font-size: var(--fs-h3); }
.prose h3 { margin-top: 1.8em; font-size: var(--fs-h4); }
.prose p, .prose li { font-size: var(--fs-body); line-height: var(--lh-relaxed); color: var(--c-ink-2); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose blockquote {
  margin: 1.6em 0; padding: 1.25rem 1.5rem;
  border-left: 2px solid var(--c-accent);
  background: var(--c-surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--fs-lead); color: var(--c-ink);
}
.prose figure { margin: 2em 0; }
.prose figcaption { margin-top: .6em; font-size: var(--fs-caption); color: var(--c-ink-3); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-body-sm); }
.prose th, .prose td { text-align: left; padding: .7rem .5rem; border-bottom: var(--bw) solid var(--c-line); vertical-align: top; }
.prose th { font-weight: var(--fw-semibold); color: var(--c-ink); }
.prose .callout {
  padding: 1.1rem 1.25rem; border: var(--bw) solid var(--c-line);
  border-radius: var(--r-md); background: var(--c-surface);
  display: grid; gap: .35rem;
}
.prose .callout strong { color: var(--c-ink); }

/* ---------- Container & section ---------- */
.container-rb {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-rb.is-wide { max-width: calc(var(--container-wide) + var(--gutter) * 2); }
.container-rb.is-narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }

.section { position: relative; padding-block: var(--section-y); }
.section.is-sm { padding-block: var(--section-y-sm); }
.section.is-flush-top { padding-top: 0; }
.section.is-flush-bottom { padding-bottom: 0; }
.section.has-line-top { border-top: var(--bw) solid var(--c-line); }

.section-head {
  display: grid; gap: var(--sp-5);
  max-width: 820px;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.section-head.is-center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head .t-lead { max-width: 56ch; }
.section-head-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-6);
  flex-wrap: wrap;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.section-head-row .section-head { margin-bottom: 0; }

/* ---------- Harita dili: grid noktaları, route, node ---------- */
.bg-grid-dots {
  background-image: radial-gradient(var(--c-grid-dot) 1px, transparent 1.2px);
  background-size: 28px 28px;
}
.bg-grid-lines {
  background-image:
    linear-gradient(var(--c-line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-fade-y { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent); }

.node {
  display: inline-grid; place-items: center;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c-surface); border: 2px solid var(--c-ink);
  flex: none;
}
.node.is-active { border-color: var(--c-accent); background: var(--c-accent); }
.node.is-pulse { position: relative; }
.node.is-pulse::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 1px solid var(--c-accent);
  animation: pulse-ring 2.2s var(--ease-out) infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(.6); opacity: .9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Route çizgisi SVG: JS .is-drawn ekleyince çizilir */
.route-path { stroke: var(--c-route-strong); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route-path.is-dashed { stroke-dasharray: 4 6; }
.route-draw { stroke-dasharray: var(--len, 2000); stroke-dashoffset: var(--len, 2000); transition: stroke-dashoffset var(--dur-draw) var(--ease-inout); }
.is-drawn .route-draw, .route-draw.is-drawn { stroke-dashoffset: 0; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }

/* ---------- Skeleton / görsel yükleme ---------- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--c-bg-2); border-radius: var(--r-md);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.img-frame { position: relative; overflow: hidden; background: var(--c-bg-2); border-radius: var(--r-lg); }
.img-frame img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--dur-slow) var(--ease-out); }
.img-frame img.is-loaded, .img-frame img[data-no-fade] { opacity: 1; }
.img-frame.ratio-16x9 { aspect-ratio: 16 / 9; }
.img-frame.ratio-4x3 { aspect-ratio: 4 / 3; }
.img-frame.ratio-3x4 { aspect-ratio: 3 / 4; }
.img-frame.ratio-1x1 { aspect-ratio: 1; }

/* Gerçek fotoğraf gelene kadar kullanılan dürüst placeholder modülü */
.media-placeholder {
  position: relative; display: grid; place-items: center;
  background:
    radial-gradient(var(--c-grid-dot) 1px, transparent 1.2px) 0 0 / 24px 24px,
    var(--c-bg-2);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-lg);
  overflow: hidden; min-height: 160px;
  color: var(--c-ink-4);
}
.media-placeholder.ratio-16x9 { aspect-ratio: 16/9; }
.media-placeholder.ratio-4x3 { aspect-ratio: 4/3; }
.media-placeholder.ratio-3x4 { aspect-ratio: 3/4; }
.media-placeholder.ratio-1x1 { aspect-ratio: 1; }
.media-placeholder.ratio-21x9 { aspect-ratio: 21/9; }
.media-placeholder > span {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ff-mono); font-size: var(--fs-mono); letter-spacing: var(--ls-mono); text-transform: uppercase;
  padding: .4rem .7rem; border: var(--bw) dashed var(--c-line-strong); border-radius: var(--r-sm);
  background: var(--c-surface);
}
.media-placeholder::before, .media-placeholder::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--c-line-strong); border-style: solid;
}
.media-placeholder::before { left: 10px; top: 10px; border-width: 1px 0 0 1px; }
.media-placeholder::after { right: 10px; bottom: 10px; border-width: 0 1px 1px 0; }

/* ---------- Yardımcılar ---------- */
.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.flow-x { display: flex; gap: var(--sp-3); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.flow-x::-webkit-scrollbar { display: none; }
.max-ch-50 { max-width: 50ch; }
.max-ch-60 { max-width: 60ch; }
.mt-auto { margin-top: auto; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .route-draw { stroke-dashoffset: 0; }
}

/* Yatay kaydırma şeritleri: sürüklerken metin seçimi oluşmasın */
.hud-strip, .eco-strip, .diag-list, .legal-nav, .tabs, .case-toggle, .hero-foot {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* Şerit durumları: sürüklenebilir imleç + kenarda "devamı var" solgunluğu */
.strip.is-scrollable { cursor: grab; }
.strip.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.strip.is-dragging * { pointer-events: none; }
.strip.is-scrollable:not(.is-at-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.strip.is-scrollable:not(.is-at-start):not(.is-at-end) { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 56px), transparent); }
.strip.is-scrollable:not(.is-at-start).is-at-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px); mask-image: linear-gradient(to right, transparent, #000 40px); }
