/* ============================================================
   WORLDS — the art-led page
   ============================================================
   The games' own artwork as the page: the mark's light in the hero, a
   stage per live game, the posters, and the craft wall. Same house as the
   rest of the site — its type, its fire, its hairlines — with the worlds
   doing the talking. Nothing here is a game; every world ends at a door.
   ============================================================ */

/* ---------- each game's own colour, for its own words ---------- */
[data-world="cc"], [data-game="cc"]     { --world-accent: #e2b744; }
[data-world="six"], [data-game="six"]   { --world-accent: #5aa4ff; }
[data-world="faro"], [data-game="faro"] { --world-accent: #d1b07a; }
[data-world="snap"], [data-game="snap"] { --world-accent: #a3d45e; }

/* ============ THE PORTHOLE ============ */
.hero { isolation: isolate; }
.hero__inner { grid-template-columns: minmax(0, 1fr); }
.hero__copy { max-width: 600px; }

/*/* The mark's geometry for the still, before js/reel.js measures the page and
   sets it exactly: ring radius r = min(60vh, 42vw), centre 0.55r in from the
   right edge, so it falls off it. 2.4344 and 2.4073 are the traced mark's box
   over its ring radius; 1.7888 and 1.2081 place that box. */
.reel {
  --mark-r: min(60vh, 42vw);
  --mark-size: calc(var(--mark-r) * 2.4344) calc(var(--mark-r) * 2.4073);
  --mark-pos: calc(100vw - var(--mark-r) * 1.7888) calc(50svh + 44px - var(--mark-r) * 1.2081);
}
@media (max-width: 760px) {
  .reel {
    --mark-r: 60vw;
    --mark-pos: calc(100vw - var(--mark-r) * 1.7388) calc(64px + 25svh - var(--mark-r) * 1.2081);
  }
}

.reel {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
  background: var(--surface);
  /* No section ends on a line. The reel is opaque, so without this the glow
     the manifesto paints up behind the hero stops dead at the hero's foot. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--mesh-bleed)), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - var(--mesh-bleed)), transparent);
}
.reel__still,
.reel__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
/* The picture shows through the mark's outline until the cut takes over. */
.reel__still {
  object-fit: cover; object-position: 50% 45%; transition: opacity 0.6s var(--ease-out);
  -webkit-mask: url(../assets/hero/mark-window.svg) var(--mark-pos) / var(--mark-size) no-repeat;
          mask: url(../assets/hero/mark-window.svg) var(--mark-pos) / var(--mark-size) no-repeat;
}
/* The footage plays here, a speck under the hero, and the canvas draws it through
   the mark. Not opacity 0: a browser may stop decoding a video nobody can see
   (SIX!, which plays its cinema the same way, found Safari refusing it). */
.reel__footage { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0.01; z-index: -1; pointer-events: none; }
.reel__canvas { opacity: 0; transition: opacity 0.6s var(--ease-out); }
.reel.is-live .reel__canvas { opacity: 1; }
.reel.is-live .reel__still { opacity: 0; }

/* Legibility for the headline, and a floor the next section rises out of. */
.reel__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 8, 6, 0.85) 0%, rgba(10, 8, 6, 0.6) 34%, rgba(10, 8, 6, 0.12) 52%, rgba(10, 8, 6, 0) 62%),
    linear-gradient(180deg, rgba(10, 8, 6, 0.45) 0%, rgba(10, 8, 6, 0) 16%, rgba(10, 8, 6, 0) 78%, var(--surface) 100%);
}

/* On a phone the copy sits at the foot and the light takes the space above
   it (js/reel.js measures it), so the shade only has to darken the floor. */
@media (max-width: 760px) {
  .hero { align-items: flex-end; padding-bottom: 56px; }
  .reel__still { object-position: 34% 45%; }
  .reel__shade {
    background: linear-gradient(180deg, rgba(10, 8, 6, 0) 0%, rgba(10, 8, 6, 0) 50%, rgba(10, 8, 6, 0.78) 64%, var(--surface) 100%);
  }
  .hero__scrollhint { display: none; }
}
/* A short phone has no room for both the light and every line of copy; the
   line under the headline is the one that gives way. */
@media (max-width: 760px) and (max-height: 740px) {
  .hero__sub { display: none; }
}

/* ============ THE WORLDS ============ */
.worlds { position: relative; }
.worlds__head { padding-bottom: clamp(36px, 6vh, 64px); }
.worlds__head .section-title { margin-bottom: 0; }

.world { position: relative; }
.world__stage {
  position: relative; isolation: isolate;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
/* No world starts or ends on a line. The art fades to nothing at the top and
   the foot of its stage, so what the page shows behind it, glow and all, runs
   on through; fading to the surface colour instead left an edge wherever the
   page behind was not exactly that colour. The copy sits outside the fade. */
.world__art {
  position: absolute; inset: 0;
  background: #050403;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
.world__layer {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  will-change: transform, opacity;
}
.world__layer img { width: 100%; height: 100%; object-fit: cover; }
.world__shade {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(90deg, rgba(5, 4, 3, 0.9) 0%, rgba(5, 4, 3, 0.62) 32%, rgba(5, 4, 3, 0) 60%),
    linear-gradient(0deg, var(--surface) 0%, rgba(5, 4, 3, 0.75) 12%, rgba(5, 4, 3, 0) 34%),
    linear-gradient(180deg, var(--surface) 0%, rgba(10, 8, 6, 0) 14%);
  pointer-events: none;
}
.world__copy {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  pointer-events: none;
}
.world__copy > * { pointer-events: auto; max-width: 470px; }
.world__kicker {
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--world-accent);
}
.world__logo {
  width: auto; max-width: min(440px, 80vw);
  margin: 16px 0 24px;
  object-fit: contain; object-position: left center;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.6));
}
.world--cc .world__logo   { height: clamp(32px, 3.3vw, 46px); }
.world--six .world__logo  { height: clamp(78px, 8.4vw, 124px); margin: 6px 0 12px; }
.world--faro .world__logo { height: clamp(52px, 5.2vw, 78px); margin: 10px 0 18px; }
.world--snap .world__logo { height: clamp(66px, 6.8vw, 104px); margin: 8px 0 16px; }
.world__title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; letter-spacing: -0.02em;
}
.world__title em { font-style: normal; color: var(--world-accent); }
.world__text {
  margin: 16px 0 28px;
  color: var(--on-surface-variant); font-size: 16px; line-height: 1.6;
}
.world__links { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; }

/* Captain's Call: the sky, the crowd, two captains looking up at the coin. */
.world__sky { object-position: 50% 30%; }
.world__stands { object-position: 50% 52%; }
.world__captain {
  inset: auto; top: auto;
  bottom: -3%; height: 76%; width: auto;
  object-fit: contain;
  z-index: 1;
}
.world__captain--blue { left: 46%; }
.world__captain--red  { left: 72%; }
.world__coin {
  inset: auto; left: 64%; top: 12%;
  width: clamp(64px, 7vw, 116px); height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(255, 196, 90, 0.6));
}

/* SIX!: one ground under three lights, the ball over the rope. */
.world__light--powerplay,
.world__light--bigwin { opacity: 0; }
.world__symbols { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.world__symbol {
  position: absolute;
  width: clamp(62px, 6.6vw, 108px); height: auto;
  border-radius: 16%;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  will-change: transform;
}
.world__symbol:nth-child(1) { right: 15%; top: 24%; }
.world__symbol:nth-child(2) { right: 30%; top: 60%; }
.world__symbol:nth-child(3) { right: 7%;  top: 66%; }
.world__ball {
  position: absolute; left: 0; top: 0; z-index: 1;
  width: clamp(34px, 3.4vw, 54px); height: auto;
  filter: drop-shadow(0 0 18px rgba(255, 200, 80, 0.75));
  will-change: transform;
  opacity: 0;
}

/* FARO: the table, and the deal fanning out over the felt. */
.world__deal { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.world__card {
  position: absolute; left: 68%; top: 58%;
  width: clamp(62px, 7vw, 116px); height: auto;
  margin-left: calc(clamp(62px, 7vw, 116px) / -2);
  transform-origin: 50% 110%;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
  will-change: transform;
}

/* SNAP!: down through the swamp, into the jaws, and the bite. The maw is the
   game's own open-mouth frame (1086 × 1448) in its three pieces, placed by
   the bands the game uses (its art.json): upper 0–360, sides 300–990, lower
   930–1448. The closed face takes over at the bite; the Pearl is never
   bitten, and three Bite Multipliers rise beside it. */
.world__swamp img { object-position: 50% 40%; }
.world__bubbles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.world__bubbles i {
  position: absolute; bottom: -4%;
  width: 10px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85), rgba(200, 255, 220, 0.18) 46%, rgba(200, 255, 220, 0.05) 70%);
  box-shadow: inset 0 0 0 1px rgba(220, 255, 230, 0.35);
  will-change: transform;
}
.world__bubbles i:nth-child(1) { left: 52%; width: 9px; }
.world__bubbles i:nth-child(2) { left: 58%; width: 14px; }
.world__bubbles i:nth-child(3) { left: 63%; width: 7px; }
.world__bubbles i:nth-child(4) { left: 79%; width: 12px; }
.world__bubbles i:nth-child(5) { left: 86%; width: 8px; }
.world__bubbles i:nth-child(6) { left: 92%; width: 16px; }
.world__bubbles i:nth-child(7) { left: 44%; width: 6px; }
.world__bubbles i:nth-child(8) { left: 71%; width: 10px; }
.world__shoal { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.world__fish {
  position: absolute; left: 0; top: 0;
  height: auto;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.45));
  will-change: transform;
}
.world__fish--far  { width: clamp(46px, 4.6vw, 76px); filter: brightness(0.62) saturate(0.7); opacity: 0.7; }
.world__fish--mid  { width: clamp(70px, 7vw, 116px); filter: brightness(0.82) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4)); }
.world__fish--near { width: clamp(120px, 12vw, 200px); }
.world__maw {
  position: absolute; z-index: 1; left: 70%; top: 50%;
  height: min(94%, 62vw); aspect-ratio: 1086 / 1448;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
/* The three pieces overlap (sides 300–990 under upper to 360 and lower from
   930), so moved as one they read as one mouth; only the bite parts them. */
.world__mouth { position: absolute; inset: 0; z-index: 1; will-change: transform, opacity; }
.world__jaw, .world__pearl, .world__face {
  position: absolute; height: auto;
  will-change: transform, opacity;
}
.world__jaw { left: 0; width: 100%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5)); }
.world__jaw--upper { top: 0; z-index: 3; }
.world__jaw--sides { top: 20.72%; z-index: 1; }
.world__jaw--lower { top: 64.23%; z-index: 2; }
.world__pearl {
  left: 38%; top: 38.9%; width: 24%; z-index: 0;
  filter: drop-shadow(0 0 26px rgba(190, 255, 225, 0.75));
}
/* The game's own closed painting, anchored as the game anchors it: its point
   (0.5, 0.47) on the mouth's centre (49.7%, 46.9% of the frame). The game
   draws it at 1.3 × the frame, which leaves the closed head a quarter wider
   than the open one; at 1.04 × the two heads are the same width. */
.world__face {
  left: -2.3%; top: 22.4%; width: 104%; max-width: none; z-index: 4;
  opacity: 0;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}
.world__bites { position: absolute; inset: 0; z-index: 6; }
.world__bite {
  position: absolute;
  padding: 7px 16px; border-radius: 999px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  font-family: var(--font-display); font-weight: 700; text-shadow: 0 0 14px rgba(163, 212, 94, 0.45); font-size: clamp(15px, 1.5vw, 22px); letter-spacing: -0.01em;
  color: var(--world-accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(163, 212, 94, 0.28);
  opacity: 0;
  will-change: transform, opacity;
}
/* Above the crown, rising like bubbles. */
.world__bite:nth-child(1) { left: 66%; top: 7%; }
.world__bite:nth-child(2) { left: 88%; top: 14%; }
.world__bite:nth-child(3) { left: 6%;  top: 10%; font-size: clamp(18px, 1.9vw, 28px); }
.world__flash {
  position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(ellipse 40% 50% at 70% 50%, rgba(225, 255, 205, 0.85), rgba(150, 215, 110, 0.32) 46%, rgba(150, 215, 110, 0) 72%);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .world__maw { left: 50%; top: 29%; height: min(46%, 96vw); }
  .world__flash { background: radial-gradient(ellipse 60% 40% at 50% 32%, rgba(225, 255, 205, 0.85), rgba(150, 215, 110, 0.32) 46%, rgba(150, 215, 110, 0) 72%); }
}

@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .world__shade {
    background:
      linear-gradient(0deg, var(--surface) 0%, rgba(5, 4, 3, 0.8) 34%, rgba(5, 4, 3, 0) 62%),
      linear-gradient(180deg, var(--surface) 0%, rgba(10, 8, 6, 0) 14%);
  }
  .world__copy { justify-content: flex-end; padding-bottom: 44px; }
  .world__copy > * { max-width: 100%; }
  .world__text { font-size: 15px; margin: 12px 0 22px; }
  .world__captain { height: 50%; bottom: 28%; }
  .world__captain--blue { left: -4%; }
  .world__captain--red  { left: 52%; }
  .world__coin { left: 42%; top: 9%; width: 64px; }
  .world__symbol { width: 58px; }
  .world__symbol:nth-child(1) { right: 8%; top: 16%; }
  .world__symbol:nth-child(2) { right: 34%; top: 30%; }
  .world__symbol:nth-child(3) { right: 64%; top: 14%; }
  .world__card { left: 50%; top: 40%; width: 58px; margin-left: -29px; }
}

/* ============ THE POSTERS ============ */
.posters {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
  /* room above for what breaks out of the frames */
  padding-top: 84px;
}
.poster {
  position: relative; display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-card);
  color: inherit; text-decoration: none;
  /* a long press selects nothing in it (links can't be lifted at all: styles.css) */
  -webkit-user-select: none; user-select: none;
}
.poster__frame {
  position: absolute; inset: 0;
  border-radius: inherit; overflow: hidden;
  background: #0c0a08;
}
.poster__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1s var(--ease-out);
}
.poster[data-game="cc"] .poster__bg { object-position: 42% 50%; }
.poster[data-game="six"] .poster__bg { object-position: 50% 64%; }
.poster[data-game="faro"] .poster__bg { object-position: 50% 74%; }
.poster:hover .poster__bg,
.poster.is-up .poster__bg { transform: scale(1.06); }
.poster__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0) 38%, rgba(10, 8, 6, 0.55) 62%, rgba(10, 8, 6, 0.94) 86%);
}
/* Clipped to the frame at the sides and the foot, open above it: what rises
   out of the poster breaks the top edge and nowhere else. */
.poster__popwrap {
  position: absolute; inset: 0; z-index: 1;
  clip-path: inset(-60% 0 0 0 round 0 0 var(--r-card) var(--r-card));
  pointer-events: none;
}
.poster__pop {
  position: absolute;
  transition: transform 0.9s var(--ease-out);
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.55));
}
/* The captain's cut-out ends at his thighs, so that edge must stay below the
   poster's foot even fully risen: 112% tall, resting 24% low, rising 22% of
   the poster (19.6% of himself) leaves it 2% under the foot, with his head
   10% out of the top. */
.poster__pop--cc   { height: 112%; bottom: -24%; left: 50%; transform: translate(-50%, 0); }
.poster:hover .poster__pop--cc,
.poster.is-up .poster__pop--cc { transform: translate(-50%, -19.6%); }
.poster__pop--six  { width: 22%; left: 40%; top: 46%; transform: translate(0, 0) rotate(0deg); }
.poster:hover .poster__pop--six,
.poster.is-up .poster__pop--six { transform: translate(120%, -300%) rotate(260deg); }
.poster__pop--faro { width: 34%; left: 50%; top: 40%; transform: translate(-50%, 36%) rotate(-8deg); }
.poster:hover .poster__pop--faro,
.poster.is-up .poster__pop--faro { transform: translate(-50%, -78%) rotate(7deg); }
/* The turtle surfaces: its face rests in the water and rises over the top. */
.poster__pop--snap { width: 128%; max-width: none; left: 50%; top: 20%; transform: translate(-50%, 0) scale(0.92); }
.poster:hover .poster__pop--snap,
.poster.is-up .poster__pop--snap { transform: translate(-50%, -46%) scale(1); }
.poster[data-game="snap"] .poster__bg { object-position: 50% 60%; }
.poster[data-game="snap"] .poster__logo { max-height: 74px; }

.poster__info {
  position: absolute; left: 22px; right: 22px; bottom: 22px; z-index: 2;
  display: grid; justify-items: start; gap: 8px;
}
.poster__logo {
  width: auto; height: auto; max-width: 74%; max-height: 66px;
  object-fit: contain; object-position: left bottom;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.7));
}
.poster[data-game="six"] .poster__logo { max-height: 92px; }
.poster__meta {
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--world-accent);
}
.poster__cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--accent);
}
.poster__cta svg { width: 16px; height: 16px; transition: transform var(--dur-btn) var(--ease-out); }
.poster:hover .poster__cta svg { transform: translateX(2px); }

/* Four posters in a row get too narrow for their logos: two by two. */
@media (max-width: 1100px) and (min-width: 761px) {
  .posters { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 96px; }
}
@media (max-width: 760px) {
  .posters {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 76%;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(var(--gutter) * -1);
    padding: 84px var(--gutter) 12px;
    scrollbar-width: none;
  }
  .posters::-webkit-scrollbar { display: none; }
  .poster { scroll-snap-align: center; }
}

/* ============ THE CRAFT WALL ============ */
.craft {
  position: relative; isolation: isolate;
  height: clamp(640px, 100svh, 980px);
  overflow: hidden;
  display: grid; place-items: center;
  /* The fade is on the section, not the wall: the wall runs past the section's
     edges, and a fade on the wall was partly cut off, leaving its tiles to end
     on a line at the top and bottom. */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
}
.craft::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(ellipse 46% 54% at 50% 50%, rgba(10, 8, 6, 0.94), rgba(10, 8, 6, 0.7) 52%, rgba(10, 8, 6, 0.12) 100%);
  pointer-events: none;
}
.craft__wall {
  position: absolute; inset: -6% 0; z-index: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px;
  padding: 0 16px;
}
/* The still grid (reduced motion, no script) keeps the drift's column counts. */
@media (max-width: 1399px) { .craft__wall { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 899px) { .craft__wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 519px) { .craft__wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.craft__wall.is-columns { display: flex; align-items: flex-start; }
.craft__col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 16px;
  animation: craft-drift var(--dur, 60s) linear infinite;
  animation-direction: var(--dir, normal);
}
@keyframes craft-drift {
  from { transform: translateY(0); }
  to   { transform: translateY(calc(-50% - 8px)); }
}
.tile {
  position: relative; margin: 0;
  aspect-ratio: 3 / 4; overflow: hidden;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 38%, #2b1e12, #0f0c09 72%);
  box-shadow: inset 0 0 0 1px rgba(var(--palette-white-rgb), 0.06);
}
.tile img { width: 100%; height: 100%; object-fit: contain; padding: 16%; }
.tile--card img { padding: 10% 20%; }
.tile--scene img {
  padding: 0; object-fit: cover; object-position: var(--pos, 50% 50%);
  transform: scale(1.7); transform-origin: var(--pos, 50% 50%);
}
.craft__copy { position: relative; z-index: 2; text-align: center; }
.craft__copy .eyebrow { justify-content: center; }
.craft__copy .section-title { margin-bottom: 0; text-shadow: 0 1px 14px rgba(10, 8, 6, 0.9); }
/* On a phone the words run nearly edge to edge, so the dark falls wider
   and deeper behind them or the cards bleed through the title. */
@media (max-width: 640px) {
  .craft::after {
    background: radial-gradient(ellipse 88% 36% at 50% 50%, rgba(10, 8, 6, 0.96), rgba(10, 8, 6, 0.86) 58%, rgba(10, 8, 6, 0.2) 100%);
  }
}

.no-motion .craft__col,
.no-js .craft__col { animation: none; }
