/* 451 Atölye — premium FX layer
 * Fahrenheit 451 dili: köz kıvılcımı → mürekkep. Hepsi JS ile açılır (html.fx-on);
 * JS yoksa ya da reduced-motion ise site statik ve eksiksiz kalır.
 */

:root {
  --fx-ember: #ff8a4c;
  --fx-ember-hot: #ffd2a8;
  --fx-ink: #163e3a;
  --fx-ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* —— Lenis —— */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* —— Intro: 0 → 451°F ——
 * Inline head script sets html.fx-intro; this cover hides the first paint until
 * JS builds the real overlay. If JS never arrives, it fades out by itself.
 */
html.fx-intro::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--fx-ink);
  animation: fx-intro-fallback 0.4s ease 2.6s forwards;
}

@keyframes fx-intro-fallback {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.fx-intro {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 60%, rgba(196, 106, 66, 0.22), transparent 70%),
    var(--fx-ink);
  color: #fff;
  clip-path: inset(0 0 0 0);
}

.fx-intro__inner {
  display: grid;
  justify-items: center;
  gap: 1.1rem;
}

.fx-intro__count {
  font-family: var(--font-heading, inherit);
  font-size: clamp(4.5rem, 16vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: transparent;
  background: linear-gradient(180deg, #fff 30%, var(--fx-ember-hot) 70%, var(--fx-ember) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.fx-intro__count sup {
  font-size: 0.3em;
  vertical-align: 1.9em;
  letter-spacing: 0;
  margin-left: 0.08em;
}

.fx-intro__bar {
  width: min(260px, 60vw);
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.fx-intro__bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--water, #2f7a72), var(--fx-ember), var(--fx-ember-hot));
  box-shadow: 0 0 14px var(--fx-ember);
  transform: scaleX(0);
  transform-origin: left center;
}

/* —— Grain —— */
.fx-grain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— Scroll progress —— */
.fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 9995;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--water, #2f7a72), var(--ember, #c46a42) 70%, var(--fx-ember-hot));
  box-shadow: 0 0 10px rgba(255, 138, 76, 0.55);
}

/* —— Hero: embers, spotlight, ignition —— */
.fx-spotlight {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(
    circle 34vmax at var(--fx-mx, 50%) var(--fx-my, 50%),
    rgba(255, 170, 110, 0.16),
    rgba(47, 122, 114, 0.06) 45%,
    transparent 70%
  );
  mix-blend-mode: screen;
}

.home-hero:hover .fx-spotlight {
  opacity: 1;
}

.fx-on .home-hero .hero-visual-context {
  will-change: transform;
}

.fx-word {
  display: inline-block;
  white-space: nowrap;
}

.fx-char {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.fx-ink-word {
  position: relative;
}

.fx-ink-stroke {
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.16em;
  width: 104%;
  height: 0.32em;
  overflow: visible;
  pointer-events: none;
}

.fx-ink-stroke path {
  fill: none;
  stroke: url(#fx-ink-grad);
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 138, 76, 0.55));
}

/* —— Split headings: words rise from a mask —— */
.fx-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.fx-mask > span {
  display: inline-block;
}

/* —— Tilt cards —— */
.fx-tilt {
  transform-style: preserve-3d;
}

.fx-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    circle 220px at var(--fx-gx, 50%) var(--fx-gy, 50%),
    rgba(255, 255, 255, 0.28),
    rgba(255, 196, 150, 0.08) 40%,
    transparent 70%
  );
  mix-blend-mode: soft-light;
}

.fx-tilt:hover .fx-glare {
  opacity: 1;
}

/* —— Page transitions: native cross-document View Transitions ——
 * No JS, no blocking overlay: the browser snapshots both pages and morphs.
 * Header keeps its own layer so it stays put while content changes.
 */
@view-transition {
  navigation: auto;
}

.site-header {
  view-transition-name: site-header;
}

::view-transition-group(site-header) {
  animation-duration: 0s;
}

::view-transition-old(root) {
  animation: fx-vt-out 0.28s cubic-bezier(0.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: fx-vt-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both;
}

@keyframes fx-vt-out {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.992);
    filter: blur(4px);
  }
}

@keyframes fx-vt-in {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
}

@media (hover: none), (pointer: coarse) {
  .fx-spotlight {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.fx-intro::after,
  .fx-intro,
  .fx-grain {
    display: none !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }

}

/* ═══════════ Story scene: bir sayfanın yolculuğu ═══════════
 * Varsayılan (JS yok / reduced-motion) = son hal; premium-fx.js başlangıcı gizleyip scrub'lar.
 */
.fx-story,
html[data-theme] body:not(#ax) .home-page > section.fx-story {
  position: relative;
  background:
    radial-gradient(ellipse 50% 60% at 85% 40%, rgba(196, 106, 66, 0.1), transparent 70%),
    radial-gradient(ellipse 60% 60% at 10% 90%, rgba(47, 122, 114, 0.12), transparent 70%),
    #f6f1e9 !important;
  color: var(--site-ink, #1a2c2a);
  overflow: hidden;
}

.fx-story__pin {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: var(--ax-max, 1240px);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(76px + 2.5rem) var(--ax-gutter, 24px) 3rem;
  box-sizing: border-box;
}

.fx-story__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--ember-deep, #9a4e30);
}

.fx-story__eyebrow::before {
  content: "";
  width: 28px;
  height: 1.5px;
  background: currentColor;
}

html[data-theme] .fx-story .fx-story__title {
  margin: 0 0 2rem;
  font-family: var(--ax-display, Georgia, serif) !important;
  font-size: clamp(2.2rem, 4.4vw, 3.9rem);
  font-weight: 360;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--fx-ink);
}

.fx-story__steps {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.fx-story.is-live .fx-story__step {
  cursor: pointer;
}

.fx-story__step {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  transition: background 0.5s var(--fx-ease-expo), opacity 0.5s ease;
}

.fx-story__num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--water, #2f7a72);
  padding-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

html[data-theme] .fx-story .fx-story__step h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--fx-ink);
}

.fx-story__step p {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--site-ink-body, rgba(26, 44, 42, 0.82));
}

/* JS-driven step states */
.fx-story.is-live .fx-story__step {
  opacity: 0.38;
}

.fx-story.is-live .fx-story__step.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 40px -30px rgba(22, 62, 58, 0.5);
}

.fx-story.is-live .fx-story__step.is-done {
  opacity: 0.62;
}

.fx-story.is-live .fx-story__step.is-done .fx-story__num::before {
  content: "✓ ";
  color: var(--ember, #c46a42);
}

.fx-story__progress {
  display: none;
  height: 2px;
  margin: 0 0 1.4rem 0.9rem;
  max-width: 280px;
  background: rgba(22, 62, 58, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.fx-story.is-live .fx-story__progress {
  display: block;
}

.fx-story__progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--water, #2f7a72), var(--ember, #c46a42));
  transform: scaleX(0);
  transform-origin: left;
}

.fx-story__cta {
  margin-left: 0.9rem;
}

/* —— Stage —— */
.fx-story__stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 640px;
  justify-self: center;
}

.fx-drop {
  position: absolute;
  inset: 8% 12% 18% 6%;
  border: 1.5px dashed rgba(47, 122, 114, 0.4);
  border-radius: 22px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  color: var(--water, #2f7a72);
  background: rgba(255, 255, 255, 0.35);
  opacity: 0;
  visibility: hidden;
}

.fx-drop__icon svg {
  width: 40px;
  height: 40px;
}

.fx-drop__file {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px -18px rgba(22, 62, 58, 0.45);
  font-size: 0.82rem;
  color: var(--fx-ink);
}

.fx-drop__bar {
  width: 180px;
  height: 4px;
  border-radius: 99px;
  background: rgba(47, 122, 114, 0.14);
  overflow: hidden;
}

.fx-drop__bar i {
  display: block;
  height: 100%;
  background: var(--water, #2f7a72);
  transform-origin: left;
}

.fx-editors {
  position: absolute;
  top: 1%;
  left: 6%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.8rem 0.35rem 0.35rem;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 10px 26px -16px rgba(22, 62, 58, 0.5);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--fx-ink);
}

.fx-editors__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  border: 2px solid #fff;
}

.fx-editors__dot--a { background: var(--water, #2f7a72); }
.fx-editors__dot--b { background: var(--ember, #c46a42); margin-left: -0.55rem; }

.fx-editors__label {
  margin-left: 0.35rem;
}

.fx-ms {
  position: absolute;
  top: 9%;
  left: 6%;
  width: 62%;
  min-height: 74%;
  padding: 1.6rem 1.5rem 1.8rem;
  box-sizing: border-box;
  background: #fffdf8;
  border-radius: 6px 14px 14px 6px;
  box-shadow:
    0 1px 0 rgba(22, 62, 58, 0.04),
    0 40px 70px -40px rgba(22, 62, 58, 0.55),
    inset 3px 0 0 rgba(22, 62, 58, 0.05);
  font-family: var(--font-heading, Georgia, serif);
  z-index: 2;
}

.fx-ms__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(22, 62, 58, 0.08);
  font-family: var(--font-body, inherit);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(22, 62, 58, 0.45);
}

.fx-ms__line {
  position: relative;
  margin: 0 0 0.85rem;
  font-size: clamp(0.84rem, 1.15vw, 1.02rem);
  line-height: 1.5;
  color: #2a2620;
}

.fx-ms__txt {
  position: relative;
  z-index: 1;
}

/* Highlight + strike as background layers so they follow wrapped lines */
.fx-ms__line .fx-ms__txt {
  --hl: 1;
  --st: 0;
  background-image:
    linear-gradient(var(--ember, #c46a42), var(--ember, #c46a42)),
    linear-gradient(var(--hl-c, transparent), var(--hl-c, transparent));
  background-repeat: no-repeat;
  background-position: 0 58%, 0 88%;
  background-size: calc(var(--st) * 100%) 2px, calc(var(--hl) * 100%) 0.62em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.fx-ms__line[data-hl="water"] .fx-ms__txt { --hl-c: rgba(47, 122, 114, 0.2); }
.fx-ms__line[data-hl="ember"] .fx-ms__txt { --hl-c: rgba(196, 106, 66, 0.2); }

.fx-ms__line--weak .fx-ms__txt {
  --st: 1;
  color: rgba(42, 38, 32, 0.42);
}

.fx-ms__rewrite {
  display: block;
  margin-top: 0.3rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--water, #2f7a72);
  font-style: italic;
  color: var(--water-deep, #1e524c);
}

.fx-note {
  position: absolute;
  left: calc(100% + 1.6rem);
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: max-content;
  max-width: 13rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 30px -18px rgba(22, 62, 58, 0.55);
  font-family: var(--font-body, inherit);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fx-ink);
}

.fx-note::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 1.4rem;
  height: 1px;
  border-top: 1.5px dashed currentColor;
  opacity: 0.4;
}

.fx-note b {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  color: #fff;
}

.fx-note--ember { color: var(--ember-deep, #9a4e30); }
.fx-note--ember b { background: var(--ember, #c46a42); }
.fx-note--water { color: var(--water-deep, #1e524c); }
.fx-note--water b { background: var(--water, #2f7a72); }

.fx-cur {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
}

.fx-cur svg {
  width: 16px;
  height: 16px;
}

.fx-cur em {
  margin-top: 12px;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-family: var(--font-body, inherit);
  font-style: normal;
  font-size: 0.64rem;
  font-weight: 800;
  color: #fff;
}

.fx-cur--a svg { fill: var(--water, #2f7a72); }
.fx-cur--a em { background: var(--water, #2f7a72); }
.fx-cur--b svg { fill: var(--ember, #c46a42); }
.fx-cur--b em { background: var(--ember, #c46a42); }

.fx-report {
  position: absolute;
  right: 0;
  bottom: 2%;
  z-index: 4;
  width: 52%;
  padding: 1.2rem 1.25rem;
  box-sizing: border-box;
  border-radius: 18px;
  background: var(--fx-ink);
  color: #fff;
  box-shadow: 0 40px 80px -40px rgba(10, 25, 23, 0.8);
}

.fx-report__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fx-report__head b {
  display: block;
  font-size: 0.86rem;
}

.fx-report__head small {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.55);
}

.fx-report__seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--fx-ember-hot), var(--ember, #c46a42));
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  box-shadow: 0 0 22px rgba(255, 138, 76, 0.45);
}

.fx-report__rows {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.fx-report__rows li {
  display: grid;
  grid-template-columns: 6.2rem 1fr;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
}

.fx-report__rows i {
  position: relative;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.fx-report__rows i::after {
  content: "";
  position: absolute;
  inset: 0;
  width: calc(var(--v) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--water, #2f7a72), #8fd3c8);
  transform-origin: left;
  transform: scaleX(var(--fill, 1));
}

.fx-report__rows li:first-child i::after {
  background: linear-gradient(90deg, var(--ember, #c46a42), var(--fx-ember-hot));
}

.fx-report__priority {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 138, 76, 0.55);
  background: rgba(255, 138, 76, 0.08);
}

.fx-report__priority small {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.fx-report__priority b {
  font-size: 0.86rem;
  color: var(--fx-ember-hot);
}

@media (max-width: 900px) {
  .fx-story__pin {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 1.25rem;
    padding-top: calc(var(--site-header-height, 72px) + 1rem);
  }

  html[data-theme] .fx-story .fx-story__title {
    margin-bottom: 0.9rem;
  }

  .fx-story__stage {
    order: 2;
    max-width: 460px;
  }

  .fx-ms {
    width: 70%;
    padding: 1.1rem 1rem 1.2rem;
  }

  .fx-note {
    left: auto;
    right: -46%;
    top: -0.4rem;
    max-width: 42%;
    font-size: 0.64rem;
    padding: 0.4rem 0.5rem;
  }

  .fx-note::before {
    display: none;
  }

  .fx-report {
    width: 64%;
    padding: 0.9rem;
  }

  .fx-report__rows li {
    grid-template-columns: 5rem 1fr;
    font-size: 0.64rem;
  }

  /* Pinned on mobile: only the active step's text is shown */
  .fx-story.is-live .fx-story__steps {
    position: relative;
    min-height: 6.5rem;
    margin-bottom: 0.6rem;
  }

  .fx-story.is-live .fx-story__step {
    position: absolute;
    inset: 0 0 auto;
    opacity: 0;
    background: none;
    box-shadow: none;
    padding: 0;
  }

  .fx-story.is-live .fx-story__step.is-done {
    opacity: 0;
  }

  .fx-story.is-live .fx-story__step.is-active {
    opacity: 1;
    background: none;
    box-shadow: none;
  }

  .fx-story.is-live .fx-story__progress {
    margin-left: 0;
  }

  .fx-story__cta {
    display: none !important;
  }
}
