/* Section "film" — the first 17 seconds of the site's brand film, scrubbed by scroll.
 * The film lives in a FIXED stage (.film-stage) that outlives this section: it keeps showing the
 * glowing 1453 ring while the concept's "bakis" section takes over, then collapses and fades out. */

.s-film {
  position: relative;
  background: transparent;
  --seg: 177vh; /* scroll per scene — same rhythm as the original (1240vh / 7) */
}
/* every real section sits above the fixed film */
main {
  position: relative;
  z-index: 1;
}
/* "bakis" must be see-through while the film is still behind it */
main .s-bakis {
  background: transparent;
}

.film__track {
  position: relative;
  height: calc(var(--seg) * 3 + 100vh);
  height: calc(var(--seg) * 3 + 100svh);
}
.film__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* ------------------------------------------------------------ the fixed film stage */
.film-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
  pointer-events: none;
}
.film-stage video,
.film-stage canvas,
.film-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--fx, 50%) 50%;
}
.film-stage canvas {
  display: none;
}
.film-stage.use-canvas canvas {
  display: block;
}
.film-stage.use-canvas video {
  display: none;
}
.film-poster {
  background: radial-gradient(120% 120% at 50% 30%, #1b130c, #060403);
  opacity: 1;
  transition: opacity 0.8s ease;
}
.film-stage.is-ready .film-poster {
  opacity: 0;
}
.film-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(130% 95% at 50% 42%, transparent 30%, rgba(6, 4, 3, 0.62) 100%),
    linear-gradient(180deg, rgba(6, 4, 3, 0.72) 0%, transparent 24%, transparent 56%, rgba(6, 4, 3, 0.9) 100%);
}
.film-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  box-shadow: inset 0 0 220px 60px rgba(0, 0, 0, 0.7);
}
/* darkens the phrase column while "bakis" enters; opacity is driven by scroll */
.film-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  background: linear-gradient(90deg, rgba(6, 4, 3, 0.9) 0%, rgba(6, 4, 3, 0.66) 40%, rgba(6, 4, 3, 0.2) 68%, transparent 100%);
}

/* ------------------------------------------------------------ overlay scenes */
.film__scene {
  position: absolute;
  inset: 0;
  display: flex;
  padding: clamp(24px, 6vw, 96px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s linear;
  will-change: opacity;
}
.film__scene .inner {
  max-width: min(660px, 92vw);
  transition: transform 0.3s var(--ease-out);
}
.film__scene--tl {
  padding: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.film__scene--ref {
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}
/* legibility: the film's brightest moment (the sunset, left) sits right behind this text column — a soft dark field under it
   (client, 2026-10-05: "İstanbul'un Fethi…" was unreadable) */
.film__scene--ref::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 78% at 18% 52%, rgba(6, 4, 3, 0.72) 0%, rgba(6, 4, 3, 0.5) 42%, rgba(6, 4, 3, 0) 78%),
    linear-gradient(90deg, rgba(6, 4, 3, 0.55) 0%, rgba(6, 4, 3, 0.25) 38%, rgba(6, 4, 3, 0) 60%);
}

/* scene 0 — the timeline */
.film__intro {
  position: absolute;
  left: 0;
  right: 0;
  top: clamp(96px, 16vh, 180px);
  text-align: center;
  z-index: 3;
  transition: opacity 0.6s ease;
  padding: 0 24px;
}
.film__intro .l1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 48px);
}
.film__intro .l2 {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold-bright);
  font-size: clamp(17px, 2vw, 26px);
  margin-top: 8px;
}
.film__timeline {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.film__timeline::before,
.film__timeline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 34vh;
  z-index: 2;
  pointer-events: none;
}
.film__timeline::before {
  top: 0;
  background: linear-gradient(180deg, var(--bg), transparent);
}
.film__timeline::after {
  bottom: 0;
  background: linear-gradient(0deg, var(--bg), transparent);
}
.film__years {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, 0);
  will-change: transform;
}
.film__yr {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--pitch, 72px);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.02em;
  opacity: 0.4;
  transition:
    color 0.35s ease,
    text-shadow 0.35s ease;
}
.film__yr .n {
  display: inline-block;
  transition: transform 0.45s var(--ease-out);
}
.film__yr .evt {
  position: absolute;
  left: calc(50% + clamp(70px, 9vw, 150px));
  white-space: nowrap;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: clamp(12px, 1.3vw, 16px);
  color: var(--muted);
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}
.film__yr .evt::before {
  content: "";
  width: clamp(26px, 4vw, 54px);
  height: 1px;
  background: var(--gold);
}
.film__yr.center {
  color: var(--gold-bright);
  text-shadow: 0 0 40px rgba(231, 200, 120, 0.45), 0 0 90px rgba(179, 21, 27, 0.4);
}
.film__yr.center .n {
  transform: scale(1.45);
}
.film__yr.center .evt {
  opacity: 1;
  transform: none;
  color: var(--ink);
}
.film__yr.climax.center {
  color: #fff;
  text-shadow: 0 0 50px rgba(231, 200, 120, 0.85), 0 0 120px rgba(216, 35, 42, 0.7);
}
.film__yr.climax.center .n {
  transform: scale(2);
}
.film__focus {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(231, 200, 120, 0) 30%, rgba(231, 200, 120, 0.28) 50%, rgba(231, 200, 120, 0) 70%, transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.film__focus.on {
  opacity: 1;
}
@media (max-width: 560px) {
  .film__yr .evt {
    left: calc(50% + 50px);
    font-size: 11px;
    gap: 8px;
  }
  .film__yr .evt::before {
    width: 18px;
  }
}

/* scene 1 — "Referans noktası olarak 1453…" + four plaques */
.film__head {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.06;
  font-size: clamp(30px, 5.4vw, 70px);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.55);
  margin-top: 18px;
}
.film__head em {
  font-style: normal;
  color: var(--gold-bright);
}
.film__sub {
  margin-top: 22px;
  font-size: clamp(16px, 1.6vw, 21px);
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink);
  max-width: 50ch;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 2px 22px rgba(0, 0, 0, 0.75);
}
.film__concepts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 30px;
  max-width: 540px;
}
.film__plaque {
  background: rgba(20, 12, 8, 0.42);
  border: 1px solid rgba(214, 171, 92, 0.26);
  border-radius: 7px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px 20px;
  text-align: left;
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s var(--ease-out),
    border-color 0.6s ease;
}
.film__plaque .t {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 1.7vw, 21px);
  color: var(--muted);
  line-height: 1.2;
  transition: color 0.6s ease;
}
.film__plaque.on {
  opacity: 1;
  transform: none;
  border-color: rgba(214, 171, 92, 0.42);
}
.film__plaque.on .t {
  color: var(--gold-bright);
}
@media (max-width: 560px) {
  .film__concepts {
    grid-template-columns: 1fr;
    max-width: 340px;
  }
}

/* the header never slides away, however far the visitor scrolls (core.js adds .is-hidden on scroll-down) */
.nav.is-hidden {
  transform: none;
}

/* stacked "bakis" layout (phones): the phrases sit on top, so shade from the top instead of from the left */
@media (max-width: 759px) {
  .film-shade {
    background: linear-gradient(180deg, rgba(6, 4, 3, 0.9) 0%, rgba(6, 4, 3, 0.68) 36%, rgba(6, 4, 3, 0.18) 62%, transparent 100%);
  }
}

/* ------------------------------------------------------------ phones: shorter scroll, canvas frames */
@media (max-width: 820px) {
  .s-film {
    --seg: 130vh;
  }
  .film__scene {
    padding: 90px 22px 44px;
  }
  .film__scene--tl {
    padding: 0;
  }
}

/* ------------------------------------------------------------ reduced motion: one static screen, no film */
.s-film.is-static .film__track {
  height: auto;
}
.s-film.is-static .film__pin {
  position: relative;
  height: auto;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: clamp(110px, 16vh, 170px) var(--gutter) 90px;
  background:
    linear-gradient(180deg, rgba(6, 4, 3, 0.6), rgba(6, 4, 3, 0.88)),
    url("../../assets/frames-v3/f048.jpg") 68% 50% / cover;
}
.s-film.is-static .film__scene {
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  padding: 0;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
.s-film.is-static .film__scene--tl {
  display: none;
}
.s-film.is-static .film__plaque {
  opacity: 1;
  transform: none;
}
