/* ============================================================================
   Landing page — editorial photographic system
   ----------------------------------------------------------------------------
   A mature, cinematic career feature built on twelve original photorealistic
   scenes. The photography carries the human story; only the camera, the
   typography, the rails and the document are animated. No figure is ever drawn
   or animated by CSS.

   Layering, per chapter:
     1  .ch__media    the photograph, slowly pushed in
     2  .ch__grade    editorial grade + vignette, keeps text legible
     3  .ch__body     headline, copy, labels, rails

   Rules held throughout:
     - Only transform and opacity animate; nothing triggers layout.
     - Every chapter's motion is inert until it is on screen.
     - prefers-reduced-motion halts all of it and leaves a composed page.
     - Motion is suspended while the tab is hidden ([data-motion-paused]).
     - No remote font, image or script. Nothing here makes a network request.
   ========================================================================== */

:root {
  --ln-ink:      #070B12;
  --ln-char:     #0D131C;
  --ln-navy:     #101C2E;
  --ln-steel:    #33506F;
  --ln-steel-lt: #7C97B8;
  --ln-ivory:    #F4F1EA;
  --ln-ivory-d:  #CFC8B9;
  --ln-gold:     #C9973F;
  --ln-gold-lt:  #E6B65F;

  --ln-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino,
              "Times New Roman", serif;
  --ln-sans:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ln-mono:  ui-monospace, "SF Mono", Consolas, monospace;

  --ln-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ============================================================== chapters === */

.ch {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(560px, 82vh, 900px);
  display: grid;
  align-items: center;
  background: var(--ln-ink);
}

.ch--hero { min-height: clamp(600px, 92vh, 1000px); }

/* Shorter chapters for the quieter beats. */
.ch--tight { min-height: clamp(460px, 62vh, 720px); }

/* ---- layer 1 · the photograph ------------------------------------------- */

.ch__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.ch__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  display: block;
  /* The push-in. Starts wide, settles — one move per chapter, 2.5%. */
  transform: scale(1.025);
  transition: transform 2600ms var(--ln-ease), opacity 900ms linear;
  will-change: transform;
}

.ch.is-in .ch__media img { transform: scale(1); }

/* ---- layer 2 · the grade ------------------------------------------------- */

.ch__grade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 11, 18, 0.86) 0%, rgba(7, 11, 18, 0.30) 34%,
                    rgba(7, 11, 18, 0.42) 66%, rgba(7, 11, 18, 0.92) 100%),
    linear-gradient(90deg, rgba(7, 11, 18, 0.90) 0%, rgba(7, 11, 18, 0.34) 52%,
                    rgba(7, 11, 18, 0.10) 100%);
}

[dir="rtl"] .ch__grade {
  background:
    linear-gradient(180deg, rgba(7, 11, 18, 0.86) 0%, rgba(7, 11, 18, 0.30) 34%,
                    rgba(7, 11, 18, 0.42) 66%, rgba(7, 11, 18, 0.92) 100%),
    linear-gradient(270deg, rgba(7, 11, 18, 0.90) 0%, rgba(7, 11, 18, 0.34) 52%,
                    rgba(7, 11, 18, 0.10) 100%);
}

/* A very fine grain, drawn from a gradient rather than an image. */
.ch__grade::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image:
    repeating-linear-gradient(0deg,   rgba(255,255,255,.7) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg,  rgba(255,255,255,.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---- layer 3 · the words ------------------------------------------------- */

.ch__body {
  position: relative;
  z-index: 2;
  width: min(1180px, 100% - clamp(2rem, 7vw, 7rem));
  margin-inline: auto;
  padding-block: clamp(3.5rem, 9vh, 7rem);
}

.ch__col { max-width: min(46rem, 100%); }

/* ============================================================== editorial === */

/* Chapter number + label: "02 — Preparation" */
.ch__label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.1rem;
  font-family: var(--ln-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ln-gold-lt);
}

.ch__label::after {
  content: "";
  flex: 1 1 auto;
  max-width: 7rem;
  height: 1px;
  background: linear-gradient(90deg, var(--ln-gold), transparent);
}

[dir="rtl"] .ch__label::after {
  background: linear-gradient(270deg, var(--ln-gold), transparent);
}

.ch__title {
  margin: 0 0 1rem;
  font-family: var(--ln-serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.2vw, 4.15rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
}

.ch__title em {
  font-style: italic;
  color: var(--ln-gold-lt);
}

.ch__lead {
  margin: 0 0 1.6rem;
  font-family: var(--ln-sans);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.62;
  color: rgba(238, 243, 250, 0.86);
  max-width: 40rem;
}

/* Lower third — a caption anchored to the base of a chapter. */
.ch__lower {
  position: absolute;
  z-index: 2;
  inset-inline-start: clamp(1rem, 7vw, 7rem);
  bottom: clamp(1.4rem, 4vh, 2.6rem);
  padding-inline-start: 0.95rem;
  border-inline-start: 2px solid var(--ln-gold);
  max-width: min(30rem, calc(100% - 2rem));
}

.ch__lower-k {
  display: block;
  font-family: var(--ln-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ln-gold-lt);
  margin-bottom: 0.2rem;
}

.ch__lower-v {
  display: block;
  font-family: var(--ln-sans);
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(238, 243, 250, 0.9);
}

/* Location / time treatment, e.g. "Financial District · Morning" */
.ch__place {
  position: absolute;
  z-index: 1;
  inset-inline-end: clamp(1rem, 7vw, 7rem);
  top: clamp(5.5rem, 12vh, 8rem);
  font-family: var(--ln-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(238, 243, 250, 0.6);
  text-align: end;
}

/* Facts rail under the hero copy. */
.ch__facts {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.1rem, 3vw, 2.6rem);
  margin: 1.9rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(124, 151, 184, 0.26);
  list-style: none;
}

.ch__fact-k {
  display: block;
  font-family: var(--ln-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ln-gold-lt);
  margin-bottom: 0.25rem;
}

.ch__fact-v {
  display: block;
  font-family: var(--ln-sans);
  font-size: 0.88rem;
  color: rgba(238, 243, 250, 0.82);
}

/* ================================================================ actions === */

.ln-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.ln-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.85rem 1.9rem;
  border-radius: 3px;
  font-family: var(--ln-sans);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 200ms var(--ln-ease), background-color 200ms linear,
              border-color 200ms linear;
}

a.ln-btn--primary,
.ln-btn--primary {
  background: linear-gradient(180deg, var(--ln-gold-lt), var(--ln-gold));
  color: #1A1206;
  box-shadow: 0 10px 30px -12px rgba(201, 151, 63, 0.7);
}

a.ln-btn--ghost,
.ln-btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(238, 243, 250, 0.32);
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .ln-btn:hover { transform: translateY(-1px); }
  .ln-btn--ghost:hover { border-color: #fff; background: rgba(255,255,255,.09); }
}

.ln-btn:focus-visible {
  outline: 3px solid var(--ln-gold-lt);
  outline-offset: 3px;
}

/* =========================================================== career brief === */

.brief {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0;
  background: rgba(7, 11, 18, 0.72);
  border-block: 1px solid rgba(124, 151, 184, 0.2);
  overflow: hidden;
}

.brief__tag {
  flex: 0 0 auto;
  padding-inline: clamp(1rem, 5vw, 3rem) 0.9rem;
  font-family: var(--ln-mono);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ln-gold-lt);
  white-space: nowrap;
}

.brief__win {
  flex: 1 1 auto;
  overflow: hidden;
  /* A flex item's default min-width:auto refuses to shrink below its content,
     so the tape would widen the whole document on narrow screens. */
  min-width: 0;
}

.brief__tape {
  display: flex;
  gap: 2.6rem;
  white-space: nowrap;
  animation: brief-run 42s linear infinite;
  will-change: transform;
}

@keyframes brief-run {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

[dir="rtl"] .brief__tape { animation-direction: reverse; }

.brief__item {
  font-family: var(--ln-sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: rgba(238, 243, 250, 0.74);
}

.brief__item::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-inline-end: 0.7rem;
  vertical-align: 2px;
  background: var(--ln-gold);
}

/* ============================================================ progress rail = */

.rail {
  position: fixed;
  z-index: 40;
  inset-inline-end: clamp(0.55rem, 1.6vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 0.72rem;
  pointer-events: none;
}

.rail__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(238, 243, 250, 0.26);
  transition: background-color 320ms linear, transform 320ms var(--ln-ease);
}

.rail__dot.is-on {
  background: var(--ln-gold);
  transform: scale(1.5);
}

@media (max-width: 900px) { .rail { display: none; } }

/* ============================================================== document ==== */
/* The representative CV. Assembles once, on entry. */

.doc {
  position: relative;
  width: min(430px, 100%);
  aspect-ratio: 1 / 1.24;
  background: var(--ln-ivory);
  border-radius: 3px;
  box-shadow: 0 44px 90px -30px rgba(0, 0, 0, 0.85);
  padding: clamp(1.2rem, 2.4vw, 1.9rem);
  overflow: hidden;
}

.doc__row {
  display: block;
  height: 7px;
  border-radius: 2px;
  background: var(--ln-ivory-d);
  margin-bottom: 0.62rem;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 620ms var(--ln-ease);
  transition-delay: calc(var(--r, 0) * 85ms);
}

[dir="rtl"] .doc__row { transform-origin: right center; }

.ch.is-in .doc__row { transform: scaleX(1); }

.doc__row--head { height: 12px; width: 58%; background: var(--ln-navy); }
.doc__row--rule { height: 2px; background: var(--ln-gold); width: 34%; margin-bottom: 1.1rem; }
.doc__row--short { width: 62%; }

.doc__sec {
  margin: 1.15rem 0 0.5rem;
  font-family: var(--ln-mono);
  font-size: 0.6rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ln-steel);
  opacity: 0;
  transition: opacity 520ms linear;
  transition-delay: calc(var(--r, 0) * 85ms);
}

.ch.is-in .doc__sec { opacity: 1; }

.doc__note {
  margin-top: 0.9rem;
  font-family: var(--ln-sans);
  font-size: 0.72rem;
  line-height: 1.5;
  color: #5D6675;
}

.doc__chips {
  position: absolute;
  inset-block-start: clamp(1.1rem, 2.2vw, 1.7rem);
  inset-inline-end: clamp(1.1rem, 2.2vw, 1.7rem);
  display: grid;
  gap: 0.4rem;
  justify-items: end;
}

.doc__chip {
  display: block;
  padding: 0.26rem 0.6rem;
  border-radius: 2px;
  background: var(--ln-navy);
  color: #fff;
  font-family: var(--ln-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
}

.doc-caption {
  margin: 0.85rem 0 0;
  font-family: var(--ln-sans);
  font-size: 0.76rem;
  color: rgba(238, 243, 250, 0.6);
}

/* Split composition: copy beside the document. */
.ch__split {
  display: grid;
  gap: clamp(1.8rem, 5vw, 4.5rem);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 980px) {
  .ch__split { grid-template-columns: 1.05fr 0.95fr; }
  .ch__split--rev > :first-child { order: 2; }
}

/* =============================================================== mosaic ===== */

.stages {
  display: grid;
  gap: clamp(0.7rem, 1.6vw, 1.1rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.stage {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  aspect-ratio: 3 / 4;
  background: var(--ln-char);
}

.stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  display: block;
  transition: transform 800ms var(--ln-ease);
}

@media (hover: hover) and (pointer: fine) {
  .stage:hover img { transform: scale(1.045); }
}

.stage__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.5rem 0.95rem 0.95rem;
  background: linear-gradient(180deg, transparent, rgba(7, 11, 18, 0.94) 62%);
}

.stage__t {
  display: block;
  font-family: var(--ln-serif);
  font-size: 1.02rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.18rem;
}

.stage__d {
  display: block;
  font-family: var(--ln-sans);
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(238, 243, 250, 0.76);
}

/* ============================================================ text reveal === */

.rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ln-ease), transform 620ms var(--ln-ease);
  transition-delay: calc(var(--d, 0) * 110ms);
}

.ch.is-in .rv { opacity: 1; transform: none; }

/* ====================================================== paused / reduced ==== */

/* Tab in the background: stop every loop. */
[data-motion-paused] .brief__tape { animation-play-state: paused; }

/* Off-screen chapters do not animate at all. */
.ch:not(.is-in) .rv,
.ch:not(.is-in) .doc__row { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .ch__media img,
  .doc__row,
  .doc__sec,
  .rv,
  .stage img,
  .ln-btn { transition: none !important; transform: none !important; }

  .brief__tape { animation: none !important; transform: none !important; }

  /* Everything is simply present, composed, and still. */
  .rv { opacity: 1 !important; }
  .doc__row { transform: scaleX(1) !important; }
  .doc__sec { opacity: 1 !important; }
}

/* ================================================================ small ===== */

@media (max-width: 860px) {
  .ch { min-height: clamp(480px, 74vh, 700px); }
  .ch--hero { min-height: clamp(540px, 86vh, 780px); }
  .ch__place { display: none; }
  .ch__lower { position: static; margin-top: 1.6rem; max-width: none; }
  .ch__grade {
    background: linear-gradient(180deg, rgba(7,11,18,.88) 0%, rgba(7,11,18,.52) 40%,
                                rgba(7,11,18,.72) 72%, rgba(7,11,18,.96) 100%);
  }
}

@media (max-width: 480px) {
  .brief__tag { padding-inline-start: 1rem; }
  .doc { width: 100%; }
}
