:root {
  color-scheme: light;
  --bg: #f4ede2;
  --panel: rgba(255, 250, 242, 0.78);
  --ink: #132238;
  --muted: #51627d;
  --accent: #de6a4c;
  --border: rgba(19, 34, 56, 0.12);
  --border-strong: rgba(19, 34, 56, 0.14);
  --border-subtle: rgba(19, 34, 56, 0.08);
  --shadow: 0 2rem 5rem rgba(19, 34, 56, 0.15);
  --ui-focus-outline: rgba(222, 106, 76, 0.42);
  --ui-focus-outline-light: rgba(255, 255, 255, 0.9);
  --ui-glass-highlight-top: rgba(255, 255, 255, 0.72);
  --ui-glass-shadow-bottom: rgba(19, 34, 56, 0.08);
  --ui-pill-bg: rgba(255, 255, 255, 0.62);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next Condensed", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}


body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

.site-shell {
  position: relative;
}

.foreground-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.foreground-shell-legal {
  align-items: flex-start;
}

.foreground-shell-home {
  display: block;
  padding: 0;
}

.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;
}

.background-stage {
  position: fixed;
  inset: 0;
  background: #efe7db;
}

.homepage-shell {
  --home-background-base-image-blur: 0px;
  --home-hero-headline-color: var(--home-logo-wordmark-color-hero);
  --home-hero-headline-font-size: clamp(2.5rem, 3vw, 4rem);
  --home-hero-headline-line-height: 1;
  --home-hero-headline-shadow-blur-radius: var(--home-logo-wordmark-shadow-blur-radius-hero);
  --home-hero-headline-shadow-color: var(--home-logo-wordmark-shadow-color-hero);
  --home-hero-headline-shadow-offset-x: var(--home-logo-wordmark-shadow-offset-x-hero);
  --home-hero-headline-shadow-offset-y: calc(var(--home-logo-wordmark-shadow-offset-y-hero) * 0.5);
  --home-logo-motion-transform-duration: 467ms;
  --home-hero-copy-motion-duration: 320ms;
  --home-glass-blur-nav: 6px;
  --home-glass-blur-card: 4px;
  --home-glass-blur-footer: 6px;
  --home-glass-surface-topbar: rgba(249, 243, 234, 0.82);
  --home-glass-surface-menu: rgba(249, 243, 234, 0.92);
  --home-glass-surface-footer: rgba(255, 250, 242, 0.72);
  --home-logo-wordmark-color-hero: #ffa747;
  --home-logo-wordmark-shadow-color-hero: rgb(64, 0, 0);
  --home-logo-wordmark-shadow-blur-radius-hero: 0.15rem;
  --home-logo-wordmark-shadow-offset-x-hero: 0rem;
  --home-logo-wordmark-shadow-offset-y-hero: 0.5rem;
  --home-logo-wordmark-color-docked: #132238;
  --home-logo-wordmark-shadow-color-docked: rgba(19, 34, 56, 0.14);
  --home-logo-wordmark-shadow-blur-radius-docked: 0rem;
  --home-logo-wordmark-shadow-offset-x-docked: 0rem;
  --home-logo-wordmark-shadow-offset-y-docked: 0rem;
}

.homepage-shell .background-stage {
  overflow: hidden;
}

.homepage-shell .background-stage::before {
  content: "";
  position: absolute;
  inset: calc(var(--home-background-base-image-blur) * -2);
  background: url("/assets/images/karucha-room-02.webp") center 28% / cover no-repeat;
  filter: blur(var(--home-background-base-image-blur));
  transform: translateZ(0);
}

.homepage-shell .home-background-overlay-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  pointer-events: none;
  opacity: 0;
  backface-visibility: hidden;
  transform: translateZ(0);
  transform-origin: center center;
  z-index: 0;
}

.homepage-shell .home-background-overlay-video.is-visible {
  opacity: 1;
}

.homepage-shell .home-background-overlay-video.is-front {
  z-index: 1;
}

.homepage-shell .home-background-overlay-video.is-no-transition {
  transition: none;
}

/* Shared foundations */
.ui-glass-surface {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--ui-glass-border, var(--border));
  border-radius: var(--ui-glass-radius, 1.5rem);
  background: transparent;
  box-shadow: var(--ui-glass-shadow, var(--shadow));
}

.ui-glass-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ui-glass-fill, var(--panel));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur, 18px));
  backdrop-filter: blur(var(--ui-glass-blur, 18px));
  box-shadow: var(--ui-glass-inner-shadow, none);
  opacity: var(--ui-glass-opacity, 1);
  pointer-events: none;
  transition: var(--ui-glass-transition, none);
}

.ui-glass-surface > * {
  position: relative;
  z-index: 1;
}

.ui-pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding:
    var(--ui-pill-padding-block, 0.75rem)
    var(--ui-pill-padding-inline, 1rem);
  border: 1px solid var(--ui-pill-border, var(--border));
  border-radius: 999px;
  background: var(--ui-pill-background, var(--ui-pill-bg));
  font-family: var(--sans);
  font-size: var(--ui-pill-font-size, 0.82rem);
  font-weight: 700;
  letter-spacing: var(--ui-pill-letter-spacing, 0.16em);
  text-decoration: none;
  text-transform: uppercase;
  color: var(--ui-pill-color, var(--ink));
  transition: border-color 160ms ease, transform 160ms ease;
}

.ui-pill-link:hover,
.ui-pill-link:focus-visible {
  border-color: rgba(222, 106, 76, 0.38);
  transform: translateY(-1px);
}

.ui-pill-link:focus-visible {
  outline: 2px solid var(--ui-focus-outline);
  outline-offset: 2px;
}

.ui-brand-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ui-brand-cta-gap, 0.75rem);
  padding:
    var(--ui-brand-cta-padding-block, 0.8rem)
    var(--ui-brand-cta-padding-inline, 1.4rem);
  border: 0;
  border-radius: var(--ui-brand-cta-radius, 999px);
  font-family: var(--sans);
  font-size: var(--ui-brand-cta-font-size, 1rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--ui-brand-cta-letter-spacing, 0.04em);
  color: var(--ui-brand-cta-color, #ffffff);
  text-decoration: none;
  background: var(--ui-brand-cta-background);
  box-shadow: var(--ui-brand-cta-shadow);
  transform: var(--ui-brand-cta-transform, none);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.ui-brand-cta:hover,
.ui-brand-cta:focus-visible {
  transform: var(--ui-brand-cta-hover-transform, translateY(-1px));
  box-shadow: var(--ui-brand-cta-hover-shadow, var(--ui-brand-cta-shadow));
  filter: brightness(1.04);
}

.ui-brand-cta:focus-visible {
  outline: 2px solid var(--ui-brand-cta-outline, var(--ui-focus-outline-light));
  outline-offset: var(--ui-brand-cta-outline-offset, 2px);
}

.eyebrow {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.brand-mark {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Homepage */
.home-shell {
  --home-shell-max: 88rem;
  --home-shell-gutter: clamp(1rem, 3vw, 2rem);
  --home-viewport-width: 100vw;
  --home-viewport-center-x: 50vw;
  --home-hero-section-max-width: 76rem;
  --home-hero-inline-padding: clamp(2rem, 5vw, 4rem);
  --home-topbar-width:
    max(
      0px,
      min(
        calc(var(--home-viewport-width) - (var(--home-shell-gutter) * 2)),
        calc(var(--home-shell-max) - (var(--home-shell-gutter) * 2))
      )
    );
  --home-hero-section-width:
    max(
      0px,
      min(
        calc(var(--home-viewport-width) - (var(--home-shell-gutter) * 2)),
        var(--home-hero-section-max-width)
      )
    );
  --home-hero-content-width:
    max(0px, calc(var(--home-hero-section-width) - (var(--home-hero-inline-padding) * 2)));
  --home-logo-hero-max-width: 36rem;
  --home-logo-hero-width: min(var(--home-logo-hero-max-width), var(--home-hero-content-width));
  --home-hero-copy-width: min(56rem, var(--home-hero-content-width));
  --home-topbar-offset: clamp(1rem, 2vw, 1.5rem);
  --home-topbar-reserved: 5.75rem;
  --home-hero-stack-gap: clamp(1.35rem, 3vw, 2rem);
  --home-hero-center-y:
    min(
      calc((var(--home-topbar-offset) + var(--home-topbar-reserved) + 100vh) / 2),
      calc(var(--home-topbar-offset) + var(--home-topbar-reserved) + var(--home-logo-hero-width) * 0.75)
    );
  --home-topbar-dock-top: 0px;
  --home-topbar-dock-left: 0px;
  --home-topbar-dock-scale: 0.1;
  width: min(100%, var(--home-shell-max));
  margin: 0 auto;
  padding:
    calc(var(--home-topbar-offset) + var(--home-topbar-reserved))
    var(--home-shell-gutter)
    clamp(3rem, 7vw, 5rem);
}

.home-topbar {
  --ui-glass-radius: 1.25rem;
  --ui-glass-border: var(--border-strong);
  --ui-glass-fill: var(--home-glass-surface-topbar);
  --ui-glass-blur: var(--home-glass-blur-nav);
  --ui-glass-shadow: none;
  --ui-glass-inner-shadow:
    inset 0 0 0 1px var(--border-strong),
    inset 0 1px 0 var(--ui-glass-highlight-top),
    inset 0 -1px 0 var(--ui-glass-shadow-bottom),
    0 1rem 2.4rem rgba(19, 34, 56, 0.12);
  --ui-glass-opacity: 0;
  --ui-glass-transition: opacity var(--home-logo-motion-transform-duration) ease;
  position: fixed;
  top: var(--home-topbar-offset);
  left: calc(var(--home-viewport-center-x) - (var(--home-topbar-width) / 2));
  z-index: 10;
  width: var(--home-topbar-width);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  padding: 0.9rem 1rem;
  overflow: visible;
  border-color: transparent;
}

:root[data-home-menu-state="open"] .home-topbar:not(.docked),
:root[data-home-language-menu-state="open"] .home-topbar:not(.docked),
:root[data-home-compact-language-menu-state="open"] .home-topbar:not(.docked) {
  z-index: 30;
}

.home-topbar.docked {
  --ui-glass-opacity: 1;
}

.home-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.home-topbar-inner > * {
  position: relative;
}

.home-topbar-brand {
  position: static;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(3.5rem, 8vw, 4.5rem);
  height: clamp(2rem, 4vw, 2.4rem);
  text-decoration: none;
  pointer-events: none;
  z-index: 1;
}

.home-topbar-brand.docked {
  pointer-events: auto;
}

.home-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
}

.home-topbar-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
  z-index: 2;
}

.home-topbar-nav-mobile {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin-left: 0;
}

.home-topbar-link {
  --ui-pill-padding-block: 0.7rem;
  --ui-pill-padding-inline: 0.95rem;
  --ui-pill-letter-spacing: 0.16em;
}

.home-topbar-nav-mobile .home-topbar-link {
  justify-content: flex-start;
  width: 100%;
}

.home-topbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  z-index: 3;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.home-topbar-toggle-icon {
  display: block;
  width: 1rem;
  height: 0.8rem;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
}

.home-topbar-language-control {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.home-topbar-language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  color: var(--ink);
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.home-topbar-language-toggle:hover,
.home-topbar-language-toggle:focus-visible {
  border-color: rgba(222, 106, 76, 0.38);
  transform: translateY(-1px);
}

.home-topbar-language-toggle:focus-visible {
  outline: 2px solid var(--ui-focus-outline);
  outline-offset: 2px;
}

.home-topbar-language-icon {
  display: block;
  width: 1.34rem;
  height: 1.34rem;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.home-topbar-menu {
  --ui-glass-radius: 1.25rem;
  --ui-glass-border: var(--border);
  --ui-glass-fill: var(--home-glass-surface-menu);
  --ui-glass-blur: var(--home-glass-blur-nav);
  --ui-glass-shadow: 0 1rem 2rem rgba(19, 34, 56, 0.12);
  --ui-glass-inner-shadow:
    inset 0 1px 0 var(--ui-glass-highlight-top),
    inset 0 -1px 0 var(--ui-glass-shadow-bottom);
  --ui-glass-opacity: 1;
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: min(20rem, var(--home-topbar-width));
  padding: 0.85rem;
  z-index: 4;
  overflow: visible;
}

.home-topbar-menu-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-topbar-language-menu {
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.75rem;
  overflow: hidden;
}

.home-topbar-menu-language-group {
  display: none;
  justify-content: flex-end;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.home-topbar-language-control-compact {
  display: none;
}

.home-language-menu-nav {
  width: 100%;
}

.home-language-menu-scroll {
  max-height: min(32rem, calc(100svh - 2rem - 1.5rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(19, 34, 56, 0.22) transparent;
}

.home-language-menu-scroll::-webkit-scrollbar {
  width: 0.7rem;
}

.home-language-menu-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.home-language-menu-scroll::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(19, 34, 56, 0.2);
  background-clip: padding-box;
}

.home-language-link {
  --ui-pill-padding-block: 0.68rem;
  --ui-pill-padding-inline: 0.9rem;
  width: 100%;
  justify-content: flex-start;
}

.home-language-link[aria-current="page"] {
  border-color: rgba(222, 106, 76, 0.4);
  background: rgba(255, 255, 255, 0.84);
}

.home-hero {
  position: relative;
  display: grid;
  align-content: center;
  gap: var(--home-hero-stack-gap);
  width: var(--home-hero-section-width);
  min-height: calc(100svh - 5.5rem);
  margin: 0 auto clamp(2rem, 5vw, 4rem);
  padding: var(--home-hero-inline-padding);
}

.home-logo-stage {
  display: flex;
  justify-content: center;
}

.home-logo-stage-anchor {
  width: min(100%, var(--home-logo-hero-width));
  aspect-ratio: 672 / 504;
  visibility: hidden;
  pointer-events: none;
}

.home-topbar-logo-shell {
  position: fixed;
  top: var(--home-hero-center-y);
  left: var(--home-viewport-center-x);
  z-index: 20;
  display: inline-flex;
  width: var(--home-logo-hero-width);
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  transform-origin: top left;
}

.home-topbar-logo-shell.animate {
  transition:
    top var(--home-logo-motion-transform-duration) cubic-bezier(0.45, 0, 0.55, 1),
    left var(--home-logo-motion-transform-duration) cubic-bezier(0.45, 0, 0.55, 1),
    transform var(--home-logo-motion-transform-duration) cubic-bezier(0.45, 0, 0.55, 1);
}

.home-topbar-logo-shell.docked {
  position: fixed;
  top: var(--home-topbar-dock-top);
  left: var(--home-topbar-dock-left);
  cursor: pointer;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(var(--home-topbar-dock-scale));
}

.home-hero-copy-stage {
  position: relative;
  display: grid;
  justify-items: center;
  width: 100%;
}

.home-hero-copy-sizer {
  width: var(--home-hero-copy-width);
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.home-hero-copy {
  position: fixed;
  top: calc(var(--home-hero-center-y) + var(--home-logo-hero-width) * 0.375 + var(--home-hero-stack-gap));
  left: var(--home-viewport-center-x);
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 1rem;
  width: var(--home-hero-copy-width);
  text-align: center;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0);
  transition: opacity var(--home-hero-copy-motion-duration) ease;
}

.home-hero-copy.docked {
  opacity: 0;
  pointer-events: none;
}

.home-hero h1 {
  margin: 0;
  color: var(--home-hero-headline-color);
  font-size: var(--home-hero-headline-font-size);
  line-height: var(--home-hero-headline-line-height);
  letter-spacing: -0.04em;
  white-space: nowrap;
  text-shadow:
    var(--home-hero-headline-shadow-offset-x)
    var(--home-hero-headline-shadow-offset-y)
    var(--home-hero-headline-shadow-blur-radius)
    var(--home-hero-headline-shadow-color);
}

.home-content-shell {
  display: grid;
  gap: 1.5rem;
  width: min(100%, 76rem);
  margin: 0 auto;
}

.home-content-shell [tabindex="-1"]:focus {
  outline: none;
}

.home-content-group {
  display: grid;
  gap: 1.5rem;
}

.home-content-card {
  --ui-glass-radius: 2rem;
  --ui-glass-fill: var(--panel);
  --ui-glass-blur: var(--home-glass-blur-card);
  --ui-glass-shadow: var(--shadow);
  --home-content-card-padding: clamp(1.75rem, 4vw, 3rem);
  padding: var(--home-content-card-padding);
  scroll-margin-top: calc(var(--home-topbar-offset) + var(--home-topbar-reserved) + 1rem);
}

.home-content-card-game {
  --home-game-card-padding: 1rem;
  --home-game-card-radius: 2rem;
  --home-game-frame-radius: 1.4rem;
  --ui-glass-radius: var(--home-game-card-radius);
  width: 100%;
  min-width: 0;
  padding: var(--home-game-card-padding);
  overflow: visible;
}

.home-game-card-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--home-game-frame-radius);
  background: #d6dbe3;
  overflow: hidden;
  isolation: isolate;
}

.home-game-card-copy {
  margin-top: 0.9rem;
  display: grid;
  justify-items: start;
  gap: 1rem;
  padding-inline: 0.15rem;
}

.home-game-card-copy p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.home-game-card-cta {
  --ui-brand-cta-gap: 0.7rem;
  --ui-brand-cta-padding-block: 0.8rem;
  --ui-brand-cta-padding-inline: 1.4rem;
  --ui-brand-cta-font-size: 1.38rem;
  --ui-brand-cta-background: linear-gradient(90deg, #6ea720 0%, #588a1b 100%);
  --ui-brand-cta-shadow: 0 0.6rem 1.4rem rgba(63, 101, 20, 0.28);
  --ui-brand-cta-hover-shadow: 0 0.85rem 1.6rem rgba(63, 101, 20, 0.34);
  --ui-brand-cta-hover-transform: translateY(-1px);
  --ui-brand-cta-outline: rgba(255, 255, 255, 0.85);
  justify-self: center;
  width: fit-content;
  max-width: 100%;
}

.home-game-card-cta-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
}

.home-game-card-status {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 4;
  margin: 0;
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 0.2rem 0.7rem rgba(19, 34, 56, 0.7);
}

.home-game-card-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--home-game-backdrop-position-y, 50%);
  will-change: object-position;
}

.home-game-card-layer,
.home-game-card-logo {
  position: absolute;
  top: var(--home-game-item-top, 50%);
  left: var(--home-game-item-left, 50%);
  width: var(--home-game-item-width, 50%);
  pointer-events: none;
}

.home-game-card-layer {
  z-index: 1;
  transform: translate3d(-50%, calc(-50% + var(--home-game-layer-offset-y, 0px)), 0);
  will-change: transform;
}

.home-game-card-layer-art {
  display: block;
  width: 100%;
  height: auto;
}

.home-game-card-layer-art[data-home-game-layer-float="true"] {
  animation:
    home-game-card-layer-float var(--home-game-float-duration, 6s)
    ease-in-out
    var(--home-game-float-delay, 0s)
    infinite;
  will-change: transform;
}

@keyframes home-game-card-layer-float {
  0% { transform: translate3d(0, calc(var(--home-game-float-amplitude, 0%) * -1), 0); }
  50% { transform: translate3d(0, var(--home-game-float-amplitude, 0%), 0); }
  100% { transform: translate3d(0, calc(var(--home-game-float-amplitude, 0%) * -1), 0); }
}

[data-home-banner="kailla"] [data-home-banner-layer="kailla"] .home-game-card-layer-art {
  opacity: 1;
  animation: home-game-card-kailla-flicker 6s linear infinite;
}

@keyframes home-game-card-kailla-flicker {
  0% { opacity: 0; }
  30% { opacity: 0; }
  35% { opacity: 1; }
  40% { opacity: 1; }
  45% { opacity: 0; }
  60% { opacity: 0; }
  67% { opacity: 0; }
  70% { opacity: 1; }
  73% { opacity: 0; }
  76% { opacity: 1; }
  97% { opacity: 1; }
  100% { opacity: 0; }
}

.home-game-card-logo {
  z-index: 3;
  max-width: min(60%, calc(100% - 1rem));
  transform: translate3d(-50%, -50%, 0);
}

.home-content-card-contact {
  min-height: clamp(5rem, 10vw, 7rem);
  display: flex;
  align-items: center;
}

.home-discord-button {
  --ui-brand-cta-padding-block: 0.43125rem;
  --ui-brand-cta-padding-inline: 1.35rem;
  --ui-brand-cta-radius: 1.25rem;
  --ui-brand-cta-font-size: clamp(2.4rem, 5.2vw, 3.1rem);
  --ui-brand-cta-letter-spacing: 0.04em;
  --ui-brand-cta-background: #5865f2;
  --ui-brand-cta-shadow:
    0 1rem 2.4rem rgba(88, 101, 242, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --ui-brand-cta-hover-shadow: var(--ui-brand-cta-shadow);
  --ui-brand-cta-hover-transform: none;
  --ui-brand-cta-outline: rgba(255, 255, 255, 0.9);
  --ui-brand-cta-outline-offset: 3px;
  align-self: center;
  width: 100%;
}

.home-discord-button-label {
  line-height: 1.2;
  text-align: center;
}

.home-discord-button-icon {
  flex: 0 0 auto;
  width: 4.3rem;
  height: 4.3rem;
}

.home-footer-slot {
  --ui-glass-radius: 1.6rem;
  --ui-glass-fill: var(--home-glass-surface-footer);
  --ui-glass-blur: var(--home-glass-blur-footer);
  --ui-glass-shadow: 0 1rem 2.4rem rgba(19, 34, 56, 0.09);
  --ui-surface-frame-inset: 1rem;
  --ui-surface-frame-radius: 1.4rem;
  --home-footer-padding-block: 1.35rem;
  --home-footer-padding-inline: clamp(1.75rem, 4vw, 3rem);
  width: min(100%, 76rem);
  min-height: 5rem;
  display: flex;
  align-items: center;
  margin: 1.5rem auto 0;
  padding-block: var(--home-footer-padding-block);
  padding-inline: var(--home-footer-padding-inline);
}

.home-footer-slot::after,
.legal-panel::after {
  content: "";
  position: absolute;
  inset: var(--ui-surface-frame-inset, 1rem);
  border: 1px solid var(--border-subtle);
  border-radius: var(--ui-surface-frame-radius, 1.4rem);
  pointer-events: none;
}

.home-footer-slot-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink);
}

.home-footer-slot-credit {
  flex: 0 1 auto;
}

.home-footer-slot-link {
  flex: 0 0 auto;
  margin-inline-start: auto;
  color: var(--accent);
  text-decoration: none;
}

.home-footer-slot-link:hover,
.home-footer-slot-link:focus-visible {
  text-decoration: underline;
}

/* Legal surface */
.legal-shell {
  width: min(100%, 72rem);
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  padding-block: clamp(2rem, 5vw, 4rem);
}

.legal-panel {
  --ui-glass-radius: 2rem;
  --ui-glass-fill: var(--panel);
  --ui-glass-blur: 18px;
  --ui-glass-shadow: var(--shadow);
  --ui-surface-frame-inset: 1rem;
  --ui-surface-frame-radius: 1.5rem;
  width: 100%;
  padding: clamp(1.75rem, 4vw, 3rem);
}

.legal-topbar {
  --ui-glass-radius: 1.25rem;
  --ui-glass-border: var(--border-strong);
  --ui-glass-fill: rgba(249, 243, 234, 0.82);
  --ui-glass-blur: 18px;
  --ui-glass-shadow: 0 1rem 2.4rem rgba(19, 34, 56, 0.12);
  position: sticky;
  top: 1rem;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1rem 1.15rem;
}

.legal-home-link {
  --ui-pill-padding-block: 0.75rem;
  --ui-pill-padding-inline: 1rem;
  --ui-pill-letter-spacing: 0.14em;
}

.legal-locale-control {
  display: flex;
  justify-content: flex-end;
  margin-left: auto;
  max-width: min(100%, 20rem);
}

.legal-locale-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  width: 100%;
}

.legal-locale-label {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.legal-locale-select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 12rem;
  padding: 0.75rem 2.8rem 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%),
    rgba(255, 255, 255, 0.72);
  background-position:
    calc(100% - 1.15rem) calc(50% - 0.12rem),
    calc(100% - 0.85rem) calc(50% - 0.12rem),
    0 0;
  background-size: 0.38rem 0.38rem, 0.38rem 0.38rem, auto;
  background-repeat: no-repeat;
  appearance: none;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
}

.legal-locale-select:focus-visible {
  outline: 2px solid var(--ui-focus-outline);
  outline-offset: 2px;
}

.legal-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.legal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.legal-title {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.legal-section {
  padding-top: 1.75rem;
  border-top: 1px solid rgba(19, 34, 56, 0.1);
  scroll-margin-top: 8.5rem;
}

.legal-section + .legal-section {
  margin-top: 1.5rem;
}

.legal-section-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.08;
}

.legal-section-copy {
  display: grid;
  gap: 1rem;
  margin-top: 0.95rem;
}

.legal-section-copy p {
  margin: 0;
  max-width: 46rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}

.legal-subheading {
  margin: 0.4rem 0 0;
  max-width: 32rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.legal-bullet-list {
  margin: 0;
  padding-left: 1.4rem;
  max-width: 46rem;
  color: var(--muted);
}

.legal-bullet-list li {
  line-height: 1.75;
}

.legal-bullet-list li + li {
  margin-top: 0.55rem;
}

.legal-contact-note {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(19, 34, 56, 0.1);
}

.legal-contact-note-label {
  margin: 0 0 0.35rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.legal-contact-note-body {
  margin: 0;
  max-width: 46rem;
  line-height: 1.75;
  color: var(--muted);
}

/* Homepage motion */
.logo-wordmark-svg path {
  fill: currentColor;
}

.home-topbar-logo-shell .logo-wordmark-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: var(--home-logo-wordmark-color-hero);
  filter:
    drop-shadow(
      var(--home-logo-wordmark-shadow-offset-x-hero)
      var(--home-logo-wordmark-shadow-offset-y-hero)
      var(--home-logo-wordmark-shadow-blur-radius-hero)
      var(--home-logo-wordmark-shadow-color-hero)
    );
}

.home-topbar-logo-shell.docked .logo-wordmark-svg {
  color: var(--home-logo-wordmark-color-docked);
  filter:
    drop-shadow(
      var(--home-logo-wordmark-shadow-offset-x-docked)
      var(--home-logo-wordmark-shadow-offset-y-docked)
      var(--home-logo-wordmark-shadow-blur-radius-docked)
      var(--home-logo-wordmark-shadow-color-docked)
    );
}

.home-topbar-logo-shell.animate .logo-wordmark-svg {
  transition:
    color var(--home-logo-motion-transform-duration) cubic-bezier(0.45, 0, 0.55, 1),
    filter var(--home-logo-motion-transform-duration) cubic-bezier(0.45, 0, 0.55, 1);
}

.home-topbar-logo-shell.animate .logo-wordmark-svg g,
.home-topbar-logo-shell.animate .logo-wordmark-svg path {
  transition:
    transform var(--home-logo-motion-transform-duration) cubic-bezier(0.45, 0, 0.55, 1),
    opacity var(--home-logo-motion-transform-duration) ease;
}

@media (prefers-reduced-motion: reduce) {
  .home-topbar::before,
  .home-background-overlay-video,
  .home-topbar-logo-shell,
  .home-topbar-logo-shell.animate,
  .home-topbar-logo-shell .logo-wordmark-svg,
  .home-topbar-logo-shell.animate .logo-wordmark-svg,
  .home-hero-copy,
  .home-game-card-layer,
  .home-game-card-layer-art,
  .logo-wordmark-svg g,
  .logo-wordmark-svg path {
    transition: none;
  }

  .home-game-card-layer-art[data-home-game-layer-float="true"] {
    animation: none;
    transform: translate3d(0, 0, 0);
  }

  [data-home-banner="kailla"] [data-home-banner-layer="kailla"] .home-game-card-layer-art {
    animation: none;
    opacity: 1;
  }
}

/* Keep this breakpoint aligned with HOME_MOBILE_MAX_WIDTH_PX in homepage-logo.js. */
@media (max-width: 720px) {
  .foreground-shell {
    padding: 1rem;
  }

  .foreground-shell-home {
    padding: 0;
  }

  .home-shell {
    --home-shell-gutter: 1rem;
    --home-hero-inline-padding: 1.5rem;
    --home-logo-hero-max-width: 28rem;
    --home-topbar-offset: 0.75rem;
    --home-topbar-reserved: 5.25rem;
    --home-hero-center-y:
      calc(
        var(--home-topbar-offset) +
        var(--home-topbar-reserved) +
        var(--home-hero-inline-padding) +
        var(--home-logo-hero-width) * 0.375
      );
    padding:
      calc(var(--home-topbar-offset) + var(--home-topbar-reserved))
      var(--home-shell-gutter)
      2rem;
  }

  .home-topbar {
    --ui-glass-radius: 1rem;
    padding: 0.85rem 0.95rem;
  }

  .home-topbar-actions {
    gap: 0.5rem;
  }

  .home-topbar-toggle {
    display: inline-flex;
  }

  .home-topbar-language-control {
    display: flex;
  }

  .home-topbar-language-control-desktop {
    display: none;
  }

  .home-topbar-language-control-compact {
    display: flex;
  }

  .home-topbar-nav-desktop {
    display: none;
  }

  .home-topbar-menu {
    --ui-glass-radius: 1rem;
    top: calc(100% + 0.6rem);
    right: 0;
    left: 0;
    width: auto;
    padding: 0.75rem;
  }

  .home-topbar-language-menu {
    left: auto;
    right: 0;
    width: min(16rem, calc(100vw - 2rem));
  }

  .home-topbar-language-menu-compact {
    position: fixed;
    top: var(--home-topbar-offset);
    right: calc(var(--home-shell-gutter) + 4rem);
    bottom: auto;
    left: var(--home-shell-gutter);
    width: auto;
    max-height: calc(100svh - var(--home-topbar-offset) - 1rem);
  }

  .home-topbar-language-menu-compact .home-language-menu-scroll {
    max-height: calc(100svh - var(--home-topbar-offset) - 2.5rem);
  }

  .home-topbar-menu-language-group {
    display: flex;
  }

  .home-topbar-nav {
    gap: 0.45rem;
  }

  .home-topbar-link {
    --ui-pill-padding-inline: 0.8rem;
    --ui-pill-letter-spacing: 0.12em;
  }

  .home-hero {
    min-height: auto;
    padding: 1.5rem;
  }

  .home-hero-copy-sizer,
  .home-hero-copy {
    width: min(100%, var(--home-hero-copy-width));
    max-width: calc(100vw - (var(--home-shell-gutter) * 2) - 0.5rem);
  }

  .home-hero h1 {
    font-size: clamp(1.7rem, 7.2vw, 2.35rem);
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  .home-content-card {
    --ui-glass-radius: 1.5rem;
    --home-content-card-padding: 1.5rem;
  }

  .home-content-card-game {
    --home-game-card-padding: 0.75rem;
    --home-game-card-radius: 1.5rem;
    --home-game-frame-radius: 0.95rem;
  }

  .home-footer-slot {
    --ui-glass-radius: 1.25rem;
    --ui-surface-frame-inset: 0.75rem;
    --ui-surface-frame-radius: 1.1rem;
    --home-footer-padding-block: 1.1rem;
    --home-footer-padding-inline: 1.5rem;
    min-height: 4.5rem;
  }

  .legal-shell {
    padding-block: 1rem 2rem;
  }

  .legal-panel {
    --ui-glass-radius: 1.5rem;
    --ui-surface-frame-inset: 0.75rem;
    --ui-surface-frame-radius: 1.1rem;
    padding: 1.5rem;
  }

  .legal-topbar {
    --ui-glass-radius: 1rem;
    top: 0.75rem;
    padding: 0.9rem 1rem;
  }

  .legal-locale-control {
    width: 100%;
    justify-content: stretch;
  }

  .legal-locale-row {
    justify-content: space-between;
    gap: 0.7rem;
  }

  .legal-locale-select {
    min-width: 0;
  }

  .legal-section {
    scroll-margin-top: 7.75rem;
  }

  .home-discord-button {
    --ui-brand-cta-font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  }

  .home-discord-button-icon {
    width: 2.15rem;
    height: 2.15rem;
  }

  .home-game-card-status {
    font-size: 0.8rem;
  }

  .home-game-card-cta {
    --ui-brand-cta-padding-inline: 1.15rem;
    --ui-brand-cta-font-size: 1.2rem;
  }
}
