/* Saltbarrow Studio -- site.css
   Self-contained stylesheet. No CDN. No external fonts.
   Palette and type tokens live in the --css vars below.
*/

/* ---------- Tokens ---------- */

:root {
  --ink-900: #0e1a2b;
  --ink-700: #1f2c44;
  --ink-500: #364a6a;
  --ink-300: #6a7c97;

  --paper-50: #f4ecdc;
  --paper-100: #e7dcc6;
  --paper-200: #d2c39e;
  --paper-300: #b9a87d;

  --brass-500: #c98a2b;
  --brass-600: #a76d18;
  --brass-300: #e6b76a;

  --foam-400: #7ba7a5;
  --rust-500: #9a4a2a;

  --night-900: #070d18;
  --night-700: #0f1a2c;
  --night-500: #1a2942;

  --shadow-soft: 0 1px 0 rgba(20, 12, 4, 0.04), 0 8px 24px -16px rgba(20, 12, 4, 0.25);
  --shadow-card: 0 1px 0 rgba(20, 12, 4, 0.06), 0 12px 30px -18px rgba(20, 12, 4, 0.30);
  --shadow-press: 0 1px 0 rgba(20, 12, 4, 0.08) inset, 0 -1px 0 rgba(20, 12, 4, 0.06) inset;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;

  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 64ch;
  --maxw: 72rem;
  --gap-s: 0.5rem;
  --gap-m: 1rem;
  --gap-l: 2rem;
  --gap-xl: 4rem;
}

/* ---------- Reset (small, deliberate) ---------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper-50);
  color: var(--ink-900);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--brass-600);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover { color: var(--ink-900); }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brass-600);
  outline-offset: 3px;
  border-radius: 4px;
}

button {
  font: inherit;
  cursor: pointer;
}

hr {
  border: none;
  border-top: 1px solid var(--paper-200);
  margin: var(--gap-l) 0;
}

/* ---------- Background paper texture (CSS only, no images) ---------- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--paper-50);
  background-image:
    radial-gradient(circle at 20% 12%, rgba(167, 109, 24, 0.04), transparent 38%),
    radial-gradient(circle at 78% 84%, rgba(14, 26, 43, 0.03), transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(14, 26, 43, 0.015) 0 1px, transparent 1.4px);
  background-size: auto, auto, 7px 7px;
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink-900);
  color: var(--paper-50);
  padding: 0.6rem 0.9rem;
  border-radius: 0 0 var(--radius-s) 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Site header ---------- */

.site-header {
  border-bottom: 1px solid var(--paper-200);
  background: var(--paper-50);
}

.site-header__bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink-900);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand__mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.brand__name { white-space: nowrap; }

.brand__sub {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink-500);
  font-size: 0.85rem;
  margin-left: 0.4rem;
  letter-spacing: 0.02em;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-s);
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink-700);
  border: 1px solid transparent;
}

.site-nav a:hover {
  background: var(--paper-100);
  color: var(--ink-900);
}

.site-nav a[aria-current="page"] {
  background: var(--paper-100);
  border-color: var(--paper-200);
  color: var(--ink-900);
}

/* ---------- Layout primitives ---------- */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--gap-l) 1.25rem var(--gap-xl);
}

.container--narrow {
  max-width: 44rem;
}

.section {
  padding: var(--gap-l) 0;
}

.stack-s > * + * { margin-top: var(--gap-s); }
.stack-m > * + * { margin-top: var(--gap-m); }
.stack-l > * + * { margin-top: var(--gap-l); }

.row {
  display: flex;
  gap: var(--gap-m);
  flex-wrap: wrap;
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--gap-l);
}

@media (min-width: 720px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--featured { grid-template-columns: 1.4fr 1fr; }
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink-900);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.005em;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(1.9rem, 3.2vw + 0.4rem, 2.8rem); }
h2 { font-size: clamp(1.4rem, 1.6vw + 0.6rem, 1.85rem); margin-top: 0.4em; }
h3 { font-size: 1.18rem; margin-top: 0.6em; }

p { margin: 0 0 1em; max-width: var(--measure); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 600;
  display: inline-block;
  border-left: 3px solid var(--brass-500);
  padding-left: 0.55rem;
  margin-bottom: 0.6rem;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink-700);
  max-width: 52ch;
}

.muted {
  color: var(--ink-500);
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-700);
  font-size: 1.05rem;
  max-width: 52ch;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-m);
  border: 1px solid var(--ink-900);
  background: var(--ink-900);
  color: var(--paper-50);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: transform 80ms ease, background-color 120ms ease, color 120ms ease;
}

.btn:hover { background: var(--ink-700); color: var(--paper-50); }
.btn:active { transform: translateY(1px); }

.btn--brass {
  background: var(--brass-500);
  border-color: var(--brass-600);
  color: var(--ink-900);
}
.btn--brass:hover { background: var(--brass-600); color: var(--paper-50); }

.btn--ghost {
  background: transparent;
  color: var(--ink-900);
  border-color: var(--ink-900);
}
.btn--ghost:hover {
  background: var(--ink-900);
  color: var(--paper-50);
}

.btn--small {
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
}

/* ---------- Cards ---------- */

.card {
  background: var(--paper-100);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-l);
  padding: 1.4rem;
  box-shadow: var(--shadow-card);
}

.card h3 { margin-top: 0; }

.card--ink {
  background: var(--ink-900);
  color: var(--paper-50);
  border-color: var(--ink-700);
}
.card--ink h2,
.card--ink h3 { color: var(--paper-50); }
.card--ink .eyebrow { color: var(--brass-300); }
.card--ink p, .card--ink li { color: var(--paper-100); }
.card--ink a { color: var(--brass-300); }
.card--ink a:hover { color: var(--paper-50); }

/* ---------- Game tile ---------- */

.tile {
  display: flex;
  flex-direction: column;
  background: var(--paper-100);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-l);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(20,12,4,0.06), 0 18px 36px -22px rgba(20, 12, 4, 0.35);
}

.tile__art {
  background: var(--night-900);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.tile__art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tile__body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tile__title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.tile__sub {
  color: var(--ink-500);
  font-size: 0.92rem;
  margin: 0;
}

.tile__meta {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--paper-200);
  color: var(--ink-700);
  border: 1px solid var(--paper-300);
}

.badge--brass {
  background: var(--brass-300);
  color: var(--ink-900);
  border-color: var(--brass-600);
}

.badge--ink {
  background: var(--ink-900);
  color: var(--paper-50);
  border-color: var(--ink-700);
}

/* ---------- Lists ---------- */

ul.plain, ol.plain {
  padding-left: 1.2rem;
  margin: 0 0 1em;
}

ul.plain li, ol.plain li {
  margin-bottom: 0.35em;
  max-width: var(--measure);
}

/* ---------- Definition list ---------- */

.deflist {
  margin: 0 0 1em;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem 1.2rem;
}

@media (min-width: 640px) {
  .deflist { grid-template-columns: 11rem 1fr; }
}

.deflist dt {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink-700);
}

.deflist dd {
  margin: 0;
  color: var(--ink-900);
}

/* ---------- Site footer ---------- */

.site-footer {
  border-top: 1px solid var(--paper-200);
  margin-top: var(--gap-xl);
  background: var(--paper-100);
}

.site-footer__bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  color: var(--ink-500);
}

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.site-footer__links a { color: var(--ink-700); }

/* ---------- Page hero ---------- */

.hero {
  padding: var(--gap-xl) 0 var(--gap-l);
  position: relative;
}

.hero__art {
  background: var(--night-900);
  border-radius: var(--radius-l);
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hero__art svg { width: 100%; height: 100%; display: block; }

/* ---------- Status pill ---------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--paper-100);
  border: 1px solid var(--paper-200);
  color: var(--ink-700);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.status-pill__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brass-500);
  box-shadow: 0 0 0 3px rgba(201, 138, 43, 0.18);
}

/* ---------- Devlog entries ---------- */

.devlog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.devlog-entry {
  background: var(--paper-100);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-l);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-soft);
}

.devlog-entry__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 0.4rem;
}

.devlog-entry__date {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-500);
  letter-spacing: 0.02em;
}

.devlog-entry__title {
  font-family: var(--serif);
  font-size: 1.18rem;
  margin: 0;
  font-weight: 600;
}

.devlog-entry h2, .devlog-entry h3 { margin-top: 0.6em; }
.devlog-entry p:last-child { margin-bottom: 0; }

/* ---------- Inline notes ---------- */

.note {
  border-left: 3px solid var(--brass-500);
  padding: 0.4rem 0.9rem;
  background: var(--paper-100);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--ink-700);
  font-size: 0.96rem;
  max-width: var(--measure);
}

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th, .table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--paper-200);
}

.table th {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink-700);
  background: var(--paper-100);
}

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

.game-shell {
  display: grid;
  gap: var(--gap-l);
}

@media (min-width: 980px) {
  .game-shell {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    align-items: start;
  }
}

.game-frame {
  background: var(--night-900);
  border-radius: var(--radius-l);
  border: 1px solid var(--ink-700);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

.game-frame__canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  background: var(--night-900);
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  background: var(--ink-900);
  color: var(--paper-50);
  border-bottom: 1px solid var(--ink-700);
  font-family: var(--mono);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.game-hud__group {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.game-hud__label {
  color: var(--brass-300);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  margin-right: 0.2rem;
}

.game-hud__btn {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.6rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--brass-500);
  background: transparent;
  color: var(--paper-50);
  text-transform: uppercase;
}
.game-hud__btn:hover { background: var(--brass-500); color: var(--ink-900); }
.game-hud__btn[aria-pressed="true"] {
  background: var(--brass-500);
  color: var(--ink-900);
}

.game-controls {
  background: var(--paper-100);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-l);
  padding: 1.1rem 1.2rem;
}

.kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--paper-300);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper-50);
  color: var(--ink-900);
  white-space: nowrap;
}

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

.notfound {
  text-align: center;
  padding: var(--gap-xl) 1rem;
}

.notfound h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: -0.02em;
  margin: 0;
}

.notfound .pulse {
  width: 80px;
  height: 80px;
  margin: 1.5rem auto;
}

/* ---------- Print-friendly ---------- */

@media print {
  body { background: white; color: black; }
  body::before { display: none; }
  .site-header, .site-footer, .game-frame, .hero__art { display: none; }
  a { color: black; text-decoration: underline; }
}
