/* RWS Films: five full-screen "test card" panels. Headline stack sits right-aligned left of centre,
   a big tinted icon behind it, SMPTE-style colour bars fixed along the bottom double as navigation. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff") format("woff");
  font-weight: 400 900;
  font-stretch: 62% 100%;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Test-card colours, taken from the October layout */
  --c-black: #000000;
  --c-blue: #0000ff;
  --c-cyan: #00ffff;
  --c-green: #00ff00;
  --c-magenta: #ff00ff;
  --c-red: #ff0000;
  --c-white: #ffffff;
  --c-yellow: #ffe100;

  --ink: #000000;            /* text on the current panel; flips to white on blue */
  --tint: rgba(0, 0, 0, .18); /* the big background icons */
  --field: #f1f1ef;
  --muted: #4a4a48;

  /* Helvetica-style grotesque, self-hosted (Archivo, SIL OFL). Swap the first name here for
     "Neue Haas Grotesk Display" or "Helvetica Neue LT" if you license a web Helvetica. */
  --display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --bars-h: clamp(28px, 8.2vh, 64px);
  --legal-h: 44px;
  --chrome-h: calc(var(--bars-h) + var(--legal-h));
  --gutter: clamp(16px, 3.8vw, 44px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  background: var(--c-yellow);
}
@media (min-width: 800px) and (min-height: 560px) {
  html { scroll-snap-type: y mandatory; }
}

body {
  margin: 0;
  font-family: var(--text);
  font-stretch: 100%;
  color: var(--ink);
  background: var(--c-yellow);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-panel="4"] { --ink: #ffffff; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: #000; color: #fff; padding: 10px 14px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Fixed chrome ---------- */

.brand {
  position: fixed; z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + clamp(14px, 3vh, 22px));
  left: var(--gutter);
  width: clamp(120px, 16vw, 172px);
  color: #000;
  transition: opacity .35s ease, transform .35s ease;
}
.brand svg { display: block; width: 100%; height: auto; fill: currentColor; }
html[data-panel="5"] .brand { opacity: 0; transform: translateY(-8px); pointer-events: none; }

.chrome {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: transparent;
  pointer-events: none;
}
.legal {
  min-height: var(--legal-h);
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px 14px;
  padding: 6px var(--gutter);
  font-size: 11px; line-height: 1.35; letter-spacing: .01em;
  color: var(--ink);
  transition: color .35s ease;
  pointer-events: auto;
}
.legal p { margin: 0; }
.legal nav { display: flex; gap: 14px; flex-wrap: wrap; }
.legal a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

.bars {
  display: grid; grid-template-columns: repeat(8, 1fr);
  height: var(--bars-h);
  margin: 0; padding: 0; list-style: none;
  pointer-events: auto;
}
.bars li { position: relative; }
.bars li:nth-child(1) { --bar: var(--c-black); }
.bars li:nth-child(2) { --bar: var(--c-blue); }
.bars li:nth-child(3) { --bar: var(--c-cyan); }
.bars li:nth-child(4) { --bar: var(--c-green); }
.bars li:nth-child(5) { --bar: var(--c-magenta); }
.bars li:nth-child(6) { --bar: var(--c-red); }
.bars li:nth-child(7) { --bar: var(--c-white); }
.bars li:nth-child(8) { --bar: var(--c-yellow); }
.bars .bar {
  display: block; width: 100%; height: 100%;
  border: 0; padding: 0; margin: 0;
  background: var(--bar);
  transform-origin: bottom;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), filter .2s ease;
}
button.bar { cursor: pointer; }
button.bar:hover { transform: scaleY(1.18); }
button.bar:focus-visible { outline: 3px solid #000; outline-offset: -6px; }
/* The current panel's bar drops out, so the background shows through: you are here. */
.bar[aria-current="true"] { transform: scaleY(0); }
.bar[aria-current="true"]:focus-visible { transform: scaleY(.25); }

/* ---------- Panels ---------- */

.panel {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
}
.p-yellow { background: var(--c-yellow); }
.p-red    { background: var(--c-red); }
.p-green  { background: var(--c-green); }
.p-blue   { background: var(--c-blue); --ink: #ffffff; color: #ffffff; }
.p-white  { background: var(--c-white); }

.icon {
  position: absolute; z-index: -1;
  fill: var(--tint);
  pointer-events: none;
}
.p-blue .icon { fill: rgba(0, 0, 30, .32); }

/* Placement follows the layout PDF (1100 x 619 reference) */
.i-phone   { left: 27vw;  top: -2vh;  height: 92vh; width: 46vw; }
.i-popcorn { left: 33vw;  top: -4vh;  height: 104vh; width: 50vw; }
.i-seats   { left: 30vw;  top: -10vh; height: 112vh; width: 68vw; }
.i-chair   { left: 31vw;  top: 2vh;   height: 92vh; width: 52vw; }

.headline {
  position: absolute;
  right: 60.5vw;
  top: 12.5vh;
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-stretch: 62%;
  font-variation-settings: "wdth" 62, "wght" 900;
  font-size: min(12.4vh, 8.4vw);
  line-height: .8;
  letter-spacing: -.005em;
  text-transform: uppercase;
  text-align: right;
  color: inherit;
}
.headline .line { display: block; white-space: nowrap; position: relative; }
.headline .line:last-child { display: table; margin-left: auto; }
.tm {
  position: absolute;
  left: 100%;
  bottom: .38em;
  margin-left: .3em;
  font-size: .2em;
  font-stretch: 100%;
  font-variation-settings: "wdth" 100, "wght" 800;
  letter-spacing: .02em;
  opacity: .55;
}
.p-red .tm, .p-green .tm, .p-blue .tm { opacity: 1; }

.next {
  position: absolute; left: 50%;
  bottom: calc(var(--chrome-h) + 3.5vh);
  width: 64px; height: 44px; margin-left: -32px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: #000; cursor: pointer;
  border-radius: 8px;
}
.next svg { width: 58px; height: 34px; fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.next:hover svg { transform: translateY(4px); }
.next svg { transition: transform .2s ease; }
.next.up:hover svg { transform: translateY(-4px); }

/* Entrance: lines slide in when a panel arrives. Resting state is fully visible. */
@media (prefers-reduced-motion: no-preference) {
  .panel.enter .line { animation: slideIn .7s cubic-bezier(.2,.9,.2,1) both; }
  .panel.enter .line:nth-child(2) { animation-delay: .07s; }
  .panel.enter .line:nth-child(3) { animation-delay: .14s; }
  .panel.enter .line:nth-child(4) { animation-delay: .21s; }
  .panel.enter .icon { animation: drift 1.2s cubic-bezier(.2,.8,.2,1) both; }
  .next { animation: nudge 2.4s ease-in-out 1.2s infinite; }
  @keyframes slideIn { from { transform: translateX(-.6em); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes drift { from { transform: translateY(3vh) scale(.97); } to { transform: none; } }
  @keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(5px); } 90% { transform: translateY(-1px); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Panel 5: EPK request ---------- */

.p-white .inner {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(16px, 3.5vh, 40px) var(--gutter) calc(var(--chrome-h) + 16px);
}
.big-logo { width: min(320px, 64vw, 46vh); color: #000; }
.big-logo svg { display: block; width: 100%; height: auto; fill: currentColor; }

.epk {
  width: 100%; max-width: 520px;
  margin-top: clamp(10px, 3vh, 36px);
}
.epk h2 {
  margin: 0 0 .15em;
  font-family: var(--display);
  font-weight: 900; font-stretch: 62%;
  font-variation-settings: "wdth" 62, "wght" 900;
  font-size: clamp(2.6rem, 7vh, 4rem);
  line-height: .85; text-transform: uppercase;
}
.epk .lede { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 46ch; }

.form { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .field .label {
  font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
.field .opt { font-weight: 500; letter-spacing: .04em; text-transform: none; color: var(--muted); }
.field input, .field select {
  width: 100%;
  font: 500 16px/1.2 var(--text);
  color: #000;
  background: var(--field);
  border: 2px solid #000;
  border-radius: 10px;
  padding: 12px 14px;
  appearance: none; -webkit-appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, #000 50%), linear-gradient(135deg, #000 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px; background-repeat: no-repeat;
  padding-right: 36px;
}
.field input:focus, .field select:focus { outline: none; background: #fff; box-shadow: 0 0 0 4px var(--c-yellow); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--c-red); box-shadow: 0 0 0 4px rgba(255,0,0,.18); }

.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 13px; line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: #000; }

.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.submit {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 10px;
  font: 900 20px/1 var(--display);
  font-stretch: 62%; font-variation-settings: "wdth" 62, "wght" 900;
  letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: #000;
  border: 2px solid #000; border-radius: 10px;
  padding: 14px 22px 13px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.submit:hover { background: var(--c-yellow); color: #000; }
.submit[disabled] { opacity: .6; cursor: progress; }
.fine { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.fine a { font-weight: 700; }

.status { margin: 0; font-size: 14px; font-weight: 700; min-height: 1px; }
.status.error { color: #c00000; }

.done {
  border: 2px solid #000; border-radius: 12px;
  padding: 20px 20px 18px;
  background: var(--c-yellow);
}
.done h3 {
  margin: 0 0 6px;
  font: 900 34px/.9 var(--display); font-stretch: 62%;
  font-variation-settings: "wdth" 62, "wght" 900; text-transform: uppercase;
}
.done p { margin: 0; font-size: 15px; line-height: 1.5; }
.done .note { margin-top: 10px; font-size: 12px; color: #3a3a00; }

.p-white .next { position: static; margin: 14px auto 0; }
@media (max-height: 700px) { .p-white .next { display: none; } }
html[data-panel="5"] .legal { background: var(--c-white); }
.submit-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.submit-row .fine { flex: 1 1 220px; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  :root { --legal-h: 58px; }
  .legal { font-size: 10px; gap: 2px 10px; }
  .headline {
    right: auto; left: var(--gutter);
    top: 17vh;
    font-size: min(14.2vw, 9.6vh);
    text-align: left;
  }
  .headline .line:last-child { margin-left: 0; }
  .tm { font-size: .22em; }
  .i-phone   { left: 18vw; top: 12vh; height: 68vh; width: 90vw; }
  .i-popcorn { left: 14vw; top: 14vh; height: 70vh; width: 96vw; }
  .i-seats   { left: 6vw;  top: 10vh; height: 78vh; width: 110vw; }
  .i-chair   { left: 18vw; top: 16vh; height: 64vh; width: 92vw; }
  .row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .headline { top: 15vh; }
}

/* ---------- Legal + utility pages ---------- */

.doc {
  background: #fff; color: #000;
  min-height: 100vh;
}
.doc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px var(--gutter);
  border-bottom: 2px solid #000;
}
.doc-head .logo { width: 150px; color: #000; display: block; }
.doc-head .logo svg { width: 100%; height: auto; fill: currentColor; display: block; }
.doc-head nav { display: flex; gap: 18px; font-size: 13px; font-weight: 700; }
.doc main {
  max-width: 72ch;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) var(--gutter) 120px;
  font-size: 16px; line-height: 1.65;
}
.doc h1 {
  margin: 0 0 6px;
  font: 900 clamp(3rem, 9vw, 5.5rem)/.85 var(--display);
  font-stretch: 62%; font-variation-settings: "wdth" 62, "wght" 900;
  text-transform: uppercase;
  text-wrap: balance;
}
.doc .meta { margin: 0 0 32px; font-size: 13px; color: var(--muted); }
.doc h2 {
  margin: 40px 0 8px;
  font: 900 26px/1 var(--display);
  font-stretch: 75%; font-variation-settings: "wdth" 75, "wght" 900;
  text-transform: uppercase; letter-spacing: .01em;
}
.doc h3 { margin: 22px 0 4px; font-size: 16px; font-weight: 800; }
.doc p, .doc ul { margin: 0 0 14px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 6px; }
.doc .summary {
  background: var(--c-yellow);
  border: 2px solid #000; border-radius: 12px;
  padding: 16px 20px; margin-bottom: 8px;
}
.doc .summary ul { margin: 6px 0 0; }
.doc-foot { border-top: 2px solid #000; }
.doc-foot .legal { color: #000; }
.doc-bars { height: 22px; }
