/* Bitrealms Studio shared styles: tokens, header, footer, buttons and the upcoming-game pages.
   Visual refresh (2026-10-09): flat slate (the Outmarbled ground) with restrained gold, and one ground colour
   and accent per game; brown is Digging Deep's alone. Page-specific layout lives next to the page (assets/home/home.css, assets/digging-deep.css). */

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

:root {
  /* The studio's own ground is the Outmarbled slate; brown belongs to Digging Deep alone. */
  --bedrock: #151E27;
  --bedrock-2: #1C2733;
  --bedrock-lo: #10171E;
  --seam: #263240;
  --seam-hi: #3A4858;
  --paper: #EFE8D9;
  --paper-dim: #A3B0BC;
  --gold: #E6B03C;
  --gold-hi: #F2C45A;
  --ink-on-gold: #1A1409;

  /* One accent and one ground per game, taken from its own art. */
  --dd1: #E6B03C;  --dd1-ground: #241A10;
  --dd2: #E57A4C;  --dd2-ground: #29150F;
  --om: #8EC5EC;   --om-ground: #151E27;

  --font-display: 'Luckiest Guy', cursive;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 64px;

  /* Earlier names, still read by page-local styles. */
  --bg-deep: var(--bedrock);
  --bg-dark: var(--bedrock);
  --white: var(--paper);
  --white-dim: var(--paper-dim);
  --diamond: var(--gold);
  --line: var(--seam);
}

.accent-dd1 { --accent: var(--dd1); --ground: var(--dd1-ground); --ground-hi: #2E2216; --ground-lo: #1B130B; }
.accent-dd2 { --accent: var(--dd2); --ground: var(--dd2-ground); --ground-hi: #341B13; --ground-lo: #1F0F0A; }
.accent-om  { --accent: var(--om);  --ground: var(--om-ground);  --ground-hi: #1C2733; --ground-lo: #10171E; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bedrock);
  color: var(--paper);
  overflow-x: hidden;
  line-height: 1.6;
}

img { max-width: 100%; }

a { color: var(--gold); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--gold);
  color: var(--ink-on-gold);
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ── SITE HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* The backdrop sits on a pseudo-element: a backdrop-filter on the header itself would stop
   the mobile dropdown (which hangs below it) from blurring the page behind. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(16, 23, 30, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid var(--seam);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before { background: rgba(16, 23, 30, 0.97); }
}

.site-nav {
  max-width: 1180px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 1px;
  color: var(--gold);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
  line-height: var(--header-h);
}
/* Luckiest Guy's ink sits ~0.14em above its line box centre; this lines the wordmark up with the icon. */
.site-brand span { transform: translateY(0.14em); }
.site-brand img { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.nav-links a {
  display: block;
  color: var(--paper-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav-links a[aria-current="page"] {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--accent, var(--gold));
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

/* The button keeps its "Menu" text as the accessible name; the bars are drawn over it.
   ::before is the middle bar (box-shadows are the outer two); open turns it and ::after into an X. */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 0;
  color: transparent;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.nav-toggle::before,
.nav-toggle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  margin: -1px 0 0 -9px;
  border-radius: 2px;
  background: var(--paper);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.nav-toggle::before { box-shadow: 0 -6px 0 var(--paper), 0 6px 0 var(--paper); }
.nav-toggle::after { opacity: 0; }
.nav-toggle:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }
.nav-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent, var(--gold));
}
.nav-toggle[aria-expanded="true"]::before { box-shadow: none; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"]::after { opacity: 1; transform: rotate(-45deg); }

/* The menu only collapses once JS is there to open it again. */
@media (max-width: 760px) {
  html.js .nav-toggle { display: block; }
  html.js .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 1.25rem 0.75rem;
    background: rgba(16, 23, 30, 0.97);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    border-bottom: 1px solid var(--seam);
    box-shadow: 0 24px 40px -20px rgba(0, 0, 0, 0.9);
  }
  html.js .site-nav.open .nav-links { display: flex; animation: navDrop 0.18s ease-out; }
  html.js .nav-links li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }
  html.js .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0.25rem;
    border-radius: 0;
    font-size: 1.05rem;
    color: var(--paper);
    text-decoration: none;
  }
  html.js .nav-links a::after {
    content: '';
    width: 7px;
    height: 7px;
    border: solid var(--paper-dim);
    border-width: 2px 2px 0 0;
    transform: rotate(45deg);
    opacity: 0.6;
  }
  html.js .nav-links a:hover { color: var(--accent, var(--gold)); }
  html.js .nav-links a[aria-current="page"] { color: var(--accent, var(--gold)); }
  html.js .nav-links a[aria-current="page"]::after {
    width: 8px;
    height: 8px;
    border: 0;
    background: var(--accent, var(--gold));
    transform: none;
    opacity: 1;
  }
  html:not(.js) .nav-links { width: 100%; padding-bottom: 0.75rem; }
}

@keyframes navDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 380px) {
  .site-nav { padding: 0 1rem; gap: 0.75rem; }
  .site-header .site-brand { font-size: 1.2rem; }
  html.js .nav-links { padding-inline: 1rem; }
}

/* ── BUTTONS AND LINKS: flat, no glow ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-play { background: var(--gold); color: var(--ink-on-gold); }
.btn-play:hover { background: var(--gold-hi); }
.btn-ghost { border: 1px solid var(--seam-hi); background: transparent; color: var(--paper); }
.btn-ghost:hover { border-color: var(--paper-dim); }

.text-link {
  color: var(--paper);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent, var(--gold));
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  display: inline-block;
  padding: 0.6rem 0;
}
.text-link::after { content: ' →'; }
.text-link:hover { color: var(--accent, var(--gold)); }

/* Status: a small square "block", filled when the game is out. */
.status {
  font-family: var(--font-label);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-dim);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.status::before {
  content: '';
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent, var(--gold));
}
.status-live { color: var(--paper); }
.status-live::before { background: var(--accent, var(--gold)); }

/* ── REAL GAME FRAMES: thin bezel, no glow ── */
.screen {
  display: block;
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 40px -28px rgba(0, 0, 0, 0.9);
}
.screen img, .screen video, img.screen { display: block; width: 100%; height: 100%; object-fit: cover; }
/* The gameplay loop is a touch narrower than 9:20; trim the bottom controls, not the score bar. */
.screen video { object-position: 50% 0; }
.screen-tall { aspect-ratio: 9 / 20; border-radius: 16px; }
.screen-wide { aspect-ratio: 2616 / 1140; }
a.screen:hover { box-shadow: 0 0 0 2px var(--accent, var(--gold)), 0 24px 40px -28px rgba(0, 0, 0, 0.9); }

/* Label on development captures: .dev-label sits on the image, .dev-tag runs inline in a caption. */
.dev-label, .dev-tag {
  font-family: var(--font-label);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  background: rgba(16, 23, 30, 0.82);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.dev-label { position: absolute; top: 10px; left: 10px; }
.dev-tag { display: inline-block; border: 1px solid var(--seam-hi); margin-right: 0.4rem; white-space: nowrap; }

.game-name, .game-title {
  font-family: var(--font-display);
  color: var(--accent, var(--gold));
  letter-spacing: 0.02em;
  line-height: 1.05;
  font-weight: 400;
}

.game-icon {
  width: 112px;
  height: 112px;
  border-radius: 22%;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Gameplay loop pause/play: bars when playing, a triangle when paused. */
.video-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 40px;
  height: 40px;
  font-size: 0;
  color: transparent;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(16, 23, 30, 0.75);
  cursor: pointer;
}
.video-toggle::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 12px;
  margin: -6px 0 0 -5px;
  border-left: 3px solid var(--paper);
  border-right: 3px solid var(--paper);
}
.video-toggle[aria-pressed="true"]::before {
  width: 0; height: 0;
  margin: -7px 0 0 -4px;
  border: solid transparent;
  border-width: 7px 0 7px 12px;
  border-left-color: var(--paper);
}

/* ── SECTIONS ── */
.studio-section { padding: clamp(3.5rem, 8vw, 5.5rem) var(--gutter); }
.section-head { max-width: var(--wrap); margin: 0 auto 2.25rem; }
.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.section-head p { color: var(--paper-dim); margin-top: 0.6rem; max-width: 40rem; }

/* ── UPCOMING GAME PAGES ── */
.game-hero { padding: clamp(3rem, 7vw, 5rem) var(--gutter); }
.game-hero-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.game-hero .game-title { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 0.6rem 0 1.1rem; }
.game-hero-lede { font-size: clamp(1.1rem, 1.9vw, 1.35rem); font-weight: 600; max-width: 36rem; }
.game-intro { color: var(--paper-dim); margin-top: 0.9rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.game-hero-art .game-icon { width: clamp(150px, 19vw, 232px); height: auto; aspect-ratio: 1; display: block; }

/* What you'll do: each step is a real development capture with a short explanation. */
.play-steps {
  max-width: var(--wrap);
  margin: 0 auto;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.25rem);
}
.play-steps.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.play-steps figure { display: grid; gap: 0.9rem; }
.play-steps h3 { font-size: 1.1rem; font-weight: 700; color: var(--paper); line-height: 1.3; }
.play-steps p { color: var(--paper-dim); font-size: 0.97rem; margin-top: 0.3rem; }
.section-note { max-width: var(--wrap); margin: 1.75rem auto 0; color: var(--paper-dim); font-size: 0.9rem; }

.media-frame {
  max-width: var(--wrap);
  margin: 0 auto;
}
.media-frame > p, .media-frame figcaption { color: var(--paper-dim); font-size: 0.92rem; margin-top: 0.8rem; }
.media-frame video { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.media-frame a { display: block; border-radius: 10px; }
.media-frame img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }

/* Release status, Digging Deep and privacy: three quiet columns, no boxes. */
.soon-panel {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
}
.panel { border-top: 2px solid var(--seam-hi); padding-top: 1.25rem; }
.panel h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.6rem; }
.panel p { color: var(--paper-dim); }
.panel-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.panel-row .game-icon { width: 64px; height: 64px; }
.panel .hero-actions { margin-top: 0; }
.follow-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: 0.75rem; }
.follow-links a { display: inline-block; padding: 0.5rem 0; color: var(--paper); font-weight: 600; }
.follow-links a:hover { color: var(--gold); }

/* ── GAME PAGES: the whole page sits on the game's own ground; sections step between a lighter and the
   base shade, the header and footer a darker one. Lines are white at low opacity so they suit any ground. ── */
body.accent-dd1, body.accent-dd2, body.accent-om {
  background: var(--ground);
  --seam: rgba(255, 255, 255, 0.08);
  --seam-hi: rgba(255, 255, 255, 0.16);
}
/* Warm secondary text on the brown and rust grounds. */
body.accent-dd1, body.accent-dd2 { --paper-dim: #A89F8C; }
body.accent-dd1 main > section:nth-of-type(odd),
body.accent-dd2 main > section:nth-of-type(odd),
body.accent-om main > section:nth-of-type(odd) { background: var(--ground-hi); }
body.accent-dd1 .site-header::before,
body.accent-dd2 .site-header::before,
body.accent-om .site-header::before { background: color-mix(in srgb, var(--ground-lo) 92%, transparent); }
body.accent-dd1 .site-footer,
body.accent-dd2 .site-footer,
body.accent-om .site-footer { background: var(--ground-lo); }
@media (max-width: 760px) {
  html.js body.accent-dd1 .nav-links,
  html.js body.accent-dd2 .nav-links,
  html.js body.accent-om .nav-links { background: color-mix(in srgb, var(--ground-lo) 97%, transparent); }
}

/* ── SITE FOOTER ── */
.site-footer {
  background: var(--bedrock-lo);
  border-top: 1px solid var(--seam);
  padding: 3rem 1.25rem 2rem;
  position: relative;
  z-index: 1;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 2rem;
}
.footer-brand .site-brand { font-size: 1.5rem; }
.footer-brand .site-brand img { width: 40px; height: 40px; border-radius: 10px; }
.footer-brand p { color: var(--paper-dim); font-size: 0.9rem; margin-top: 0.6rem; max-width: 22rem; }
.footer-col h2 {
  font-family: var(--font-label);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: 0.75rem;
}
.footer-col ul { list-style: none; display: grid; gap: 0.4rem; }
.footer-col a { color: var(--paper-dim); text-decoration: none; font-size: 0.92rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.footer-copy {
  max-width: 1180px;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--seam);
  font-size: 0.8rem;
  color: var(--paper-dim);
  opacity: 0.75;
  text-align: center;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .play-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .soon-panel { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .game-hero-inner { grid-template-columns: minmax(0, 1fr); }
  .game-hero-art { order: -1; }
  .game-hero-art .game-icon { width: 96px; }
  .play-steps.wide { grid-template-columns: minmax(0, 1fr); }
  .dev-label { top: 6px; left: 6px; font-size: 0.68rem; padding: 0.1rem 0.35rem; }
  .video-toggle { width: 34px; height: 34px; right: 5px; bottom: 5px; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ── REDUCED MOTION ── */
@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;
  }
  .video-toggle { display: none; }
}
