/* ==========================================================================
   Horsepower Interactive – stylesheet
   Change the look of the whole site from the variables below.
   ========================================================================== */

:root {
  --bg: #15140f;          /* page background */
  --surface: #1c1b14;     /* raised panels */
  --surface-2: #26241a;   /* inputs, avatars */
  --line: #38352a;        /* borders and dividers */
  --text: #f3ecc6;        /* very light yellow – main contrast colour */
  --text-strong: #fff7d1; /* hover state for the yellow buttons */
  --muted: #b3ad8c;       /* secondary text (7:1 contrast on --bg) */

  /* Page intro: black screen for --intro-delay, then fade in over --intro-fade */
  --intro-delay: 0.6s;
  --intro-fade: 1.6s;

  --radius: 6px;
  --wrap: 1120px;

  /* System font stacks: no external requests, fast, GDPR-friendly.
     To use your own fonts, add @font-face rules for self-hosted .woff2
     files and put the family name first in these two variables. */
  --font-display: "Rockwell", "Rockwell Nova", "Roboto Slab", "Sitka Heading", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
}

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

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

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

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--text); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: var(--radius); z-index: 10;
}
.skip:focus { top: 1rem; }


/* ---------- Page intro: short black delay, then fade in ---------- */
/* Pure CSS, so the page still shows if JavaScript is off. */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: #000;
  z-index: 1000;
  pointer-events: none;
  animation: fade-from-black var(--intro-fade) ease-out var(--intro-delay) forwards;
}
@keyframes fade-from-black {
  from { opacity: 1; visibility: visible; }
  99%  { visibility: visible; }
  to   { opacity: 0; visibility: hidden; }
}
/* Inner pages get a much shorter version so navigating stays snappy */
body.subpage { --intro-delay: 0.1s; --intro-fade: 0.7s; }

/* ---------- Type ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; }
h1 { font-size: clamp(2.75rem, 6.5vw, 4.75rem); line-height: 1.02; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; line-height: 1.25; }
p { margin: 0 0 1rem; }
.lead { font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.5; max-width: 34ch; }
.muted { color: var(--muted); }
.prose { max-width: 68ch; }
.prose h2 { margin: 2.5rem 0 0.75rem; font-size: 1.6rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

/* ---------- Buttons & tags ---------- */

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--text-strong); border-color: var(--text-strong); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: transparent; border-color: var(--text); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.tags { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.tag-status { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 1rem; }

.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font: 700 1.2rem/1 var(--font-display);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.nav ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.nav a { color: var(--muted); text-decoration: none; padding: 0.25rem 0; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-underline-offset: 0.45em; }

.nav-toggle {
  display: none;
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.45rem 0.9rem; font: inherit; cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; width: 100%; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0.25rem; padding-bottom: 0.75rem; }
  .nav a { display: block; padding: 0.6rem 0; }
}

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 2.25rem; }
.section-head p { margin: 0; color: var(--muted); }
.page-title { padding: clamp(3rem, 7vw, 5rem) 0 clamp(2rem, 4vw, 3rem); }
.page-title h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
.page-title p { margin: 1rem 0 0; max-width: 52ch; color: var(--muted); font-size: 1.15rem; }

/* ---------- Hero ---------- */

.hero { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-copy h1 { margin: 0 0 1.25rem; }
.hero-copy .tags { margin-bottom: 1.25rem; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1.5rem; margin: 1.5rem 0 2rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.hero-art {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-art img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; }
}

/* ---------- Game tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 2.25rem 2rem; }
.tile-art { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.1rem; }
.tile-art img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: opacity 0.2s; }
.tile-art:hover img { opacity: 0.85; }
.tile h3 { margin-bottom: 0.4rem; }
.tile h3 a { text-decoration: none; }
.tile h3 a:hover { text-decoration: underline; }
.tile p { color: var(--muted); }

.tiles-wide { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ---------- Devlog list ---------- */

.posts { list-style: none; margin: 0; padding: 0; }
.posts li {
  display: grid; grid-template-columns: 9rem 1fr; gap: 0.5rem 2rem;
  padding: 1.5rem 0; border-top: 1px solid var(--line);
}
.posts li:last-child { border-bottom: 1px solid var(--line); }
.posts time { color: var(--muted); }
.posts h3 { margin-bottom: 0.4rem; }
.posts h3 a { text-decoration: none; }
.posts h3 a:hover { text-decoration: underline; }
.posts p { margin: 0; color: var(--muted); max-width: 62ch; }
@media (max-width: 640px) { .posts li { grid-template-columns: minmax(0, 1fr); } }

.article { padding: 2.5rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.5rem 2rem; }
.article:last-of-type { border-bottom: 1px solid var(--line); }
.article time { color: var(--muted); }
.article h2 { font-size: 1.75rem; margin-bottom: 1rem; }
.article .body { max-width: 66ch; }
@media (max-width: 640px) { .article { grid-template-columns: minmax(0, 1fr); } }
.article:target h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }

/* ---------- Call-to-action band ---------- */

.band { background: var(--surface); border-block: 1px solid var(--line); padding: clamp(2.5rem, 6vw, 4rem) 0; }
.band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.band h2 { margin-bottom: 0.5rem; }
.band p { margin: 0; color: var(--muted); max-width: 48ch; }

/* ---------- Two-column layouts ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(2rem, 6vw, 5rem); }
.split-wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 820px) { .split, .split-wide { grid-template-columns: minmax(0, 1fr); } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel h3 { margin-bottom: 0.75rem; }
.panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.25rem; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li + li { margin-top: 0.5rem; }
.panel, .prose { overflow-wrap: anywhere; }

/* ---------- About ---------- */

.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
.values h3 { margin-bottom: 0.5rem; }
.values p { color: var(--muted); margin: 0; }

.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.person .avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  font: 700 1.4rem/1 var(--font-display);
  margin-bottom: 1rem;
}
.person h3 { font-size: 1.15rem; }
.person .role { color: var(--muted); margin: 0.15rem 0 0.6rem; }
.person p:last-child { margin: 0; font-size: 0.97rem; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.5rem; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding-bottom: 1.75rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: calc(-1.5rem - 5px); top: 0.6rem;
  width: 9px; height: 9px; border-radius: 50%; background: var(--text);
}
.timeline strong { display: block; font-family: var(--font-display); font-size: 1.2rem; }
.timeline span { color: var(--muted); }

/* ---------- Game page ---------- */

.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.feature-list h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.feature-list p { margin: 0; color: var(--muted); }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.shot-placeholder {
  aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; padding: 1rem;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: 0.95rem;
}

.widget-note { border: 1px dashed var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; color: var(--muted); font-size: 0.95rem; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 1.25rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.75rem 0.9rem; font: inherit;
}
.field textarea { min-height: 10rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.field .hint { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 0; }
.hp { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 3.5rem 0 2rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; }
.site-footer h2 { font-size: 1rem; margin-bottom: 0.9rem; color: var(--muted); font-family: var(--font-body); font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 0.45rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .about-line { color: var(--muted); max-width: 34ch; margin-top: 0.9rem; }
.legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.legal p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }

/* ---------- 404 ---------- */

.notfound { padding: clamp(4rem, 12vw, 9rem) 0; }
.notfound p { color: var(--muted); max-width: 44ch; margin: 1rem 0 2rem; }


/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .wrap { width: min(100% - 2.5rem, var(--wrap)); }
  body { font-size: 1rem; }
  .btn-row { flex-direction: column; }
  .btn-row .btn, .tile .btn { width: 100%; text-align: center; padding: 0.9rem 1.25rem; }
  .band-inner > .btn { width: 100%; text-align: center; padding: 0.9rem 1.25rem; }
  .section-head { margin-bottom: 1.5rem; }
  .facts, .panel dl { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .facts dd, .panel dd { margin-bottom: 0.6rem; }
  .brand { font-size: 1.05rem; }
  .lead { max-width: none; }
}
/* Comfortable tap targets on touch devices */
@media (pointer: coarse) {
  .nav-toggle { min-height: 44px; }
  .nav a { min-height: 44px; display: flex; align-items: center; }
  .site-footer li a { display: inline-block; padding: 0.3rem 0; }
}
/* Never allow sideways scrolling */
html, body { overflow-x: hidden; }

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