/*
 * Orbite website: what every page shares. The colours are the game's (Unity/Assets/Orbite/Scripts/Game/Palette.cs):
 * ink #22163F around everything, a deep violet sky, candy accents. Titles in Titan One, the game's font (licence OFL,
 * fonts/OFL-titan-one.txt), with its thick ink outline; text in the system's rounded face where there is one.
 */
@font-face {
  font-family: "Titan One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/titan-one.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --ink: #22163f;
  --night: #140c33;
  --sky: #1b1240;
  --sky-top: #4a1e7a;
  --panel: #2a1b5c;
  --panel-top: #35246f;
  --neutral: #3b2c7a;
  --violet: #7b5cff;
  --cyan: #7cf4ff;
  --gold: #ffd23f;
  --sun: #ffe45e;
  --orange: #ff8c42;
  --pink: #ff4d8d;
  --nova: #ff2e7e;
  --mint: #3ee6b5;
  --danger: #ff3b5c;
  --lavender: #c9c2ff;
  --text: #fbf8ff;
  --body: #ddd6fb;
  /* Quiet text: at least 4.5:1 on the darkest sky and on the panels. */
  --mute: #b9afe8;
  --f-display: "Titan One", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --f-body: ui-rounded, "SF Pro Rounded", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  /* viewport-fit=cover: side margins keep clear of the notch and the rounded corners. */
  --pad-l: max(var(--gutter), env(safe-area-inset-left, 0px));
  --pad-r: max(var(--gutter), env(safe-area-inset-right, 0px));
  --lift: 0 6px 0 var(--ink);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--night);
}

/* The sky: a starfield in two tiles of different sizes, over the gradient of the game's first band. */
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(1.4px 1.4px at 22px 34px, rgba(255, 255, 255, 0.85) 50%, transparent 55%),
    radial-gradient(1px 1px at 148px 92px, rgba(255, 255, 255, 0.65) 50%, transparent 55%),
    radial-gradient(1.8px 1.8px at 236px 182px, rgba(255, 255, 255, 0.8) 50%, transparent 55%),
    radial-gradient(1.1px 1.1px at 84px 236px, rgba(255, 255, 255, 0.55) 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 290px 18px, rgba(255, 255, 255, 0.6) 50%, transparent 55%),
    radial-gradient(1.6px 1.6px at 61px 401px, rgba(255, 255, 255, 0.7) 50%, transparent 55%),
    radial-gradient(1px 1px at 377px 309px, rgba(255, 255, 255, 0.5) 50%, transparent 55%),
    radial-gradient(2px 2px at 431px 77px, rgba(255, 255, 255, 0.75) 50%, transparent 55%),
    linear-gradient(180deg, #2b1563 0, var(--sky) 900px, var(--sky) 100%);
  background-size:
    320px 320px,
    320px 320px,
    320px 320px,
    320px 320px,
    320px 320px,
    470px 470px,
    470px 470px,
    470px 470px,
    auto;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* Languages: every text exists in English and French; lang.js picks before the first paint (English without it). */
html:not([data-lang="fr"]) [lang="fr"]:not(html) {
  display: none !important;
}
html[data-lang="fr"] [lang="en"]:not(html) {
  display: none !important;
}

/* The game's titles: white letters with a thick ink outline drawn behind them, and a drop under them. */
.outlined {
  font-family: var(--f-display);
  font-weight: 400;
  color: var(--text);
  -webkit-text-stroke: 0.16em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.1em 0 var(--ink);
  letter-spacing: 0.01em;
}
.outlined em {
  font-style: normal;
  color: var(--sun);
}

/* Panels: the game's dark violet plate, ink-outlined, standing on its own thickness. */
.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel-top), var(--panel) 60%);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow:
    0 7px 0 var(--ink),
    0 22px 44px -12px rgba(8, 3, 32, 0.6),
    inset 0 2px 0 rgba(255, 255, 255, 0.07);
}

/* The phone that frames a screen of the game: its screenshots, or the live preview. */
.phone {
  position: relative;
  aspect-ratio: 540 / 970;
  overflow: hidden;
  background: var(--sky);
  border: clamp(7px, 0.8vw, 10px) solid var(--ink);
  border-radius: clamp(26px, 3vw, 38px);
  box-shadow:
    0 10px 0 #0e0724,
    0 40px 70px -24px rgba(6, 2, 30, 0.8);
}
.phone > img,
.phone > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.phone > img {
  object-fit: cover;
}

/* Header and footer, the same on every page. */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
  padding: max(clamp(12px, 2.4vh, 24px), env(safe-area-inset-top, 0px)) var(--pad-r) 0 var(--pad-l);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  color: var(--text);
  font: 400 1.25rem/1 var(--f-display);
  letter-spacing: 0.04em;
  text-decoration: none;
}
.mark img {
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--ink);
}
.mark span {
  -webkit-text-stroke: 0.18em var(--ink);
  paint-order: stroke fill;
}

.lang-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
}
.lang-switch button {
  min-width: 44px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mute);
  font: 400 0.85rem/1 var(--f-display);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}
.lang-switch button:hover {
  color: var(--text);
}
.lang-switch button[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
}

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 22px var(--pad-r) max(22px, env(safe-area-inset-bottom, 0px)) var(--pad-l);
  color: var(--text);
  font-size: 0.9rem;
}
.foot p {
  margin: 0;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.foot a {
  display: inline-block;
  padding: 8px 0;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 4px;
}
.foot a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
