/* ============================================================
   sardin-ventures — unified design system
   "MONO ARCADE": dark monochrome, one pink accent, pixel voice.
   Single source of truth for the studio home, RUNZ, and OHJATA.
   Asset/font URLs are root-absolute so this one file serves
   every page (the repo is a GitHub user/org site at domain root).
   ============================================================ */

@font-face {
  font-display: swap;
  font-family: "Press Start 2P";
  src: url("/runz/assets/fonts/PressStart2P-Regular.ttf") format("truetype");
}

@font-face {
  font-display: swap;
  font-family: "VG5000";
  src: url("/assets/fonts/VG5000-Regular.otf") format("opentype");
}

:root {
  color-scheme: dark;

  /* monochrome ramp */
  --bg: #0c0b0d;
  --bg-2: #131115;
  --bg-3: #1a171c;
  --ink: #ece7dd;
  --muted: #958f85;
  --faint: #645e57;

  /* hairlines */
  --line: rgba(236, 231, 221, 0.13);
  --line-2: rgba(236, 231, 221, 0.26);

  /* the single accent */
  --accent: #d94a73;
  --accent-soft: rgba(217, 74, 115, 0.16);
  --on-accent: #0c0b0d;

  --shadow: rgba(0, 0, 0, 0.55);

  --max: 1140px;
  --gutter: clamp(20px, 4vw, 40px);

  --display: "Press Start 2P", ui-monospace, SFMono-Regular, Consolas, monospace;
  --body: "VG5000", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* subtle pixel-grid + scanline texture, fully monochrome */
body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(rgba(236, 231, 221, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 231, 221, 0.015) 1px, transparent 1px),
    var(--bg);
  background-size: 6px 6px, 6px 6px, auto;
  content: "";
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.16) 0,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
  content: "";
}

a {
  color: inherit;
}

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------
   shared display rules
   ------------------------------------------------------------ */
h1,
h2,
h3,
.eyebrow,
.button,
.status,
.tag,
.spec dt,
.copy-label,
.brand span {
  font-family: var(--display);
  font-weight: 400;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.eyebrow::before {
  width: 22px;
  height: 2px;
  background: var(--accent);
  content: "";
}

/* ------------------------------------------------------------
   header / nav
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - (var(--gutter) * 2), var(--max));
  min-height: 64px;
  margin: 0 auto;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 26px;
  height: 35px;
  object-fit: contain;
  image-rendering: pixelated;
}

.brand span {
  font-family: var(--body);
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 26px);
}

.nav-links a {
  color: var(--muted);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 120ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
}

/* ------------------------------------------------------------
   buttons
   ------------------------------------------------------------ */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border: 1.5px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 130ms ease, color 130ms ease, border-color 130ms ease, transform 130ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: transparent;
  color: var(--accent);
}

/* ------------------------------------------------------------
   detail hero (RUNZ / OHJATA)
   ------------------------------------------------------------ */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(620px, 84svh);
  overflow: clip;
  border-bottom: 1px solid var(--line-2);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url("/runz/assets/hero-bg.jpg");
  background-position: center;
  background-size: cover;
  filter: grayscale(1) contrast(1.05) brightness(0.5);
  content: "";
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, var(--bg) 4%, rgba(12, 11, 13, 0.35) 52%, rgba(12, 11, 13, 0.72)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px);
  content: "";
}

.ohjata-hero::before {
  background-image: url("/ohjata/assets/ohjata-header.jpg");
  /* the OHJATA capsule art contains its own (non-pixel) wordmark — darken it
     hard so only the pixel H1 reads as the title */
  filter: grayscale(1) contrast(1.05) brightness(0.26);
}

.ohjata-hero::after {
  background:
    linear-gradient(0deg, var(--bg) 6%, rgba(12, 11, 13, 0.6) 55%, rgba(12, 11, 13, 0.82)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px);
}

.hero-inner {
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin: 0 auto;
  padding: 120px 0 56px;
}

h1 {
  margin: 0;
  font-size: clamp(46px, 11vw, 124px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.6);
}

.hero-lead {
  max-width: 30ch;
  margin: 26px 0 0;
  color: var(--ink);
  font-size: clamp(19px, 2.3vw, 26px);
  line-height: 1.3;
}

/* ------------------------------------------------------------
   sections
   ------------------------------------------------------------ */
.section {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.section-inner {
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: end;
  gap: 28px;
  margin-bottom: 44px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(20px, 3.4vw, 34px);
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

h2 {
  font-size: clamp(20px, 3.4vw, 34px);
  line-height: 1.15;
}

/* big editorial statement — replaces the old boxed "Pitch" panel */
.lead-statement {
  max-width: 22ch;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(18px, 3.1vw, 30px);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.lead-statement .hl {
  color: var(--accent);
}

.prose p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 17px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  color: var(--ink);
  font-weight: 400;
}

/* two-column editorial split: statement | supporting copy/list */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

/* feature list with pixel ticks (no boxes) */
.features {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 14px 0 14px 26px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
}

.features li:first-child {
  border-top: 1px solid var(--line);
}

.features li {
  position: relative;
}

.features li::before {
  position: absolute;
  left: 0;
  top: 17px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  content: "";
}

/* tag chips (pixel) */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.tag {
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------
   specs table (replaces facts cards on RUNZ + OHJATA)
   ------------------------------------------------------------ */
.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(28px, 5vw, 56px);
  margin: 0;
  border-top: 1px solid var(--line-2);
}

.spec {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.spec dt {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.spec dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.spec a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  overflow-wrap: anywhere;
  transition: color 120ms ease;
}

.spec a:hover,
.spec a:focus-visible {
  color: var(--accent);
}

/* ------------------------------------------------------------
   media galleries (mono frame, art colorizes on hover)
   ------------------------------------------------------------ */
.media-group-title {
  margin: 40px 0 16px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head + .media-group-title,
.media-group-title:first-child {
  margin-top: 0;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.media-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
}

.media-card a,
.screenshot-card {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #060507;
}

.media-card img,
.screenshot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.screenshot-card {
  border: 1px solid var(--line-2);
}

.screenshot-card img {
  object-fit: contain;
  image-rendering: pixelated;
}

.media-card a:hover img,
.media-card a:focus-visible img,
.screenshot-card:hover img,
.screenshot-card:focus-visible img {
  transform: scale(1.03);
}

.media-card figcaption {
  flex: 1 1 auto;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* ------------------------------------------------------------
   editorial columns (creator notes) — hairlines, not boxes
   ------------------------------------------------------------ */
.col-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
}

.col-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.col {
  position: relative;
  padding-top: 22px;
  border-top: 1px solid var(--line-2);
}

.col::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.col h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
}

.col p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.col p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   downloads + copy blocks
   ------------------------------------------------------------ */
.downloads-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}

.downloads h3 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 13px;
}

.downloads p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
}

.downloads ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.downloads li {
  padding: 11px 0 11px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  position: relative;
}

.downloads li::before {
  position: absolute;
  left: 0;
  top: 16px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  content: "";
}

.copy-blocks {
  display: grid;
  gap: 12px;
}

.copy-block {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.copy-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-text {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

/* ------------------------------------------------------------
   footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line-2);
}

.footer-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin: 0 auto;
  padding: 30px 0;
}

.footer-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  text-decoration: none;
}

.footer-brand img {
  width: 28px;
  height: 38px;
  object-fit: contain;
  image-rendering: pixelated;
}

.footer-brand span {
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* ============================================================
   STUDIO HOME — one locked screen, no scroll
   ============================================================ */
.studio-home {
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.studio-home .site-header {
  position: static;
  background: transparent;
  backdrop-filter: none;
}

.home-main {
  position: relative;
  display: grid;
  align-content: center;
  gap: clamp(18px, 3.5vh, 40px);
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin: 0 auto;
  padding: clamp(12px, 2.5vh, 32px) 0;
  min-height: 0;
}

.home-wordmark {
  display: grid;
  gap: 10px;
}

.home-wordmark .eyebrow {
  margin: 0;
}

.home-wordmark h1 {
  margin: 0;
  font-size: clamp(34px, 6.6vw, 78px);
  line-height: 1.12;
  text-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
}

.home-wordmark h1 .line2 {
  display: block;
}

.home-tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 22px);
}

.home-tagline .pin {
  color: var(--accent);
}

/* the games list */
.game-index {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-2);
}

.game-row {
  display: grid;
  grid-template-columns: clamp(140px, 17vw, 230px) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
  padding: clamp(18px, 2.8vh, 30px) 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: padding-left 160ms ease, background 160ms ease;
}

.game-row:hover,
.game-row:focus-visible {
  padding-left: 18px;
  background: linear-gradient(90deg, var(--accent-soft), transparent 60%);
}

.game-row .thumb {
  width: 100%;
  height: clamp(82px, 11vh, 126px);
  object-fit: cover;
  border: 1px solid var(--line-2);
  filter: grayscale(1) brightness(0.85);
  transition: filter 220ms ease;
}

.game-row:hover .thumb,
.game-row:focus-visible .thumb {
  filter: none;
}

.game-row-copy {
  min-width: 0;
}

.game-row-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.2vw, 38px);
  line-height: 1;
}

.game-row-copy p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.7vw, 18px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status::before {
  width: 7px;
  height: 7px;
  background: var(--accent);
  content: "";
}

.game-arrow {
  color: var(--muted);
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1;
  transition: color 160ms ease, transform 160ms ease;
}

.game-row:hover .game-arrow,
.game-row:focus-visible .game-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

.studio-home .site-footer {
  border-top: 1px solid var(--line);
}

.studio-home .footer-inner {
  padding: 18px 0;
}

/* ============================================================
   RUNZ ENEMIES — procedural chunky creatures whose pupils track
   the cursor (ported from the game's ChunkyShape + threat eye).
   Decorative hosts: aria-hidden + pointer-events:none. JS injects
   a <canvas>; placement comes from inline top/right/left/bottom.
   ============================================================ */
.enemy {
  position: absolute;
  z-index: 4;
  line-height: 0;
  pointer-events: none;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.55));
}

.enemy canvas {
  display: block;
  image-rendering: pixelated;
}

/* ------------------------------------------------------------
   screenshot lightbox (opens images on-page; no navigation)
   ------------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(6, 5, 7, 0.93);
  cursor: zoom-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.lightbox.is-open {
  display: grid;
}

.lightbox-figure {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0;
}

.lightbox img {
  max-width: min(94vw, 1600px);
  max-height: 80vh;
  border: 1px solid var(--line-2);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.65);
}

.lightbox-caption {
  max-width: 70ch;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 1px solid var(--line-2);
  background: rgba(12, 11, 13, 0.82);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-prev {
  left: clamp(8px, 2vw, 24px);
}

.lightbox-next {
  right: clamp(8px, 2vw, 24px);
}

.lightbox-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-family: var(--display);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 920px) {
  .section-head,
  .split,
  .downloads-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    gap: 14px;
  }

  .specs {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .screenshot-grid,
  .col-grid {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .nav {
    min-height: 56px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .game-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px 16px;
  }

  .game-row .thumb,
  .game-row .game-arrow {
    display: none;
  }

  .game-row-copy p {
    white-space: normal;
  }

  .game-row .status {
    grid-column: 1;
  }

  .button {
    flex: 1 1 auto;
  }
}

/* relax the locked home so nothing clips on short / small screens */
@media (max-width: 620px), (max-height: 600px) {
  .studio-home {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    padding: 14px 0;
    gap: 12px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .hero-inner {
    padding-top: 96px;
  }

  .spec {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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