/* The cinematics (js/opening.js, js/crewmoment.js): full-screen, over whatever page is
 * showing, with letterbox bars as a cutscene has them. They carry their own look, so they
 * can open over the menu or the board. Titles are set in Unbounded (SIL Open Font Licence,
 * fonts/Unbounded-OFL.txt), light, as the owner picked on 1 Dec. */

@font-face { font-family: "Unbounded"; src: url("/fonts/Unbounded-Variable.ttf") format("truetype"); font-weight: 200 900; font-display: swap; }

.cine {
  --ink: #f4f2ee;
  --i80: rgb(244 242 238 / 0.8);
  --i65: rgb(244 242 238 / 0.65);
  --i55: rgb(244 242 238 / 0.55);
  --i40: rgb(244 242 238 / 0.4);
  --i28: rgb(244 242 238 / 0.28);
  --i14: rgb(244 242 238 / 0.14);
  --signal: #ff6b5e;
  --head: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter", "Helvetica Neue", Arial, sans-serif;
  --display: "Unbounded", "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  position: fixed; inset: 0; z-index: 90; overflow: hidden; background: #060608; color: var(--i80);
  font: 400 14px/1.5 var(--text); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
  animation: cine-in 0.6s ease both; transition: opacity 0.9s ease;
}
@keyframes cine-in { from { opacity: 0; } }
.cine.leaving { opacity: 0; pointer-events: none; }
.cine ::selection { background: rgb(244 242 238 / 0.24); color: #fff; }
.cine canvas, .cine > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.cine.crew .crew-back, .cine.crew .crew-front { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; overflow: visible; }
/* The vignette (no grain over it: a grain that only adds light lifts the black off #060608) */
.cine::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgb(0 0 0 / 0.55)); }

/* Letterbox bars, sliding in as it begins and away as it ends */
.cine-bar { position: absolute; left: 0; right: 0; height: 10.5vh; z-index: 4; background: #000; transition: transform 1.4s var(--out); pointer-events: none; }
.cine-bar.top { top: 0; transform: translateY(-101%); border-bottom: 1px solid rgb(244 242 238 / 0.06); }
.cine-bar.bottom { bottom: 0; transform: translateY(101%); border-top: 1px solid rgb(244 242 238 / 0.06); }
.cine.bars .cine-bar { transform: none; }

/* The title: light, large, each word rising out of soft focus (js/cine.js rise()); the
 * script moves it nearer and flies the camera through it. The last words answer it. */
.cine-title { position: absolute; left: 0; right: 0; top: 50%; z-index: 5; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 36px; pointer-events: none; text-align: center; padding: 0 24px; opacity: 0; }
.cine-title h1 { margin: 0; font: 300 clamp(30px, 5.3vw, 86px)/1.08 var(--display); letter-spacing: 0.005em; color: var(--ink); text-wrap: balance; text-shadow: 0 0 34px rgb(6 6 8 / 0.75), 0 0 10px rgb(6 6 8 / 0.6), 0 0 2px rgb(6 6 8 / 0.5); }
.cine-title p { margin: 0; font: 500 13px/1 var(--head); letter-spacing: 0.62em; margin-right: -0.62em; color: var(--ink); text-shadow: 0 0 14px #060608, 0 0 4px #060608, 0 0 2px #060608; }
/* A soft dark wash under the words, so the galaxy's core never shines through them; it
 * travels with the title, so the galaxy blooms as the camera passes through the words */
.cine-title::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(1180px, 96vw); height: clamp(200px, 30vh, 300px); translate: -50% -56%; background: radial-gradient(closest-side, rgb(6 6 8 / 0.72), rgb(6 6 8 / 0.5) 45%, rgb(6 6 8 / 0.16) 75%, transparent); pointer-events: none; opacity: var(--wash, 0); }
.cine-title .w, .cine-end .w { display: inline-block; opacity: 0; }
.cine-end { position: absolute; left: 0; right: 0; top: calc(10.5vh + 34px); z-index: 5; margin: 0; padding: 0 24px; text-align: center; pointer-events: none; font: 300 clamp(24px, 3.1vw, 48px)/1.12 var(--display); letter-spacing: 0.005em; color: var(--ink); text-wrap: balance; text-shadow: 0 0 26px rgb(6 6 8 / 0.8), 0 0 8px rgb(6 6 8 / 0.6); }

/* Captions, in the lower bar, as subtitles: the old line fades before the new one comes */
.cine-cap { position: absolute; left: 50%; bottom: calc(10.5vh + 26px); z-index: 6; width: min(640px, calc(100% - 40px)); translate: -50% 0; text-align: center; pointer-events: none; opacity: 0; transform: translateY(8px); transition: opacity 0.45s ease, transform 0.9s var(--out); }
.cine-cap.show { opacity: 1; transform: none; transition: opacity 0.9s ease, transform 1.1s var(--out); }
.cine-cap.show.out { opacity: 0; transform: translateY(-4px); transition: opacity 0.42s ease, transform 0.42s ease; }
.cine-cap p { margin: 0; font: 400 17px/1.55 var(--text); letter-spacing: 0.005em; color: var(--i80); text-wrap: balance; text-shadow: 0 0 18px rgb(6 6 8 / 0.95), 0 0 4px rgb(6 6 8 / 0.9); }

/* A dissolve's dark, for camera cuts when less motion is asked for */
.cine-veil { position: absolute; inset: 0; z-index: 3; background: #060608; opacity: 0; pointer-events: none; }

/* The lines of the scene */
.cine .cn-orbit { fill: none; stroke: rgb(244 242 238 / 0.24); stroke-width: 1; }
.cine .cn-orbit.lit { stroke: rgb(244 242 238 / 0.5); }
.cine .cn-orbit.task { stroke: rgb(244 242 238 / 0.32); }
.cine .cn-ghost { fill: rgb(6 6 8 / 0.35); stroke: rgb(244 242 238 / 0.7); stroke-width: 1; stroke-dasharray: 2 5; stroke-linecap: round; }
.cine .cn-tick { stroke: rgb(244 242 238 / 0.55); fill: none; }
.cine .cn-leader { stroke: rgb(244 242 238 / 0.4); stroke-dasharray: 1 4; stroke-linecap: round; fill: none; }
.cine .cn-dial { fill: none; stroke: rgb(244 242 238 / 0.14); }
.cine .cn-ticks { stroke: rgb(244 242 238 / 0.55); fill: none; }
.cine .cn-deadline { stroke: rgb(244 242 238 / 0.85); stroke-width: 1.2; fill: none; }
.cine .cn-left { fill: none; stroke: #f4f2ee; stroke-width: 1.6; stroke-linecap: round; }
.cine .cn-task { fill: #060608; stroke: #e9c46a; stroke-width: 1.6; }
.cine .cn-day { font: 500 10px var(--head); letter-spacing: 0.16em; fill: rgb(244 242 238 / 0.6); }
.cine .cn-day.hot { fill: #f4f2ee; }

/* A planet's plate letter and name; a task's name */
.cine-tags { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.cine-tag { position: absolute; left: 0; top: 0; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; text-shadow: 0 0 10px #060608; }
.cine-tag b { font: 700 13px/1 var(--head); color: rgb(244 242 238 / 0.95); }
.cine-tag span { font: 400 11px/1 var(--text); letter-spacing: 0.28em; text-transform: uppercase; color: var(--i80); white-space: pre; }
.cine-tag.ghost span { color: var(--i28); }
.cine-task-tag { position: absolute; left: 0; top: 0; white-space: pre; font: 400 13px/1.2 var(--text); color: var(--i80); text-shadow: 0 0 10px #060608; }

/* The panels where the newcomer makes things: the game's dossier */
.cine-panel {
  position: absolute; z-index: 7; right: 8vw; top: 50%; width: min(380px, calc(100% - 40px));
  display: flex; flex-direction: column; gap: 18px; padding: 24px 26px 26px;
  background:
    linear-gradient(rgb(244 242 238 / 0.5), rgb(244 242 238 / 0.5)) top right / calc(100% - 14px) 1px no-repeat,
    linear-gradient(rgb(244 242 238 / 0.5), rgb(244 242 238 / 0.5)) top right / 1px calc(100% - 14px) no-repeat,
    linear-gradient(rgb(244 242 238 / 0.5), rgb(244 242 238 / 0.5)) bottom left / calc(100% - 14px) 1px no-repeat,
    linear-gradient(rgb(244 242 238 / 0.5), rgb(244 242 238 / 0.5)) bottom left / 1px calc(100% - 14px) no-repeat,
    rgb(9 9 12 / 0.9);
  opacity: 0; transform: translate(18px, -50%); pointer-events: none; transition: opacity 0.6s var(--out), transform 0.8s var(--out);
  user-select: text; -webkit-user-select: text;
}
.cine-panel.on { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.cine-panel .lbl { font: 400 9.5px/1.2 var(--text); letter-spacing: 0.3em; text-transform: uppercase; color: var(--i40); }
.cine-panel h2 { margin: 0 0 2px; font: 300 23px/1.2 var(--display); letter-spacing: 0.005em; color: var(--ink); text-wrap: balance; }
.cine-field { display: flex; flex-direction: column; gap: 10px; }
.cine-field input { width: 100%; padding: 8px 0 9px; border: 0; border-bottom: 1px solid var(--i28); border-radius: 0; background: transparent; font: 400 17px/1.3 var(--text); color: var(--ink); caret-color: var(--ink); outline: none; transition: border-color 0.2s; }
.cine-field input:focus { border-bottom-color: var(--i80); }
.cine .cine-field input:focus-visible { outline: none; }
.cine-field input::placeholder { color: var(--i28); }
.cine-looks { display: flex; gap: 8px; }
.cine-look { width: 42px; height: 42px; padding: 5px; border: 1px solid transparent; border-radius: 50%; background: none; cursor: pointer; opacity: 0.55; transition: opacity 0.2s, border-color 0.2s; }
.cine-look svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cine-look:hover { opacity: 0.9; }
.cine-look.on { opacity: 1; border-color: var(--i65); }
.cine-keys { display: flex; align-items: center; gap: 18px; margin-top: 4px; }
.cine-err { margin: -8px 0 0; min-height: 1em; font-size: 12.5px; color: var(--signal); }
.cine-later { border: 0; background: none; padding: 4px 0; cursor: pointer; font: 400 10px/1.2 var(--text); letter-spacing: 0.26em; text-transform: uppercase; color: var(--i55); }
.cine-later:hover { color: var(--ink); }

/* Keys in brackets */
.cine .kbtn { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; cursor: pointer; font: 500 10.5px/1 var(--head); letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink); background: rgb(6 6 8 / 0.6); transition: background-color 0.2s; }
.cine .kbtn:hover { background: rgb(244 242 238 / 0.06); }
.cine .kbtn .bk { position: absolute; inset: 0; pointer-events: none; }
.cine .kbtn .bk i { position: absolute; width: 7px; height: 7px; border: 0 solid rgb(244 242 238 / 0.85); }
.cine .kbtn .bk i:nth-child(1) { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.cine .kbtn .bk i:nth-child(2) { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.cine .kbtn .bk i:nth-child(3) { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.cine .kbtn .bk i:nth-child(4) { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }
.cine kbd { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; font: 500 9.5px/1 var(--head); color: var(--i80); border: 1px solid rgb(244 242 238 / 0.22); border-radius: 2px; }
.cine .kbtn kbd { margin: -4px -6px -4px 0; }
.cine-enter { position: absolute !important; left: 50%; bottom: 5vh; z-index: 7; translate: -50% 0; opacity: 0; pointer-events: none; transition: opacity 0.9s var(--out), translate 0.9s var(--out); }
.cine-enter.on { opacity: 1; pointer-events: auto; translate: -50% -8px; }

/* Skip, sound, and the key to begin */
.cine-skip, .cine-sound { position: absolute; z-index: 8; top: calc(10.5vh - 34px); display: inline-flex; align-items: center; gap: 10px; box-sizing: border-box; height: 29px; padding: 6px 0; border: 0; background: none; cursor: pointer; font: 400 10px/1 var(--text); letter-spacing: 0.26em; text-transform: uppercase; color: var(--i40); transition: color 0.2s; }
.cine-skip { right: 30px; }
.cine-sound { left: 30px; }
.cine-skip:hover, .cine-sound:hover { color: var(--ink); }
.cine-gate { position: absolute; left: 50%; top: 50%; z-index: 9; translate: -50% -50%; border: 0; background: none; cursor: pointer; font: 400 11px/1 var(--text); letter-spacing: 0.5em; text-transform: uppercase; color: var(--i65); opacity: 0; pointer-events: none; }
.cine-gate.on { opacity: 1; pointer-events: auto; animation: gate 2.4s ease-in-out infinite; }
@keyframes gate { 50% { color: rgb(244 242 238 / 0.25); } }
.cine :focus-visible { outline: 1px solid rgb(244 242 238 / 0.55); outline-offset: 4px; }

/* The Crew moment */
.cine.crew .crew-words { position: absolute; z-index: 6; left: 54%; top: 50%; translate: 0 -50%; width: min(540px, 40vw); display: flex; flex-direction: column; gap: 16px; }
.crew-words h1 { margin: 0; font: 300 clamp(30px, 3.4vw, 50px)/1.08 var(--display); letter-spacing: 0.005em; color: var(--ink); text-wrap: balance; text-shadow: 0 0 26px rgb(6 6 8 / 0.7); }
.crew-words h1 .w { display: inline-block; opacity: 0; }
.crew-words .sub { margin: -4px 0 8px; font: 400 10px/1.3 var(--text); letter-spacing: 0.32em; text-transform: uppercase; color: var(--i55); }
.crew-perks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.crew-perks li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: center; font: 400 14px/1.3 var(--text); color: var(--i80); opacity: 0; transform: translateX(-6px); transition: opacity 0.5s var(--out), transform 0.6s var(--out); }
.crew-perks li.on { opacity: 1; transform: none; }
.crew-perks li i { width: 12px; height: 12px; border: 1px solid var(--i55); border-radius: 50%; position: relative; }
.crew-perks li.on i::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: #f4f2ee; animation: perk 0.5s var(--out) both; }
@keyframes perk { from { transform: scale(0); } }
.crew-perks li small { display: block; color: var(--i40); font-size: 12px; margin-top: 2px; }
.cine.crew .cine-enter { left: 54%; translate: 0 0; bottom: 15vh; }
.cine.crew .cine-enter.on { translate: 0 -8px; }

@media (max-width: 820px) {
  .cine-panel { right: 50%; top: auto; bottom: calc(10.5vh + 14px); transform: translate(50%, 18px); }
  .cine-panel.on { transform: translate(50%, 0); }
  .cine-cap { bottom: auto; top: calc(10.5vh + 16px); }
  .cine-end { top: auto; bottom: calc(5vh + 74px); }
  .cine.crew .crew-words { left: 50%; top: auto; bottom: 22vh; translate: -50% 0; width: calc(100% - 48px); }
  .cine.crew .cine-enter { left: 50%; translate: -50% 0; bottom: 12vh; }
  .cine.crew .cine-enter.on { translate: -50% -8px; }
}
/* Less motion (the system setting, or ?reduced): the same scenes with nothing sliding,
 * growing or flying; fades stay, so every change still shows (js/cine.js reduced) */
.cine.reduced .cine-bar { transform: none; opacity: 0; transition: opacity 0.8s ease; }
.cine.reduced.bars .cine-bar { opacity: 1; }
.cine.reduced .cine-panel, .cine.reduced .cine-enter, .cine.reduced .cine-cap, .cine.reduced .crew-perks li { transition-property: opacity; }
.cine.reduced .cine-cap, .cine.reduced .cine-cap.show.out, .cine.reduced .crew-perks li { transform: none; }
.cine.reduced .crew-perks li.on i::after, .cine.reduced .cine-gate.on { animation: none; }

/* The end: the scene goes to black and the black stays until what comes next takes over */
.cine.ending > :not(.cine-bar) { opacity: 0 !important; pointer-events: none !important; transition: opacity 0.9s ease !important; }

.still .cine, .still .cine * { animation: none !important; transition: none !important; }
.still .cine-cap.show { opacity: 1; }
