/* A continuous piece of film, from the process into four portrait worlds. */
#pixel-atmosphere {
  opacity: 0.85;
}
.worlds {
  position: relative;
  z-index: 1;
  background: radial-gradient(ellipse at 48% 30%, #191e3030, transparent 70%);
}
.worlds-sticky {
  position: relative;
  padding: 68px var(--gutter) 32px;
}
.worlds-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 36px;
}
.worlds-header .kicker {
  font-size: 11px;
  margin-bottom: 18px;
}
.worlds h2 {
  font: 700 clamp(42px, 5.9vw, 96px)/0.95 var(--font-display);
  letter-spacing: -0.07em;
  margin: 0;
}
.worlds h2 em {
  color: var(--ivory);
  -webkit-text-stroke: 1px var(--ivory);
  font-style: normal;
}
.film-signature {
  width: min(29vw, 360px);
  flex-shrink: 0;
  padding-bottom: 8px;
}
.pixel-film {
  width: 100%;
  height: 100%;
}
.film-signature canvas {
  height: 116px;
}
.film-signature > span {
  display: block;
  margin-top: 15px;
  font: 10px var(--font-mono);
  letter-spacing: 0.2em;
  color: #9698a7;
}
/* One person, four worlds: the original photo opens the row (desktop: a
   smaller frame, vertically centred on the film frames, then a thin arrow). */
.worlds {
  --screen-h: clamp(240px, 41vh, 480px);
  --visual-pad: 35px;
}
.worlds-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(12px, 1.4vw, 22px);
}
.original-photo {
  height: calc(var(--screen-h) + var(--visual-pad) + 2px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
}
.original-frame {
  width: calc(var(--screen-h) * 0.6 * 0.8);
  aspect-ratio: 4 / 5;
  padding: 7px;
  border: 1px solid #29292944;
  background: #e4e4e166;
}
.original-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.original-photo figcaption {
  margin-top: 12px;
  font: 10px/1.2 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #4b4b4b;
  white-space: nowrap;
}
/* Thin connector: a hairline with a small open arrowhead. */
.original-arrow {
  position: relative;
  align-self: start;
  width: clamp(22px, 2.2vw, 36px);
  height: calc(var(--screen-h) + var(--visual-pad) + 2px);
}
.original-arrow::before,
.original-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
}
.original-arrow::before {
  left: 0;
  right: 1px;
  height: 1px;
  background: #151515;
}
.original-arrow::after {
  right: 1px;
  width: 6px;
  height: 6px;
  border-top: 1px solid #151515;
  border-right: 1px solid #151515;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: 75% 25%;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 28px);
}
.theme-card {
  min-width: 0;
}
.theme-visual {
  position: relative;
  padding: 16px 10px 19px;
  border: 1px solid #f4efe637;
  background: #090a0fc9;
}
.theme-screen {
  position: relative;
  height: var(--screen-h);
  overflow: hidden;
  background: #12151c;
  isolation: isolate;
}
.theme-poster,
.theme-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.theme-video {
  opacity: 0;
  z-index: 2;
  transition: opacity 0.4s;
}
.theme-card.has-film .theme-video {
  opacity: 1;
}
/* Film-frame labels: 10 px where the frame has room for them, hidden below
   (they would be under 8 px). */
.frame-code,
.frame-counter {
  position: absolute;
  left: 10px;
  right: 10px;
  font: 10px/1.2 var(--font-mono);
  letter-spacing: 0.12em;
  color: #bfc0c9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frame-code {
  top: 4px;
}
.frame-counter {
  bottom: 5px;
}
/* The counter needs ~200 px; on narrower cards (the row now opens with the
   original photo) it hides instead of ending in an ellipsis. */
.theme-visual {
  container-type: inline-size;
}
@container (max-width: 224px) {
  .frame-counter {
    display: none;
  }
}
@media (min-width: 1051px) {
  .worlds {
    --visual-pad: 44px;
  }
  .theme-visual {
    padding: 21px 10px 23px;
  }
}
@media (max-width: 1050px) {
  .frame-code,
  .frame-counter {
    display: none;
  }
}
.theme-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 18px 0 0;
  gap: 5px 10px;
}
.theme-caption h3 {
  margin: 0;
  font: 600 17px var(--font-display);
  letter-spacing: -0.04em;
}
.theme-caption p {
  grid-column: 1/-1;
  margin: 0;
  font-size: 11px;
  color: #92939f;
}
.theme-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(#fff3 0.6px, transparent 0.8px);
  background-size: 5px 5px;
  opacity: 0.12;
}
.worlds-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  font: 11px var(--font-mono);
  color: #92939f;
}
.worlds-footer p {
  margin: 0;
}
.worlds-footer .text-control {
  flex-shrink: 0;
  font-size: 11px;
  padding: 10px 0;
}
.js .worlds {
  height: 175svh;
}
.js .worlds-sticky {
  position: sticky;
  top: 0;
  min-height: 100svh;
}
.js .worlds-header {
  opacity: var(--worlds-heading, 0);
  transform: translateY(calc((1 - var(--worlds-heading, 0)) * 20px));
}
.js .theme-card:not(:first-child) {
  opacity: var(--card-k, 0);
  transform: translateY(calc((1 - var(--card-k, 0)) * 110px));
}
.js .theme-card[data-theme="1"] {
  --card-k: var(--card-1, 0);
}
.js .theme-card[data-theme="2"] {
  --card-k: var(--card-2, 0);
}
.js .theme-card[data-theme="3"] {
  --card-k: var(--card-3, 0);
}
/* Card 0 keeps its own media hidden while the shared card morphs onto it,
   then the two cut over on the same video frame (no crossfade, no ghosting). */
.has-shared-portrait .theme-card:first-child :is(.theme-poster, .theme-video) {
  transition: none;
}
.has-shared-portrait
  .worlds[data-handoff]
  .theme-card:first-child
  :is(.theme-poster, .theme-video, .theme-play) {
  opacity: 0;
  visibility: hidden;
}
.has-shared-portrait .theme-card:first-child .theme-grain {
  opacity: 0;
}
.has-shared-portrait .theme-card:first-child .theme-visual {
  background: transparent;
}
/* Padding, border and the monitor bars collapse in continuity.css. */
.js .portal-monitor.is-shared[data-location^="themes"] {
  box-shadow: none;
}
.is-shared[data-location="themes"] .delivery-card {
  display: none;
}
/* Only once landed: during the handoff continuity.js unwinds the phone's
   screen radius continuously (a prefix match here snapped it square). */
.is-shared[data-location="themes"] .monitor-screen {
  border-radius: 0 !important;
}
.hosts-item {
  position: relative;
  transition: border-color 0.4s;
}
/* The pixel triplet is a bullet before each term (not a kebab menu). */
.hosts-item dt::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 24px 0 0;
  vertical-align: 0.32em;
  background: var(--coral);
  box-shadow:
    8px 0 #f4efe657,
    16px 0 #8199ff42;
  animation: grain-flicker 3.8s steps(1) infinite;
}
.hosts-item:nth-child(2n) dt::before {
  animation-delay: -1.6s;
}
.invite-film {
  width: min(550px, 78vw);
  height: 130px;
  margin-bottom: 36px;
}
@keyframes grain-flicker {
  0%,
  24%,
  40%,
  78%,
  100% {
    opacity: 0.35;
  }
  25%,
  39%,
  79%,
  90% {
    opacity: 0.9;
  }
}
/* Theme films: one small play/pause chip in the frame (no native controls). */
.theme-play {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #f2f2ef59;
  border-radius: 2px;
  background: #151515b8;
  color: #f2f2ef;
  cursor: pointer;
  transition: background-color 0.2s;
}
.theme-card:not(.has-film) .theme-play {
  visibility: hidden;
}
/* Save-Data: posters only, and the chip offers each film on tap. */
.theme-card[data-tap-to-play] .theme-play {
  visibility: visible;
}
.theme-play > span {
  width: 9px;
  height: 10px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}
.theme-play[aria-pressed="true"] > span {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent currentColor;
  transform: translateX(1px);
}
.theme-play:hover {
  background: #151515eb;
}
/* Two-tone ring: visible on dark film and on paper alike. */
.theme-play:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 0;
  box-shadow: 0 0 0 4px #151515;
}
@media (max-width: 760px) {
  .worlds-sticky {
    padding: 72px var(--pad) 24px;
  }
  .worlds-header {
    gap: 10px;
    margin-bottom: 24px;
    align-items: start;
  }
  .worlds h2 {
    font-size: clamp(34px, 9vw, 58px);
  }
  .worlds-header .kicker {
    font-size: 11px;
    margin-bottom: 14px;
  }
  .film-signature {
    width: 70px;
    padding-top: 25px;
  }
  .film-signature canvas {
    height: 48px;
  }
  .film-signature > span {
    display: none;
  }
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 14px;
  }
  .theme-visual {
    padding: 13px 6px 15px;
  }
  .worlds {
    --screen-h: clamp(120px, calc((100svh - 438px) / 2), 235px);
  }
  .original-photo {
    margin-bottom: 16px;
  }
  .theme-play {
    right: 6px;
    bottom: 6px;
  }
  .theme-caption {
    padding-top: 9px;
    gap: 3px;
  }
  .theme-caption h3 {
    font-size: 12px;
  }
  .theme-caption p {
    display: none;
  }
  .worlds-footer {
    margin-top: 22px;
    font-size: 11px;
    gap: 10px;
  }
  .worlds-footer .text-control {
    font-size: 11px;
  }
}
@media (max-height: 700px) {
  .js .worlds {
    height: auto;
  }
  .js .worlds-sticky {
    position: relative;
  }
}
@media (prefers-reduced-motion: reduce) {
  .js .worlds {
    height: auto;
  }
  .js .worlds-sticky {
    position: relative;
  }
  .js .worlds-header,
  .js .theme-card:not(:first-child) {
    opacity: 1;
    transform: none;
  }
  .hosts-item dt::before {
    animation: none;
  }
}
html:not(.js) .worlds-header,
html:not(.js) .theme-card {
  opacity: 1;
  transform: none;
}

.has-shared-portrait .journey-header,
.has-shared-portrait .journey-copy,
.has-shared-portrait .journey-rail {
  opacity: calc(var(--arrival, 0) * var(--exit-opacity, 1));
}
.js .theme-card:first-child {
  opacity: var(--card-0, 0);
}
.js .original-photo,
.js .original-arrow {
  opacity: var(--worlds-original, 0);
}
.js .worlds-footer {
  opacity: var(--worlds-heading, 0);
}
@media (prefers-reduced-motion: reduce) {
  .js .theme-card:first-child,
  .js .original-photo,
  .js .original-arrow,
  .js .worlds-footer {
    opacity: 1;
  }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .worlds-sticky {
    padding-top: 72px;
  }
  .theme-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
  .worlds {
    --screen-h: clamp(180px, calc((100svh - 470px) / 2), 320px);
  }
  .original-photo {
    margin-bottom: 20px;
  }
  .worlds h2 {
    font-size: 52px;
  }
  .film-signature {
    width: 200px;
  }
}

/* Very wide screens: let the gallery breathe instead of a thin strip. */
@media (min-width: 2200px) {
  .worlds {
    --max: 1680px;
    --gutter: max(var(--pad), calc((100% - var(--max)) / 2));
  }
}

/* Tablet and phone: the original sits above the grid as a compact chip
   (thumbnail + label), its arrow pointing down into the worlds. */
@media (max-width: 1050px) {
  .worlds-row {
    display: block;
  }
  .original-photo {
    height: auto;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
  }
  .original-frame {
    width: 44px;
    padding: 3px;
  }
  .original-photo figcaption {
    margin: 0;
    font-size: 11px;
  }
  .original-arrow {
    display: none;
  }
  .original-photo::after {
    content: "";
    width: 7px;
    height: 7px;
    margin: -4px 0 0 2px;
    border-right: 1px solid #151515;
    border-bottom: 1px solid #151515;
    transform: rotate(45deg);
  }
}
