/* Chakra Petch (SIL Open Font License 1.1, assets/fonts/OFL-ChakraPetch.txt), served locally */

@font-face {
  font-family: 'Chakra Petch';
  src: url('../fonts/chakra-petch-400-latin-ext.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  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: 'Chakra Petch';
  src: url('../fonts/chakra-petch-400-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  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;
}

@font-face {
  font-family: 'Chakra Petch';
  src: url('../fonts/chakra-petch-500-latin-ext.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  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: 'Chakra Petch';
  src: url('../fonts/chakra-petch-500-latin.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  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;
}

@font-face {
  font-family: 'Chakra Petch';
  src: url('../fonts/chakra-petch-600-latin-ext.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  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: 'Chakra Petch';
  src: url('../fonts/chakra-petch-600-latin.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  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;
}

@font-face {
  font-family: 'Serpentine';
  src: url('../fonts/serpentine-bold.woff2') format('woff2'),
       url('../fonts/serpentine-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --green: #70bf45;
  --green-hi: #9be36e;
  --green-lo: #3e7a22;
  --green-glow: rgba(112, 191, 69, 0.45);
  --green-soft: rgba(112, 191, 69, 0.12);

  --bg: #060807;
  --bg-2: #0b0f0c;
  --panel: rgba(14, 20, 16, 0.78);
  --panel-solid: #0e1410;
  --line: rgba(112, 191, 69, 0.22);
  --line-strong: rgba(112, 191, 69, 0.5);

  --text: #e7efe3;
  --muted: #94a38e;
  --dim: #7a8973;

  --font-display: 'Serpentine', 'Chakra Petch', system-ui, sans-serif;
  --font-body: 'Chakra Petch', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --nav-w: clamp(250px, 22vw, 320px);
  --gutter: clamp(24px, 4.5vw, 80px);
  --top-safe: 76px;
  --bottom-safe: 72px;
  /* Credits footer at the end of the page: covers the fixed footer strip when the page reaches the end */
  --footer-h: 80px;

  --cut: 12px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Maximum content width, centered in the area to the right of the menu */
  --container: 1320px;

  /* Sentence-style section titles (Games, About and Contact) */
  --title-phrase-size: clamp(40px, 3.6vw, 60px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-booting {
  overflow: hidden;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
select {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--green);
  color: #071006;
}

:focus-visible {
  outline: 2px solid var(--green-hi);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--green);
  color: #071006;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: none;
}

/* ==========================================================================
   Screen effects (scanlines, vignette, noise)
   ========================================================================== */

.fx-scanlines,
.fx-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

.fx-scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.fx-vignette {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

@keyframes blink {
  to { visibility: hidden; }
}

/* ==========================================================================
   Side menu (game main menu style)
   ========================================================================== */

.sidenav {
  --mx: 0;
  --my: 0;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--nav-w);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 20px calc(var(--bottom-safe) + 16px) 28px;
  perspective: 900px;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidenav::-webkit-scrollbar {
  display: none;
}

.sidenav__stage {
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--mx) * 9deg)) rotateX(calc(var(--my) * -7deg));
  will-change: transform;
}

/* Each layer has a depth (--depth) and moves in proportion to the pointer */

.layer {
  --depth: 10;
  transform: translate3d(
    calc(var(--mx) * var(--depth) * 1px),
    calc(var(--my) * var(--depth) * 1px),
    calc(var(--depth) * 1px)
  );
}

.sidenav__logo {
  /* Same depth as the navigation: logo and menu move together in the parallax */
  --depth: 18;
  display: inline-block;
  width: min(150px, 100%);
  margin: 0 0 clamp(16px, 3vh, 28px) 32px;
  text-decoration: none;
}

.sidenav__logo svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(112, 191, 69, 0.15));
}

.menu {
  --depth: 18;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(2px, 0.8vh, 8px);
}

.menu li {
  animation: menu-in 0.6s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 80ms + 200ms);
}

@keyframes menu-in {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: none; }
}

.menu__item {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px 8px 30px;
  font-family: var(--font-display);
  font-size: clamp(19px, min(1.75vw, 3.4vh), 28px);
  line-height: 1.2;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  isolation: isolate;
  transition: color 0.2s;
}

/* Slanted selection bar */

.menu__item::before {
  content: '';
  position: absolute;
  inset: 0 0 0 18px;
  z-index: -1;
  background: linear-gradient(90deg, rgba(112, 191, 69, 0.28), rgba(112, 191, 69, 0.04) 85%, transparent);
  border-left: 3px solid var(--green);
  transform: skewX(-14deg) scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.menu__index {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--dim);
  transition: color 0.2s;
}

/* Menu ▶ cursor */

.menu__cursor {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--green);
  transform: translate(-8px, -50%);
  opacity: 0;
  transition: opacity 0.2s, transform 0.3s var(--ease-out);
  filter: drop-shadow(0 0 6px var(--green-glow));
}

.menu__item:hover,
.menu__item:focus-visible {
  color: #fff;
  outline: none;
}

.menu__item:hover::before,
.menu__item:focus-visible::before,
.menu__item.is-active::before {
  transform: skewX(-14deg) scaleX(1);
}

.menu__item:hover .menu__cursor,
.menu__item:focus-visible .menu__cursor {
  opacity: 1;
  transform: translate(0, -50%);
}

.menu__item:hover .menu__cursor,
.menu__item:focus-visible .menu__cursor {
  animation: cursor-nudge 0.8s ease-in-out infinite;
}

@keyframes cursor-nudge {
  50% { transform: translate(4px, -50%); }
}

.menu__item.is-active {
  color: var(--green-hi);
  text-shadow: 0 0 18px var(--green-glow);
}

.menu__item.is-active .menu__index,
.menu__item:hover .menu__index {
  color: var(--green);
}

/* Menu button and backdrop (mobile only) */

.topbar,
.nav-backdrop {
  display: none;
}

/* ==========================================================================
   Fixed HUD: language, copyright and social links
   ========================================================================== */

.lang {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 80;
}

/* Version in the top-left corner, aligned with the menu and the language selector */

.build-tag {
  position: fixed;
  top: 20px;
  left: 28px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.6em;
  height: 40px;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
}

.build-tag b {
  color: var(--green);
  font-weight: 500;
  text-transform: none;
}

/* Native select: shown only without customizable select support and without JS */

.lang select {
  appearance: none;
  -webkit-appearance: none;
  height: 40px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  /* Arrow and the two chamfer diagonals (the clip-path cuts the border there) */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%2370BF45' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 12px center / 10px 6px,
    linear-gradient(to bottom right, transparent 50%, var(--line) 50% calc(50% + 1px), transparent calc(50% + 1px)) left top / 8px 8px no-repeat border-box,
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--line) calc(50% - 1px) 50%, transparent 50%) right bottom / 8px 8px no-repeat border-box,
    var(--panel);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.lang select:focus-visible {
  outline: none;
  border-color: var(--green);
}

/* JS fallback (assets/js/lang-select-fallback.js) replaces the native select */

.lang.is-enhanced select {
  display: none;
}

/* Button, list and options: shared by the customizable select and the JS fallback */

.lang__button {
  --cut: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(8px);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
  cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: border-color 0.2s, background 0.2s;
}

.lang__button:hover,
.lang.is-open .lang__button {
  border-color: var(--line-strong);
  background: rgba(18, 28, 20, 0.92);
}

.lang__button:focus-visible {
  outline: none;
  border-color: var(--green);
}

.lang__globe {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex: none;
}

.lang__arrow {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--green);
  transition: transform 0.25s var(--ease-out);
}

.lang.is-open .lang__arrow {
  transform: rotate(180deg);
}

/* Fallback list; in the customizable select the equivalent is ::picker(select) */

.lang__list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--line-strong);
  /* The clip-path cuts the border at the chamfer; the first layer redraws that diagonal */
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--line-strong) calc(50% - 1px) 50%, transparent 50%) right bottom / 12px 12px no-repeat border-box,
    rgba(8, 12, 9, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  /* On close, visibility only changes after the fade */
  transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
}

/* On open, becomes visible immediately so it can receive focus */

.lang.is-open .lang__list {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s;
}

.lang__list:focus {
  outline: none;
}

.lang__option {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px 9px 28px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  isolation: isolate;
  transition: color 0.15s;
}

/* Slanted selection bar, without the side menu's green border */

.lang__option::before {
  content: '';
  position: absolute;
  inset: 0 0 0 14px;
  z-index: -1;
  background: linear-gradient(90deg, rgba(112, 191, 69, 0.28), rgba(112, 191, 69, 0.04) 85%, transparent);
  transform: skewX(-14deg) scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

/* ▶ cursor */

.lang__option::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--green);
  transform: translate(-4px, -50%);
  opacity: 0;
  transition: opacity 0.15s, transform 0.25s var(--ease-out);
}

/* :hover/:focus-visible/:checked in the customizable select; .is-focused/aria-selected in the fallback */

.lang__option:hover,
.lang__option:focus-visible,
.lang__option.is-focused {
  color: #fff;
  outline: none;
}

.lang__option:hover::before,
.lang__option:focus-visible::before,
.lang__option.is-focused::before {
  transform: skewX(-14deg) scaleX(1);
}

.lang__option:checked::after,
.lang__option[aria-selected='true']::after,
.lang__option:hover::after,
.lang__option:focus-visible::after,
.lang__option.is-focused::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.lang__option:checked,
.lang__option[aria-selected='true'] {
  color: var(--green-hi);
}

.lang__code {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.04em;
}

.lang__name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.lang__option:hover .lang__name,
.lang__option:focus-visible .lang__name,
.lang__option:checked .lang__name,
.lang__option.is-focused .lang__name,
.lang__option[aria-selected='true'] .lang__name {
  color: var(--muted);
}

/* Customizable select (appearance: base-select + <selectedcontent>) */

@supports (appearance: base-select) {
  .lang select,
  .lang ::picker(select) {
    appearance: base-select;
  }

  .lang select {
    height: auto;
    padding: 0;
    border: 0;
    background: none;
    clip-path: none;
  }

  .lang select::picker-icon,
  .lang__option::checkmark {
    display: none;
  }

  .lang select:open .lang__button {
    border-color: var(--line-strong);
    background: rgba(18, 28, 20, 0.92);
  }

  .lang select:focus-visible .lang__button {
    border-color: var(--green);
  }

  .lang select:open .lang__arrow {
    transform: rotate(180deg);
  }

  /* The button shows only the code, in the button's typeface */
  .lang selectedcontent .lang__name {
    display: none;
  }

  .lang selectedcontent .lang__code {
    font: inherit;
    letter-spacing: inherit;
  }

  /* List aligned to the right of the button */
  .lang ::picker(select) {
    position-area: bottom span-left;
    min-width: 220px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--line-strong);
    /* The clip-path cuts the border at the chamfer; the first layer redraws that diagonal */
    background:
      linear-gradient(to bottom right, transparent calc(50% - 1px), var(--line-strong) calc(50% - 1px) 50%, transparent 50%) right bottom / 12px 12px no-repeat border-box,
      rgba(8, 12, 9, 0.96);
    color: var(--text);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.25s var(--ease-out), overlay 0.25s allow-discrete, display 0.25s allow-discrete;
  }

  .lang select:open::picker(select) {
    opacity: 1;
    transform: none;
  }

  @starting-style {
    .lang select:open::picker(select) {
      opacity: 0;
      transform: translateY(-6px);
    }
  }
}

.hud-footer {
  pointer-events: none;
}

/* Copy of copyright and social links in the menu panel: mobile only */

.sidenav__footer {
  display: none;
}

.copyright {
  position: fixed;
  left: 32px;
  bottom: 22px;
  z-index: 70;
  max-width: calc(var(--nav-w) - 48px);
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
  pointer-events: auto;
}

.copyright__rights {
  display: block;
}

.social {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 70;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: auto;
}

.social a {
  --cut: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  backdrop-filter: blur(8px);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.social a:hover,
.social a:focus-visible {
  color: #071006;
  background: var(--green);
  border-color: var(--green);
  transform: translateY(-2px);
}

.social svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   Main layout
   ========================================================================== */

main {
  position: relative;
  margin-left: var(--nav-w);
}

main:focus {
  outline: none;
}

.section {
  position: relative;
  /* Height comes from the content. The top never sits below the strip of fixed elements (language and version);
     top + bottom form the spacing between sections, proportional to the screen height */
  padding: clamp(calc(var(--top-safe) + 20px), 12vh, 136px) var(--gutter) clamp(64px, 8vh, 96px);
  scroll-margin-top: 0;
}

.section:focus {
  outline: none;
}

/* Credits footer: the text is centered on the same line as the fixed footer's social links */

.site-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--footer-h);
  margin-left: var(--nav-w);
  padding: 0 var(--gutter);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

/* Line in the style of the section kicker, fading out at both ends; the width clears the social links on the right */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: min(640px, 100% - 360px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  transform: translateX(-50%);
}

.site-footer__credit {
  margin: 0;
}

.site-footer__credit a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer__credit a:hover,
.site-footer__credit a:focus-visible {
  color: var(--green-hi);
}

/* Subtle section background grid; extends beneath the side menu */

.section::before {
  content: '';
  position: absolute;
  inset: 0 0 0 calc(var(--nav-w) * -1);
  z-index: -1;
  background-image:
    linear-gradient(rgba(112, 191, 69, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 191, 69, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(32px, 6vh, 56px);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green);
}

.kicker::after {
  content: '';
  flex: 0 1 80px;
  height: 1px;
  background: linear-gradient(90deg, var(--green), transparent);
}

.section-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(44px, 6.5vw, 96px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Sentence-style titles: header without width limit, smaller font and balanced lines
   (e.g. "Vamos / conversar?") */

.section-head--phrase {
  max-width: none;
}

.section-title--phrase {
  max-width: 18ch;
  font-size: var(--title-phrase-size);
  line-height: 1.02;
  text-wrap: balance;
}

.section-intro {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

/* Glitch: two copies of the text offset at random moments */

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.glitch::before {
  color: var(--green);
  animation: glitch-a 7s infinite steps(1);
}

.glitch::after {
  color: #ff3b6b;
  mix-blend-mode: screen;
  animation: glitch-b 7s infinite steps(1);
}

.glitch:hover::before {
  animation-duration: 0.9s;
}

.glitch:hover::after {
  animation-duration: 0.9s;
}

@keyframes glitch-a {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  92% { opacity: 0.85; transform: translate(-4px, 1px); clip-path: inset(10% 0 60% 0); }
  94% { opacity: 0.85; transform: translate(3px, -1px); clip-path: inset(55% 0 20% 0); }
  96% { opacity: 0.85; transform: translate(-2px, 0); clip-path: inset(30% 0 45% 0); }
}

@keyframes glitch-b {
  0%, 91%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); }
  92.5% { opacity: 0.7; transform: translate(4px, 0); clip-path: inset(65% 0 10% 0); }
  95% { opacity: 0.7; transform: translate(-3px, 1px); clip-path: inset(15% 0 70% 0); }
  97% { opacity: 0.7; transform: translate(2px, -1px); clip-path: inset(40% 0 35% 0); }
}

/* Reveal on scroll */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(var(--delay, 0) * 1ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
  outline: none;
}

.btn--primary {
  --btn-bg: var(--green);
  --btn-fg: #071006;
  border-color: var(--green);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--green-hi);
  box-shadow: 0 0 32px var(--green-glow);
}

.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   Carousel controls: home games (.chapters) and game page gallery (.gallery)
   ========================================================================== */

.chapters__arrow,
.gallery__arrow {
  --cut: 8px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--green);
  cursor: pointer;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.chapters__arrow:hover:not(:disabled),
.chapters__arrow:focus-visible,
.gallery__arrow:hover:not(:disabled),
.gallery__arrow:focus-visible {
  background: var(--green);
  color: #071006;
  outline: none;
}

.chapters__arrow:disabled,
.gallery__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.chapters__arrow svg,
.gallery__arrow svg {
  width: 14px;
  height: 14px;
}

.chapters__dots,
.gallery__dots {
  display: flex;
  gap: 6px;
}

.chapters__dot,
.gallery__dot {
  width: 28px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.chapters__dot::before,
.gallery__dot::before {
  content: '';
  display: block;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s, box-shadow 0.2s;
}

.chapters__dot:hover::before,
.gallery__dot:hover::before {
  background: rgba(255, 255, 255, 0.35);
}

.chapters__dot[aria-current='true']::before,
.gallery__dot[aria-current='true']::before {
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.chapters__hint,
.gallery__hint {
  margin-left: auto;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Bordered chamfers: the clip-path cuts the border at both diagonals (top left and
   bottom right). ::before and ::after redraw those lines inheriting the border color, so they
   follow hover and focus. The line is 2px centered on the cut; the clip-path leaves 1px visible. */

.btn,
.lang__button,
.social a,
.chapters__arrow,
.gallery__arrow,
.menu-toggle,
.chapter__cta,
.follow__icon,
.lightbox__btn {
  position: relative;
}

.btn::before,
.btn::after,
.lang__button::before,
.lang__button::after,
.social a::before,
.social a::after,
.chapters__arrow::before,
.chapters__arrow::after,
.gallery__arrow::before,
.gallery__arrow::after,
.menu-toggle::before,
.menu-toggle::after,
.chapter__cta::before,
.chapter__cta::after,
.follow__icon::before,
.follow__icon::after,
.lightbox__btn::before,
.lightbox__btn::after {
  content: '';
  position: absolute;
  width: calc(var(--cut) * 1.4142);
  height: 0;
  border-top: 2px solid;
  border-top-color: inherit;
  pointer-events: none;
}

/* Positions relative to the inner border: the center of the cut sits --cut/2 from the outer corner */

.btn::before,
.lang__button::before,
.social a::before,
.chapters__arrow::before,
.gallery__arrow::before,
.menu-toggle::before,
.chapter__cta::before,
.follow__icon::before,
.lightbox__btn::before {
  top: calc(var(--cut) / 2 - 1px);
  left: calc(var(--cut) / 2 - 1px);
  transform: translate(-50%, -50%) rotate(-45deg);
}

.btn::after,
.lang__button::after,
.social a::after,
.chapters__arrow::after,
.gallery__arrow::after,
.menu-toggle::after,
.chapter__cta::after,
.follow__icon::after,
.lightbox__btn::after {
  right: calc(var(--cut) / 2 - 1px);
  bottom: calc(var(--cut) / 2 - 1px);
  transform: translate(50%, 50%) rotate(-45deg);
}

.tri {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--green);
  white-space: nowrap;
}

.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  background: currentColor;
  animation: blink 1.2s steps(2, start) infinite;
}

/* With the lighter gradient, a soft shadow keeps the text legible over the art */

.chapter__genre,
.chapter__desc,
.chapter__body .stages {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.75);
}

.stages {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stages__pips {
  display: flex;
  gap: 4px;
}

.stages__pips i {
  width: 18px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.stages__pips i.is-done {
  background: var(--green-lo);
}

.stages__pips i.is-current {
  position: relative;
  background: rgba(112, 191, 69, 0.22);
  box-shadow: 0 0 8px var(--green-glow);
}

/* Current phase: fills from left to right, like a loading bar */

.stages__pips i.is-current::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green);
  transform-origin: left;
  animation: pip-fill 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

/* On cards, the status indicator blinks and the current phase fills only on the selected card or the one
   under the pointer; on the others, both stay lit and still */

.chapter:not(.is-active) .chapter__card:not(:hover, :focus-visible) .chip::before,
.chapter:not(.is-active) .chapter__card:not(:hover, :focus-visible) .stages__pips i.is-current::after {
  animation: none;
}

@keyframes pip-fill {
  0% { transform: scaleX(0); opacity: 1; }
  60% { transform: scaleX(1); opacity: 1; }
  85% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* The phase does not wrap: without room, the button drops to the next line */

.chapter__footer .stages {
  white-space: nowrap;
}

.chapter__footer .stages {
  margin-bottom: 0;
}

/* Text right below the title, with the same spacing as the other sections' intro */

.about .section-head {
  margin-bottom: 0;
}

.panel {
  position: relative;
  padding: 1px;
  background: var(--line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.panel__inner {
  padding: 22px 24px 24px;
  background: var(--panel-solid);
  clip-path: inherit;
}

.panel__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green);
}

.panel__title::after {
  content: '■ ■ ■';
  font-size: 8px;
  letter-spacing: 0.3em;
  color: var(--dim);
}

/* Wide screens: text on the left and channels on the right */

@media (min-width: 1361px) {
  .contact__grid .section-head {
    margin-bottom: 0;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-height: 720px) and (min-width: 961px) {
  .sidenav__logo {
    width: 110px;
  }
}

/* Below 960px the menu becomes a side panel opened by the button at the top */

@media (max-width: 960px) {
  :root {
    --nav-w: 0px;
    --top-safe: 72px;
    /* No fixed bottom bar: copyright and social links go in the menu panel */
    --bottom-safe: 16px;
    --footer-h: 56px;
    --gutter: 20px;
  }

  body {
    font-size: 16px;
  }

  /* Layers: with the menu closed, the bar (79) sits below the language selector (80) so it does not darken it.
     With the menu open: selector (80) < dimmed backdrop (84) < panel (85) < bar with the button (86) */

  .topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 79;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 72px;
    padding: 0 20px;
    background: linear-gradient(to bottom, rgba(6, 8, 7, 0.98), rgba(6, 8, 7, 0.88) 70%, transparent);
    pointer-events: none;
    transition: background 0.3s;
  }

  .nav-open .topbar {
    z-index: 86;
    background: none;
  }

  .topbar > * {
    pointer-events: auto;
  }

  .topbar__logo {
    width: 56px;
    transition: opacity 0.2s;
  }

  .nav-open .topbar__logo {
    opacity: 0;
    pointer-events: none;
  }

  .menu-toggle {
    --cut: 8px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line-strong);
    background: var(--panel);
    cursor: pointer;
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  }

  .menu-toggle span {
    position: relative;
    display: block;
    width: 18px;
    height: 2px;
    background: var(--green);
    transition: background 0.2s;
  }

  .menu-toggle span::before,
  .menu-toggle span::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: var(--green);
    transition: transform 0.25s var(--ease-out);
  }

  .menu-toggle span::before { top: -6px;
  }

  .menu-toggle span::after { top: 6px;
  }

  .nav-open .menu-toggle span { background: transparent;
  }

  .nav-open .menu-toggle span::before { transform: translateY(6px) rotate(45deg);
  }

  .nav-open .menu-toggle span::after { transform: translateY(-6px) rotate(-45deg);
  }

  .lang {
    top: 16px;
    right: 20px;
  }

  .lang select,
  .lang__button {
    height: 44px;
  }

  .sidenav {
    z-index: 85;
    justify-content: flex-start;
    width: min(340px, 86vw);
    padding: 96px 28px 24px;
    background: var(--bg);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.4s var(--ease-out), visibility 0.4s;
  }

  .nav-open .sidenav {
    transform: none;
    visibility: visible;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 84;
    display: block;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .nav-open {
    overflow: hidden;
  }

  .sidenav__logo {
    width: 110px;
  }

  .menu__item {
    font-size: 26px;
  }

  .sidenav__hint,
  .build-tag {
    display: none;
  }

  /* Menu vertically centered; copyright and social links at the bottom of the panel */

  .sidenav__stage {
    margin-block: auto;
  }

  .hud-footer {
    display: none;
  }

  .site-footer::before {
    width: calc(100% - var(--gutter) * 2);
  }

  .sidenav__footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px dashed var(--line);
  }

  .copyright--inline,
  .social--inline {
    position: static;
  }

  .copyright--inline {
    max-width: none;
    text-align: center;
  }

  .social--inline {
    justify-content: center;
  }
}

/* Phone: channels in a single column, as a list (icon on the left, name and handle on the right) */
