/* Kıvılcım — yerleşim ve hareket.
   İki düzen vardır:
   1. html.film-mode  : geniş ekranda dikey kaydırma, 11 bölümü yatay bir film şeridinde ilerletir (app.js).
   2. varsayılan      : telefon, kısa ekran veya metin kareye sığmadığında bölümler alt alta okunur.
   app.js her kareye --p (bölüm ilerlemesi), --off (ekran ortasına uzaklık, -1…1), --fade, --b1, --b2 yazar. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
  overflow-x: hidden;
}
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.04; letter-spacing: -.02em; }
em { font-style: italic; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 60;
  background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.kicker, .frame-kicker, .now, .ruler, figcaption, .impact span, .source-list span, .cue, .detail-btn, .source-link {
  font-family: var(--font-mono);
  letter-spacing: .06em;
}

/* ---------- Üst çubuk ---------- */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 50; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--ember); transform-origin: 0 50%; transform: scaleX(0); }

.bar {
  position: fixed; inset: 0 0 auto; z-index: 40; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  color: var(--bar-ink, var(--ink));
  background: linear-gradient(var(--bar-bg, rgba(236,230,218,.94)), var(--bar-bg, rgba(236,230,218,.94)) 70%, transparent);
  transition: color .5s var(--ease), background .5s var(--ease);
}
.mark { font-family: var(--font-display); font-style: italic; font-size: 26px; text-decoration: none; letter-spacing: -.02em; }
.mark span { color: var(--ember); }
.now { margin: 0; font-size: 11px; display: flex; gap: 12px; text-transform: uppercase; }
.now-year { opacity: .8; }
.now-no { color: var(--bar-accent, var(--ember-ink)); }
html.is-dark { --bar-ink: var(--night-ink); --bar-bg: rgba(20,17,15,.9); --bar-accent: var(--ember-soft); }


/* ---------- Yıl cetveli (alt gezinme) ---------- */
.ruler {
  position: fixed; inset: auto 0 0; z-index: 40; height: var(--ruler-h);
  padding: 0 var(--gutter);
  color: var(--bar-ink, var(--ink));
  background: var(--bar-bg, rgba(236,230,218,.94));
  transition: color .5s var(--ease), background .5s var(--ease);
}
.ruler ol {
  list-style: none; margin: 0; padding: 0; height: 100%;
  display: grid; grid-template-columns: repeat(11, minmax(0, 1fr));
  border-top: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 30%, transparent);
}
.ruler a {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  height: 100%; padding: 0 8px 0 0; text-decoration: none; font-size: 10px; opacity: .65;
  transition: opacity .3s, color .3s;
}
.ruler a::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 1px; height: 9px; background: currentColor;
}
.ruler a b { font-weight: 400; font-size: 12px; }
.ruler a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
.ruler a:hover, .ruler a[aria-current] { opacity: 1; }
.ruler a[aria-current] { color: var(--bar-accent, var(--ember-ink)); }
.ruler-fill {
  position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 2px;
  background: var(--ember); transform-origin: 0 50%; transform: scaleX(var(--film, 0));
}

/* ---------- Açılış: gece, tek bir kıvılcım ---------- */
.opening { position: relative; background: var(--night); color: var(--night-ink); }
.opening-stage { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; display: grid; place-items: center; }
.opening-stage::before {
  /* şafak: kıvılcım çizgisi tamamlanırken kâğıt aydınlığı gelir */
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: var(--dawn, 0);
  background: radial-gradient(120% 90% at 50% 78%, #f7d7bf 0%, #f1e2cf 35%, var(--paper) 70%);
}
.opening .scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.opening-copy {
  position: relative; z-index: 2; text-align: center; padding: 0 var(--gutter);
  opacity: calc(1 - var(--o, 0) * 1.6);
  translate: 0 calc(var(--o, 0) * -60px);
}
.opening .kicker { font-size: 11px; text-transform: uppercase; color: var(--night-soft); margin: 0 0 18px; }
.opening h1 { font-size: clamp(76px, 15vw, 230px); font-style: italic; letter-spacing: -.045em; line-height: .9; }
.opening h1 span { color: var(--ember); font-style: normal; }
.opening-question { font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 30px); line-height: 1.3; margin: 26px 0 34px; color: var(--night-soft); }
.opening-question em { color: var(--night-ink); }
.cue { font-size: 11px; text-transform: uppercase; text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }
.cue:hover { color: var(--ember); }
.script-note { max-width: 46ch; margin: 22px auto 0; color: var(--night-soft); font-size: 13px; }

/* JavaScript yokken etkisiz düğmeler yerine ana metin ve sahne açıklamaları okunur. */
html:not(.js-enabled) .detail-btn,
html:not(.js-enabled) .scene-canvas { display: none; }
html:not(.js-enabled) .stage .sr-only {
  position: static; width: auto; height: auto; margin: 14px 0 0;
  overflow: visible; clip: auto; white-space: normal; color: var(--ink-soft); font-size: 14px;
}

/* ---------- Film şeridi: kareler ---------- */
.film { position: relative; }
.frame {
  position: relative;
  padding: 72px var(--gutter) 64px;
  border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 18px;
  overflow: hidden;
}
.frame-copy { display: contents; }
.frame-kicker { order: 1; }
.frame h2 { order: 2; }
.stage { order: 3; }
.beats { order: 4; }
.impact { order: 5; }
.frame-actions { order: 6; }

.frame-year {
  position: absolute; right: var(--gutter); top: 28px; z-index: 0;
  font-family: var(--font-display); font-style: italic; line-height: .8; letter-spacing: -.05em;
  font-size: clamp(90px, 22vw, 360px);
  color: transparent; -webkit-text-stroke: 1px rgba(22, 19, 15, .2);
  pointer-events: none; white-space: nowrap;
}
.frame-kicker { position: relative; z-index: 2; margin: 0; font-size: 11px; text-transform: uppercase; color: var(--ink-soft); display: flex; gap: 12px; }
.frame-kicker span { color: var(--ember-ink); }
.frame h2 { position: relative; z-index: 2; font-size: clamp(40px, 5.4vw, 84px); }
.beats { position: relative; z-index: 2; display: grid; gap: 14px; max-width: 46ch; }
.beat { margin: 0; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.impact {
  position: relative; z-index: 2; margin: 0; max-width: 44ch; font-size: 15px; line-height: 1.5;
  padding-left: 16px; border-left: 2px solid var(--ember);
}
.impact span { display: block; font-size: 10px; text-transform: uppercase; color: var(--ember-ink); margin-bottom: 4px; }
.frame-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.detail-btn {
  display: inline-flex; gap: 12px; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--ink); background: transparent; cursor: pointer; font-size: 11px; text-transform: uppercase;
  transition: background .25s, color .25s, border-color .25s;
}
.detail-btn:hover { background: var(--ember-ink); border-color: var(--ember-ink); color: var(--paper); }
.detail-btn span { transition: translate .25s var(--ease); }
.detail-btn:hover span { translate: 4px 0; }
.source-link { font-size: 11px; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); padding: 6px 0; }
.source-link:hover { color: var(--ember-ink); border-color: var(--ember-ink); }

/* Sahne: kâğıda basılmış bir fotoğraf karesi gibi */
.stage { position: relative; z-index: 1; margin: 0; }
.stage .scene-canvas {
  width: 100%; aspect-ratio: 800 / 540; height: auto;
  background: #f4efe6;
  box-shadow: 0 1px 0 var(--rule), 0 24px 50px -30px rgba(22, 19, 15, .45);
  outline: 1px solid var(--rule); outline-offset: -1px;
}
.stage figcaption {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 10px;
  font-size: 10px; text-transform: uppercase; color: var(--ink-soft);
}

/* Geniş ekran film düzeni (app.js .film-mode ekler) */
html.film-mode .film { height: var(--film-h, 1500vh); }
html.film-mode .film-viewport { position: sticky; top: 0; height: 100vh; overflow: hidden; }
html.film-mode .film-track { display: flex; height: 100%; width: max-content; will-change: transform; }
html.film-mode .frame {
  width: 100vw; height: 100vh; flex: none; border: 0;
  display: grid; grid-template-columns: minmax(330px, 38%) 1fr; align-items: center;
  column-gap: clamp(28px, 4.5vw, 80px);
  padding: calc(var(--bar-h) + 18px) var(--gutter) calc(var(--ruler-h) + 22px);
}
html.film-mode .frame-copy {
  display: flex; flex-direction: column; gap: 18px;
  translate: calc(var(--off, 0) * -9vw) 0;
  opacity: var(--fade, 1);
}
html.film-mode .frame-year {
  top: auto; right: auto; left: calc(var(--gutter) - .06em); bottom: calc(var(--ruler-h) - 12px);
  font-size: clamp(140px, 24vw, 400px);
  translate: calc(var(--off, 0) * -42vw) 0;
  opacity: calc(.35 + var(--fade, 1) * .65);
}
html.film-mode .stage {
  align-self: center; width: 100%;
  max-width: calc((100vh - var(--bar-h) - var(--ruler-h) - 110px) * 800 / 540);
  justify-self: center;
  translate: calc(var(--off, 0) * 14vw) 0;
  scale: calc(1 - var(--off-abs, 0) * .08);
}
html.film-mode .beats { display: grid; }
html.film-mode .beat { grid-area: 1 / 1; }
html.film-mode .beat-one { opacity: var(--b1, 1); translate: 0 calc((1 - var(--b1, 1)) * -18px); }
html.film-mode .beat-two { opacity: var(--b2, 0); translate: 0 calc((1 - var(--b2, 0)) * 22px); }
html.film-mode .frame h2 { font-size: clamp(42px, 4.8vw, 82px); }

/* ---------- Kapanış: alacakaranlık ---------- */
.finale { position: relative; background: var(--night); color: var(--night-ink); }
.finale-stage { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; display: flex; align-items: center; }
.finale .scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.finale-copy {
  position: relative; z-index: 2; width: 100%; max-width: 1040px;
  padding: calc(var(--bar-h) + 40px) var(--gutter) calc(var(--ruler-h) + 40px);
}
.finale .kicker { font-size: 11px; text-transform: uppercase; color: var(--night-soft); margin: 0 0 22px; }
/* Sabit kapanışta başlık, dar sütunda fazladan satırlara bölünüp kesilmemeli.
   Yükseklik sınırı kısa ve geniş ekranlarda metin ile kaynak bağlantısına yer bırakır. */
.finale h2 { font-size: clamp(46px, min(6.6vw, 10vh), 104px); }
.finale h2 em { color: var(--ember); }
.finale-copy > p:not(.kicker) { color: var(--night-soft); font-size: 18px; max-width: 46ch; margin: 28px 0; }
html.film-mode .finale { height: 170vh; }
html.film-mode .finale-stage { position: sticky; top: 0; height: 100vh; }
html.film-mode .finale-copy { opacity: var(--fin-copy, 1); translate: 0 calc((1 - var(--fin-copy, 1)) * 40px); }

/* ---------- Kaynakça ---------- */
.sources {
  display: grid; grid-template-columns: minmax(260px, 1fr) 1.6fr; gap: clamp(28px, 6vw, 96px);
  padding: 110px var(--gutter) calc(var(--ruler-h) + 90px);
  border-top: 1px solid var(--rule);
}
.sources .kicker { font-size: 11px; text-transform: uppercase; color: var(--ember-ink); margin: 0 0 16px; }
.sources h2 { font-size: clamp(32px, 3.6vw, 52px); margin-bottom: 20px; }
.sources-head p:last-child { color: var(--ink-soft); max-width: 42ch; }
.source-list { list-style: none; margin: 0; padding: 0; counter-reset: src; }
.source-list li { counter-increment: src; border-top: 1px solid var(--rule); }
.source-list li:last-child { border-bottom: 1px solid var(--rule); }
.source-list a {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 14px; align-items: baseline;
  padding: 15px 0; text-decoration: none; font-family: var(--font-display); font-size: 18px; line-height: 1.35;
  transition: color .2s, padding .3s var(--ease);
}
.source-list a::before { content: counter(src, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.source-list a:hover { color: var(--ember-ink); padding-left: 6px; }
.source-list span { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px var(--gutter) calc(var(--ruler-h) + 28px); border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-soft);
}
.foot p { margin: 0; }

/* ---------- Detay pencereleri: sağdan kayan dosya ---------- */
.chapter-dialog {
  margin: 0 0 0 auto; padding: 0; border: 0; height: 100vh; height: 100dvh; max-height: none;
  width: min(720px, 100vw); max-width: 100vw;
  background: var(--paper); color: var(--ink);
  box-shadow: -30px 0 80px -40px rgba(0, 0, 0, .6);
}
.chapter-dialog[open] { animation: dossierIn .55s var(--ease) both; }
.chapter-dialog.is-closing { animation: dossierOut .32s ease-in both; }
.chapter-dialog::backdrop { background: rgba(20, 17, 15, .62); backdrop-filter: blur(3px); }
.chapter-dialog[open]::backdrop { animation: fadeIn .4s ease both; }
.chapter-dialog.is-closing::backdrop { animation: fadeOut .32s ease both; }
@keyframes dossierIn { from { translate: 100% 0; } to { translate: 0 0; } }
@keyframes dossierOut { from { translate: 0 0; } to { translate: 100% 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.dialog-window { height: 100%; display: flex; flex-direction: column; }
.dialog-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px clamp(20px, 4vw, 48px); border-bottom: 1px solid var(--rule);
}
.dialog-tag { display: flex; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; }
.dialog-year { color: var(--ember-ink); }
.dialog-divider { opacity: .4; }
.dialog-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); }
.dialog-close-btn {
  width: 42px; height: 42px; border: 1px solid var(--rule); border-radius: 50%; background: transparent; cursor: pointer;
}
.dialog-close-btn:hover { background: var(--ink); color: var(--paper); }
.dialog-scroll-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 34px clamp(20px, 4vw, 48px) 40px; }
.dialog-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--ember-ink); margin: 0 0 14px; }
.dialog-headline h3 { font-size: clamp(34px, 4.4vw, 54px); }
.dialog-lead { font-family: var(--font-display); font-size: 21px; line-height: 1.45; margin: 22px 0 30px; }
.dialog-section { border-top: 1px solid var(--rule); padding: 22px 0; }
.dialog-section h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; line-height: 1.4; }
.dialog-section p { margin: 0; line-height: 1.7; }
.chapter-dialog[open] .dialog-headline, .chapter-dialog[open] .dialog-section, .chapter-dialog[open] .dialog-quote {
  animation: riseIn .6s var(--ease) both;
}
.chapter-dialog[open] .dialog-section:nth-child(1) { animation-delay: .12s; }
.chapter-dialog[open] .dialog-section:nth-child(2) { animation-delay: .2s; }
.chapter-dialog[open] .dialog-section:nth-child(3) { animation-delay: .28s; }
.chapter-dialog[open] .dialog-quote { animation-delay: .36s; }
@keyframes riseIn { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.dialog-quote { margin: 10px 0 30px; padding: 22px 24px; background: var(--paper-deep); border-left: 3px solid var(--ember); }
.quote-text { font-family: var(--font-display); font-style: italic; font-size: 19px; line-height: 1.5; margin: 0 0 12px; }
.quote-source { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; border-top: 1px solid var(--rule); padding-top: 22px; }
.dialog-source-link { display: inline-flex; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: 12px 0; }
.dialog-source-link:hover { color: var(--ember-ink); }
.dialog-action-close { border: 1px solid var(--ink); background: transparent; padding: 10px 18px; cursor: pointer; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; }
.dialog-action-close:hover { background: var(--ink); color: var(--paper); }

/* ---------- Ekran uyumu ---------- */
@media (min-width: 900px) {
  .frame { padding-top: 96px; }
}
@media (max-width: 899px) {
  .ruler a span { display: none; }
  .ruler a { align-items: flex-start; }
  .now { display: none; }
  .sources { grid-template-columns: 1fr; padding-top: 80px; }
  .source-list a { grid-template-columns: 30px 1fr; font-size: 16px; }
  .source-list span { grid-column: 2; }
}
@media (max-width: 560px) {
  :root { --bar-h: 56px; --ruler-h: 48px; }
  .ruler a b { font-size: 9px; }
  .ruler a { padding-right: 0; }
  .mark { font-size: 22px; }
  .beat { font-size: 16px; }
  .frame { padding: 56px var(--gutter) 48px; }
}
/* 11 yıl en dar telefonlarda da yan yana sığsın */
@media (max-width: 360px) {
  .ruler { padding: 0 10px; }
  .ruler a b { font-size: 8px; letter-spacing: 0; }
}
