/* Where We Go When We Die: one shared stylesheet.
   Colours are UMBRA: ENDLESS v5 "VIVID" palette anchors (crates/umbra_palette, source.rs):
   colour radiates out of deep coloured darks. System fonts only; nothing is loaded from elsewhere. */

:root {
  color-scheme: dark;

  /* Darks (Midnight glass, Ink glass, Dusk indigo, Lifted indigo, Storm slate) */
  --void: #000000;
  --midnight: #090e1b;
  --ink: #101629;
  --dusk: #19223a;
  --lifted: #273454;
  --slate: #455a85;
  --shadow-indigo: #0b1020;
  --shadow-teal: #0a1a1c;
  --shadow-wine: #1a0b18;

  /* Text (Pure white, Dim silver, Warm white) */
  --text: #ffffff;
  --text-dim: #a7b0c3;
  --title: #fff8ec;

  /* Luminous accents */
  --lime: #b4ff1a;
  --spring: #3dff8a;
  --emerald: #00e08a;
  --cyan: #19e6ff;
  --blue: #2a7bff;
  --violet: #8e5bff;
  --magenta: #ff4cb8;
  --pink: #ff5897;
  --gold: #ffc93a;

  --radius: 22px;
  --radius-small: 14px;
  --measure: 68ch;
  --page: 1120px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(60rem 36rem at 12% -8%, rgba(142, 91, 255, 0.22), transparent 70%),
    radial-gradient(48rem 30rem at 100% 12%, rgba(25, 230, 255, 0.10), transparent 70%),
    radial-gradient(56rem 40rem at 50% 110%, rgba(0, 224, 138, 0.10), transparent 70%),
    var(--void);
  background-attachment: fixed;
}

img {
  max-width: 100%;
  height: auto;
}

/* <picture> only offers a WebP copy; the <img> inside keeps its own layout. */
picture {
  display: contents;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- links and focus */

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
  box-shadow: 0 0 0 6px rgba(25, 230, 255, 0.25);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--lime);
  color: var(--void);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: min(100% - 2.5rem, var(--page));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgba(167, 176, 195, 0.12);
  background: rgba(0, 0, 0, 0.6);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

.studio-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--title);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.studio-mark:hover {
  color: var(--text);
}

.studio-mark svg {
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--dusk);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(180, 255, 26, 0.35);
}

main {
  display: block;
  padding-bottom: 4rem;
}

section {
  padding-block: 2.5rem;
}

.site-footer {
  border-top: 1px solid rgba(167, 176, 195, 0.12);
  background: var(--void);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.site-footer .wrap {
  padding-block: 2rem 2.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--text-dim);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 0.4rem 0;
}

/* ---------------------------------------------------------------- type */

h1,
h2,
h3 {
  margin: 0 0 0.6em;
  color: var(--title);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.55rem, 3.6vw, 2.2rem);
  font-weight: 750;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

.prose {
  max-width: var(--measure);
}

.panel h2:not(:first-child),
.panel h3:not(:first-child) {
  margin-top: 1.6em;
}

.prose li + li {
  margin-top: 0.35em;
}

.lead {
  max-width: 60ch;
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  color: var(--text);
}

.dim {
  color: var(--text-dim);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.9rem;
  color: var(--lime);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.glow-title {
  color: var(--cyan);
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(25, 230, 255, 0.45), 0 0 46px rgba(142, 91, 255, 0.35);
}

/* The game's title treatment: violet into electric blue into cyan, with a coloured glow. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .glow-title {
    background: linear-gradient(100deg, #a27bff 0%, var(--violet) 18%, #4f8dff 55%, var(--cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 14px rgba(42, 123, 255, 0.45)) drop-shadow(0 0 34px rgba(142, 91, 255, 0.3));
  }
}

/* ---------------------------------------------------------------- hero blocks */

.hero {
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2rem, 5vw, 3.5rem);
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.hero h1 {
  margin-bottom: 0.4em;
}

.hero .screen {
  width: min(100%, 340px);
  margin-inline: auto;
}

/* The home page's eclipse: a luminous corona around the dark (the umbra), not Apple's Activity rings. */
.hero-mark {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 0 18px rgba(25, 230, 255, 0.35)) drop-shadow(0 0 42px rgba(142, 91, 255, 0.3));
}

@media (max-width: 859px) {
  .hero-mark {
    width: min(60%, 220px);
  }
}

/* ---------------------------------------------------------------- buttons and pills */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border: 1px solid var(--lifted);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
  transition: box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  color: var(--text);
  border-color: var(--cyan);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 22px rgba(25, 230, 255, 0.35);
}

/* Interaction is cyan and electric blue in the game (its "New Expedition" button); dark text keeps AA contrast. */
.btn-primary {
  border-color: transparent;
  background: linear-gradient(100deg, var(--cyan), #3a9bfd);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 22px rgba(25, 230, 255, 0.35);
  color: var(--void);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--void);
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 34px rgba(25, 230, 255, 0.6);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(180, 255, 26, 0.45);
  border-radius: 999px;
  background: rgba(180, 255, 26, 0.08);
  color: var(--lime);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pill::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  /* Three pulses, then still (WCAG 2.2.2: nothing blinks for more than five seconds). */
  animation: pulse 1.6s ease-in-out 3;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* The App Store badge goes in .store-slot once the App Store link exists (see the comment in umbra/index.html). */
.store-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

/* ---------------------------------------------------------------- panels and cards */

.panel {
  position: relative;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid rgba(69, 90, 133, 0.55);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(25, 34, 58, 0.72), rgba(9, 14, 27, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.grid {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(69, 90, 133, 0.45);
  border-radius: var(--radius-small);
  background: rgba(16, 22, 41, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card h3 {
  margin-bottom: 0.35em;
}

.card p {
  margin: 0;
  color: var(--text-dim);
}

/* A coloured top edge, like the game's luminous bars. */
.accent {
  border-top: 3px solid var(--accent, var(--lime));
}

.accent-lime { --accent: var(--lime); }
.accent-spring { --accent: var(--spring); }
.accent-emerald { --accent: var(--emerald); }
.accent-cyan { --accent: var(--cyan); }
.accent-blue { --accent: var(--blue); }
.accent-violet { --accent: var(--violet); }
.accent-magenta { --accent: var(--magenta); }
.accent-pink { --accent: var(--pink); }
.accent-gold { --accent: var(--gold); }

/* The game's feature card on the studio page. */
.feature {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  overflow: hidden;
}

@media (min-width: 820px) {
  .feature {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.feature-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.feature-art .app-icon {
  width: clamp(96px, 22vw, 150px);
}

.feature-art .screen {
  width: clamp(150px, 34vw, 230px);
}

.app-icon {
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 40px rgba(180, 255, 26, 0.25);
}

/* ---------------------------------------------------------------- game screens */

.screen {
  display: block;
  border: 6px solid #05070d;
  border-radius: 20% / 16.4%;
  background: var(--void);
  box-shadow:
    0 0 0 1px rgba(167, 176, 195, 0.25),
    0 0 0 9px #0b0f1a,
    0 0 0 10px rgba(167, 176, 195, 0.18),
    0 18px 50px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(142, 91, 255, 0.18);
  image-rendering: pixelated;
}

.gallery {
  display: grid;
  gap: 2.25rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.gallery figure {
  margin: 0;
}

.gallery .screen {
  width: min(100%, 300px);
  margin-inline: auto;
}

.gallery figcaption {
  max-width: 300px;
  margin: 1.1rem auto 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  text-align: center;
}

.gallery figcaption strong {
  display: block;
  color: var(--text);
}

/* ---------------------------------------------------------------- lists, facts, FAQ */

.ticks {
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 1.6rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--spring);
  box-shadow: 0 0 8px rgba(61, 255, 138, 0.7);
}

.facts {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0;
  margin: 0;
  border: 1px solid rgba(69, 90, 133, 0.45);
  border-radius: var(--radius-small);
  overflow: hidden;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(69, 90, 133, 0.35);
}

.facts dt {
  background: rgba(25, 34, 58, 0.8);
  color: var(--text-dim);
  font-weight: 650;
}

.facts dd {
  background: rgba(9, 14, 27, 0.75);
}

.facts dt:last-of-type,
.facts dd:last-of-type {
  border-bottom: 0;
}

@media (max-width: 520px) {
  .facts {
    grid-template-columns: 1fr;
  }
  .facts dt {
    border-bottom: 0;
    padding-bottom: 0.25rem;
  }
}

.faq {
  max-width: var(--measure);
}

.faq h3 {
  margin-top: 2rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--cyan);
}

.faq p,
.faq ul {
  color: var(--text);
}

.devices {
  display: grid;
  gap: 1rem;
}

@media (min-width: 760px) {
  .devices {
    grid-template-columns: repeat(2, 1fr);
  }
}

.devices ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-dim);
}

.contact-mail {
  display: inline-block;
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  font-weight: 700;
  word-break: break-word;
}

.note {
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(255, 201, 58, 0.45);
  border-radius: var(--radius-small);
  background: rgba(255, 201, 58, 0.07);
  color: var(--text);
}

.downloads {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.downloads li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(69, 90, 133, 0.45);
  border-radius: var(--radius-small);
  background: rgba(16, 22, 41, 0.78);
  text-align: center;
}

.downloads img {
  width: 150px;
}

.downloads .screen {
  border-width: 4px;
  box-shadow: 0 0 0 1px rgba(167, 176, 195, 0.25), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.downloads span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.center {
  text-align: center;
}

.lost {
  min-height: 60vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.lost .lead {
  margin-inline: auto;
}

.lost .actions {
  justify-content: center;
}

/* ---------------------------------------------------------------- motion and contrast preferences */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  body {
    background: var(--void);
  }
  .panel,
  .card,
  .facts,
  .downloads li {
    border-color: var(--text-dim);
    background: var(--void);
  }
  .card p,
  .dim,
  .site-nav a,
  .site-footer,
  .site-footer a {
    color: var(--text);
  }
}

@media (forced-colors: active) {
  .hero-mark {
    filter: none;
  }
  .glow-title {
    color: CanvasText;
    text-shadow: none;
    background: none;
    filter: none;
  }
  .pill::before,
  .ticks li::before {
    forced-color-adjust: none;
    background: CanvasText;
    box-shadow: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .site-header,
  .site-footer,
  .skip-link {
    display: none;
  }
  h1,
  h2,
  h3,
  .glow-title {
    color: #000;
    background: none;
    filter: none;
  }
  a {
    color: #000;
  }
}
