/* ============================================================
   16:40 Dijital — Homepage scroll-story scenes
   ============================================================ */

/* ---------- Scene 1: Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-content: center;
  overflow: clip;
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--s-8) var(--s-6);
}

/* Halftone dot field */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(244, 241, 236, 0.09) 1px, transparent 1.5px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 70% at 60% 40%, black 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(1.75rem, 3.5vw, 3.25rem);
  align-items: center;
}

.hero__copy {
  display: grid;
  gap: var(--s-4);
  justify-items: start;
  justify-self: end;
  width: 100%;
  max-width: 42rem;
}

.hero__visual {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  justify-self: start;
  width: max-content;
  max-width: 100%;
  min-width: min(100%, 17.5rem);
  min-height: clamp(20rem, 52vh, 30rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: color-mix(in srgb, var(--ink-soft) 80%, transparent);
}
.hero__visual-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  border-bottom: 1px solid var(--line);
}
.hero__visual-head::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: var(--accent);
}
.hero__cats {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  min-height: 0;
}

.hero-cat {
  --cat: var(--accent);
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  align-items: center;
  gap: 0.7rem;
  padding: 0 1.1rem;
  min-height: 0;
  text-decoration: none;
  color: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.hero-cat:last-child {
  border-bottom: 0;
}
.hero-cat:hover,
.hero-cat:focus-visible {
  background: color-mix(in srgb, var(--cat) 16%, transparent);
  outline: none;
}
.hero-cat__art {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--cat);
  opacity: 0.9;
}
.hero-cat__art svg {
  width: 100%;
  max-height: 2.75rem;
}
.hero-cat__meta {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  min-width: 0;
}
.hero-cat__num {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  color: var(--cat);
  flex: none;
}
.hero-cat__title {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero__time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(1rem, 4vw, 3rem);
}

.hero__digits {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-mega);
  line-height: 0.9;
  letter-spacing: -0.05em;
  display: flex;
  align-items: baseline;
}
.hero__digits .colon {
  color: var(--accent);
  /* 1 Hz soft square: ~420 ms on, ~80 ms fade, ~420 ms off, ~80 ms fade */
  animation: colon-blink 1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes colon-blink {
  0%,
  42% {
    opacity: 1;
  }
  50%,
  92% {
    opacity: 0.14;
  }
  100% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero__digits .colon {
    animation: none;
    opacity: 1;
  }
}

/* Clock badge */
.hero__clock {
  width: clamp(4.5rem, 4rem + 8vw, 9.5rem);
  flex: none;
}
.hero__clock circle.face {
  fill: none;
  stroke: rgba(244, 241, 236, 0.25);
  stroke-width: 1.5;
}
.hero__clock .tick {
  stroke: rgba(244, 241, 236, 0.4);
  stroke-width: 1.5;
}
.hero__clock .hand {
  stroke: var(--paper);
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 50px 50px;
}
.hero__clock .hand--min {
  stroke: var(--accent);
  stroke-width: 2.5;
}
.hero__clock .pin {
  fill: var(--accent);
}

.hero__tag {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 22em;
}
.hero__tag em {
  font-style: normal;
  color: var(--accent);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-4);
  color: var(--fg-mute);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero__meta .dotsep {
  color: var(--accent);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: var(--s-2);
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }
  .hero__visual {
    justify-self: stretch;
    width: auto;
    min-height: clamp(18rem, 70vw, 24rem);
    order: 2;
  }
  .hero__copy {
    justify-self: stretch;
    max-width: none;
  }
  .hero-cat {
    grid-template-columns: 3.5rem 1fr;
    padding: 0 0.85rem;
  }
  .hero-cat__art svg {
    max-height: 2.1rem;
  }
}

.hero__cue {
  position: absolute;
  bottom: var(--s-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--text-xs);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.hero__cue::after {
  content: "";
  width: 1px;
  height: 3rem;
  background: linear-gradient(var(--accent), transparent);
  animation: cue-drop 1.8s var(--ease-inout) infinite;
}
@keyframes cue-drop {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  45% {
    transform: scaleY(1);
    transform-origin: top;
  }
  55% {
    transform: scaleY(1);
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

/* Registration mark ornament */
.regmark {
  position: absolute;
  top: 14vh;
  right: 6vw;
  width: clamp(3rem, 8vw, 6rem);
  opacity: 0.3;
  animation: reg-spin 40s linear infinite;
}
@keyframes reg-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Scene 2: Manifesto ---------- */
.manifesto p {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 24em;
}
.manifesto .mword {
  opacity: 0.13;
}
.manifesto .mark {
  color: var(--accent);
}

/* ---------- Scene 3: Üretim Hattı (pinned horizontal) ---------- */
.line-scene {
  background: var(--ink);
  color: var(--paper);
  overflow: clip;
}
@media (max-width: 820px) {
  /* clip on the section breaks nested overflow-x scroll on iOS */
  .line-scene {
    overflow: visible;
  }
}
.line-scene__head {
  padding-block: var(--s-section) var(--s-5);
}
.line-scene__head h2 {
  font-size: var(--text-2xl);
}
.line-scene__head p {
  color: var(--fg-mute);
  margin-top: var(--s-2);
}

/* Desktop: wrap is transparent so GSAP pin still targets .line-viewport */
.line-pin-wrap {
  display: contents;
}

.line-viewport {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - 5rem);
  overflow: clip;
  touch-action: pan-y;
  cursor: grab;
}
.line-viewport.is-line-pinned {
  /* Take over gestures so horizontal swipe isn't eaten by page scroll */
  touch-action: none;
  overscroll-behavior-x: none;
}
.line-viewport.is-line-dragging {
  cursor: grabbing;
  user-select: none;
}
.line-viewport.is-line-dragging .station {
  pointer-events: none;
}
/* While production line is pinned, reduce iOS horizontal overscroll / history swipe */
html.is-line-pin-lock {
  overscroll-behavior-x: none;
}
.line-track {
  display: flex;
  flex-direction: row;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-inline: var(--gutter);
  padding-block: var(--s-4);
  width: max-content;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-user-drag: none;
}
/* During pin: skip hover transform transitions (paint cost while scrubbing) */
.line-viewport.is-line-pinned .station {
  transition: border-color var(--dur-fast) var(--ease-out);
}
.line-viewport.is-line-pinned .station:hover {
  transform: none;
}
  .station {
  --st-accent: var(--accent);
  flex: none;
  width: min(78vw, 34rem);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--s-3);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(244, 241, 236, 0.04), transparent 55%);
  text-decoration: none;
  color: var(--paper);
  transition: border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  overflow: hidden;
  isolation: isolate;
  position: relative;
  -webkit-user-drag: none;
}
.station::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--st-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}
.station:hover::after {
  transform: scaleX(1);
}
.station:hover {
  border-color: var(--st-accent);
  transform: translateY(-6px);
}
.station__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-display);
}
.station__num {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--st-accent);
}
.station__cat {
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.station__art {
  height: clamp(9rem, 22vh, 13rem);
  display: grid;
  place-items: center;
}
.station__art svg {
  width: 100%;
  height: 100%;
  max-width: 16rem;
}
.station h3 {
  font-size: var(--text-lg);
}
.station p {
  color: var(--fg-mute);
  font-size: var(--text-sm);
}
.station .link-arrow {
  color: var(--paper);
}

/* Conveyor progress */
.line-progress {
  position: sticky;
  top: 0;
  height: 2px;
  background: var(--line);
  z-index: 2;
}
.line-progress__bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.line-mobile-progress {
  display: none;
  position: sticky;
  top: 4.5rem;
  z-index: 2;
  width: fit-content;
  margin: 0 auto var(--s-2);
  padding: 0.35rem 0.75rem;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--paper);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Mobile horizontal-swipe → “scroll vertically” cue */
.line-scroll-hint {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 5;
  place-items: center;
  gap: 0.55rem;
  pointer-events: none;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  color: var(--paper);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.line-scroll-hint.is-visible {
  opacity: 1;
}
.line-scroll-hint__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--paper) 35%, transparent);
  background: color-mix(in srgb, var(--ink) 70%, transparent);
  animation: line-hint-bob 1.1s ease-in-out infinite;
}
.line-scroll-hint__icon svg {
  width: 1.35rem;
  height: 2rem;
}
.line-scroll-hint__label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@keyframes line-hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@keyframes line-mobile-x {
  to {
    transform: translate3d(var(--line-x-end, -1000px), 0, 0);
  }
}

/* Mobile: sticky wrap + compositor slide; station size tuned for one-card framing */
@media (max-width: 820px) {
  .line-pin-wrap.is-mobile-line {
    display: block;
    position: relative;
    width: 100%;
  }
  .line-viewport {
    min-height: calc(100svh - 4.75rem - 3.55rem - env(safe-area-inset-bottom, 0px));
    padding-bottom: 0.5rem;
    overflow: clip;
    touch-action: pan-y;
    cursor: default;
    -webkit-overflow-scrolling: auto;
    scroll-snap-type: none;
  }
  .line-viewport.is-mobile-sticky {
    position: sticky;
    top: 4.5rem;
    z-index: 1;
    touch-action: pan-y;
    overscroll-behavior-x: none;
  }
  .line-viewport.is-line-pinned {
    touch-action: pan-y;
    overscroll-behavior-x: none;
    cursor: default;
  }
  .line-scroll-hint:not([hidden]) {
    display: grid;
  }
  .line-track {
    will-change: transform;
    padding-inline: var(--gutter);
    contain: layout style;
    transform: translate3d(0, 0, 0);
  }

  /* Safari 17.4+: GPU scroll-driven track (no JS transform on scroll) */
  @supports (animation-timeline: view()) {
    .line-pin-wrap.is-mobile-line.is-css-line {
      view-timeline-name: --line-pin;
      view-timeline-axis: block;
    }
    .line-pin-wrap.is-css-line .line-track {
      animation: line-mobile-x linear both;
      animation-timeline: --line-pin;
      animation-range: contain 0% contain 100%;
    }
  }

  .station {
    width: min(calc(100vw - var(--gutter) * 2), 22rem);
    max-height: calc(100svh - 4.75rem - 3.55rem - env(safe-area-inset-bottom, 0px) - 1rem);
    padding: var(--s-3);
    gap: var(--s-2);
    background: rgba(244, 241, 236, 0.03);
    isolation: auto;
    transition: none;
  }
  .station:hover {
    transform: none;
  }
  .station::after {
    transition: none;
  }
  .station__art {
    height: clamp(5.5rem, 14vh, 9rem);
  }
  .station__art svg {
    contain: strict;
  }
  .station h3 {
    font-size: var(--text-md);
  }
  .line-progress {
    display: block;
  }
  .line-mobile-progress {
    display: block;
  }
}

/* Reduced motion: vertical stack, no pin scrub */
@media (prefers-reduced-motion: reduce) {
  .line-pin-wrap {
    display: contents;
    height: auto !important;
  }
  .line-viewport {
    min-height: 0;
    overflow: visible;
    position: static !important;
  }
  .line-track {
    flex-direction: column;
    align-items: stretch;
    width: auto;
    max-width: 100%;
    transform: none !important;
    animation: none !important;
  }
  .station {
    width: 100%;
  }
  .line-progress {
    display: none;
  }
  .line-mobile-progress {
    display: block;
  }
}

/* ---------- Scene 4: Malzeme Kütüphanesi ---------- */
.materials__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-2);
  margin-top: var(--s-5);
}
.swatch {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: var(--s-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
/* Real macro photo drop-in (replaces CSS texture when present) */
.swatch--photo {
  color: var(--paper);
  background: var(--ink);
}
.swatch--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.swatch--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  /* .cropmarks::after sets 14px corner box; restore full-card scrim */
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 1;
  background: linear-gradient(to top, rgba(14, 14, 16, 0.94) 0%, rgba(14, 14, 16, 0.6) 18%, rgba(14, 14, 16, 0.15) 32%, transparent 42%);
  pointer-events: none;
}
.swatch--photo strong,
.swatch--photo small {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(14, 14, 16, 0.9), 0 0 14px rgba(14, 14, 16, 0.6);
}
.swatch--photo::before {
  display: none;
}
.swatch:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 0 18px 40px rgba(14, 14, 16, 0.14);
}
.swatch strong {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
}
.swatch small {
  font-size: var(--text-xs);
  color: var(--ink-mute);
  position: relative;
}
/* Beat .swatch small mute color on photo cards */
.swatch.swatch--photo strong,
.swatch.swatch--photo small {
  color: #fff !important;
}

.materials__foot {
  margin-top: var(--s-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  color: var(--fg-mute);
  font-size: var(--text-sm);
}

@media (max-width: 900px) {
  .materials__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Scene 5: Sayılarla ---------- */
.stats {
  background: var(--ink);
  color: var(--paper);
}
.stats__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--s-6);
  align-items: center;
}
.stat-hero {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--s-4);
}
.stat-hero__ring {
  width: min(100%, 24rem);
}
.stat-hero__ring .track {
  fill: none;
  stroke: rgba(244, 241, 236, 0.12);
  stroke-width: 2;
}
.stat-hero__ring .fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 289.03;
  stroke-dashoffset: 289.03;
  transform: rotate(-90deg);
  transform-origin: 50px 50px;
}
.stat-hero__body {
  position: absolute;
  display: grid;
  gap: 0.2rem;
}
.stat-hero__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1;
}
.stat-hero__value sup {
  font-size: 0.4em;
  color: var(--accent);
}
.stat-hero__label {
  color: var(--fg-mute);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stats__list {
  display: grid;
  gap: var(--s-4);
}
.stat {
  display: grid;
  gap: 0.3rem;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.stat__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1;
}
.stat__value .suffix {
  color: var(--accent);
}
.stat__label {
  color: var(--fg-mute);
  font-size: var(--text-sm);
}

@media (max-width: 820px) {
  .stats__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Scene 6: Süreç ---------- */
.process__list {
  position: relative;
  display: grid;
  gap: var(--s-5);
  margin-top: var(--s-5);
  padding-left: clamp(2.2rem, 6vw, 4rem);
}
.process__line {
  position: absolute;
  left: 0.55rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--line);
}
.process__line-fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
}
.step {
  position: relative;
  max-width: 40rem;
}
.step::before {
  content: "";
  position: absolute;
  left: calc(-1 * clamp(2.2rem, 6vw, 4rem) + 0.15rem);
  top: 0.45rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.step__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--accent-deep);
  letter-spacing: 0.1em;
}
.step h3 {
  font-size: var(--text-md);
  margin: 0.3rem 0 0.4rem;
}
.step p {
  color: var(--fg-mute);
  font-size: var(--text-sm);
}

/* ---------- Scene 7: Neden 16:40 ---------- */
.why {
  background: var(--ink);
  color: var(--paper);
}
.why h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--s-5);
  max-width: 12em;
}
.why__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.why__list li {
  display: grid;
  gap: 0.35rem;
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}
.why__list strong {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.why__list span {
  color: var(--fg-mute);
  font-size: var(--text-sm);
  max-width: 28ch;
}
.why__ig {
  margin-top: var(--s-6);
  color: var(--fg-mute);
  font-size: var(--text-sm);
}
.why__ig a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.why__ig a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .why__list {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .why__list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Scene 8: CTA finale ---------- */
.finale {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  overflow: clip;
}
.finale h2 {
  font-size: var(--text-hero);
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin-bottom: var(--s-4);
}
.finale h2 em {
  font-style: normal;
  color: var(--accent);
}
.finale p {
  margin-inline: auto;
  color: var(--fg-mute);
  margin-bottom: var(--s-5);
}
.finale__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2);
}
