/* ==========================================================================
   8 Circuit Studios — site.css
   One stylesheet, no build step. Sections:
   1. Fonts  2. Tokens  3. Base  4. Layout  5. Components  6. Pages
   ========================================================================== */

/* 1. Fonts (self-hosted, SIL OFL 1.1 — see /assets/fonts/OFL.txt) -------- */

@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* 2. Tokens --------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Colour. Contrast on --c-ground (WCAG): text 17.3:1, muted 10.1:1, subtle 7.6:1, accent 7.5:1 — all AAA */
  --c-ground: #07080a;
  --c-surface: #000;
  --c-text: #edeef0;
  --c-text-muted: #b4b8c0;
  --c-text-subtle: #9aa0aa;
  --c-accent: #a98bff;
  --c-rule: #1e2127;
  --c-rule-strong: #2a2e36;
  --c-outline: #4a4f59;
  --c-grid: rgb(237 238 240 / 6%);

  /* Type */
  --f-display: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Menlo", monospace;

  /* Type scale */
  --fs-label: 0.75rem;                                   /* 12px */
  --fs-small: 0.8125rem;                                 /* 13px */
  --fs-body: 1.0625rem;                                  /* 17px */
  --fs-lead: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);     /* 18–20px */
  --fs-h3: 1.5rem;                                       /* 24px */
  --fs-h2: clamp(2rem, 1.4rem + 2.4vw, 3rem);            /* 32–48px */
  --fs-h1: clamp(2.75rem, 1.5rem + 5.6vw, 6.5rem);       /* 44–104px */

  /* Space */
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-pad: clamp(4rem, 3rem + 5vw, 7rem);
  --max-width: 80rem;                                    /* 1280px */
  --tap-min: 3rem;                                       /* 48px */
}

/* 3. Base ----------------------------------------------------------------- */

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

html {
  /* iOS Safari still needs the prefix to stop font inflation in landscape. */
  /* stylelint-disable-next-line property-no-vendor-prefix */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--c-ground);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  text-rendering: optimizelegibility;
  -webkit-font-smoothing: antialiased;
}

:where(h1, h2, h3, p, ul, dl, dd, figure) {
  margin: 0;
}

:where(ul) {
  padding: 0;
  list-style: none;
}

main {
  flex: 1 0 auto;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #fff;
}

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

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

/* 4. Layout --------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
  border-block-end: 1px solid var(--c-rule);
}

.section--last {
  border-block-end: 0;
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}

@media (width >= 56rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* 5. Components ----------------------------------------------------------- */

/* Small labels */
.label {
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-accent);
}

/* Headings */
.h1,
.h2,
.h3 {
  font-family: var(--f-display);
  text-transform: uppercase;
  text-wrap: balance;
}

.h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: 1.05;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.2;
}

.lead {
  max-width: 39rem;
  font-size: var(--fs-lead);
  color: var(--c-text-muted);
}

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

.prose {
  max-width: 40rem;
  font-size: var(--fs-lead);
  color: var(--c-text-muted);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding-inline: 1.75rem;
  font-family: var(--f-mono);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button--solid {
  background: var(--c-text);
  color: var(--c-ground);
}

.button--solid:hover {
  background: #fff;
  color: var(--c-ground);
}

.button--outline {
  border: 1px solid var(--c-outline);
}

.button--outline:hover {
  border-color: var(--c-text-muted);
}

/* Site header */
.site-header {
  border-block-end: 1px solid var(--c-rule);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand__mark {
  width: auto;
  height: 2.5rem;
}

.brand__wordmark {
  width: auto;
  height: 2.125rem;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  font-family: var(--f-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

/* Blueprint grid */
.blueprint {
  background-image:
    linear-gradient(var(--c-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-grid) 1px, transparent 1px);
  background-size: 4rem 4rem;
}

/* Hero */
.hero {
  border-block-end: 1px solid var(--c-rule);
}

.hero__inner {
  display: grid;
  align-items: end;
  gap: 3rem;
  padding-block: clamp(4.5rem, 3rem + 6vw, 7.5rem) clamp(3.5rem, 2.5rem + 4vw, 6rem);
}

@media (width >= 64rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.hero__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

.hero__logo {
  justify-self: center;
  width: auto;
  height: clamp(11rem, 7.5rem + 14vw, 21.5rem);
}

.hero__status {
  border-block-start: 1px solid var(--c-rule);
}

.hero__status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
}

/* Section heading block */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* "Shipped at" strip */
.shipped {
  border-block-start: 1px solid var(--c-rule);
  margin-block-start: var(--section-pad);
}

.shipped__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 3.5rem;
  padding-block-start: 2rem;
}

.shipped__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 3.5rem;
}

.shipped__item {
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Craft list */
.craft__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  margin-block-start: 3rem;
  border-block-start: 1px solid var(--c-rule-strong);
}

.craft__item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-block: 2rem;
  padding-inline-end: 2rem;
}

.craft__index {
  font-family: var(--f-mono);
  font-size: var(--fs-small);
  color: var(--c-text-subtle);
}

/* Tool panel (GameNostic) */
.tool {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-block-start: 3rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--c-rule-strong);
}

.tool__logo {
  flex: 0 0 auto;
  width: 9.375rem;
}

.tool__body {
  display: flex;
  flex: 999 1 26rem;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
}

.tool__title {
  font-size: 2rem;
}

/* Site footer */
.site-footer {
  border-block-start: 1px solid var(--c-rule);
}

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

.site-footer__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
}

.site-footer__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}

/* 6. Pages ---------------------------------------------------------------- */

/* Project Genesis archive */
.archive-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.archive-hero__eyebrow {
  color: var(--c-text-subtle);
}

.keyart {
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--c-rule-strong);
  background: var(--c-surface);
}

.keyart__img {
  width: 100%;
  max-width: 38.5rem;                                    /* 616px, the art's native width */
}

.facts {
  border-block-start: 1px solid var(--c-rule-strong);
}

.facts__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 1.25rem;
  border-block-end: 1px solid var(--c-rule-strong);
}

.facts__term {
  font-family: var(--f-mono);
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-subtle);
}

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

/* 404 */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  padding-block: clamp(5rem, 4rem + 8vw, 9rem);
}
