/* Home — cinematic chapters */

.home-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  padding: calc(var(--header-h) + 2rem) var(--gutter) var(--space-6);
  overflow: hidden;
}

.home-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  filter: saturate(0.85) contrast(1.05);
}

.home-hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 16, 14, 0.35) 0%, rgba(18, 16, 14, 0.55) 40%, rgba(18, 16, 14, 0.92) 100%),
    radial-gradient(ellipse at 30% 20%, rgba(184, 149, 90, 0.12), transparent 50%);
  z-index: 1;
}

.home-hero__content {
  position: relative;
  z-index: 2;
  max-width: 18ch;
  opacity: 1;
}

.home-hero__content > * {
  opacity: 1;
}

.home-hero__content .display {
  margin-bottom: 0.4em;
  font-size: clamp(2.4rem, 1.5rem + 3.2vw, 5rem);
}

.home-hero__content .lead {
  margin-bottom: 2rem;
}

.scroll-hint {
  position: absolute;
  right: var(--gutter);
  bottom: var(--space-6);
  z-index: 2;
  writing-mode: vertical-rl;
  font-size: var(--text-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.scroll-hint::after {
  content: "";
  display: block;
  width: 1px;
  height: 3.5rem;
  background: linear-gradient(to bottom, var(--brass), transparent);
  margin: 0.75rem auto 0;
}

/* Chapter */
.chapter {
  position: relative;
  min-height: 100vh;
  color: var(--paper);
}

.chapter__pin {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.chapter__stage {
  position: absolute;
  inset: 0;
}

.chapter__bg {
  position: absolute;
  inset: -8%;
  z-index: 0;
}

.chapter__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) brightness(0.72);
}

.chapter__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(18, 16, 14, 0.88) 0%, rgba(18, 16, 14, 0.35) 48%, rgba(18, 16, 14, 0.55) 100%),
    linear-gradient(180deg, transparent 50%, rgba(18, 16, 14, 0.75) 100%);
}

.chapter__layers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.chapter__layer {
  position: absolute;
  will-change: transform, opacity;
  pointer-events: auto;
  cursor: pointer;
}

.chapter__layer:nth-child(n + 4) {
  display: none;
}

.chapter__layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
  background: none;
}

.chapter__title,
.chapter__text {
  cursor: pointer;
}

.chapter__layer--a {
  width: min(42vw, 520px);
  right: 8%;
  top: 18%;
  aspect-ratio: 3/4;
}

.chapter__layer--b {
  width: min(28vw, 320px);
  right: 28%;
  bottom: 12%;
  aspect-ratio: 1;
  opacity: 0.85;
}

.chapter__layer--c {
  width: min(18vw, 200px);
  right: 4%;
  bottom: 28%;
  aspect-ratio: 4/5;
  opacity: 0.7;
}

.chapter__copy {
  position: absolute;
  z-index: 3;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  max-width: min(42ch, 90vw);
  padding-right: 1rem;
  opacity: 1;
}

.chapter__index {
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
  color: var(--brass);
  margin-bottom: 1rem;
}

.chapter__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  margin-bottom: 0.75rem;
  line-height: 0.98;
}

.chapter__title-image {
  display: block;
  margin: 0 0 0.85rem;
  max-width: min(22rem, 78vw);
  text-decoration: none;
  color: inherit;
}

.chapter__title-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 7.5rem;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}

.chapter__text {
  color: var(--paper-muted);
  margin-bottom: 1.75rem;
  max-width: 34ch;
}

.chapter__children {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.35rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  max-width: 40ch;
}

.chapter__children a {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-muted);
  border-bottom: 1px solid rgba(184, 149, 90, 0.35);
  padding-bottom: 0.15rem;
  transition: color 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft);
}

.chapter__children a:hover {
  color: var(--brass-soft);
  border-color: var(--brass-soft);
}

.chapter:nth-child(even) .chapter__shade {
  background:
    linear-gradient(270deg, rgba(18, 16, 14, 0.88) 0%, rgba(18, 16, 14, 0.35) 48%, rgba(18, 16, 14, 0.55) 100%),
    linear-gradient(180deg, transparent 50%, rgba(18, 16, 14, 0.75) 100%);
}

.chapter:nth-child(even) .chapter__copy {
  left: auto;
  right: var(--gutter);
  text-align: right;
}

.chapter:nth-child(even) .chapter__text {
  margin-left: auto;
}

.chapter:nth-child(even) .chapter__children {
  margin-left: auto;
  justify-content: flex-end;
}

.chapter:nth-child(even) .chapter__layer--a {
  left: 8%;
  right: auto;
}

.chapter:nth-child(even) .chapter__layer--b {
  left: 28%;
  right: auto;
}

.chapter:nth-child(even) .chapter__layer--c {
  left: 4%;
  right: auto;
}

.home-closing {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--space-7) var(--gutter);
  background:
    radial-gradient(ellipse at center, rgba(184, 149, 90, 0.1), transparent 55%),
    var(--ink);
}

.home-closing .display {
  max-width: 14ch;
  margin-inline: auto;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  /* Stable viewport: avoid jump when mobile browser chrome shows/hides */
  .home-hero {
    min-height: 100vh;
    min-height: 100svh;
  }

  .chapter {
    min-height: 100vh;
    min-height: 100svh;
  }

  .chapter__pin {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    display: block;
  }

  .chapter__stage {
    position: absolute;
    inset: 0;
  }

  .chapter__bg {
    position: absolute;
    inset: 0;
  }

  .chapter__shade,
  .chapter:nth-child(even) .chapter__shade {
    background:
      linear-gradient(180deg, rgba(18, 16, 14, 0.18) 0%, rgba(18, 16, 14, 0.28) 40%, rgba(18, 16, 14, 0.96) 100%),
      linear-gradient(90deg, rgba(18, 16, 14, 0.5) 0%, rgba(18, 16, 14, 0.12) 60%, rgba(18, 16, 14, 0.35) 100%);
  }

  /* Collage band sits in the same viewport as the text, above the copy */
  .chapter__layers {
    display: block;
    position: absolute;
    z-index: 2;
    inset: auto;
    left: 0;
    right: 0;
    top: max(4.5rem, 10%);
    bottom: 34%;
    pointer-events: none;
  }

  .chapter__layer {
    transform: none !important;
    pointer-events: auto;
    cursor: pointer;
  }

  /* a: sağ üst · b: sol üst · c: sağ alt — max 3, daha büyük */
  .chapter__layer--a,
  .chapter:nth-child(even) .chapter__layer--a {
    width: min(54vw, 240px);
    right: 3%;
    left: auto;
    top: 0;
    bottom: auto;
    aspect-ratio: 3/4;
    opacity: 1;
  }

  .chapter__layer--b,
  .chapter:nth-child(even) .chapter__layer--b {
    width: min(48vw, 210px);
    left: 3%;
    right: auto;
    top: 6%;
    bottom: auto;
    aspect-ratio: 1;
    opacity: 0.96;
  }

  .chapter__layer--c,
  .chapter:nth-child(even) .chapter__layer--c {
    width: min(44vw, 190px);
    right: 5%;
    left: auto;
    top: auto;
    bottom: 0;
    aspect-ratio: 4/5;
    opacity: 0.92;
  }

  .chapter__layer img {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
  }

  .chapter__title,
  .chapter__text {
    cursor: pointer;
  }

  .chapter__copy,
  .chapter:nth-child(even) .chapter__copy {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    text-align: left;
    padding: 2.5rem var(--gutter) max(1.5rem, env(safe-area-inset-bottom, 0px));
    max-width: none;
    background: linear-gradient(transparent, rgba(18, 16, 14, 0.97) 32%);
  }

  .chapter:nth-child(even) .chapter__text {
    margin-left: 0;
  }

  .chapter:nth-child(even) .chapter__children {
    margin-left: 0;
    justify-content: flex-start;
  }

  .scroll-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter {
    min-height: auto;
  }

  .chapter__pin {
    height: auto;
    min-height: 100vh;
  }
}
