/* Studio identity ("Sign and four words"): the textured logo is the only loud
   thing on a page; everything around it is flat ground, plain type and hairlines.
   Shared by every page via _includes/layouts/studio.njk.

   Color roles:
     ground / ink / body / quiet / rule — nearly all of any screen
     accent      — hover and the occasional marker; text-safe on the ground
     accent-fill — the logo orange, as a fill under dark text only

   Light is the default. Dark applies when the visitor's system asks for it, or
   when they pick it with the toggle (theme.js sets data-theme on <html>). */

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

:root {
  --ground: #F4F0E8;
  --ink: #1B1815;
  --body: #3A3530;
  --quiet: #5E574F;
  --rule: #CFC7B8;
  --accent: #B8430E;
  --accent-fill: #E4611F;
  --on-fill: #1B1815;
  --max-w: 1080px;
  --gutter: clamp(1.1rem, 4vw, 3rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #1E1C19;
    --ink: #F1E7D6;
    --body: #CFC6B6;
    --quiet: #A79E91;
    --rule: #403B36;
    --accent: #F08A45;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #1E1C19;
  --ink: #F1E7D6;
  --body: #CFC6B6;
  --quiet: #A79E91;
  --rule: #403B36;
  --accent: #F08A45;
  color-scheme: dark;
}

html { scroll-behavior: smooth; }
body {
  background: var(--ground);
  color: var(--body);
  font-family: 'Barlow', sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent-fill); color: var(--on-fill); }

.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Shared display face: condensed caps, as on the home page's four words. */
.page-title, .spec-title, .section-title, .card h3, .posts h2, .post-title,
.article h2, .article h3, .form-thanks h2, .posts-empty strong,
.site-nav-links a, .hero-nav a, .btn, .chip, .field label, .field .label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
}

/* ---- Site nav ------------------------------------------------------------ */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.9rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}
/* Home: the hero is the nav, so the bar carries only the theme toggle. */
.site-nav--home { justify-content: flex-end; border-bottom: 0; }
.site-nav-home { display: block; flex: none; }
.site-nav-home img { width: 7.5rem; height: auto; }
.site-nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.2rem 1.6rem; }
.site-nav-links a {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  color: var(--quiet);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav-links a:hover { color: var(--accent); }
.site-nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent-fill); }
.site-nav-links a.is-cta { color: var(--ink); }
.site-nav-links a.is-cta:hover { color: var(--accent); }

.theme-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  color: var(--quiet);
  border: 1px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { display: block; }
/* Logo, links, toggle; the links take the slack so the toggle sits at the right edge. */
.site-nav-links { margin-left: auto; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }

/* ---- Home hero ------------------------------------------------------------ */
.hero {
  min-height: calc(100svh - 14rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vh, 3.5rem);
  text-align: center;
  padding: 2rem var(--gutter) 3rem;
}
.hero-logo { width: 100%; max-width: 35rem; }
.hero-logo img { width: 100%; height: auto; }
.hero-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem clamp(1.6rem, 4vw, 3.5rem); }
.hero-nav a {
  font-size: clamp(1.6rem, 4.6vw, 2.125rem);
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--ink);
  padding: 0.5rem 0;
}
.hero-nav a:hover { color: var(--accent); }

/* ---- Page header (inner pages) ------------------------------------------ */
.page-head { padding: clamp(2.6rem, 7vw, 4.6rem) 0 clamp(1.8rem, 4vw, 2.6rem); }
.page-eyebrow { color: var(--quiet); margin-bottom: 0.9rem; }
.page-title {
  font-size: clamp(2.8rem, 9vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.page-lede { max-width: 40rem; margin-top: 1.5rem; font-size: 1.15rem; color: var(--body); }
.page-lede + .page-lede { margin-top: 0.9rem; }
.page-lede strong, .prose strong { color: var(--ink); font-weight: 600; }

/* ---- Project panel ------------------------------------------------------- */
.spec {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: start;
  padding: clamp(1.6rem, 4vw, 2.6rem) 0;
  border-top: 2px solid var(--ink);
}
.spec--flip .spec-art { order: 2; }
.spec--text { grid-template-columns: 1fr; }
.spec-art { border: 1px solid var(--rule); }
.spec-art img { width: 100%; height: auto; }
.spec-art figcaption { color: var(--quiet); padding: 0.6rem 0.7rem; border-top: 1px solid var(--rule); }
.spec-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.tag { padding: 0.3rem 0.55rem; border: 1px solid var(--rule); color: var(--quiet); }
.tag--live { border-color: var(--ink); color: var(--ink); }
.tag--hot { border-color: var(--accent); color: var(--accent); }
.spec-title {
  font-size: clamp(2.3rem, 7vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.spec-line {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--quiet);
  margin: 0.6rem 0 1.1rem;
}
.prose p + p { margin-top: 0.9rem; }
.prose ul { margin: 0.9rem 0 0 1.1rem; }
.prose li + li { margin-top: 0.35rem; }
.prose li::marker { color: var(--accent); }

.facts { margin-top: 1.5rem; border-top: 1px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--quiet); padding-top: 0.25rem; }
.facts dd { font-size: 0.97rem; line-height: 1.5; color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.btn {
  display: inline-block;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  background: var(--ink);
  color: var(--ground);
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-fill); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* ---- Section heading + card grid (work-with-me) -------------------------- */
.section { padding: clamp(1.5rem, 4vw, 2.6rem) 0; }
.section-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--quiet);
  margin-bottom: 1.4rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.section-title {
  font-size: clamp(1.9rem, 5.5vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 1rem;
}
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.card { border-top: 2px solid var(--ink); padding: 1.2rem 0 0; }
.card h3 {
  font-size: 1.8rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 0.5rem 0 0.8rem;
}
.card .mono { color: var(--quiet); }
.card p { font-size: 0.98rem; }
.card ul { list-style: none; margin-top: 1rem; border-top: 1px solid var(--rule); }
.card li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); font-size: 0.92rem; line-height: 1.4; color: var(--ink); }

.split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.4rem, 4vw, 3rem); align-items: start; }

/* ---- Contact form --------------------------------------------------------- */
.form-panel { border-top: 2px solid var(--ink); padding: clamp(1.3rem, 3.5vw, 2rem) 0 0; }
.field { margin-bottom: 1.6rem; }
.field label, .field .label {
  display: block;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.field .hint { font-size: 0.9rem; margin-bottom: 0.6rem; color: var(--quiet); }
.field input, .field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: transparent;
  border: 1px solid var(--quiet);
  border-radius: 0;
  color: var(--ink);
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 13rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: var(--quiet); opacity: 0.8; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  padding: 0.5rem 0.9rem;
  background: transparent;
  border: 1px solid var(--quiet);
  color: var(--body);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.selected { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.form-error { display: none; color: var(--accent); font-weight: 600; margin-bottom: 1rem; }
.submit-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.submit-note { font-size: 0.9rem; max-width: 24rem; color: var(--quiet); }
.form-thanks { display: none; text-align: center; padding: 2rem 0; }
.form-thanks h2 { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1; letter-spacing: 0.04em; color: var(--ink); margin-bottom: 1rem; }

/* ---- Footer ---------------------------------------------------------------- */
.site-foot {
  margin-top: 3rem;
  padding: 1.5rem var(--gutter) 1.8rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  color: var(--quiet);
}
.site-foot a { color: var(--quiet); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }

/* ---- 404 --------------------------------------------------------------------- */
.lost { text-align: center; padding: clamp(3rem, 12vh, 7rem) var(--gutter); }
.lost .page-title { font-size: clamp(4rem, 20vw, 8rem); }

@media (max-width: 820px) {
  .spec, .split { grid-template-columns: 1fr; }
  .spec--flip .spec-art { order: 0; }
  .spec-art { max-width: 26rem; }
  .cards { grid-template-columns: 1fr; }
}
/* Narrow: logo and toggle share the top row; the links get the row beneath. */
@media (max-width: 700px) {
  .site-nav-links { order: 3; flex-basis: 100%; margin-left: 0; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 0.1rem; }
  .site-nav-links { gap: 0.1rem 1.1rem; }
  .site-nav-links a { font-size: 1rem; }
  .site-nav-home img { width: 6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---- Project media: stacked art, game sprites ------------------------------- */
.spec-media { display: grid; gap: 1.2rem; }
.spec--wide { grid-template-columns: 1fr; }
.spec--wide .spec-art { max-width: none; }
.spec-sprite { text-align: center; padding: 0.5rem 0 0; }
.spec-sprite img { width: min(100%, 20rem); height: auto; margin: 0 auto; }
.spec-sprite figcaption { color: var(--quiet); margin-top: 0.8rem; }
.roster { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.roster li { text-align: center; }
.roster img { width: 100%; height: auto; }
.roster .mono { display: block; margin-top: 0.4rem; font-size: 0.6rem; letter-spacing: 0.1em; color: var(--quiet); }
.cards--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) { .cards--two { grid-template-columns: 1fr; } }
.prose ul + p { margin-top: 0.9rem; }

/* ---- Blog: The Razor ---------------------------------------------------------- */
.posts { list-style: none; border-top: 2px solid var(--ink); }
.posts li { border-bottom: 1px solid var(--rule); }
.posts a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1.5rem;
  align-items: center;
  padding: 1.5rem 0 1.6rem;
  text-decoration: none;
  color: var(--body);
}
.post-meta { color: var(--quiet); display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.post-meta .tag { padding: 0; border: 0; }
.posts h2 {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin: 0.5rem 0 0.4rem;
  transition: color 0.15s;
}
.posts a:hover h2, .posts a:focus-visible h2 { color: var(--accent); }
.posts img { grid-column: 2; grid-row: 1; width: 11rem; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--rule); }
.posts-empty { border: 1px dashed var(--quiet); padding: 2rem 1.5rem; }
.posts-empty strong { display: block; font-size: 1.6rem; letter-spacing: 0.05em; color: var(--ink); }

.post { max-width: 46rem; margin: 0 auto; padding: 0 var(--gutter); }
.post-back { display: inline-block; margin-top: clamp(1.8rem, 5vw, 3rem); color: var(--quiet); text-decoration: none; }
.post-back:hover { color: var(--accent); }
.post-head { padding: 1.4rem 0 2rem; }
.post-title {
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0.9rem 0 0;
  overflow-wrap: anywhere;
}
.post-sub { font-size: 1.25rem; line-height: 1.45; color: var(--quiet); margin-top: 1rem; }
.post-hero { border: 1px solid var(--rule); margin-bottom: 2.4rem; }
.post-hero img { width: 100%; height: auto; }

/* Rendered Markdown. */
.article { font-size: 1.12rem; line-height: 1.75; color: var(--body); }
.article > * + * { margin-top: 1.2rem; }
.article h2, .article h3 { line-height: 1.05; letter-spacing: 0.04em; color: var(--ink); }
.article h2 { font-size: 1.9rem; margin-top: 2.8rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.article h3 { font-size: 1.4rem; margin-top: 2rem; }
.article strong { color: var(--ink); font-weight: 600; }
.article ul, .article ol { padding-left: 1.4rem; }
.article li + li { margin-top: 0.4rem; }
.article li::marker { color: var(--accent); }
.article blockquote { border-left: 3px solid var(--accent-fill); padding: 0.2rem 0 0.2rem 1.2rem; color: var(--ink); }
.article img { height: auto; border: 1px solid var(--rule); }
.article hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }
.article code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.86em; border: 1px solid var(--rule); padding: 0.1em 0.35em; color: var(--ink); }
.article pre { border: 1px solid var(--rule); padding: 1rem 1.1rem; overflow-x: auto; line-height: 1.5; }
.article pre code { border: 0; padding: 0; }
.article table { width: 100%; border-collapse: collapse; font-size: 0.98rem; display: block; overflow-x: auto; }
.article th, .article td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); }
.article th { color: var(--quiet); font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.post-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem 2rem; color: var(--quiet); }
.post-foot a { color: var(--quiet); text-decoration: none; }
.post-foot a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .posts a { grid-template-columns: 1fr; padding: 1.2rem 0 1.3rem; }
  .posts img { grid-column: 1; grid-row: auto; width: 100%; margin-top: 0.6rem; }
}

/* ---- Games: key art, video, shot gallery --------------------------------------- */
.key-art { margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.spec-art video { display: block; width: 100%; height: auto; }
.shots { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; padding-top: clamp(1.6rem, 4vw, 2.6rem); border-top: 2px solid var(--ink); }
.shots .spec-art { max-width: none; }
@media (max-width: 820px) {
  .key-art { max-width: none; }
  .shots { grid-template-columns: 1fr; }
}
