/* Magic Weather film: layout for film.js (canvas + HTML overlays). */

/* ---------- the film page ---------- */
.film-page { background: #06080f; min-height: 100vh; }
/* The home page hero's sky, fixed behind the whole page. */
.film-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 75% 35%, rgba(40,80,160,0.30), transparent 60%),
    radial-gradient(800px 500px at 15% 85%, rgba(217,122,71,0.18), transparent 60%),
    linear-gradient(180deg, #06080f 0%, #0a0d18 50%, #0e1224 100%);
}
.film-main, .film-foot { position: relative; z-index: 1; }
.film-main {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 96px 32px 40px;
}
.film-head { max-width: 780px; margin: 64px auto 0; text-align: center; }
.film-head .display-mid { margin-top: 12px; }
.film-head .section-sub { max-width: 640px; margin-left: auto; margin-right: auto; }
/* As large as fits under the heading on a laptop screen, never wider than the page. */
.film-page .film { max-width: min(100%, calc((100svh - 190px) * 16 / 9)); margin: 0 auto; }
.film[hidden] { display: none; }

.film-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 1240px;
  margin: 46px auto 0;
}
.fn-item { padding: 20px 22px; border: 1px solid var(--line-d-2); border-radius: 18px; background: rgba(255, 255, 255, 0.025); }
.fn-label { font-family: var(--t-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ember-soft); margin-bottom: 8px; }
.fn-item p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--star-dim); }
.film-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 40px 0 10px; }
.film-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 32px 36px;
  border-top: 1px solid var(--line-d);
  font-family: var(--t-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--star-fade);
}

/* ---------- full screen ---------- */
.film-full {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(246, 239, 230, 0.22);
  background: rgba(10, 13, 24, 0.5);
  color: var(--star);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.film-full[hidden] { display: none; }
.film-full .i-exit { display: none; }
.film.is-full .film-full .i-exit { display: block; }
.film.is-full .film-full .i-enter { display: none; }
.film-full:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.film:fullscreen, .film.is-full { width: 100vw; height: 100vh; max-width: none; aspect-ratio: auto; border-radius: 0; border: 0; }
.film:-webkit-full-screen { width: 100vw; height: 100vh; max-width: none; aspect-ratio: auto; border-radius: 0; border: 0; }

.film {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  overflow: hidden;
  background: #03050c;
  border: 1px solid var(--line-d-2);
  box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
  isolation: isolate;
  color: var(--star);
  user-select: none;
  -webkit-user-select: none;
}
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }

/* ---------- captions ---------- */
.film-caption {
  position: absolute;
  left: 5.5%;
  bottom: 17%;
  width: 40%;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.film-caption.is-on { opacity: 1; transform: none; }
.film-caption::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -70% -45% -60% -30%;
  background: radial-gradient(ellipse at 38% 55%, rgba(2, 4, 10, 0.72) 0%, rgba(2, 4, 10, 0.42) 42%, rgba(2, 4, 10, 0) 72%);
  pointer-events: none;
}
.film-kicker {
  font-family: var(--t-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember-soft);
  margin-bottom: 12px;
}
.film-line {
  font-family: var(--t-display);
  font-weight: 400;
  font-size: clamp(26px, 3.3vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
}
.film-line em { font-style: italic; font-weight: 300; color: var(--ember); }
.film-sub {
  margin-top: 12px;
  font-family: var(--t-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--star-dim);
}
.film-sub:empty { display: none; }
.film-caption.is-title { bottom: 38%; width: 46%; }
.film-caption.is-title .film-line { font-size: clamp(44px, 6.6vw, 96px); line-height: 0.95; letter-spacing: -0.035em; }
.film-caption.is-app { bottom: 11%; }

/* ---------- time-lapse clock ---------- */
.film-clock {
  position: absolute;
  left: 5.5%;
  top: 8%;
  font-family: var(--t-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--star);
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.film-clock.is-on { opacity: 1; }
.film-clock i {
  display: block;
  width: 180px;
  height: 2px;
  margin-top: 10px;
  background: rgba(246, 239, 230, 0.16);
  border-radius: 2px;
  overflow: hidden;
}
.film-clock b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ember-soft), var(--ember));
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- pin + weather card ---------- */
.film-pin, .film-card { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.film-pin { width: 0; height: 0; opacity: 0; transition: opacity .4s ease; }
.film-pin.is-on { opacity: 1; }
.film-pin span,
.film-pin::before {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.film-pin span { background: var(--ember); box-shadow: 0 0 0 2px #fff, 0 0 18px rgba(217, 122, 71, 0.9); }
.film-pin::before {
  content: '';
  border: 2px solid rgba(240, 168, 123, 0.9);
  animation: film-ping 1.8s ease-out infinite;
}
@keyframes film-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(4.2); opacity: 0; } }

.film-card {
  min-width: 200px;
  padding: 14px 16px 13px;
  border-radius: 18px;
  background: rgba(9, 13, 28, 0.62);
  border: 1px solid rgba(246, 239, 230, 0.18);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity .5s ease;
}
.film-card.is-on { opacity: 1; }
.fc-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--t-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--star-dim);
}
.fc-top span:first-child { color: var(--star); }
.fc-temp {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--t-display);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.fc-temp span:empty { display: none; }
.fc-icon { font-size: 24px; color: var(--ember-soft); }
.fc-cond { margin-top: 6px; font-size: 13px; color: var(--star); }
.fc-sun { margin-top: 3px; font-family: var(--t-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ember-soft); }
.fc-sun:empty { display: none; }

/* ---------- app screens ---------- */
.film-screens {
  position: absolute;
  right: 7%;
  top: 9%;
  bottom: 19%;
  width: 36%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.film-screens.is-on { opacity: 1; }
.film-shot {
  position: absolute;
  inset: 0 0 30px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(18px) scale(.965);
  transition: opacity .55s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}
.film-shot.is-on { opacity: 1; transform: none; }
.film-shot img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.65));
}
.film-shot-0 img, .film-shot-1 img { border-radius: 26px; border: 1px solid rgba(255, 255, 255, 0.12); }
.film-shot-3 img { max-height: 72%; border-radius: 46px; border: 6px solid #15161b; }
.film-shot figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -30px;
  text-align: center;
  font-family: var(--t-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--star-dim);
}

/* ---------- end card ---------- */
.film-end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 0 24px 40px;
  background: radial-gradient(ellipse at 50% 52%, rgba(2, 4, 10, 0.45) 0%, rgba(2, 4, 10, 0.86) 70%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s ease, visibility 0s linear .8s;
}
.film-end.is-on { opacity: 1; visibility: visible; transition: opacity .8s ease; }
.film-end img { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); }
.fe-name {
  font-family: var(--t-display);
  font-size: clamp(30px, 3.4vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 4px;
}
.fe-tag { font-family: var(--t-display); font-size: clamp(18px, 1.8vw, 24px); color: var(--star-dim); }
.fe-tag em { font-style: italic; color: var(--ember); }
.film-end .btn { margin-top: 10px; }
.fe-plat { font-family: var(--t-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--star-fade); }

/* ---------- loading ---------- */
.film-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--t-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--star-dim);
  transition: opacity .5s ease;
  pointer-events: none;
}
.film-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  animation: film-ping 1.4s ease-out infinite;
}
.film-loading.is-done { opacity: 0; }

/* ---------- controls ---------- */
.film-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 18px 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0;
  transition: opacity .4s ease;
}
.film.is-ready .film-bar { opacity: .72; }
.film.is-ready:hover .film-bar,
.film.is-ready:focus-within .film-bar,
.film.is-ready:not(.is-playing) .film-bar { opacity: 1; }
.film-play {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 230, 0.28);
  background: rgba(10, 13, 24, 0.55);
  color: var(--star);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.film-play:focus-visible, .film-seg:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.film-play .i-pause { display: none; }
.film.is-playing .film-play .i-pause { display: block; }
.film.is-playing .film-play .i-play { display: none; }
.film-chapters { flex: 1 1 auto; display: flex; gap: 4px; min-width: 0; }
.film-seg {
  flex: 1 1 0;
  height: 18px;
  padding: 7px 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
}
.film-seg::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 3px;
  border-radius: 3px;
  background: rgba(246, 239, 230, 0.2);
}
.film-seg i {
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 3px;
  border-radius: 3px;
  background: var(--ember);
  transform-origin: left;
  transform: scaleX(0);
}
.film-time, .film-credit {
  flex: 0 0 auto;
  font-family: var(--t-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--star-dim);
  white-space: nowrap;
}
.film-credit { color: var(--star-fade); }

/* Still frame for reduced motion: a clear play button. */
.film.is-still:not(.is-playing) .film-play { width: 44px; height: 44px; background: var(--ember); border-color: var(--ember); color: var(--ink); }

/* ---------- phones ---------- */
@media (max-width: 1100px) {
  .film-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
}
@media (max-width: 640px) {
  .film-notes { grid-template-columns: 1fr; gap: 12px; max-width: 560px; }
}
@media (max-width: 720px) {
  .film-main { padding: 84px 14px 28px; }
  .film-head { margin-top: 40px; }
  .film-head .section-sub { font-size: 15px; }
  .film-page .film { max-width: 100%; }
  .film-foot { padding: 22px 18px 30px; }
  .film { aspect-ratio: 9 / 14; border-radius: 22px; }
  .film-caption, .film-caption.is-title, .film-caption.is-app { left: 6%; right: 6%; width: auto; bottom: 66px; top: auto; }
  .film-caption.is-app { bottom: auto; top: 5%; }
  .film-caption.is-title .film-line { font-size: clamp(40px, 12vw, 58px); }
  .film-line { font-size: clamp(24px, 7vw, 32px); }
  .film-kicker, .film-sub { font-size: 10.5px; }
  .film-clock { left: 6%; top: 5%; font-size: 11px; }
  .film-clock i { width: 140px; }
  .film-card { min-width: 168px; padding: 11px 13px; }
  .fc-temp { font-size: 34px; }
  .film-screens { left: 12%; right: 12%; width: auto; top: 25%; bottom: 76px; }
  .film-shot-3 img { border-width: 4px; border-radius: 34px; }
  .film-credit { display: none; }
  .film-bar { gap: 10px; padding: 20px 12px 10px; }
}

/* iPhone: no element full screen, so the film covers the window. */
.film.is-full { position: fixed; inset: 0; z-index: 2000; }
html.film-locked, html.film-locked body { overflow: hidden; }

/* ---------- music ---------- */
.film-sound {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(246, 239, 230, 0.22);
  background: rgba(10, 13, 24, 0.5);
  color: var(--star);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.film-sound[hidden] { display: none; }
.film-sound .i-on { display: none; }
.film.has-sound .film-sound { color: var(--ember-soft); border-color: rgba(240, 168, 123, 0.5); }
.film.has-sound .film-sound .i-on { display: block; }
.film.has-sound .film-sound .i-off { display: none; }
.film-sound:focus-visible, .film-sound-hint:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.film-sound-hint {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(246, 239, 230, 0.26);
  background: rgba(10, 13, 24, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: var(--star);
  font-family: var(--t-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .5s ease, transform .5s ease, background .2s ease;
}
.film-sound-hint[hidden] { display: none; }
.film.is-ready .film-sound-hint { opacity: 1; transform: none; }
.film-sound-hint:hover { background: rgba(217, 122, 71, 0.85); border-color: transparent; }
.film.has-sound .film-sound-hint { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.fsh-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.fsh-bars i { width: 2px; height: 100%; border-radius: 1px; background: var(--ember-soft); transform-origin: bottom; animation: fsh 1.1s ease-in-out infinite; }
.fsh-bars i:nth-child(2) { animation-delay: -.3s; }
.fsh-bars i:nth-child(3) { animation-delay: -.6s; }
.fsh-bars i:nth-child(4) { animation-delay: -.85s; }
.film-sound-hint:hover .fsh-bars i { background: var(--ink); }
@keyframes fsh { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .fsh-bars i { animation: none; transform: scaleY(.7); } }
@media (max-width: 720px) {
  .film-sound-hint { top: 12px; right: 12px; padding: 8px 12px 8px 11px; font-size: 10px; }
}
@media (max-width: 720px) {
  /* The app chapter's caption sits at the top on phones: keep it clear. */
  .film-caption.is-app.is-on ~ .film-sound-hint { opacity: 0; pointer-events: none; }
}


/* ---------- the two films: tabs ---------- */
.film-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 16px;
}
.film-tab {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 250px;
  padding: 11px 18px 12px;
  border-radius: 16px;
  border: 1px solid var(--line-d-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--star-dim);
  text-align: left;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.film-tab:hover { background: rgba(255, 255, 255, 0.06); color: var(--star); }
.film-tab.is-on { background: rgba(217, 122, 71, 0.13); border-color: rgba(240, 168, 123, 0.55); color: var(--star); }
.film-tab:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.ft-name { font-family: var(--t-display); font-size: 18px; letter-spacing: -0.01em; line-height: 1.15; }
.ft-meta { font-family: var(--t-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember-soft); }

/* ---------- "A day with Magic Weather": cards and notifications ---------- */
.day-chip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px 9px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #141826;
  font-family: var(--t-body);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  scale: .8;
  transition: opacity .3s ease, scale .5s cubic-bezier(.2, .9, .3, 1.35);
  pointer-events: none;
  will-change: transform;
}
.day-chip.is-on { opacity: 1; scale: 1; }
.day-chip svg { width: 20px; height: 20px; color: var(--ember); flex: none; }

.day-note {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 3;
  width: min(390px, calc(100% - 24px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px 13px 12px;
  border-radius: 22px;
  background: rgba(246, 246, 248, 0.84);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  color: #111318;
  font-family: var(--t-body);
  box-shadow: 0 22px 44px -14px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, -150%);
  transition: transform .6s cubic-bezier(.2, .9, .25, 1.12), opacity .35s ease;
  pointer-events: none;
}
.day-note.is-on { opacity: 1; transform: translate(-50%, 0); }
.day-note img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.dn-text { flex: 1; min-width: 0; }
.dn-top { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: rgba(17, 19, 24, 0.5); }
.dn-title { margin-top: 2px; font-size: 15px; font-weight: 700; }
.dn-body { margin-top: 1px; font-size: 14px; line-height: 1.35; color: rgba(17, 19, 24, 0.78); }
.day-note.is-on ~ .film-sound-hint { opacity: 0; pointer-events: none; }

@media (max-width: 720px) {
  .film-tabs { gap: 8px; }
  .film-tab { min-width: 0; flex: 1 1 0; padding: 10px 12px 11px; }
  .ft-name { font-size: 15px; }
  .ft-meta { font-size: 9.5px; letter-spacing: 0.08em; }
  .day-chip { font-size: 12px; padding: 7px 11px 7px 9px; border-radius: 12px; }
  .day-chip svg { width: 16px; height: 16px; }
  .day-note { top: 10px; padding: 10px 12px 11px 10px; border-radius: 18px; }
  .dn-title { font-size: 14px; }
  .dn-body { font-size: 13px; }
}

/* The city's weather card can sit where the music pill is: let the card win. */
.film-card.is-on ~ .film-sound-hint { opacity: 0; pointer-events: none; }

/* ---------- Magic Earth layer bar (first film) ---------- */
.film-layers {
  position: absolute;
  left: 5.5%;
  top: 8%;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(10, 13, 24, 0.55);
  border: 1px solid rgba(246, 239, 230, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .5s ease, transform .5s ease;
  pointer-events: none;
}
.film-layers.is-on { opacity: 1; transform: none; }
.film-layers span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  font-family: var(--t-body);
  font-weight: 600;
  font-size: 13px;
  color: rgba(246, 239, 230, 0.72);
  transition: background .35s ease, color .35s ease;
}
.film-layers svg { width: 15px; height: 15px; flex: none; }
.film-layers span.is-active { background: #2f7bf6; color: #fff; }
@media (max-width: 720px) {
  .film-layers { left: 50%; top: auto; bottom: 178px; transform: translate(-50%, 8px); gap: 2px; padding: 4px; }
  .film-layers.is-on { transform: translate(-50%, 0); }
  .film-layers span { padding: 6px 8px; font-size: 11px; gap: 4px; }
  .film-layers svg { width: 12px; height: 12px; }
}

/* Export mode (film.js / film-day.js enterRender): overlays are faded from film time. */
.film.is-render, .film.is-render *, .film.is-render *::before, .film.is-render *::after { transition: none !important; }

/* ============== Mobile view (9:16) ==============
   .is-vertical is set by the Desktop / Mobile switch (and always on phones).
   Sizes use cqw, a percentage of the player's own width, so the layout is the
   same whether the player is 360 px wide on a phone or 420 px on a desktop. */
.film-page .film.is-vertical {
  aspect-ratio: 9 / 16;
  width: min(100%, calc((100svh - 190px) * 9 / 16));
  max-width: none;
  border-radius: 26px;
  container-type: inline-size;
}
.film.is-vertical.is-full, .film.is-vertical:fullscreen { width: 100vw; }
.film.is-vertical .film-caption,
.film.is-vertical .film-caption.is-title,
.film.is-vertical .film-caption.is-app { left: 7%; right: 7%; width: auto; top: auto; bottom: 12.5%; }
.film.is-vertical .film-kicker { font-size: max(9.5px, 2.4cqw); letter-spacing: .18em; margin-bottom: 1.8cqw; }
.film.is-vertical .film-line { font-size: 7.2cqw; line-height: 1.04; }
.film.is-vertical .film-caption.is-title .film-line { font-size: 11.5cqw; line-height: .96; }
.film.is-vertical .film-sub { font-size: max(9.5px, 2.4cqw); margin-top: 2cqw; }
.film.is-vertical .film-clock { top: 5%; left: 7%; font-size: max(9.5px, 2.4cqw); }
.film.is-vertical .film-clock i { width: 34cqw; }
.film.is-vertical .film-layers,
.film.is-vertical .film-layers.is-on { top: 62%; bottom: auto; left: 50%; transform: translateX(-50%); gap: .4cqw; padding: .8cqw; }
.film.is-vertical .film-layers span { font-size: 2.7cqw; padding: 1.3cqw 1.8cqw; gap: 1cqw; }
.film.is-vertical .film-layers svg { width: 2.8cqw; height: 2.8cqw; }
.film.is-vertical .film-screens { top: 8%; bottom: 39%; left: 14%; right: 14%; width: auto; }
.film.is-vertical .film-shot figcaption { font-size: max(9px, 2.2cqw); bottom: -6cqw; }
.film.is-vertical .film-card { min-width: 42cqw; padding: 2.8cqw 3.2cqw; border-radius: 4cqw; }
.film.is-vertical .fc-top { font-size: max(9px, 2.4cqw); }
.film.is-vertical .fc-temp { font-size: 9cqw; }
.film.is-vertical .fc-icon { font-size: 5cqw; }
.film.is-vertical .fc-cond { font-size: 3.2cqw; }
.film.is-vertical .fc-sun { font-size: max(9px, 2.5cqw); }
.film.is-vertical .film-end { gap: 3cqw; padding-bottom: 14%; }
.film.is-vertical .film-end img { width: 20cqw; height: 20cqw; border-radius: 4.6cqw; }
.film.is-vertical .fe-name { font-size: 9.2cqw; }
.film.is-vertical .fe-tag { font-size: 5cqw; }
.film.is-vertical .film-end .btn { font-size: 3.6cqw; padding: 3cqw 5cqw; }
.film.is-vertical .fe-plat { font-size: max(8.5px, 2.1cqw); }
.film.is-vertical .film-sound-hint { top: 3cqw; right: 3cqw; font-size: max(9px, 2.3cqw); padding: 1.8cqw 3cqw 1.8cqw 2.6cqw; }
.film.is-vertical .film-bar { gap: 2.4cqw; padding: 5cqw 3cqw 2.6cqw; }
.film.is-vertical .film-credit { display: none; }
.film.is-vertical .film-time { font-size: max(9px, 2.4cqw); }
/* The animated film */
.film.is-vertical .day-chip { font-size: 3.1cqw; padding: 1.8cqw 2.8cqw 1.8cqw 2.2cqw; border-radius: 3cqw; gap: 1.6cqw; }
.film.is-vertical .day-chip svg { width: 4cqw; height: 4cqw; }
.film.is-vertical .day-note { top: 3cqw; width: 90%; padding: 2.6cqw 3cqw 2.8cqw 2.6cqw; border-radius: 4.6cqw; gap: 2.6cqw; }
.film.is-vertical .day-note img { width: 8.6cqw; height: 8.6cqw; border-radius: 2cqw; }
.film.is-vertical .dn-top { font-size: max(8.5px, 2.4cqw); }
.film.is-vertical .dn-title { font-size: 3.5cqw; }
.film.is-vertical .dn-body { font-size: 3.2cqw; }

/* Word-by-word subtitles for the narration (Mobile view of the animated film). */
.film-voice { display: none; font-family: var(--t-body); font-weight: 700; font-size: 6.4cqw; line-height: 1.16; letter-spacing: -0.01em; color: #fff; }
.film-caption.speaking .film-line, .film-caption.speaking .film-sub { display: none; }
.film-caption.speaking .film-voice { display: block; }
.film-voice span { display: inline-block; margin-right: .26em; opacity: .38; }
.film-voice span.said { opacity: 1; }
.film-voice span.now { opacity: 1; color: #ffb27d; transform: scale(1.06); transform-origin: 50% 70%; }

/* ---------- Desktop / Mobile switch ---------- */
.film-toolbar { position: relative; max-width: min(100%, calc((100svh - 190px) * 16 / 9)); margin: 0 auto 16px; }
.film-toolbar .film-tabs { margin: 0 auto; }
.film-view {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line-d-2);
  background: rgba(255, 255, 255, 0.03);
}
.film-view button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--star-dim);
  font-family: var(--t-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.film-view button:hover { color: var(--star); }
.film-view button[aria-pressed="true"] { background: var(--ember); color: var(--ink); }
.film-view button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.film-view svg { width: 15px; height: 15px; flex: none; }
@media (max-width: 1180px) {
  .film-view { position: static; transform: none; width: max-content; margin: 12px auto 0; }
}
@media (max-width: 720px) {
  .film-view { display: none; }            /* phones always get the Mobile view */
}

/* ============== Embedded (film.html?embed=1) ==============
   The home page's film popup shows the first film in an iframe sized to the
   film's own shape; the player fills it edge to edge, without the page around it. */
html.film-embed, html.film-embed body { height: 100%; overflow: hidden; background: #03050c; }
html.film-embed body::after { display: none; }   /* the page grain: the popup frame is the film */
html.film-embed .film-bg,
html.film-embed .nav,
html.film-embed .film-toolbar,
html.film-embed .film-head,
html.film-embed .film-notes,
html.film-embed .film-cta,
html.film-embed .film-foot,
html.film-embed #film-day { display: none; }
html.film-embed .film-main { max-width: none; padding: 0; height: 100%; }
html.film-embed .film-page .film,
html.film-embed .film-page .film.is-vertical {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
