/* ONYX - project experience
   Chapter of the same book: reuses main.css tokens, type and reveal
   systems. This file only adds the film opening and editorial layouts. */

/* ---------- Act I: the opening frame ---------- */
.ox-open {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: clip;
}
.ox-film { position: absolute; inset: 0; z-index: 0; }
.ox-film video, .ox-film img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2.4s var(--ease-out);
}
.ox-open.has-film .ox-film video,
.ox-open.has-film .ox-film img { opacity: 1; }
/* subtle vignette so the film melts into the page */
.ox-film::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 62% at 50% 55%, rgba(5, 5, 6, 0.38), transparent 68%),
    radial-gradient(120% 90% at 50% 42%, transparent 52%, rgba(5, 5, 6, 0.68) 100%),
    linear-gradient(to bottom, rgba(5, 5, 6, 0.35), transparent 22% 72%, rgba(13, 12, 11, 0.92));
}
/* fade from black */
.ox-veil {
  position: absolute; inset: 0; z-index: 2;
  background: #000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 2.6s var(--ease-out);
}
.ox-open.is-open .ox-veil { opacity: 0; }

.ox-title { position: relative; z-index: 1; width: 100%; text-align: center; text-shadow: 0 1px 28px rgba(0, 0, 0, 0.55); }
/* the real lockup holds the frame; site typography steps back */
.ox-name img {
  width: clamp(15rem, 52vw, 40rem);
  height: auto;
  display: block;
  margin-inline: auto;
  filter: drop-shadow(0 2px 30px rgba(0, 0, 0, 0.55));
}
.ox-sub {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}
.ox-roles {
  margin-top: clamp(2.25rem, 5vh, 3.5rem);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
/* the title enters only once the veil lifts */
.js .ox-title > * {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(10px);
  transition: opacity 1.6s var(--ease-out), transform 1.6s var(--ease-out), filter 1.6s var(--ease-out);
}
.js .ox-open.is-open .ox-title > * { opacity: 1; transform: none; filter: none; }
.js .ox-open.is-open .ox-name { transition-delay: 0.5s; }
.js .ox-open.is-open .ox-sub { transition-delay: 0.95s; }
.js .ox-open.is-open .ox-roles { transition-delay: 1.3s; }

/* ---------- Shared scene rhythm ---------- */
.ox-scene .lead { margin-top: 1.6rem; max-width: 18ch; }
.ox-scene .body-copy { margin-top: 2rem; }

/* ---------- Act III: role list ---------- */
.ox-role-list {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem) clamp(2rem, 5vw, 4.5rem);
  max-width: 62rem;
}
.ox-role-list li { display: flex; flex-direction: column; gap: 0.6rem; border-top: 1px solid var(--line); padding-top: 1.1rem; }
.ox-role-list strong {
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ox-role-list span { color: var(--ink-dim); font-size: 0.98rem; line-height: 1.55; max-width: 34ch; }
.ox-honest { color: var(--ink-faint); font-size: 0.95rem; margin-top: clamp(2.5rem, 5vh, 3.5rem); }

/* ---------- Figures ---------- */
.ox-full { margin-top: clamp(3rem, 8vh, 5.5rem); }
.ox-full img { width: 100%; height: auto; display: block; aspect-ratio: 21 / 9; object-fit: cover; }
.ox-full video { width: 100%; display: block; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.ox-full figcaption, .ox-band figcaption {
  margin-top: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

/* print meets screen: the pair that proves the system */
.ox-pair {
  margin-top: clamp(3rem, 7vh, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: end;
}
.ox-pair img { width: 100%; height: auto; display: block; }

/* applications: asymmetric editorial block, no repeating grid */
.ox-apps {
  margin-top: clamp(3.5rem, 9vh, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
}
.ox-apps img { width: 100%; height: auto; display: block; }
.ox-apps figure:nth-child(1) { grid-column: 1; grid-row: 1 / 3; }
.ox-apps figure:nth-child(2) { grid-column: 2; grid-row: 1; }
.ox-apps figure:nth-child(3) { grid-column: 2; grid-row: 2; width: 76%; margin-left: auto; align-self: end; }

/* street pair inside the gallery */
.ox-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: start;
}
.ox-duo img { width: 100%; height: auto; display: block; }

.ox-pair figcaption, .ox-apps figcaption, .ox-duo figcaption {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* ---------- Act VI: film band ---------- */
.ox-band { margin-top: clamp(3rem, 8vh, 5.5rem); }
.ox-band video, .ox-band img {
  width: 100%;
  height: clamp(20rem, 62vh, 38rem);
  object-fit: cover;
  display: block;
}
.ox-band figcaption { padding-block: 1rem 0; }

/* ---------- Act VII: gallery (offset editorial rhythm) ---------- */
.ox-gallery { margin-top: clamp(3rem, 7vh, 5rem); display: flex; flex-direction: column; gap: clamp(4rem, 10vh, 7rem); }
.ox-gallery figure img { width: 100%; height: auto; display: block; object-fit: cover; }
.ox-gallery figcaption { margin-top: 0.9rem; font-size: 0.8rem; letter-spacing: 0.05em; color: var(--ink-faint); }
.ox-g-a { width: min(100%, 62%); }
.ox-g-a img { aspect-ratio: 4 / 3; }
.ox-g-b { width: min(100%, 74%); margin-left: auto; }
.ox-g-b img { aspect-ratio: 16 / 9; }
.ox-g-c { width: 100%; }
.ox-g-c img { aspect-ratio: 21 / 9; }

/* ---------- Act VIII: reflection ---------- */
.ox-quote {
  margin-top: 1.6rem;
  font-family: var(--font-display);
  font-weight: 620;
  font-size: clamp(1.9rem, 4.4vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 22ch;
  text-wrap: balance;
}
.ox-reflect .body-copy { margin-top: clamp(2.5rem, 5vh, 3.5rem); }

/* ---------- Chapter-to-chapter navigation ---------- */
.proj-nav .wrap {
  border-top: 1px solid var(--line);
  padding-top: clamp(2.75rem, 7vh, 4.5rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}
.proj-nav-item { display: flex; flex-direction: column; gap: 1rem; width: fit-content; }
.proj-nav-prev { grid-column: 1; align-items: flex-start; text-align: left; }
.proj-nav-next { grid-column: 2; align-items: flex-end; text-align: right; justify-self: end; }
.proj-nav-label {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.4s ease;
}
.proj-nav-label svg { width: 11px; height: 11px; }
.proj-nav-prev .proj-nav-label svg { rotate: 90deg; }
.proj-nav-next .proj-nav-label svg { rotate: -90deg; }
.proj-nav-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink-dim);
  transition: color 0.45s ease;
}
.proj-nav-cat { font-size: 0.85rem; color: var(--ink-faint); }
.proj-nav-item:hover .proj-nav-name { color: var(--ink); }
.proj-nav-item:hover .proj-nav-label { color: var(--accent); }
@media (max-width: 900px) {
  .proj-nav .wrap { grid-template-columns: 1fr; }
  .proj-nav-next { grid-column: 1; align-items: flex-start; text-align: left; justify-self: start; }
}

/* ---------- Act IX: return ---------- */
.ox-return { text-align: center; padding-block: clamp(8rem, 22vh, 14rem); }
.ox-back { flex-direction: row; }
.ox-back svg { rotate: 90deg; }
.ox-copyright { margin-top: clamp(3.5rem, 8vh, 5.5rem); font-size: 0.78rem; letter-spacing: 0.05em; color: var(--ink-faint); }

/* ---------- Gentle parallax where supported ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .ox-full img, .ox-g-c img {
      scale: 1.08;
      animation: ox-par linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
  }
}
@keyframes ox-par {
  from { transform: translateY(-2.6%); }
  to { transform: translateY(2.6%); }
}

/* ---------- Mobile recomposition ---------- */
@media (max-width: 900px) {
  /* stronger central veil: the film crops tighter and brighter on phones */
  .ox-film::after {
    background:
      radial-gradient(150% 66% at 50% 58%, rgba(5, 5, 6, 0.52), transparent 78%),
      radial-gradient(120% 90% at 50% 42%, transparent 48%, rgba(5, 5, 6, 0.7) 100%),
      linear-gradient(to bottom, rgba(5, 5, 6, 0.38), transparent 24% 68%, rgba(13, 12, 11, 0.92));
  }
  .ox-role-list { grid-template-columns: 1fr; }
  .ox-pair, .ox-apps, .ox-duo { grid-template-columns: 1fr; }
  .ox-pair figure, .ox-apps figure { grid-column: auto !important; grid-row: auto !important; }
  .ox-apps figure:nth-child(3) { width: 100%; margin-left: 0; }
  .ox-g-a, .ox-g-b { width: 100%; }
  .ox-full img { aspect-ratio: 16 / 10; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ox-veil { display: none; }
  .js .ox-title > * { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .ox-film video, .ox-film img, .ox-band video, .ox-band img { opacity: 1; transition: none; }
}
