/* ==========================================================================
   Vesta Studios - shared stylesheet
   Dark space theme. Mobile-first. No build step.
   ========================================================================== */

:root {
  /* colour tokens */
  --bg: #070812;                 /* near-black blue/violet - painted on <html> (the canvas sits over it) */
  --bg-2: #0d1022;
  --surface: rgba(16, 19, 40, 0.62);
  --surface-strong: rgba(16, 19, 40, 0.88);
  --border: rgba(170, 182, 230, 0.16);
  --border-strong: rgba(170, 182, 230, 0.32);
  --text: #eef1fb;               /* star-white */
  --text-muted: #b2b9d2;         /* ~10:1 on --bg */
  --ember: #ff8c42;              /* warm ember accent, ~8.6:1 on --bg */
  --ember-strong: #ffb061;
  --ember-deep: #d9541e;
  --ember-ink: #1a0a04;          /* text on ember buttons, ~7.8:1 */
  --focus: #ffd27a;

  /* shape + layout */
  --radius: 14px;
  --radius-sm: 10px;
  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 4rem;

  /* type */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --step--1: clamp(0.85rem, 0.81rem + 0.2vw, 0.95rem);
  --step-0: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4: clamp(2.6rem, 1.8rem + 4vw, 5rem);
}

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

html {
  background: var(--bg);           /* only <html> carries the page background: the fixed canvas (z-index -1)
                                      must paint above it, so <body> stays transparent */
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { max-width: 100%; display: block; }
img, video { height: auto; }   /* the HTML width/height hints must not fix the rendered height */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }

p, ul, ol { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--ember-strong); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--focus); }

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 0.9rem;
}

.lede {
  font-size: var(--step-1);
  color: var(--text);
  line-height: 1.45;
  max-width: 36rem;
}

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

.note {
  color: var(--text-muted);
  font-size: var(--step--1);
}

.placeholder {
  color: var(--focus);
  border-bottom: 1px dashed rgba(255, 210, 122, 0.7);
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--ember);
  color: var(--ember-ink);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   Header + nav (three links fit at 360px, icon-only brand under 340px, no hamburger)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 8, 18, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand img { width: 28px; height: 28px; }

.site-nav { margin-left: auto; }   /* if the row ever wraps, the nav stays right-aligned */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.15rem;
}
.site-nav a {
  display: inline-block;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.site-nav a[aria-current="page"] {
  color: var(--ember-strong);
  background: rgba(255, 140, 66, 0.12);
}

@media (max-width: 400px) {
  .brand { font-size: 0.95rem; gap: 0.4rem; }
  .brand img { width: 24px; height: 24px; }
  .site-nav a { padding: 0.4rem 0.45rem; font-size: 0.88rem; }
}

/* Very narrow phones (320px): icon-only brand so the three nav links stay on one row.
   The wordmark stays in the DOM as the link's accessible name (the img has alt=""). */
@media (max-width: 340px) {
  .brand { position: relative; }
  .brand span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section + .section,
.page-head + .section { padding-top: 0; }
.section-title { margin-bottom: 1.5rem; }

.page-head {
  padding-block: clamp(5rem, 14vh, 8rem) clamp(2rem, 5vw, 3.5rem);
}
.page-head .lede { color: var(--text-muted); }
.page-head .page-title-sm { font-size: var(--step-3); }   /* games.html: the product name below outranks the page title */

/* --------------------------------------------------------------------------
   Hero (index)
   -------------------------------------------------------------------------- */
.hero {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: flex-start;
  /* on narrow screens the asteroid sits upper-centre (starfield.js layoutRock():
     centre at 20% of the viewport height, longest spike ~1.21 * clamp(14vmin, 36px, 80px)
     = clamp(2.75rem, 17vmin, 6rem)). Start the copy a fixed 2.5rem below the rock's
     bottom edge; the sticky header is in flow above the hero, so subtract it.
     vh first as the fallback for browsers without svh. */
  padding-top: calc(20vh + clamp(2.75rem, 17vmin, 6rem) - var(--header-h) + 2.5rem);
  padding-top: calc(20svh + clamp(2.75rem, 17vmin, 6rem) - var(--header-h) + 2.5rem);
  padding-bottom: clamp(3rem, 8vh, 6rem);
}
.hero-inner {
  max-width: 40rem;
  text-shadow: 0 2px 24px rgba(7, 8, 18, 0.9);
}
.hero h1 { margin-bottom: 0.35em; }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .hero h1 {
    background: linear-gradient(180deg, #ffffff 0%, #eef1fb 55%, #cfd6ea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* text-shadow paints above a clipped background and greys the gradient;
       drop-shadow is applied to the rendered glyphs, so the halo sits behind them */
    text-shadow: none;
    filter: drop-shadow(0 2px 10px rgba(7, 8, 18, 0.85));
  }
}
.hero .lede { font-weight: 500; margin-bottom: 1rem; }
.hero .hero-copy { color: var(--text-muted); max-width: 34rem; }

@media (min-width: 760px) {
  .hero {
    align-items: center;
    padding-top: clamp(3rem, 8vh, 6rem);
  }
  .hero-inner { max-width: min(40rem, 56%); }
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ember-strong), var(--ember) 60%, #f0702f);
  color: var(--ember-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-0);
  text-decoration: none;
  border: 1px solid transparent;
  box-shadow: 0 0 0 1px rgba(255, 140, 66, 0.25), 0 8px 30px rgba(255, 120, 40, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover {
  color: var(--ember-ink);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 176, 97, 0.5), 0 12px 36px rgba(255, 120, 40, 0.35);
}
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.btn[data-placeholder] {
  background: rgba(255, 140, 66, 0.12);
  color: var(--ember-strong);
  border: 1px dashed rgba(255, 176, 97, 0.6);
  box-shadow: none;
  cursor: default;
}
.btn[data-placeholder]:hover { transform: none; color: var(--ember-strong); }

.text-link {
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  /* no backdrop-filter: it would re-blur every card over the canvas on every
     animation frame, and smear the asteroid into any card that scrolls over it */
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.card-pad { padding: clamp(1.25rem, 3vw, 2rem); }

/* teaser on the front page */
.teaser {
  display: grid;
  overflow: hidden;
}
.teaser-media { display: block; }
.teaser-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.teaser-body { padding: clamp(1.25rem, 3vw, 2rem); }
.teaser-body h3 { margin-top: 0.5rem; }
.teaser-body p { color: var(--text-muted); }

@media (min-width: 700px) {
  .teaser { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .teaser-media { height: 100%; }
  .teaser-media img { height: 100%; aspect-ratio: auto; }
  .teaser-body { align-self: center; }
}

/* badges */
.badge,
.badges li {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.badge.hot,
.badges li.hot {
  border-color: rgba(255, 140, 66, 0.55);
  background: rgba(255, 140, 66, 0.12);
  color: var(--ember-strong);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Games page
   -------------------------------------------------------------------------- */
.game-head { margin-bottom: 2rem; }
.game-head h2 { font-size: var(--step-4); margin-bottom: 0.2em; }   /* the product name is the largest thing on the page */
/* the Steam-page lockup (title + subtitle baked into one transparent PNG) stands in for the h2 text */
.game-head .game-lockup { margin: 0 0 1.4rem; line-height: 0; }
.game-head .game-lockup img {
  display: block;
  width: min(100%, 36rem);
  height: auto;
  filter: drop-shadow(0 0 22px rgba(255, 176, 96, 0.16)) drop-shadow(0 2px 6px rgba(7, 8, 18, 0.9));
}

.game-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.game-copy { max-width: 62ch; }
.game-copy .genre {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ember);
  margin-bottom: 0.75rem;
}
.game-copy .pitch { font-size: var(--step-0); }
.game-copy h3 { font-size: var(--step-1); margin-top: 1.75rem; }
.what-you-do {
  padding-left: 1.2rem;
}
.what-you-do li { margin-bottom: 0.55rem; }
.what-you-do li::marker { color: var(--ember); }
.what-you-do strong { color: var(--text); font-weight: 600; }

.facts { padding: clamp(1.25rem, 3vw, 1.75rem); }
.facts h3 { font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 1rem; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; }
.facts dt { color: var(--text-muted); font-size: var(--step--1); }
.facts dd { margin: 0; }
.facts .btn { margin-top: 1.25rem; width: 100%; }

@media (min-width: 860px) {
  .game-grid { grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); align-items: start; }
  .facts { position: sticky; top: calc(var(--header-h) + 1rem); }
}

.media-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.25rem;
}
.media-note h3 { margin: 0; font-size: var(--step-1); }

.videos {
  display: grid;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.videos figure { margin: 0; }
.videos video {
  width: 100%;
  height: auto;   /* the height="720" attribute must not win over aspect-ratio */
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.videos figcaption {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: var(--step--1);
}
.videos figcaption strong { color: var(--text); font-weight: 600; }

@media (min-width: 760px) {
  .videos { grid-template-columns: 1fr 1fr; }
}

.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
}
.gallery figcaption {
  margin-top: 0.45rem;
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   About page
   -------------------------------------------------------------------------- */
.prose { max-width: 42rem; }
.prose p { color: var(--text-muted); }
.prose p strong { color: var(--text); }
.prose .lede { color: var(--text); }

.split {
  display: grid;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; }
}

.vesta-facts {
  padding: clamp(1.25rem, 3vw, 2rem);
}
.vesta-facts ul { margin: 0; padding-left: 1.2rem; }
.vesta-facts li { margin-bottom: 0.5rem; color: var(--text-muted); }
.vesta-facts li::marker { color: var(--ember); }
.vesta-facts strong { color: var(--text); }

.team {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
}
.team-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.team-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border-strong), 0 0 30px rgba(255, 140, 66, 0.15);
}
.team-card h3 { font-size: var(--step-1); margin: 0; }
.team-card .role {
  font-size: var(--step--1);
  color: var(--ember);
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
}
.team-card .bio { color: var(--text-muted); font-size: var(--step--1); margin: 0; }

.contact {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}
.contact h2 { margin-bottom: 0.4em; }
.contact p { color: var(--text-muted); max-width: 34rem; margin-inline: auto; }
.contact .btn { margin-top: 1.25rem; }

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.lost {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding-top: clamp(10rem, 36vh, 18rem);
  padding-top: clamp(10rem, 36svh, 18rem);
  padding-bottom: 4rem;
}
.lost-inner { max-width: 34rem; text-shadow: 0 2px 24px rgba(7, 8, 18, 0.9); }
.lost .code {
  font-family: var(--font-display);
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  color: var(--ember);
}
@media (min-width: 760px) {
  .lost { align-items: center; padding-top: 3rem; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 0;   /* the last section's padding-bottom already provides the gap */
  border-top: 1px solid var(--border);
  background: rgba(7, 8, 18, 0.8);   /* opaque enough without a per-frame backdrop blur */
  padding-block: 1.75rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
  color: var(--text-muted);
  font-size: var(--step--1);
}
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--ember-strong); }

/* Background motion toggle (WCAG 2.2.2). No `display` here so the `hidden`
   attribute keeps working until js/site.js reveals it. */
.motion-toggle {
  font: inherit;
  font-size: var(--step--1);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}
.motion-toggle:hover { color: var(--ember-strong); background: rgba(255, 255, 255, 0.08); }

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