/* Apex Games. Pure black, bone text from the logo, bronze only where light lands. */
@font-face { font-family: "Flex"; src: url("fonts/roboto-flex-cyrillic-ext.woff2") format("woff2"); font-weight: 100 1000; font-stretch: 25% 151%; font-display: swap; unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Flex"; src: url("fonts/roboto-flex-cyrillic.woff2") format("woff2"); font-weight: 100 1000; font-stretch: 25% 151%; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Flex"; src: url("fonts/roboto-flex-latin-ext.woff2") format("woff2"); font-weight: 100 1000; font-stretch: 25% 151%; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Flex"; src: url("fonts/roboto-flex-latin.woff2") format("woff2"); font-weight: 100 1000; font-stretch: 25% 151%; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --black: #000;
  --bone: #e4ddd1;
  --ash: #938e84;
  --soot: #2c2a26;
  --bronze: #c69562;
  --pad: clamp(18px, 3.2vw, 48px);
  --bar: 76px;
  --wheel-x: 34vw;
  --ease: cubic-bezier(0.22, 0.9, 0.24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--black);
  color: var(--bone);
  font-family: "Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  /* No visible scrollbar; the page still scrolls by wheel, touch, keys and the menu. */
  scrollbar-width: none;
  overscroll-behavior-y: none;
}
html::-webkit-scrollbar { display: none; }
html.is-locked { overflow: hidden; }
body { margin: 0; background: var(--black); overflow-x: clip; }
main { transition: opacity 0.17s ease; }
.is-switching main { opacity: 0; }
h1, h2, p, ol { margin: 0; padding: 0; font: inherit; }
ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--bronze); color: var(--black); }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 4px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: var(--pad); top: 12px; z-index: 60; padding: 8px 14px; background: var(--bone); color: var(--black); transform: translateY(-200%); }
.skip:focus { transform: none; }

.display {
  font-weight: 800;
  font-stretch: 151%;
  line-height: 1;
  letter-spacing: -0.012em;
  text-transform: uppercase;
}
.line { display: block; white-space: nowrap; }
.line > span { display: inline-block; }

/* Every logo on the page comes from the SVG files in /logos, so it stays sharp at any size. */
.wm { display: block; width: 100%; height: auto; }
.giant {
  display: block; aspect-ratio: 833 / 217; background: currentColor;
  -webkit-mask: url("../logos/apex-games-wordmark-light-traced.svg") center / contain no-repeat;
  mask: url("../logos/apex-games-wordmark-light-traced.svg") center / contain no-repeat;
}
.display, .wheel-word, .menu-link, .game-name { text-rendering: geometricPrecision; }
.icon { display: inline-block; width: 1.15em; height: 1.15em; margin-right: 0.45em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-after { margin: 0 0 0 0.35em; }

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--bar); padding: 0 var(--pad);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
/* Content that scrolls under the bar fades out before it can collide with the logo or menu. */
.bar::before { content: ""; position: absolute; inset: 0 0 -30px 0; z-index: -1; pointer-events: none; background: linear-gradient(#000 52%, transparent); }
.bar-mark { display: block; padding: 6px; margin-left: -6px; }
.bar-mark img { display: block; width: 36px; height: auto; }
.bar-tools { display: flex; align-items: center; gap: clamp(16px, 2.6vw, 36px); }
.lang { display: flex; gap: 2px; }
.lang button { padding: 6px 7px; font-size: 13px; color: var(--ash); transition: color 0.2s; }
.lang button[aria-pressed="true"] { color: var(--bone); }
.motion-btn { font-size: 13px; color: var(--bronze); white-space: nowrap; }
.motion-btn[hidden] { display: none; }
.menu-btn { display: inline-flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 15px; }
.menu-btn i { width: 11px; height: 10px; background: var(--bronze); clip-path: polygon(50% 0, 100% 100%, 0 100%); transition: transform 0.6s var(--ease); }
.menu-open .menu-btn i { transform: rotate(180deg); }

/* ---------- Plain layout: no JavaScript or reduced motion ---------- */
.stage { position: relative; }
.world-gl, .counter, .axis, .strip, .drag-hint, .snaps, .giant, .ring, .menu-go { display: none; }
.hero .stage { padding: calc(var(--bar) + 24px) var(--pad) 48px; text-align: center; }
.hero-still { width: min(70vw, 56vh); margin: 0 auto; }
.hero-logo { width: min(76vw, 60vh); margin: 18px auto 0; }
.hero-notes { margin-top: 28px; color: var(--ash); }
.hero-hint { display: none; }
.about, .values, .games, .contact { padding: 12vh var(--pad); }
.about .stage { display: grid; gap: 28px; }
.display { font-size: clamp(38px, 8vw, 110px); }
.lit { font-size: clamp(22px, 3vw, 44px); line-height: 1.24; max-width: 30em; }
.values-title { font-size: 15px; color: var(--ash); margin-bottom: 28px; }
.wheel { display: grid; gap: 28px; }
.wheel-word { display: block; font-weight: 800; font-stretch: 130%; font-size: clamp(34px, 7vw, 96px); line-height: 1; text-transform: uppercase; text-align: left; cursor: default; }
.wheel-text { color: var(--ash); max-width: 34em; margin-top: 6px; }
.game-row { display: block; margin-top: 8vh; padding: 28px 0; border-block: 1px solid var(--soot); position: relative; }
.game-name { display: block; font-size: clamp(36px, 6vw, 84px); font-weight: 800; font-stretch: 151%; line-height: 1; text-transform: uppercase; }
.game-meta { display: grid; gap: 4px; margin-top: 16px; max-width: 34em; color: var(--ash); }
.game-status { color: var(--bone); }
.game-link { display: inline-block; margin-top: 16px; border-bottom: 1px solid currentColor; }
.game-art { display: block; margin-top: 24px; }
.game-art img { width: 100%; }
.game-note { margin-top: 12px; font-size: 13px; color: var(--ash); }
.contact-text { margin-top: 28px; max-width: 30em; color: var(--ash); font-size: clamp(17px, 1.5vw, 22px); }
.mail { display: block; width: fit-content; margin-top: 7vh; font-size: clamp(25px, 8.1vw, 134px); font-weight: 700; font-stretch: 112%; line-height: 1.05; letter-spacing: -0.02em; white-space: nowrap; }
.mail-letter { display: inline-block; will-change: transform; }
.tg { display: inline-block; margin-top: 20px; color: var(--ash); transition: color 0.2s; }
.tg:hover, .foot a:hover, .menu-side a:hover { color: var(--bone); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; margin-top: 8vh; font-size: 14px; color: var(--ash); }
.foot p:first-child { flex: 1 1 auto; }
.foot a { color: var(--bone); }

/* ---------- Menu ---------- */
.menu {
  position: fixed; inset: 0; z-index: 20;
  background: var(--black);
  padding: calc(var(--bar) + 24px) var(--pad) var(--pad);
}
.menu[hidden] { display: none; }
.menu-side { display: grid; gap: 6px; font-size: 16px; }
.menu-side p { margin-top: 18px; color: var(--ash); font-size: 14px; }
.menu-list { display: grid; gap: 8px; margin-top: 32px; }
.menu-link { display: block; font-size: clamp(38px, 11vw, 72px); font-weight: 800; line-height: 1.08; text-transform: uppercase; }

/* ---------- With motion ---------- */
.fx .about, .fx .values { padding: 0; }
.fx .hero-still { display: none; }
.no-gl .hero-still { display: block; }
.fx .hero .stage, .fx .about .stage, .fx .values .stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; padding: 0;
}

/* Bar and hero text wait until the mark has formed. */
.fx .bar { opacity: 0; transition: opacity 0.9s ease; }
.fx.is-in .bar { opacity: 1; }

/* One canvas sits behind the whole page, so the cubes keep moving in every section. */
.fx main { position: relative; z-index: 1; }
.fx .world-gl { display: block; position: fixed; left: 0; top: 0; z-index: 0; width: 100%; height: 100vh; height: 100lvh; pointer-events: none; }
.fx.no-gl .world-gl { display: none; }
.fx .hero { height: 200vh; }
.fx:not(.no-gl) .hero .stage { touch-action: pinch-zoom; }
.fx.no-gl .hero { height: auto; }
.fx.no-gl .about { margin-top: 0; }
.fx.no-gl .hero .stage { position: relative; height: auto; padding: calc(var(--bar) + 24px) var(--pad) 48px; }
.fx.no-gl .hero-logo { position: static; width: min(76vw, 60vh); margin: 18px auto 0; }
/* Past the hero nothing of it may show, even after a jump that skips the fade (a link to /#studio, a reload). */
.is-past .hero-logo, .is-past .hero-notes { visibility: hidden; }
.fx:not(.no-gl) .hero-logo {
  position: absolute; left: 50%; top: var(--mark-bottom, 70%);
  width: calc(var(--mark-size, 400px) * 1.23);
  margin: calc(var(--mark-size, 400px) * 0.015) 0 0 calc(var(--mark-size, 400px) * -0.615);
  will-change: transform, opacity;
}
.fx .wm { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity 1s ease, transform 1.2s var(--ease); }
.fx.is-in .wm { opacity: 1; transform: none; }
.fx .hero-notes {
  position: absolute; inset: auto var(--pad) clamp(18px, 3.4vh, 36px); margin: 0;
  display: flex; justify-content: space-between; gap: 24px; text-align: left; font-size: 15px;
  opacity: 0; transition: opacity 1s ease 0.5s;
}
.fx.is-in .hero-notes { opacity: 1; }
.fx .hero-hint { display: block; color: var(--ash); white-space: nowrap; }

/* The studio section rises over the end of the flight and rests where it lands. Its text plays by
   itself, so it needs no long scroll of its own. */
.fx .about { position: relative; z-index: 1; height: 112vh; margin-top: -100vh; }
.fx .about .stage { display: flex; flex-direction: column; justify-content: center; gap: clamp(24px, 6vh, 72px); padding: var(--bar) var(--pad) 32px; }
.fx .about-title { width: 100%; }
.fx .about-title .line { opacity: 0; font-variation-settings: "wdth" 46, "wght" 420; }
.fx .lit { align-self: flex-end; width: min(100%, 60vw); max-width: none; font-size: clamp(23px, 2.9vw, 46px); }
.fx .lit-word { opacity: 0; }

.fx .values { position: relative; height: calc(100vh + 6 * 62vh); }
.fx .values-title { position: absolute; left: var(--pad); top: calc(var(--bar) + 8px); margin: 0; }
.fx .wheel { display: block; }
.fx .wheel li { position: static; }
.fx .wheel-word {
  position: absolute; left: var(--wheel-x); top: 50%; margin-top: -0.5em;
  white-space: nowrap; font-size: 100px; font-weight: 430; font-stretch: normal;
  font-variation-settings: "wdth" 88, "wght" 430;
  transform-origin: left center; will-change: transform, opacity;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.fx .wheel-text {
  position: absolute; left: var(--pad); top: calc(50% + 46px); margin: 0;
  width: calc(var(--wheel-x) - var(--pad) - 3vw); max-width: 26em;
  font-size: clamp(15px, 1.25vw, 19px); line-height: 1.4; color: var(--bone);
}
.fx .counter {
  display: flex; position: absolute; left: var(--pad); bottom: calc(50% + 40px);
  font-size: clamp(64px, 15vh, 170px); line-height: 1; font-weight: 200; font-stretch: 130%;
  font-variant-numeric: tabular-nums lining-nums; color: var(--bone);
}
.counter-window { display: block; height: 1lh; overflow: hidden; }
.counter-col { display: block; will-change: transform; }
.counter-col > span { display: block; }
.fx .axis { display: block; position: absolute; left: 0; top: 50%; width: calc(var(--wheel-x) - 26px); height: 1px; background: var(--soot); }
.fx .axis::after { content: ""; position: absolute; right: -2px; top: -5px; width: 9px; height: 11px; background: var(--bronze); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.fx .strip {
  display: block; position: absolute; left: var(--pad); top: 50%; height: 44px; margin-top: -22px;
  width: calc(var(--wheel-x) - var(--pad) - 64px); overflow: hidden; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.glyph {
  position: absolute; left: -22px; top: 0; width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--black); will-change: transform, opacity;
}
.glyph svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.fx .drag-hint { display: block; position: absolute; left: var(--pad); bottom: clamp(18px, 3.4vh, 36px); font-size: 14px; color: var(--ash); }
.is-touch .drag-hint { display: none; }
.fx .values .stage { cursor: grab; }
.fx .values .stage.is-dragging, .fx .values .stage.is-dragging * { cursor: grabbing; }
.fx .snaps { display: block; }
.snap { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; }
.fx.is-touch { scroll-snap-type: y proximity; }

.fx .games { padding-top: 26vh; }
.fx .games-title .line, .fx .contact-title .line { opacity: 0.2; font-variation-settings: "wdth" 44, "wght" 320; }
.fx .game-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 28px clamp(20px, 4vw, 64px); margin-top: 14vh; }
.fx .game-meta { margin-top: 0; }
.fx .game-link { margin-top: 0; white-space: nowrap; }
.fx .game-name { transition: font-stretch 0.7s var(--ease); font-stretch: 100%; }
.fx:not(.is-touch) .game-row.is-open .game-name, .fx:not(.is-touch) .game-row:focus-visible .game-name { font-stretch: 151%; }
.fx:not(.is-touch) .game-art {
  position: absolute; left: 0; top: 0; z-index: 2; margin: 0;
  width: clamp(280px, 34vw, 520px); aspect-ratio: 1 / 0.9; pointer-events: none; overflow: hidden;
  clip-path: polygon(50% 62%, 50% 62%, 50% 62%);
  transition: clip-path 0.75s var(--ease);
  will-change: transform, clip-path;
}
.fx:not(.is-touch) .game-art img { width: 100%; height: 100%; object-fit: cover; object-position: 88% 62%; transform: scale(1.22); transition: transform 1.1s var(--ease); }
.fx:not(.is-touch) .game-row.is-open .game-art { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.fx:not(.is-touch) .game-row.is-open .game-art img { transform: none; }
.fx.is-touch .game-row { grid-template-columns: 1fr; }

.fx .contact { padding-top: 22vh; padding-bottom: var(--pad); }
.fx .giant, .is-touch .giant {
  display: block; width: 100%; margin-top: 12vh; color: #2a2825;
  --mx: 50%; --my: 50%;
}
.fx:not(.is-touch) .giant { background: radial-gradient(circle 30vw at var(--mx) var(--my), var(--bone) 0, #6f685c 36%, #1f1d1a 100%); }

/* The ring sits around the normal cursor, so pointing never lags. */
.fx:not(.is-touch) .ring { display: block; position: fixed; left: 0; top: 0; z-index: 40; width: 34px; height: 34px; margin: -17px 0 0 -17px; pointer-events: none; will-change: transform; transition: opacity 0.25s; }
.ring::before { content: ""; position: absolute; inset: 0; border: 1px solid rgba(228, 221, 209, 0.42); border-radius: 50%; transition: transform 0.45s var(--ease), background-color 0.3s, border-color 0.3s; }
.ring.is-link::before { transform: scale(1.75); background: rgba(198, 149, 98, 0.12); border-color: var(--bronze); }
.ring.is-hidden, .ring.is-away { opacity: 0; }

/* Menu with motion. Opening: the cover goes black first, then the words appear as they roll in.
   Closing: the words fade as they roll away, then the cover lifts, so they never sit over page text. */
.fx .menu { padding: 0; opacity: 0; transition: opacity 0.26s ease 0.14s; }
.fx.menu-open .menu { opacity: 1; transition: opacity 0.22s ease; }
.fx .menu-list, .fx .menu-side { opacity: 0; transition: opacity 0.16s ease; }
.fx.menu-open .menu-list, .fx.menu-open .menu-side { opacity: 1; transition: opacity 0.3s ease 0.1s; }
/* The focused word is already marked by sitting on the centre line, large and bright. */
.fx .menu-link:focus-visible, .fx .wheel-word:focus-visible { outline: none; }
.fx .menu-side { position: absolute; z-index: 2; left: var(--pad); bottom: var(--pad); width: fit-content; }
.fx .menu-list { position: absolute; inset: 0; display: block; margin: 0; cursor: pointer; }
.fx .menu-link {
  position: absolute; right: calc(var(--pad) + 64px); top: 50%; margin-top: -0.5em;
  font-size: min(10vw, 17vh); line-height: 1; white-space: nowrap;
  transform-origin: right center; will-change: transform, opacity;
  font-variation-settings: "wdth" 80, "wght" 500; color: var(--bone);
}
.fx .menu-go {
  display: grid; place-items: center; position: absolute; right: var(--pad); top: 50%;
  width: 54px; height: 54px; margin-top: -27px; border: 1px solid var(--bronze); border-radius: 50%; color: var(--bronze);
}
.menu-go svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Short screens, such as a phone on its side ---------- */
@media (max-height: 500px) {
  :root { --bar: 56px; }
  .fx .values-title, .fx .drag-hint { display: none; }
  .fx .counter { font-size: 52px; bottom: calc(50% + 28px); }
  .fx .wheel-text { top: calc(50% + 30px); }
}

/* ---------- Phones ---------- */
@media (max-width: 719px) {
  :root { --wheel-x: var(--pad); --bar: 64px; }
  .fx .hero-notes { flex-direction: column; gap: 2px; text-align: center; align-items: center; }
  .fx .lit { width: 100%; align-self: stretch; font-size: clamp(22px, 6vw, 30px); }
  .fx .values { height: calc(100vh + 6 * 56vh); }
  .fx .axis { display: none; }
  .fx .counter { bottom: auto; top: calc(var(--bar) + 40px); font-size: 64px; }
  .fx .strip { top: auto; bottom: 22vh; left: var(--pad); right: var(--pad); width: auto; margin: 0; }
  .fx .wheel-text { top: auto; bottom: 8vh; height: calc(14vh - 8px); width: auto; right: var(--pad); max-width: none; font-size: 16px; }
  .fx .game-row { grid-template-columns: 1fr; }
  .fx .menu-side { bottom: 18px; width: auto; right: var(--pad); }
  .fx .menu-link { right: var(--pad); font-size: 13.5vw; }
  .fx .menu-go { display: none; }
  .foot { font-size: 13px; }
}
