/* ==========================================================================
   GOLDEN DRAGON GAMES — HOME PAGE SECTIONS
   ========================================================================== */

.section {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}

.section-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.section-head > p {
  max-width: 52ch;
}

#games {
  padding-top: clamp(3rem, 5vw, 4.5rem);
}

.narrow-only,
.actions .narrow-only {
  display: none;
}

h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-wrap: balance;
}

main p {
  text-wrap: pretty;
}

.section-head > p {
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Hero: the wide world sits under the headline, the tall one runs beside both
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(1.5rem, 2.5vw, 2rem) 0 0;
  isolation: isolate;
}

/* Warm light behind the tall world, fading out before it reaches the header */
.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 760px;
  background:
    radial-gradient(38% 60% at 88% 40%, rgba(246, 173, 60, 0.3), transparent 70%),
    radial-gradient(30% 50% at 8% 30%, rgba(181, 68, 28, 0.07), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
  grid-template-areas:
    'main tall'
    'wide tall';
  gap: 1rem;
}

.hero-main {
  grid-area: main;
  min-width: 0;
  padding-bottom: 1rem;
}

.world-nightfall {
  grid-area: wide;
}

.world-aftermagic {
  grid-area: tall;
}

.hero-label {
  font-family: 'Instrument Sans', 'Instrument Sans Caps Fallback', system-ui, sans-serif;
  animation: fade-in 0.8s var(--ease) both;
}

.hero-title {
  font-family: 'Fraunces', 'Fraunces Hero Fallback', Georgia, serif;
  font-size: clamp(3.25rem, 7.8vw, 7rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

/* Each line rises out of its own mask; the padding keeps descenders from clipping */
.hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.hero-line > span {
  display: block;
  white-space: nowrap;
  animation: rise 1.1s var(--ease) both;
}

.hero-accent > span {
  color: var(--ember);
  animation-delay: 0.09s;
}

.hero-lead {
  display: flex;
  align-items: center;
  gap: 1rem 2.5rem;
  flex-wrap: wrap;
  margin-top: clamp(1rem, 2vw, 1.5rem);
  animation: fade-up 1s var(--ease) 0.2s both;
}

.hero-text {
  max-width: 44ch;
  color: var(--ink-soft);
  font-size: 1.125rem;
  line-height: 1.5;
}

.world {
  position: relative;
  display: block;
  min-height: clamp(220px, 19vw, 280px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--plum);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 30px 50px -35px rgba(60, 30, 5, 0.7);
  transition: box-shadow 0.5s var(--ease), translate 0.5s var(--ease);
  animation: fade-up 1.1s var(--ease) 0.28s both;
}

.world-aftermagic {
  animation-delay: 0.16s;
}

.world:hover {
  translate: 0 -4px;
  box-shadow: 0 40px 60px -35px rgba(60, 30, 5, 0.85);
}

.world picture {
  position: absolute;
  inset: 0;
}

.world picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1.05;
  translate: var(--tilt-x, 0) var(--tilt-y, 0);
  transition: scale 0.9s var(--ease), translate 0.4s ease-out;
}

.world:hover picture img {
  scale: 1.09;
}

.world-nightfall picture img {
  object-position: 50% 62%;
}

.world-aftermagic picture img {
  object-position: 51% 50%;
}

/* The caption sits in the open sky of the art, clear of the characters */
.world-tag {
  position: absolute;
  top: 0.875rem;
  left: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: calc(100% - 1.75rem);
  padding: 0.35rem 1rem 0.35rem 0.35rem;
  border-radius: 15px;
  background: rgba(20, 12, 8, 0.66);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

.world-tag img {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.world-name {
  display: grid;
  line-height: 1.25;
}

.world-name strong {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 500;
}

.world-name small {
  font-size: 0.8125rem;
  opacity: 0.85;
}

.world-arrow {
  margin-left: 0.25rem;
  transition: translate 0.4s var(--ease);
}

.world:hover .world-arrow {
  translate: 4px 0;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem 2rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  animation: fade-up 1.1s var(--ease) 0.36s both;
}

.facts dt {
  margin-bottom: 0.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Games: edge-to-edge scenes. Each shows real gameplay on the game's own
   colour; the copy lines up with the page wrap.
   -------------------------------------------------------------------------- */
#games {
  padding-bottom: 0;
}

.games {
  container-type: inline-size;
}

.game {
  --gutter: calc((100cqw - min(1200px, 100cqw - 3rem)) / 2);
  --copy: calc(var(--gutter) + 31rem);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--copy);
  min-height: 540px;
}

.game-nightfall {
  background: radial-gradient(70% 90% at 28% 50%, #fbc566, #f3a83b 75%);
  color: var(--ink);
}

.game-aftermagic {
  grid-template-columns: var(--copy) minmax(0, 1fr);
  background: var(--plum);
  color: var(--plum-text);
}

.game-aftermagic .stage {
  order: 2;
}

/* The stage sizes its screenshots with container units */
.stage {
  position: relative;
  overflow: hidden;
  container-type: size;
}

.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stage-phones::before {
  background: radial-gradient(55% 75% at 50% 50%, #ffd98a, transparent 72%);
}

.stage-bento::before {
  background: radial-gradient(60% 75% at 55% 50%, rgba(181, 68, 28, 0.45), transparent 72%);
}

.shot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: rotate 0.9s var(--ease), scale 0.9s var(--ease);
}

/* Nightfall Spire: three phones fanned out */
.stage-phones .shot {
  width: auto;
  height: 66cqh;
  aspect-ratio: 9 / 16;
  border: 5px solid var(--ink);
  border-radius: 26px;
  box-shadow: 0 30px 44px -22px rgba(70, 30, 0, 0.7);
}

.shot-c {
  z-index: 2;
  height: 78cqh !important;
}

.shot-l {
  left: calc(50% - 26cqw);
  rotate: -7deg;
}

.shot-r {
  left: calc(50% + 26cqw);
  rotate: 7deg;
}

.game:hover .shot-l {
  rotate: -10deg;
}

.game:hover .shot-r {
  rotate: 10deg;
}

.game:hover .shot-c {
  scale: 1.03;
}

/* Aftermagic: one lead screenshot over two smaller ones, nothing overlapping */
.stage-bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2.4cqmin;
  padding: 6cqh 7cqw;
}

/* Keep the images as grid items while picture selects a sharper desktop source. */
.stage-bento picture {
  display: contents;
}

/* With picture flattened, its <source> elements would become grid cells too */
.stage-bento source {
  display: none;
}

.stage-bento .shot {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  height: auto;
  transform: none;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(241, 226, 217, 0.18);
  border-radius: 14px;
  box-shadow: 0 26px 44px -22px rgba(0, 0, 0, 0.85);
}

.bento-main {
  grid-column: 1 / -1;
  z-index: 1;
}

.game:hover .bento-main {
  scale: 1.015;
}

.game:hover .bento-a {
  rotate: -1.5deg;
}

.game:hover .bento-b {
  rotate: 1.5deg;
}

.game-body {
  position: relative;
  align-self: center;
  padding: 2.5rem var(--gutter) 2.5rem 3rem;
}

.game-aftermagic .game-body {
  padding-inline: var(--gutter) 3rem;
}

.game-id {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.game-id img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.6);
}

.game-genre {
  font-size: 0.9375rem;
  font-weight: 600;
}

.game-title {
  font-size: clamp(2.75rem, 4.8vw, 4.25rem);
  font-weight: 500;
}

.game-tagline {
  margin: 0.4rem 0 1rem;
  font-family: var(--serif);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.25;
}

.game-nightfall .game-tagline {
  color: #4f1d02;
}

.game-aftermagic .game-tagline {
  color: var(--sun);
}

.game-desc {
  max-width: 60ch;
  margin-bottom: 1.25rem;
}

.chips {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  list-style: none;
}

.chips li {
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(27, 24, 19, 0.3);
  background: rgba(255, 250, 240, 0.42);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.game-aftermagic .chips li {
  border-color: rgba(241, 226, 217, 0.22);
  background: rgba(241, 226, 217, 0.07);
}

.game-actions {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
}

.play {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.35rem 1.35rem 0.35rem 0.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s, translate 0.3s var(--ease);
}

.play:hover {
  translate: 0 -2px;
}

.play-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
}

.play-icon::before {
  content: '';
  margin-left: 3px;
  border-left: 11px solid var(--ink);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.game-nightfall .play:hover {
  background: #5a2204;
}

.game-aftermagic .play {
  background: var(--sun);
  color: var(--ink);
}

.game-aftermagic .play:hover {
  background: #ffc35f;
}

.game-aftermagic .play-icon {
  background: var(--ink);
}

.game-aftermagic .play-icon::before {
  border-left-color: var(--sun);
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.5rem 0.9rem 0.5rem 0.7rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s, translate 0.3s var(--ease), box-shadow 0.3s;
}

.store:hover {
  background: #fff;
  translate: 0 -2px;
  box-shadow: 0 12px 20px -14px rgba(0, 0, 0, 0.7);
}

.store-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.game-credit {
  margin-top: 1.1rem;
  font-size: 0.9375rem;
}

.game-aftermagic .game-credit {
  color: #d9c7bd;
}

/* --------------------------------------------------------------------------
   Gallery: swipeable gameplay shots with captions underneath
   -------------------------------------------------------------------------- */
.gallery {
  padding-block: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.gallery-foot {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.gallery-progress {
  flex: 1;
  height: 2px;
  overflow: hidden;
  background: var(--rule);
}

.gallery-progress span {
  display: block;
  width: var(--gallery-progress, 20%);
  height: 100%;
  background: var(--ink);
  transition: width 0.2s ease-out;
}

.gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.gallery-nav {
  display: flex;
  gap: 0.5rem;
}

.gallery-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-size: 1.125rem;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}

.gallery-btn:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.gallery-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery-window {
  --edge: max(1.5rem, (100% - 1200px) / 2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
}

.gallery-window::-webkit-scrollbar {
  display: none;
}

.gallery-window:focus-visible {
  outline-offset: -3px;
}

.gallery-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  padding-inline: var(--edge);
  list-style: none;
}

.gallery-track li {
  scroll-snap-align: start;
}

.gallery-track figure {
  width: min-content;
}

.gallery-track img {
  max-width: none;
}

.gallery-track img {
  width: auto;
  height: clamp(200px, 19vw, 270px);
  border-radius: 14px;
  box-shadow: 0 18px 30px -22px rgba(40, 20, 0, 0.7);
}

.gallery-track figcaption {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.gallery-track figcaption strong {
  display: block;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   About: an editorial statement beside a ruled list
   -------------------------------------------------------------------------- */
.about {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.about-text h2 {
  margin-bottom: 1.5rem;
}

.lede {
  max-width: 30ch;
  font-family: var(--serif);
  font-size: clamp(1.3125rem, 1.9vw, 1.625rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.lede em {
  font-style: normal;
  color: var(--ember);
}

.lede + p {
  max-width: 46ch;
  margin-top: 1.25rem;
  color: var(--ink-soft);
}

.pillars {
  position: sticky;
  top: 6rem;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}

.pillars li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
}

.pillar-icon {
  grid-row: span 2;
  width: 30px;
  height: 30px;
  margin-top: 0.1rem;
  color: #c27a12;
}

.pillars h3 {
  margin-bottom: 0.3rem;
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.pillars p {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Partners: the dark block, with the two publishing models beside the offer
   -------------------------------------------------------------------------- */
.partners {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: start;
  gap: clamp(1.75rem, 5vw, 4rem);
  padding: clamp(1.5rem, 5vw, 4rem);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: radial-gradient(70% 120% at 100% 0%, #4a2412, transparent 72%), var(--plum);
  color: var(--paper);
  isolation: isolate;
}

/* Fine grain over the glow, so the gradient does not band */
.partners::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: 0.08;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.partners :focus-visible,
.game-aftermagic :focus-visible {
  outline-color: var(--ember-light);
}

.partners .label {
  color: #b9afa1;
}

.partners h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.375rem, 4.4vw, 3.5rem);
}

.partners h2 span {
  display: block;
  color: var(--sun);
}

.partners-copy > p:not(.label) {
  max-width: 46ch;
  margin-bottom: 1.75rem;
  color: #d4cbbd;
}

.partners .link {
  text-decoration-color: #6d655a;
}

.partners .link:hover {
  text-decoration-color: var(--sun);
}

.models .label {
  margin-bottom: 0.75rem;
}

.model {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(244, 239, 230, 0.18);
}

.model:last-child {
  border-bottom: 1px solid rgba(244, 239, 230, 0.18);
}

.model img {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 15px;
  box-shadow: 0 0 0 1px rgba(246, 173, 60, 0.35), 0 14px 24px -12px rgba(246, 120, 30, 0.45);
}

.model p {
  display: grid;
  line-height: 1.3;
}

.model strong {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
}

.model span {
  margin-top: 0.1rem;
  font-size: 0.9375rem;
  color: #d4cbbd;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.contact-head h2 {
  margin-bottom: 1rem;
}

.contact-head > p:last-child {
  max-width: 36ch;
  color: var(--ink-soft);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.contact-item {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.contact-item h3 {
  margin-bottom: 0.4rem;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.contact-item p {
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.5;
}

.contact-item .link {
  display: inline-block;
  padding: 0.5rem 0;
  font-weight: 500;
}

.contact-minor h3 {
  font-size: 1.0625rem;
}

.contact-minor p {
  font-size: 0.9375rem;
}

.discord {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--paper-deep);
}

.discord-copy {
  display: contents;
}

.discord p,
.discord-link {
  grid-column: 1 / -1;
}

.discord-link {
  justify-self: start;
}

.discord-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 9px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
}

.discord-copy {
  flex: 1;
  min-width: 0;
}

.discord-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
}

.discord p {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.discord-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  min-height: 46px;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, translate 0.3s var(--ease);
}

.discord-link:hover {
  background: var(--ember);
  translate: 0 -2px;
}

/* --------------------------------------------------------------------------
   Motion: scroll reveal and depth (html.js is set by an inline head script)
   -------------------------------------------------------------------------- */
@keyframes rise {
  from { transform: translateY(110%); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.js [data-reveal] h2 {
  /* Fraunces descenders extend below the line box; keep them inside the reveal mask. */
  clip-path: inset(0 0 -0.2em 0);
  transition: clip-path 1s var(--ease) 0.1s, translate 1s var(--ease) 0.1s;
}

.js [data-reveal]:not(.is-in) h2 {
  clip-path: inset(0 0 100% 0);
  translate: 0 0.25em;
}

.js .game .stage {
  transition: opacity 1s var(--ease), scale 1.2s var(--ease);
}

.js .game:not(.is-in) .stage {
  opacity: 0;
  scale: 0.97;
}

/* Scene copy arrives line by line; the scene colour itself does not fade */
.js .game[data-reveal] {
  opacity: 1;
  transform: none;
}

.js .game .game-body > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms + 150ms);
}

.js .game.is-in .game-body > * {
  opacity: 1;
  transform: none;
}

.game-body > :nth-child(2) { --i: 1; }
.game-body > :nth-child(3) { --i: 2; }
.game-body > :nth-child(4) { --i: 3; }
.game-body > :nth-child(5) { --i: 4; }
.game-body > :nth-child(6) { --i: 5; }
.game-body > :nth-child(7) { --i: 6; }

@supports (animation-timeline: view()) {
  /* Screenshots travel at different speeds as the scene passes */
  @keyframes shot-near {
    from { translate: 0 4%; }
    to { translate: 0 -4%; }
  }

  @keyframes shot-far {
    from { translate: 0 -2.5%; }
    to { translate: 0 2.5%; }
  }

  @keyframes hero-push {
    to { scale: 1.16; }
  }

  .world picture img {
    animation: hero-push linear both;
    animation-timeline: scroll(root);
    animation-range: 0 90vh;
  }

  .shot-c,
  .bento-main {
    animation: shot-near linear both;
    animation-timeline: view();
  }

  .shot-l,
  .shot-r,
  .bento-a,
  .bento-b {
    animation: shot-far linear both;
    animation-timeline: view();
  }

}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js .game .game-body > *,
  .js .game .stage {
    opacity: 1;
    transform: none;
    scale: none;
  }

  .js [data-reveal] h2 {
    clip-path: none;
    translate: none;
  }

  .shot,
  .play,
  .world picture img {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1040px) {
  .facts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .section-head,
  .partners,
  .contact {
    grid-template-columns: 1fr;
  }

  .about {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 2rem;
  }

  /* Leaves room for the one-line "We create worlds" inside its mask on narrow phones */
  .hero-title {
    font-size: 11.8vw;
  }

  .hero-grid {
    grid-template-columns: 1.3fr 1fr;
    grid-template-areas:
      'main main'
      'wide tall';
  }

  .world {
    min-height: 300px;
  }

  .game,
  .game-aftermagic {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .stage {
    aspect-ratio: 1.7 / 1;
  }

  .stage-bento {
    aspect-ratio: auto;
    container-type: inline-size;
    padding: 1.5rem var(--gutter) 0.5rem;
    gap: 0.75rem;
  }

  .bento-main,
  .bento-a,
  .bento-b {
    animation: none !important;
  }

  .contact-head {
    display: contents;
  }

  .contact {
    gap: 0;
  }

  .contact-head h2 {
    margin-top: -0.25rem;
  }

  .contact-grid {
    margin-top: 1.75rem;
  }

  .contact .discord {
    margin-top: 2rem !important;
  }

  /* A display: contents block has no box to observe, so its heading never waits for a reveal */
  .js .contact-head h2 {
    clip-path: none;
    translate: none;
  }

  .contact .discord {
    order: 3;
    margin-top: 0;
  }

  .discord {
    display: flex;
    flex-wrap: wrap;
  }

  .discord-copy {
    display: block;
    flex: 1;
    min-width: 14rem;
  }

  .stage-phones .shot {
    height: 72cqh;
  }

  .shot-c {
    height: 84cqh !important;
  }

  .shot-l {
    left: calc(50% - 21cqw);
  }

  .shot-r {
    left: calc(50% + 21cqw);
  }

  /* Scenes: name first, then the gameplay, then the rest of the copy */
  .game,
  .game-aftermagic {
    display: flex;
    flex-direction: column;
    padding-bottom: 3rem;
  }

  .game-body,
  .game-aftermagic .game-body {
    display: contents;
  }

  .game-body > * {
    margin-inline: var(--gutter);
  }

  .game-id {
    order: -3;
    margin-top: 2.25rem;
    margin-bottom: 0.9rem;
  }

  .game-title {
    order: -2;
  }

  .game-tagline {
    order: -1;
    margin-bottom: 0.25rem;
  }

  .game .stage {
    order: 0;
    margin-bottom: 0.5rem;
  }

  .game-desc,
  .chips,
  .game-actions {
    max-width: 40rem;
  }

  .pillars {
    position: static;
  }

  .partners {
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'main'
      'wide'
      'tall';
    gap: 0.75rem;
  }

  /* Doors: the art keeps its full width, the caption sits below it */
  .world {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 20px;
  }

  .world picture {
    position: relative;
    inset: auto;
    aspect-ratio: 16 / 7;
    overflow: hidden;
  }

  .world-nightfall picture img {
    object-position: 50% 60%;
  }

  .world-aftermagic picture img {
    object-position: 50% 26%;
  }

  .world-tag {
    position: static;
    max-width: none;
    padding: 0.6rem 0.9rem 0.6rem 0.6rem;
    border-radius: 0;
    background: var(--plum);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .world-tag img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .world-name {
    flex: 1;
  }

  .world-name small {
    font-size: 0.8125rem;
  }

  .world-arrow {
    margin-left: 0;
  }

  .facts {
    gap: 0.75rem 1.25rem;
  }

  .hero-lead {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-lead .actions {
    row-gap: 0.25rem;
  }

  #games .section-head > p {
    display: none;
  }

  .gallery-track figcaption {
    font-size: 0.8125rem;
  }

  #games {
    padding-top: 2.75rem;
  }

  .section-head {
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }


  /* Scene stages: tall enough for the screenshots to stay legible */
  .stage {
    aspect-ratio: 1.12 / 1;
  }

  .stage-bento {
    aspect-ratio: auto;
    container-type: inline-size;
  }

  .stage-phones .shot {
    border-width: 4px;
    border-radius: 18px;
  }

  .stage-phones .shot {
    height: 60cqh;
  }

  .shot-c {
    height: 72cqh !important;
  }

  .shot-l {
    left: calc(50% - 28cqw);
  }

  .shot-r {
    left: calc(50% + 28cqw);
  }

  .stage-bento {
    padding: 1rem var(--gutter) 0.25rem;
  }

  .stage-bento .shot {
    border-radius: 10px;
  }

  .play {
    width: 100%;
    justify-content: center;
    padding-inline: 0.35rem 1.35rem;
  }

  /* Store tiles: one equal row in both scenes */
  .game-actions {
    justify-items: stretch;
  }

  /* Stores two to a row in both scenes; the trailer keeps the full width */
  .stores {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .store {
    min-height: 48px;
    padding-inline: 0.5rem;
    font-size: 0.875rem;
  }

  .store:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .chips {
    display: flex;
    flex-wrap: wrap;
  }

  .chips li {
    font-size: 0.875rem;
  }

  .lede {
    font-size: 1.25rem;
  }

  .pillars li {
    padding: 0.8rem 0;
  }

  .pillars h3 {
    font-size: 1.25rem;
  }

  .pillars p {
    font-size: 0.9375rem;
  }

  .partners-copy > p:not(.label) {
    margin-bottom: 1.25rem;
  }

  .model {
    padding: 0.75rem 0;
  }

  .model img {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }

  .partners h2 {
    font-size: 2.125rem;
  }

  .wide-only,
  .actions .wide-only {
    display: none;
  }

  .actions .narrow-only {
    display: inline-block;
  }

  .world-name small::first-letter {
    text-transform: uppercase;
  }

  .narrow-only {
    display: inline-block;
  }

  .gallery-btn {
    width: 44px;
    height: 44px;
  }

  .gallery-track {
    gap: 0.75rem;
  }

  .gallery-track img {
    height: 168px;
  }

  .about {
    grid-template-columns: 1fr;
  }

  /* One lead shot on phones; the gallery carries the rest */
  .bento-a,
  .bento-b {
    display: none;
  }

  .discord {
    display: grid;
  }

  .discord-copy {
    display: contents;
  }

  .discord-link {
    justify-self: stretch;
    width: 100%;
  }


  .partners .actions {
    gap: 0.25rem 1.25rem;
  }

  .pillars li {
    grid-template-columns: 3rem 1fr;
  }

  .pillar-icon {
    width: 36px;
    height: 36px;
    padding: 8px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .contact-item {
    padding-top: 0.75rem;
  }

  .contact-item p {
    margin-bottom: 0.1rem;
    font-size: 0.9375rem;
  }

  .contact-item .link {
    padding: 0.35rem 0;
  }

  /* Discord: mark beside the title, copy and button at full width */
  .discord {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    padding: 1.25rem;
  }

  .discord-mark {
    width: 30px;
    height: 30px;
  }

  .discord-copy {
    display: contents;
  }

  .discord p,
  .discord-link {
    grid-column: 1 / -1;
  }

  .discord-link {
    width: 100%;
  }
}

/* Very narrow phones (320px): store buttons stack instead of overflowing the column */
@media (max-width: 359px) {
  .stores {
    grid-template-columns: 1fr;
  }

  .store:last-child:nth-child(odd) {
    grid-column: auto;
  }
}