/* Film 01 · Launch and objective (spec 17, compressed into the 10s loop; 1% = 0.1s).
   0.4s  the planner console floats in and streams its log; zones count 0, 1, 2, 4
   4.6s  the header turns teal: '4 zones · 0:42'
   5.3s  the coin bar wraps the console and the camera pulls back to the $YOURS company page
   6.3s  the zone cards fade in; 7.2s the cursor glides to card 1, its border brightens, click at 8.4s
   8.7s  CRT dissolve back to the bare sky */

.il.fl-root {
  --loop: 10s;
  --settle: -8.2s; /* reduced motion: the page with the cursor resting on card 1 */
}

/* Camera: drift right, drift left, zoom until the console fills ~80%, then pull back to the page */
.fl-cam {
  animation-name: fl-cam;
}
@keyframes fl-cam {
  0%, 4% { transform: translate(-44.975em, -20.65em) scale(1.7); }
  14% { transform: translate(-45.5625em, -22.25em) scale(1.75); }
  22% { transform: translate(-53.15em, -23.85em) scale(1.8); }
  30%, 54% { transform: translate(-63.5em, -30.25em) scale(2); }
  62%, 100% { transform: translate(0em, 0em) scale(1); }
}

/* The company page */
.fl-app {
  animation-name: fl-app;
}
@keyframes fl-app {
  0%, 56% { opacity: 0; translate: 0 0; }
  61% { opacity: 1; translate: 0 0; }
  87% { opacity: 1; translate: 0 0; animation-timing-function: step-end; }
  88% { opacity: 1; translate: .125em 0; animation-timing-function: step-end; }
  89% { opacity: .7; translate: -.125em 0; animation-timing-function: step-end; }
  90% { opacity: .35; translate: .0625em 0; }
  91%, 100% { opacity: 0; translate: 0 0; }
}
.fl-main {
  display: grid;
  grid-template-rows: 3.75em 4.5em 2em minmax(0, 1fr);
  row-gap: 1.25em;
}
.fl-info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14em 10em 10em;
  border: 1px solid var(--f-line);
  border-radius: 2px;
}
.fl-info > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .375em;
  min-width: 0;
  padding: 0 1.25em;
}
.fl-info > div + div {
  border-left: 1px solid var(--f-line);
}
.fl-lbl {
  font-size: .75em;
  color: var(--f-text-3);
}
.fl-val {
  display: flex;
  align-items: center;
  gap: .5em;
  color: var(--f-text);
  white-space: nowrap;
}
.fl-val > span {
  font-size: .8125em;
}
.fl-val > .film-dot {
  font-size: 1em;
}
.fl-val .film-ico {
  width: .875em;
  height: .875em;
  color: var(--f-text-3);
}
.fl-tools {
  display: flex;
  gap: .75em;
  animation-name: fl-tools;
}
.fl-tools .film-input {
  flex: 1 1 auto;
}
.fl-tools .film-select {
  width: 11em;
}
@keyframes fl-tools {
  0%, 61% { opacity: 0; }
  64%, 100% { opacity: 1; }
}

/* Zone cards: 3 columns, fading in 0.2s apart */
.fl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 1em;
}
.fl-card {
  padding: .875em 1em .5em;
  animation-name: fl-card;
}
.fl-card:nth-child(2) { --film-d: .2s; }
.fl-card:nth-child(3) { --film-d: .4s; }
.fl-card:nth-child(4) { --film-d: .6s; }
@keyframes fl-card {
  0%, 63% { opacity: 0; translate: 0 .5em; }
  66%, 95% { opacity: 1; translate: 0 0; }
  96%, 100% { opacity: 0; translate: 0 0; }
}
/* Card 1 brightens under the cursor and darkens for the click */
.fl-card1 {
  animation-name: fl-card, fl-card1;
}
@keyframes fl-card1 {
  0%, 79% { border-color: var(--f-line); background-color: var(--f-card); }
  80%, 84% { border-color: var(--f-line-hi); background-color: var(--f-card); }
  84.5%, 86% { border-color: var(--f-line-hi); background-color: #292723; }
  87%, 100% { border-color: var(--f-line-hi); background-color: var(--f-card); }
}
.fl-card-t {
  font-size: 1.125em;
  line-height: 1.2;
  color: var(--f-text);
}
.fl-card-s {
  margin-top: .25em;
  font-size: .75em;
  color: var(--f-text-3);
}
.fl-kvs {
  margin-top: .625em;
}
.fl-kv {
  display: flex;
  align-items: center;
  gap: .5em;
  height: 1.875em;
  border-top: 1px solid var(--f-line);
  color: var(--f-text-3);
  white-space: nowrap;
}
.fl-kv .film-ico {
  width: .875em;
  height: .875em;
}
.fl-k {
  font-size: .8125em;
}
.fl-v {
  margin-left: auto;
  font-size: .8125em;
  color: var(--f-text);
}
.fl-kv .film-chip {
  margin-left: auto;
}

/* Coin bar */
.fl-coinbar {
  position: absolute;
  left: 35.75em;
  top: 21.25em;
  width: 52em;
  height: 20.25em;
  background: var(--f-page);
  border: 1px solid var(--f-line);
  border-radius: 2px;
  animation-name: fl-coinbar;
}
@keyframes fl-coinbar {
  0%, 53% { opacity: 0; }
  56%, 59% { opacity: 1; }
  62%, 100% { opacity: 0; }
}
.fl-cb-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3em;
  padding: 0 1.25em;
  white-space: nowrap;
}
.fl-cb-coin,
.fl-cb-meta {
  display: flex;
  align-items: center;
  gap: .5em;
}
.fl-cb-meta {
  gap: .875em;
  color: var(--f-text-2);
}
.fl-cb-hd span > span,
.fl-cb-coin > span,
.fl-cb-meta > span {
  font-size: .8125em;
}
.fl-cb-hd .film-ico {
  width: .875em;
  height: .875em;
  color: var(--f-text-3);
}

/* Planner console: #131210, 1px #373631, square corners, body split 70/30 */
.fl-console {
  position: absolute;
  left: 37.75em;
  top: 24.5em;
  width: 48em;
  height: 15em;
  display: grid;
  grid-template-rows: 2.5em minmax(0, 1fr);
  background: var(--f-page);
  border: 1px solid var(--f-line-2);
  animation-name: fl-console;
}
@keyframes fl-console {
  0%, 4% { opacity: 0; translate: 0 .5em; }
  8%, 60% { opacity: 1; translate: 0 0; }
  64%, 100% { opacity: 0; translate: 0 0; }
}
.fl-con-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25em;
  border-bottom: 1px solid var(--f-line-2);
}
/* Strips: a column of states behind a one-line window, stepped by translateY */
.fl-sbox {
  position: relative;
  height: 1.5em;
  overflow: hidden;
}
.fl-strip > span {
  display: block;
  height: 1.5em;
  line-height: 1.5em;
  white-space: nowrap;
}
.fl-con-hd .fl-sbox {
  font-size: .8125em;
}
.fl-con-step {
  color: var(--f-text);
}
.fl-con-time {
  width: 9em;
  text-align: right;
  color: var(--f-text-2);
}
.fl-steps {
  animation-name: fl-steps;
}
@keyframes fl-steps {
  0% { transform: translateY(0); }
  15% { transform: translateY(-1.5em); }
  34% { transform: translateY(-3em); }
  37.5%, 100% { transform: translateY(-4.5em); }
}
/* Mono timer 0:08 to 0:41 every 0.5s, then the teal summary at 4.6s */
.fl-timer {
  animation-name: fl-timer;
}
@keyframes fl-timer {
  0%, 4% { transform: translateY(0); animation-timing-function: steps(8, end); }
  44% { transform: translateY(-12em); animation-timing-function: step-end; }
  46%, 100% { transform: translateY(-13.5em); }
}
.fl-con-body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  min-height: 0;
}

/* Log: lines append at the bottom; past 8 lines the list pushes older ones off the top */
.fl-log {
  min-width: 0;
  padding: 1em 1.25em;
}
.fl-logwin {
  height: 0;
  overflow: hidden;
  font-size: .75em;
  animation-name: fl-logwin;
}
@keyframes fl-logwin {
  0% { height: 0; }
  7% { height: 1.6em; }
  9.5% { height: 3.2em; }
  12% { height: 4.8em; }
  14.5% { height: 6.4em; }
  17.5% { height: 8em; }
  20% { height: 9.6em; }
  22.5% { height: 11.2em; }
  25%, 100% { height: 12.8em; }
}
.fl-loglist {
  animation-name: fl-logscroll;
}
@keyframes fl-logscroll {
  0% { transform: translateY(0); }
  28% { transform: translateY(-1.6em); }
  30.5% { transform: translateY(-3.2em); }
  33% { transform: translateY(-4.8em); }
  35.5% { transform: translateY(-6.4em); }
  38% { transform: translateY(-8em); }
  41%, 100% { transform: translateY(-9.6em); }
}
.fl-ln {
  display: flex;
  align-items: center;
  height: 1.6em;
  white-space: nowrap;
  color: var(--f-text-2);
}
.fl-verb {
  flex: none;
  width: 7.5ch;
  color: var(--f-text-3);
}
.fl-ln .fl-val {
  font-size: 1em;
  color: inherit;
}
.fl-ln .fl-val > span {
  font-size: 1em;
}
.fl-ln .film-ico {
  width: 1em;
  height: 1em;
  color: var(--f-text-3);
}
.fl-ln.is-found,
.fl-ln.is-found .fl-verb {
  color: var(--f-teal-text);
}

/* Zones found: the header counts 0, 1, 2, 4 and rows join in the same steps */
.fl-zones {
  min-width: 0;
  padding: 1em 1.25em;
  border-left: 1px solid var(--f-line-2);
}
.fl-zhead {
  font-size: .75em;
  margin-bottom: .375em;
  color: var(--f-text-2);
}
.fl-zcount {
  animation-name: fl-zcount;
}
@keyframes fl-zcount {
  0% { transform: translateY(0); }
  17.5% { transform: translateY(-1.5em); }
  25% { transform: translateY(-3em); }
  33%, 100% { transform: translateY(-4.5em); }
}
.fl-zwin {
  height: 0;
  overflow: hidden;
  font-size: .75em;
  animation-name: fl-zwin;
}
@keyframes fl-zwin {
  0% { height: 0; }
  17.5% { height: 1.875em; }
  25% { height: 3.75em; }
  33%, 100% { height: 7.5em; }
}
.fl-zrow {
  display: flex;
  align-items: center;
  gap: .625em;
  height: 1.875em;
  white-space: nowrap;
  color: var(--f-text);
}
.fl-zrow .film-ico {
  width: 1.125em;
  height: 1.125em;
  color: var(--f-text-2);
}
.fl-zrow:nth-child(2) { --zd: .4s; }
.fl-zrow:nth-child(3) { --zd: .8s; }
.fl-zrow:nth-child(4) { --zd: 1s; }
/* Status square: queued grey, sparkle spinner (working), dashed hollow (writing), teal (done) */
.fl-zst {
  position: relative;
  flex: none;
  width: .75em;
  height: .75em;
}
.fl-zsq {
  position: absolute;
  inset: 0;
  background: var(--f-queued);
  border: 1px dashed transparent;
  --film-d: var(--zd, 0s);
  animation-name: fl-zsq;
}
@keyframes fl-zsq {
  0% { background-color: var(--f-queued); border-color: transparent; }
  23% { background-color: transparent; border-color: transparent; }
  29% { background-color: transparent; border-color: var(--f-text-2); }
  35%, 100% { background-color: var(--f-teal); border-color: var(--f-teal); }
}
.fl-zspin {
  position: absolute;
  left: -.25em;
  top: -.25em;
  width: 1.25em;
  height: 1.25em;
  color: var(--f-text);
  opacity: 0;
  --film-d: var(--zd, 0s);
  animation-name: fl-zspin;
}
@keyframes fl-zspin {
  0%, 22.9% { opacity: 0; transform: rotate(0deg); }
  23% { opacity: 1; transform: rotate(0deg); }
  28.9% { opacity: 1; transform: rotate(270deg); }
  29%, 100% { opacity: 0; transform: rotate(270deg); }
}

/* Cursor: glides in to card 1's title, hovers, clicks at 8.4s, leaves with the dissolve */
.fl-cursor {
  animation-name: fl-cursor;
}
@keyframes fl-cursor {
  0%, 71.9% { opacity: 0; transform: translate(70em, 50em) scale(1); }
  72% { opacity: 1; transform: translate(70em, 50em) scale(1); }
  80%, 84% { opacity: 1; transform: translate(16.4em, 25.9em) scale(1); }
  84.75% { opacity: 1; transform: translate(16.4em, 25.9em) scale(.85); }
  86%, 88% { opacity: 1; transform: translate(16.4em, 25.9em) scale(1); }
  91%, 100% { opacity: 0; transform: translate(16.4em, 25.9em) scale(1); }
}

/* CRT dissolve: dim, 1px line noise and a 2px jitter for about 0.4s */
.fl-crt {
  animation-name: fl-crt;
}
@keyframes fl-crt {
  0%, 87% { opacity: 0; transform: translateX(0); }
  88% { opacity: 1; transform: translateX(.125em); animation-timing-function: step-end; }
  89% { opacity: 1; transform: translateX(-.125em); animation-timing-function: step-end; }
  90% { opacity: .9; transform: translateX(.0625em); }
  91% { opacity: .6; transform: translateX(0); }
  93%, 100% { opacity: 0; transform: translateX(0); }
}
