/* ==========================================================================
   Sentinel Creative — sections
   1 wall · 3 index · 4 rundown · 5 contact · footer
   (2 film is inserted between wall and index once the 4K frames exist)
   ========================================================================== */

/* --- 1 · THE WALL -------------------------------------------------------- */

#wall {
  position: relative;
  height: 240vh;
}

.wall-stage {
  position: sticky;
  top: 0;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
  background: var(--bg);
}

.wall-grid {
  position: absolute;
  display: grid;
  inset: var(--hud-h) 0 0;
  gap: 1px;
  grid-auto-flow: dense;
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(6, 1fr);
  /* This paints the 1px gutters. It must stay dark: once the tiles converge
     away it is the full-screen backdrop, and a tinted value washes the page. */
  background: #161d26;
}

/* GSAP owns .tile opacity outright (the scrubbed convergence fades it).
   Nothing else may touch it: two writers on this one property is what left
   the wall blank on load. */
.tile {
  position: relative;
  overflow: hidden;
  background: var(--bg-lift);
  will-change: transform, opacity;
  /* Guard: GSAP scrubs transform and opacity here every frame. Any
     transition on this element — even duration 0 with a delay — makes the
     browser hold the previous value and the convergence stops working. */
  transition: none;
}

/* The boot reveal therefore runs on the tile's CONTENTS, not the tile. */
.tile > * {
  opacity: 0;
  transition: opacity 520ms var(--ease);
}

.wall-stage.wall-on .tile > * {
  opacity: 1;
}

.tile[data-span="wide"] {
  grid-column: span 2;
}

.tile[data-span="tall"] {
  grid-row: span 2;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Source photos are already dark (night shots, unlit halls). Dim gently or
     they crush to pure black and the wall reads as broken. */
  filter: brightness(0.82) saturate(0.68) contrast(0.96);
  transition:
    filter 420ms var(--ease),
    transform 900ms var(--ease);
}

.tile-meta {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  padding: 0.3rem 0.45rem;
  background: rgba(6, 9, 13, 0.72);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.5rem;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease);
}

.tile-meta b {
  display: block;
  color: var(--gold-lit);
  font-weight: 500;
}

.wall-stage:hover .tile-meta {
  opacity: 0.85;
}

/* The live dot: this feed is up. */
.tile-live {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  animation: blink 2.4s steps(1, end) infinite;
}

.wall-stage:hover .tile-live {
  opacity: 1;
}

@keyframes blink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0.15; }
}

.tile.is-focused {
  z-index: 4;
}

.tile.is-focused img {
  filter: brightness(1) saturate(1) contrast(1.02);
  transform: scale(1.04);
}

.tile.is-focused::after {
  position: absolute;
  border: 1px solid var(--gold-lit);
  content: "";
  inset: 0;
  pointer-events: none;
}

/* Telemetry panel, pinned bottom-left, driven by the focused tile. */
.readout {
  position: absolute;
  z-index: 6;
  bottom: clamp(1rem, 3vh, 2rem);
  left: clamp(1rem, 3vw, 2rem);
  width: min(24rem, calc(100% - 2rem));
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--hair);
  background: rgba(6, 9, 13, 0.9);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition:
    opacity 320ms var(--ease),
    transform 320ms var(--ease);
  backdrop-filter: blur(8px);
}

.readout.on {
  opacity: 1;
  transform: none;
}

.readout-title {
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.4;
  word-break: keep-all;
}

.readout dl {
  display: grid;
  margin: 0;
  gap: 0.28rem;
}

.readout dl > div {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 3.4rem minmax(0, 1fr);
}

.readout dt {
  color: var(--gold-dim);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.14em;
}

.readout dd {
  margin: 0;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.6;
  word-break: keep-all;
}

/* The convergence payoff: card interrupts the line. */
.plate {
  position: absolute;
  z-index: 8;
  display: flex;
  inset: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.2rem, 3vw, 2.2rem);
  opacity: 0;
  pointer-events: none;
}

.plate-word {
  margin: 0;
  /* Korean display text uses the same face as the rest of the site. The
     Latin serif stack has no Hangul, and the substituted fallback read as
     a different typeface entirely. */
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.1rem, 3vw, 2.1rem);
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0.3rem 2rem rgba(0, 0, 0, 0.9);
  word-break: keep-all;
}

/* The logo PNG is transparent, so it sits straight on the backdrop — no card.
   A card here read as a panel appearing out of nowhere. */
.plate-card {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

.plate-card img {
  display: block;
  width: clamp(5.5rem, 12vw, 10rem);
  height: auto;
  filter: drop-shadow(0 0.3rem 1.6rem rgba(0, 0, 0, 0.85));
}

@media (max-width: 40rem) {
  .wall-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .plate {
    flex-direction: column;
    gap: 0.9rem;
  }
}

/* --- 3 · INDEX ----------------------------------------------------------- */

#index {
  position: relative;
  padding: clamp(6rem, 14vh, 11rem) 0;
}

/* The background IS the preview — no floating card. */
.index-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 620ms var(--ease);
}

#index::after {
  position: absolute;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(10, 14, 20, 0.7) 22%, rgba(10, 14, 20, 0.74) 78%, var(--bg) 100%);
  content: "";
  inset: 0;
  pointer-events: none;
}

#index .shell {
  position: relative;
  z-index: 2;
}

.index-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.index-head,
.index-row {
  display: grid;
  gap: clamp(0.6rem, 3vw, 2.5rem);
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr) minmax(0, 1.5fr);
}

.index-head {
  padding: 0 0 0.75rem;
  border-bottom: 1px solid var(--hair);
  color: var(--gold-dim);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
}

.index-row {
  position: relative;
  padding: clamp(1.05rem, 2.4vw, 1.6rem) 0;
  align-items: baseline;
  border-bottom: 1px solid #141c26;
  transition: padding-left 460ms var(--ease);
}

.index-row::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--gold);
  content: "";
  opacity: 0;
  transform: scaleY(0.15);
  transition:
    opacity 380ms var(--ease),
    transform 380ms var(--ease);
}

.index-row:hover {
  padding-left: 1.1rem;
}

.index-row:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.row-client {
  color: #c3ccd8;
  font-size: clamp(0.98rem, 1.9vw, 1.22rem);
  font-weight: 500;
  line-height: 1.45;
  word-break: keep-all;
  transition: color 380ms var(--ease);
}

.row-field,
.row-role {
  color: #6c7787;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.7;
  word-break: keep-all;
  transition: color 380ms var(--ease);
}

.index-row:hover .row-client {
  color: var(--ink);
}

.index-row:hover .row-field {
  color: var(--gold-lit);
}

.index-row:hover .row-role {
  color: var(--mute);
}

@media (max-width: 46rem) {
  .index-head {
    display: none;
  }

  .index-row {
    display: block;
  }

  .row-field,
  .row-role {
    display: block;
    margin-top: 0.3rem;
  }
}

/* --- 4 · RUN OF SHOW ----------------------------------------------------- */

#rundown {
  padding: clamp(6rem, 14vh, 11rem) 0;
  border-top: 1px solid #141c26;
}

.rundown-kicker {
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  color: var(--mute);
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  font-weight: 500;
  word-break: keep-all;
}

.cues {
  position: relative;
  margin: 0;
  padding: 0 0 0 clamp(4.5rem, 11vw, 8rem);
  list-style: none;
}

/* The rail the countdown runs down. */
.cues::before {
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: clamp(3.6rem, 9vw, 6.6rem);
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold-dim) 12%, var(--gold-dim) 88%, transparent);
  content: "";
}

.cue {
  position: relative;
  display: grid;
  padding: clamp(0.9rem, 2vw, 1.35rem) 0;
  align-items: baseline;
  gap: 0.35rem clamp(1rem, 3vw, 2.5rem);
  grid-template-columns: minmax(6rem, 8rem) minmax(0, 1fr);
}

.cue::before {
  position: absolute;
  top: 50%;
  left: calc(0px - clamp(4.5rem, 11vw, 8rem) + clamp(3.6rem, 9vw, 6.6rem) - 2px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-dim);
  content: "";
  transition: background 420ms var(--ease), box-shadow 420ms var(--ease);
}

.cue-t {
  grid-column: 1;
  color: var(--gold-dim);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  transition: color 420ms var(--ease);
}

.cue-name {
  grid-column: 2;
  color: #b6c0cd;
  font-size: clamp(1rem, 2.1vw, 1.3rem);
  font-weight: 600;
  transition: color 420ms var(--ease);
}

.cue-do {
  grid-column: 2;
  color: #6c7787;
  font-size: 0.86rem;
  line-height: 1.7;
  word-break: keep-all;
}

/* Scroll marks the live cue. */
.cue.is-live .cue-t,
.cue.is-live .cue-name {
  color: var(--gold-lit);
}

.cue.is-live::before {
  background: var(--gold-lit);
  box-shadow: 0 0 0 4px rgba(204, 161, 1, 0.14);
}

.cue-zero .cue-t {
  font-weight: 700;
}

@media (max-width: 40rem) {
  .cue {
    grid-template-columns: minmax(0, 1fr);
  }

  .cue-name,
  .cue-do {
    grid-column: 1;
  }
}

/* --- 5 · CONTACT --------------------------------------------------------- */

#contact {
  padding: clamp(7rem, 16vh, 13rem) 0;
  border-top: 1px solid #141c26;
}

.contact-head {
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  /* Same face as the rest of the site. The Latin serif stack carries no
     Hangul, so this line was rendering in whatever the browser substituted. */
  font-family: var(--sans);
  font-size: clamp(1.9rem, 6.4vw, 4.4rem);
  font-weight: 300;
  line-height: 1.28;
  letter-spacing: -0.015em;
  word-break: keep-all;
}

.mail {
  display: inline-block;
  color: var(--gold-lit);
  font-size: clamp(1.05rem, 3.2vw, 1.9rem);
  text-decoration: none;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 460ms var(--ease);
}

.mail:hover,
.mail:focus-visible {
  background-size: 0 1px;
}

/* --- footer -------------------------------------------------------------- */

footer {
  padding: 3rem 0 3.5rem;
  border-top: 1px solid #141c26;
}

.foot-grid {
  display: grid;
  align-items: start;
  gap: 2rem;
  grid-template-columns: auto minmax(0, 1fr);
}

.foot-logo {
  width: auto;
  height: 3.2rem;
  opacity: 0.75;
}

.foot-facts {
  display: grid;
  margin: 0;
  gap: 0.4rem;
}

.foot-facts > div {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 4.5rem minmax(0, 1fr);
}

.foot-facts dt {
  color: var(--gold-dim);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
}

.foot-facts dd {
  margin: 0;
  color: var(--dim);
  font-size: 0.76rem;
  line-height: 1.6;
  word-break: keep-all;
}

.foot-copy {
  margin: 0;
  grid-column: 1 / -1;
  color: #3f4854;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

@media (max-width: 40rem) {
  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- 2 · THE FILM -------------------------------------------------------- */

#film {
  position: relative;
  height: 620vh;
}

.film-stage {
  position: sticky;
  top: 0;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
  background: var(--bg);
}

#film-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 700ms var(--ease);
}

.film-ready #film-canvas {
  opacity: 1;
}

.film-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(10, 14, 20, 0.5) 0%,
    transparent 24%,
    transparent 58%,
    rgba(10, 14, 20, 0.8) 100%
  );
}

.film-caps {
  position: absolute;
  right: 0;
  bottom: clamp(4.5rem, 15vh, 9rem);
  left: 0;
  display: grid;
  padding: 0 1.5rem;
  justify-items: center;
}

.fcap {
  margin: 0;
  grid-area: 1 / 1;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.15rem, 2.9vw, 2rem);
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: 0.03em;
  text-align: center;
  text-shadow: 0 0.35rem 2.2rem rgba(0, 0, 0, 0.92);
  opacity: 0;
  word-break: keep-all;
  transform: translateY(0.9rem);
  transition:
    opacity 700ms var(--ease),
    transform 700ms var(--ease);
}

.fcap.on {
  opacity: 1;
  transform: none;
}

/* Gold progress hairline while the coarse pass loads. */
.film-load {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(204, 161, 1, 0.14);
  opacity: 1;
  transition: opacity 500ms var(--ease);
}

.film-ready .film-load {
  opacity: 0;
}

.film-load span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 260ms linear;
}

@media (prefers-reduced-motion: reduce) {
  #film {
    height: 100vh;
    height: 100svh;
  }

  #film-canvas {
    opacity: 1;
  }
}
