/* ============================================================
   cinema.css — the Pressroom's motion language.
   Scenes, staggers, mask reveals, pinned acts. Tokens from
   paper.css; choreography driven by cinema.js's --p and .in.
   ============================================================ */

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);      /* the settle */
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);   /* the glide */
  --stagger: 60ms;
}

body.cinema { overflow-x: clip; } /* clip, not hidden — sticky survives */

/* ---------- masthead (shared with exhibits look) ---------- */
.cn-mast {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 2rem);
  padding: 0.6rem clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  flex-wrap: wrap;
}
.cn-mast a, .cn-mast button {
  font-family: var(--grot);
  font-size: 0.7rem;
  font-weight: 540;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.cn-mast a:hover, .cn-mast button:hover { color: var(--red); }
.cn-home { color: var(--ink) !important; font-weight: 600; }
.cn-here { color: var(--red) !important; }
.cn-mast .spacer { flex: 1; }

/* ---------- scenes ---------- */
.scene { position: relative; }
.scene[data-scene] { height: 260vh; }
.scene-long[data-scene] { height: 420vh; } /* the Craft's five-stage press needs room */
.scene .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh; /* stable against iOS toolbar collapse */
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: clip;
  padding: 0 clamp(16px, 5vw, 64px);
}
.scene-flat {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 10vh, 7rem) clamp(16px, 5vw, 64px);
}
.stage-inner, .scene-flat > .inner { max-width: 1400px; margin: 0 auto; width: 100%; }

@media (prefers-reduced-motion: reduce), (max-width: 899px) {
  .scene[data-scene], .scene-long[data-scene] { height: auto; }
  .scene .stage { position: static; height: auto; min-height: 0; padding-top: 3rem; padding-bottom: 3rem; }
}

/* ---------- reveal primitives ---------- */
[data-reveal] .sp-w, [data-reveal] .sp-c {
  display: inline-block;
  transform: translateY(1.1em) rotate(1.5deg);
  opacity: 0;
  transition: transform 900ms var(--ease-out), opacity 700ms linear;
  transition-delay: calc(var(--i, 0) * var(--stagger));
  will-change: transform;
}
[data-reveal].in .sp-w, [data-reveal].in .sp-c {
  transform: translateY(0) rotate(0);
  opacity: 1;
}
[data-reveal="words"], [data-reveal="chars"] { overflow: clip; }

[data-reveal] .sp-l {
  display: block;
  clip-path: inset(0 0 100% 0);
  transform: translateY(0.4em);
  transition: clip-path 900ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 160ms);
}
[data-reveal].in .sp-l { clip-path: inset(0 0 -10% 0); transform: none; }

[data-reveal="rise"] {
  transform: translateY(2.2rem);
  opacity: 0;
  transition: transform 1000ms var(--ease-out), opacity 800ms linear;
}
[data-reveal="rise"].in { transform: none; opacity: 1; }

[data-reveal="mask"] {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1100ms var(--ease-inout);
}
[data-reveal="mask"].in { clip-path: inset(0 0 0 0); }

[data-reveal="draw"] { position: relative; }
[data-reveal="draw"]::after {
  content: "";
  position: absolute;
  left: 0; bottom: -0.15em;
  width: 100%; height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms var(--ease-inout) 250ms;
}
[data-reveal="draw"].in::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] .sp-w, [data-reveal] .sp-c, [data-reveal] .sp-l,
  [data-reveal="rise"], [data-reveal="mask"], [data-reveal="draw"]::after {
    transition: none !important;
    transform: none !important;
    clip-path: none !important;
    opacity: 1 !important;
  }
}

/* ---------- shared type at cinema scale ---------- */
.cn-kicker {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.2rem;
}
.cn-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 8.5vw, 8rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
  margin: 0 0 1.4rem;
}
.cn-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--ink-2);
  max-width: 48ch;
  line-height: 1.55;
}
.cn-statement {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 7vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}
.cn-statement + .cn-statement { margin-top: 0.4em; }
.red-ink { color: var(--red); }

/* ---------- studio: the acts ---------- */
.act-noes .cn-statement {
  opacity: calc(var(--dim, 0.18));
  transition: opacity 500ms linear;
}
[data-step="1"] .act-noes .st-1, [data-step="2"] .act-noes .st-1, [data-step="3"] .act-noes .st-1,
[data-step="2"] .act-noes .st-2, [data-step="3"] .act-noes .st-2,
[data-step="3"] .act-noes .st-3 { --dim: 1; }
@media (prefers-reduced-motion: reduce), (max-width: 899px) { .act-noes .cn-statement { --dim: 1; } }

/* layered assembly act: the sheets of a page, converging with --p */
.assembly { position: relative; height: min(62vh, 560px); }
.assembly .sheet {
  position: absolute;
  inset: 8% 12%;
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--rule);
}
.assembly .sheet-grid {
  background-image: repeating-linear-gradient(to bottom, rgb(var(--red-rgb) / 0.12) 0 1px, transparent 1px 26px);
  transform: translate(calc((1 - var(--p, 0)) * -14vw), calc((1 - var(--p, 0)) * 8vh)) rotate(calc((1 - var(--p, 0)) * -6deg));
}
.assembly .sheet-type {
  display: flex; flex-direction: column; justify-content: center; gap: 0.6rem;
  padding: clamp(1rem, 4vw, 3rem);
  transform: translate(calc((1 - var(--p, 0)) * 12vw), calc((1 - var(--p, 0)) * -6vh)) rotate(calc((1 - var(--p, 0)) * 5deg));
}
.assembly .sheet-red {
  border-color: rgb(var(--red-rgb) / 0.6);
  background: transparent;
  pointer-events: none;
  transform: translate(calc((1 - var(--p, 0)) * -4vw), calc((1 - var(--p, 0)) * 14vh)) rotate(calc((1 - var(--p, 0)) * 3deg));
}
.assembly .sheet-red::after {
  content: "COMMISSIONS OPEN";
  position: absolute;
  top: 12%; right: 6%;
  font-family: var(--grot);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--red);
}
.assembly .a-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3.4vw, 2.6rem); line-height: 1.1; }
.assembly .a-body { font-size: 0.95rem; color: var(--ink-2); max-width: 34ch; }
.assembly-caption { margin-top: 1.2rem; }

/* offer cards */
.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1rem, 2vw, 1.8rem);
  margin-top: 2rem;
}
.offer {
  border-top: 2px solid var(--ink);
  padding-top: 0.9rem;
}
.offer h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; margin-bottom: 0.5rem; }
.offer p { font-size: 0.93rem; line-height: 22px; color: var(--ink-2); }
.offer .mono { display: block; margin-top: 0.7rem; color: var(--red); font-size: 0.68rem; }

/* terms counters */
.terms-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: 2.4rem;
}
.term .big {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  color: var(--red);
  font-feature-settings: "tnum" 1;
  line-height: 1;
}
.term .big .unit { font-size: 0.4em; color: var(--ink-2); }
.term p { margin-top: 0.5rem; font-size: 0.9rem; color: var(--ink-2); max-width: 26ch; }

/* process filmstrip */
.process { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 2rem; }
.frame { background: var(--paper); padding: 1.2rem 1.2rem 1.5rem; }
.frame .mono { color: var(--red); font-size: 0.68rem; }
.frame h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin: 0.4rem 0; }
.frame p { font-size: 0.9rem; line-height: 21px; color: var(--ink-2); }

/* ---------- craft: the page that sets itself ---------- */
.press { max-width: 900px; margin: 0 auto; width: 100%; }
.press-sheet {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: clamp(1.4rem, 4vw, 3rem);
  position: relative;
  transition: background 600ms linear, color 600ms linear;
}
.press-status { margin-top: 0.9rem; }

/* stage 0: raw copy — everything mono, undesigned */
.press-sheet .ps-kicker, .press-sheet .ps-title, .press-sheet .ps-body,
.press-sheet .ps-quote, .press-sheet .ps-cta {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0;
  color: var(--ink);
  transition: font-size 700ms var(--ease-inout), line-height 700ms var(--ease-inout),
              letter-spacing 700ms var(--ease-inout), color 500ms linear,
              font-weight 700ms var(--ease-inout);
  margin: 0 0 0.6em;
}
/* stage 1+: typography arrives */
[data-step="1"] .ps-kicker, [data-step="2"] .ps-kicker, [data-step="3"] .ps-kicker, [data-step="4"] .ps-kicker {
  font-family: var(--grot);
  font-size: 0.7rem;
  font-weight: 560;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
[data-step="1"] .ps-title, [data-step="2"] .ps-title, [data-step="3"] .ps-title, [data-step="4"] .ps-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
[data-step="1"] .ps-body, [data-step="2"] .ps-body, [data-step="3"] .ps-body, [data-step="4"] .ps-body {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 26px;
}
[data-step="1"] .ps-quote, [data-step="2"] .ps-quote, [data-step="3"] .ps-quote, [data-step="4"] .ps-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.6;
}
[data-step="1"] .ps-cta, [data-step="2"] .ps-cta, [data-step="3"] .ps-cta, [data-step="4"] .ps-cta {
  font-family: var(--grot);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
/* stage 2: the grid draws itself */
.press-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, rgb(var(--red-rgb) / 0.14) 0 1px, transparent 1px 26px);
  opacity: 0;
  transition: opacity 600ms linear;
}
[data-step="2"] .press-sheet::before { opacity: 1; }
[data-step="3"] .press-sheet::before, [data-step="4"] .press-sheet::before { opacity: 0.25; }
/* stage 3: rubrication stamps in */
.ps-kicker, .ps-cta { transition-property: all; }
[data-step="3"] .ps-kicker, [data-step="4"] .ps-kicker { color: var(--red); }
[data-step="3"] .ps-quote, [data-step="4"] .ps-quote { border-left: 2px solid var(--red); padding-left: 1rem; }
[data-step="3"] .ps-cta, [data-step="4"] .ps-cta {
  display: inline-block;
  color: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 0.55em 1.1em;
}
/* stage 4: it ships — the night proof */
[data-step="4"] .press-sheet {
  background: #131110;
  border-color: #2e2a24;
}
[data-step="4"] .press-sheet .ps-title, [data-step="4"] .press-sheet .ps-body { color: #e7e1d3; }
[data-step="4"] .press-sheet .ps-quote { color: #9a9280; }
[data-step="4"] .press-sheet .ps-kicker { color: #e2543c; }
[data-step="4"] .press-sheet .ps-cta { color: #e7e1d3; border-color: #e7e1d3; box-shadow: 2px 2px 0 #e7e1d3; }

/* ---------- reel: the slates ---------- */
.slates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 4rem;
}
.slate {
  border: 1px solid var(--rule);
  background: var(--plate);
  display: flex;
  flex-direction: column;
}
.slate-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-2);
}
.slate-head .nm { color: var(--red); }
.slate-body {
  flex: 1;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem;
  overflow: clip;
  text-align: center;
}
.slate-foot { padding: 0.5rem 1rem 0.8rem; }
.slate .demo-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.1; }
.slate .demo-mask { font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 2.6vw, 2.1rem); border-bottom: 3px solid var(--red); padding-bottom: 0.1em; }
.slate .text-btn { font-size: 0.65rem; }

/* magnetic key demo */
.demo-key {
  display: inline-block;
  font-family: var(--grot);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 0.9em 1.8em;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
  will-change: transform;
}

/* marquee demo */
.demo-marquee { width: 100%; overflow: clip; }
.demo-marquee .mq {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  animation: mq 14s linear infinite;
}
@keyframes mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .demo-marquee .mq { animation: none; } }

/* ---------- shared footer band ---------- */
.cn-fold {
  --paper: #131110; --plate: #1c1915; --ink: #e7e1d3; --ink-2: #9a9280;
  --rule: #2e2a24; --red: #e2543c; --red-rgb: 226 84 60;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  padding: clamp(3rem, 10vh, 6rem) clamp(16px, 4vw, 48px);
}
.cn-fold .cn-title { font-size: clamp(2.2rem, 6vw, 5rem); }
.cn-fold .key-row { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; }
.cn-foot {
  border-top: 1px solid var(--rule);
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-2);
}
.cn-foot a { color: var(--red); }
