/* Alsatian Studio — play.alsatian.co
   Two-colour system taken from the Alsatian's coat: black saddle and tan.
   One typeface, Recursive. Its CASL axis carries the audience: linear for developer projects, casual for family projects. */

@font-face {
  font-family: "Recursive";
  src: url("../fonts/recursive-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Recursive";
  src: url("../fonts/recursive-latin-ext.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Recursive";
  src: url("../fonts/recursive-vietnamese.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --paper: #F7F7F4;
  --surface: #FFFFFF;
  --ink: #1C1A17;
  --ink-2: #55504A;
  --rule-soft: #D9D6CF;
  --tan: #C8873F;
  --tan-ink: #8B5216;
  --on-tan: #1C1A17;
  --code-bg: #1C1A17;
  --code-ink: #EFEBE4;
  --inline-code-bg: #ECEAE4;
  --band: #C8873F;

  --font: "Recursive", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --casl: 0;
  --mono: 0;
  --voice: 0;

  --max: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 66ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171513;
    --surface: #201D1A;
    --ink: #EEEAE3;
    --ink-2: #B7B0A6;
    --rule-soft: #3A3530;
    --tan: #D39A55;
    --tan-ink: #E0A964;
    --on-tan: #171513;
    --code-bg: #0F0E0C;
    --code-ink: #EEEAE3;
    --inline-code-bg: #2A2622;
    --band: #B97A3C;
  }
}

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

/* Every element reads its own --casl and --mono, so a group or page can set the voice once. */
* { font-variation-settings: "CASL" var(--casl), "MONO" var(--mono); }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

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

a { color: var(--tan-ink); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible { outline: 3px solid var(--tan); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--tan); color: var(--on-tan); }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 6px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* Voice: display type follows the audience of the group or page. */
.voice-linear { --voice: 0; }
.voice-mid { --voice: 0.5; }
.voice-casual { --voice: 1; }

code, pre, kbd, samp { font-family: var(--font); --mono: 1; --casl: 0; }

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

.site-header { padding-block: 20px; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }

/* The wordmark, with no logo: the studio name in the casual heavy voice, coloured like the dog's coat, the black saddle above and the tan below. */
.brand {
  display: inline-flex; align-items: center;
  color: var(--ink); text-decoration: none;
  font-size: 1.625rem; font-weight: 900; letter-spacing: -0.025em; line-height: 1.05;
  --casl: 1;
}
.brand-name {
  padding-block: 0.04em;
  background: linear-gradient(180deg, var(--ink) 0 57%, var(--tan) 57% 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.brand:hover .brand-name { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--tan); text-underline-offset: 0.22em; }

.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 24px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; padding: 6px 0;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.0625rem;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--rule-soft); }
.site-nav a[aria-current="page"], .site-nav a.is-section { border-bottom-color: var(--tan); }

/* ------------------------------------------------------------------ home */

.intro { padding-block: clamp(40px, 9vw, 120px) clamp(32px, 6vw, 72px); }
.intro-title {
  margin: 0 0 0.45em;
  max-width: 16ch;
  font-size: clamp(2.5rem, 1.25rem + 5vw, 5.25rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.lede {
  margin: 0 0 1.25em;
  max-width: 54ch;
  font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.4375rem);
  line-height: 1.5;
  color: var(--ink-2);
}
.latest { margin: 0; font-size: 1rem; color: var(--ink-2); }

.featured { padding-block: clamp(32px, 5vw, 64px); border-bottom: 1px solid var(--rule-soft); }
.featured-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px); }
.featured-image { display: block; }
.featured-image img { width: 100%; border-radius: 8px; }
.featured-label { margin: 0 0 12px; color: var(--tan-ink); font-size: 0.875rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.featured h2 { margin: 0; font-size: clamp(2.25rem, 3.5vw, 3.5rem); line-height: 1.05; letter-spacing: -0.035em; --casl: 1; }
.featured-text { margin: 20px 0; color: var(--ink-2); }
.featured .actions { margin-bottom: 0; }
@media (max-width: 760px) {
  .featured-inner { grid-template-columns: minmax(0, 1fr); }
}

.index { padding-bottom: 32px; }
.group { margin-top: clamp(40px, 6vw, 72px); }
.group:first-child { margin-top: 0; }

.group-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin: 0; padding-bottom: 10px;
  border-bottom: 4px solid var(--ink);
  font-size: 1.1875rem; font-weight: 750; letter-spacing: -0.005em;
  --casl: var(--voice);
}

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-bottom: 1px solid var(--rule-soft); }

.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1.1fr) minmax(0, 1fr) 9.5rem;
  grid-template-areas: "icon name line kind";
  align-items: center;
  gap: 6px 28px;
  padding: 20px 14px;
  margin-inline: -14px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.row-icon { grid-area: icon; width: 64px; height: 64px; border-radius: 14px; object-fit: contain; background: #FFFFFF; border: 1px solid var(--rule-soft); }
.row-icon--mono {
  display: grid; place-items: center;
  background: #1C1A17; color: #D39A55; border-color: #1C1A17;
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  --mono: 1;
}
.row-name { grid-area: name; }
.row-line { grid-area: line; }
.row-kind { grid-area: kind; }
.row-name {
  font-size: clamp(1.75rem, 1rem + 2.5vw, 2.875rem);
  line-height: 1.04;
  font-weight: 760;
  letter-spacing: -0.03em;
  --casl: var(--voice);
}
.row-line { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.45; max-width: 40ch; }
.row-kind { color: var(--ink-2); font-size: 0.9375rem; text-align: right; }

.row:hover, .row:focus-visible { background: var(--tan); color: var(--on-tan); }
.row:hover .row-line, .row:hover .row-kind,
.row:focus-visible .row-line, .row:focus-visible .row-kind { color: var(--on-tan); }
.row:focus-visible { outline: 3px solid var(--ink); outline-offset: 0; }

.closing { padding-block: 40px 0; }
.closing p { max-width: 60ch; margin: 0; font-size: 1.125rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ project page */

.project { padding-top: 16px; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.project-head { padding-block: clamp(24px, 5vw, 56px) clamp(28px, 4vw, 44px); }
.project-name {
  margin: 0 0 0.22em;
  font-size: clamp(3.25rem, 1.4rem + 7.5vw, 8rem);
  line-height: 0.95;
  font-weight: 820;
  letter-spacing: -0.045em;
  --casl: var(--voice);
}
.project-tagline {
  margin: 0 0 32px;
  max-width: 44ch;
  font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.5625rem);
  line-height: 1.42;
  color: var(--ink-2);
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 10px 22px;
  border: 2px solid var(--ink); border-radius: 7px;
  color: var(--ink); background: transparent;
  font-weight: 700; font-size: 1.0625rem; line-height: 1.2; text-decoration: none; text-align: center;
  transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button--primary { background: var(--ink); color: var(--paper); }
.button--primary:hover { background: var(--tan); border-color: var(--tan); color: var(--on-tan); }

/* Media */
.media { margin: 0 0 clamp(40px, 6vw, 72px); }
.media img, .media video, .media--gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--rule-soft);
  background: var(--surface);
}
.media > img, .media > video, .media > a.zoom > img { width: auto; max-width: 100%; max-height: min(80vh, 820px); }
.media figcaption, .shot figcaption { margin-top: 10px; font-size: 0.9375rem; color: var(--ink-2); }
.media--narrow { max-width: 340px; }
.media--narrow img { border: 0; background: transparent; }
@media (prefers-color-scheme: dark) { .media--narrow img { border-radius: 14px; } }

/* Screenshots in rows of equal height. Each figure grows in proportion to its aspect ratio (--ar), so a phone
   screenshot and a desktop screenshot can share a row. A row aims at about 340px high and never passes 600px,
   and no image is stretched past its own width (--w). */
.shots { display: flex; flex-wrap: wrap; align-items: flex-start; gap: clamp(12px, 2vw, 24px); }
.shot {
  margin: 0; min-width: 0;
  flex: calc(var(--ar) * 340) 1 calc(var(--ar) * 340px);
  max-width: min(100%, calc(var(--ar) * 600px), var(--w, 100%));
}
.shot img { width: 100%; height: auto; aspect-ratio: var(--ar); border-radius: 10px; border: 1px solid var(--rule-soft); background: var(--surface); }
.screens { margin: 0 0 clamp(40px, 6vw, 72px); scroll-margin-top: 24px; }
.screens-title {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem);
  line-height: 1.15; font-weight: 780; letter-spacing: -0.02em;
  --casl: var(--voice);
}

.media--code pre { margin: 0; }
.terminal {
  font-size: clamp(0.875rem, 0.8rem + 0.35vw, 1.0625rem);
  line-height: 1.65;
  padding: clamp(18px, 3vw, 32px);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  overflow-x: auto;
  box-shadow: inset 0 6px 0 var(--tan);
}

/* position: relative keeps the screen-reader label inside a scrolling gallery, so it cannot widen the page. */
.zoom { position: relative; display: block; cursor: zoom-in; border-radius: 10px; }

/* Body: facts label beside the prose */
.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  grid-template-areas: "prose facts";
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.prose { grid-area: prose; max-width: var(--measure); min-width: 0; }
.facts { grid-area: facts; }

/* The facts label. Heavy rules like a printed product label: each row is one plain fact. */
.facts {
  position: sticky; top: 24px;
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 14px 18px 4px;
}
.facts h2 {
  margin: 0 0 8px;
  font-size: 2rem; line-height: 1; font-weight: 850; letter-spacing: -0.03em;
  --casl: var(--voice);
}
.facts dl { margin: 0; border-top: 10px solid var(--ink); }
.fact {
  display: grid; grid-template-columns: 6.75rem minmax(0, 1fr); gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ink);
  font-size: 0.9375rem; line-height: 1.45;
}
.fact:last-child { border-bottom: 0; }
.fact dt { font-weight: 750; }
.fact dd { margin: 0; }
.fact--status { border-top: 5px solid var(--ink); margin-top: -1px; }

/* Prose */
.prose > section + section { margin-top: clamp(44px, 5vw, 64px); }
.prose section { scroll-margin-top: 24px; }
.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.875rem);
  line-height: 1.15; font-weight: 780; letter-spacing: -0.02em;
  --casl: var(--voice);
}
.prose--page h2 { margin-top: clamp(44px, 5vw, 64px); }
.prose p, .prose ul, .prose ol, .prose pre, .prose .table-wrap { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.35em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--ink-2); }
.prose ol li::marker { font-weight: 700; }
.prose strong { font-weight: 750; }
.prose .lede { color: var(--ink); }

.link-list { list-style: none; padding-left: 0 !important; }
.link-list li { padding-left: 0; }

.promises { list-style: none; padding-left: 0 !important; border-top: 4px solid var(--ink); }
.promises li { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }

:not(pre) > code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--inline-code-bg);
  overflow-wrap: anywhere;
}

.prose pre {
  position: relative;
  padding: 16px 18px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-x: auto;
}
/* With JavaScript, commands get a bar with a Copy button above the code, so the button never covers it. */
.code-block { margin: 0 0 1em; border-radius: 8px; background: var(--code-bg); color: var(--code-ink); }
.code-bar { display: flex; justify-content: flex-end; padding: 8px 8px 0; }
.prose .code-block pre { margin: 0; padding-top: 6px; background: transparent; border-radius: 0 0 8px 8px; }
.copy-button {
  min-height: 34px; padding: 4px 12px;
  border: 1px solid #5C564E; border-radius: 5px;
  background: transparent; color: var(--code-ink);
  font: inherit; font-size: 0.875rem; font-weight: 600; --mono: 0;
  cursor: pointer;
}
.copy-button:hover { background: var(--tan); border-color: var(--tan); color: #1C1A17; }

.table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9688rem; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 9px 16px 9px 0; border-bottom: 1px solid var(--rule-soft); }
.prose thead th { border-bottom: 3px solid var(--ink); font-weight: 750; }
.prose td:first-child { font-weight: 650; white-space: nowrap; }
.prose .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }

@media (max-width: 600px) {
  .prose table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
  .prose table.stack td { padding: 0; border: 0; }
  .prose table.stack td:nth-child(2) { color: var(--ink-2); }
  .prose table.stack td:nth-child(3) { grid-column: 1 / -1; }
  .prose table.stack tbody { border-top: 3px solid var(--ink); display: block; }
}

/* More from the same group */
.more { margin-top: clamp(64px, 8vw, 112px); }
/* A dark "More games" band is the last thing on a game page, so the footer starts right under it. */
main:has(> .band--ink:last-child) + .site-footer { margin-top: 0; }
.more .row-name { font-size: clamp(1.75rem, 1rem + 2.4vw, 2.75rem); }

/* ------------------------------------------------------------------ simple pages */

.page-head { padding-block: clamp(40px, 8vw, 104px) clamp(24px, 4vw, 48px); }
.page-head h1 {
  margin: 0 0 0.3em;
  font-size: clamp(3rem, 1.5rem + 6vw, 6.5rem);
  line-height: 0.98; font-weight: 820; letter-spacing: -0.04em;
  --casl: var(--voice);
}
.prose--page { max-width: var(--measure); }

.timeline { list-style: none; margin: 0; padding: 0; max-width: 880px; border-top: 4px solid var(--ink); }
.timeline li {
  display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 4px 32px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.timeline time { color: var(--ink-2); font-variant-numeric: tabular-nums; padding-top: 2px; }
.update-body p { margin: 0; }
.update-title { font-size: 1.3125rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.3; }
.update-title a { color: var(--ink); text-decoration: none; }
.update-title a:hover { text-decoration: underline; text-decoration-color: var(--tan); }
.update-note { color: var(--ink); }
.update-source { font-size: 0.9375rem; margin-top: 4px !important; }
.older { max-width: 880px; padding-top: 20px; color: var(--ink-2); }
.older p { margin: 0; max-width: 60ch; }

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

.site-footer { margin-top: clamp(80px, 10vw, 144px); border-top: 4px solid var(--ink); }
.footer-inner {
  display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: center;
  padding-block: 28px 44px;
  font-size: 0.9375rem; color: var(--ink-2);
}
.footer-brand { margin: 0; color: var(--ink); font-weight: 900; letter-spacing: -0.01em; --casl: 1; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--ink); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-decoration-color: var(--tan); }
.footer-note, .footer-copy { margin: 0; grid-column: 1; }
.footer-note { margin-top: 8px; }

/* The design menu: a quiet button at the bottom right. It opens a list of the same page in each design, above the button. */
.design-switch { position: relative; grid-column: 2; grid-row: 2 / span 2; justify-self: end; align-self: end; }
.design-switch summary {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 12px;
  border: 2px solid var(--rule-soft); border-radius: 7px;
  color: var(--ink-2); font-weight: 600; cursor: pointer; list-style: none;
}
.design-switch summary::-webkit-details-marker { display: none; }
.design-switch summary::after { content: ""; width: 7px; height: 7px; margin: -3px 2px 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg); }
.design-switch[open] summary::after { margin-top: -9px; transform: rotate(45deg); }
.design-switch summary:hover, .design-switch[open] summary { border-color: var(--ink); color: var(--ink); }
.design-current { color: var(--ink); font-weight: 800; }
.design-list {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 5;
  min-width: 230px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 2px solid var(--ink); border-radius: 9px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}
.design-list a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 5px; color: var(--ink); font-weight: 600; text-decoration: none; }
.design-list a::before { content: ""; flex: none; width: 1.1em; text-align: center; }
.design-list a[aria-current="page"] { font-weight: 800; }
.design-list a[aria-current="page"]::before { content: "\2713" / ""; }
.design-list a:hover, .design-list a:focus-visible { background: var(--tan); color: var(--on-tan); }

/* ------------------------------------------------------------------ screenshot viewer */

/* The viewer covers the whole window. The image is fitted into the area under the bar; "Actual size" shows it
   pixel for pixel, and the area scrolls. Colours are fixed, because screenshots read best on dark. */
.viewer {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #12100E; color: #EEEAE3;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: #12100E; }
.viewer [hidden] { display: none !important; }
html.viewer-open { overflow: hidden; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; }
.viewer-count { margin: 0; color: #B7B0A6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viewer-count:empty { display: none; }
.viewer-caption { margin: 0; flex: 1 1 14rem; min-width: 0; font-weight: 650; }
.viewer-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.viewer-button {
  min-height: 44px; padding: 8px 16px;
  border: 2px solid #EEEAE3; border-radius: 7px;
  background: #1C1A17; color: #EEEAE3;
  font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.viewer-button:hover { background: #C8873F; border-color: #C8873F; color: #1C1A17; }
.viewer-button:focus-visible { outline: 3px solid #C8873F; outline-offset: 2px; }
.viewer-stage { position: relative; flex: 1 1 auto; min-height: 0; margin: 0 16px 16px; }
.viewer-image { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; border-radius: 6px; }
.viewer-image.can-zoom { cursor: zoom-in; }
.viewer.is-actual .viewer-stage { overflow: auto; overscroll-behavior: contain; }
.viewer.is-actual .viewer-image { position: static; max-width: none; max-height: none; margin: 0 auto; border-radius: 0; cursor: zoom-out; }
.viewer.is-loading .viewer-image { visibility: hidden; }
.viewer-problem { position: absolute; inset: 0; margin: auto; height: fit-content; max-width: 40ch; text-align: center; }
.viewer-arrow { display: none; }
@media (max-width: 600px) {
  .viewer-bar { padding: 8px 12px; gap: 6px 10px; }
  .viewer-tools { order: -1; width: 100%; margin-left: 0; gap: 6px; }
  .viewer-close { margin-left: auto; }
  .viewer-button { padding: 6px 14px; font-size: 0.9375rem; }
  .viewer-arrow { display: inline; font-size: 1.25rem; line-height: 1; }
  .viewer-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .viewer-caption { font-size: 0.9375rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .viewer-stage { margin: 0 8px 8px; }
}

/* ------------------------------------------------------------------ dark mode details */

@media (prefers-color-scheme: dark) {
  .copy-button { border-color: #5C564E; }
}

/* ------------------------------------------------------------------ smaller screens */

@media (max-width: 1000px) {
  .project-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "facts" "prose"; gap: 48px; }
  .facts { position: static; max-width: 560px; }
}

@media (max-width: 820px) {
  .row { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "icon name kind" "icon line line"; gap: 4px 16px; padding-block: 16px; }
  .row-icon { width: 52px; height: 52px; border-radius: 12px; }
  .row-icon--mono { font-size: 1.25rem; }
}

@media (max-width: 600px) {
  body { font-size: 1.0625rem; }
  .site-header { padding-block: 16px 8px; }
  .site-nav ul { gap: 4px 20px; }
  .row { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "icon name" "icon line" "icon kind"; align-items: start; gap: 2px 14px; }
  .row-icon { width: 48px; height: 48px; border-radius: 11px; margin-top: 4px; }
  .row-kind { text-align: left; font-size: 0.875rem; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-links { justify-content: flex-start; }
  .design-switch { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
  .design-list { right: auto; left: 0; }
  .brand { font-size: 1.375rem; }
  .fact { grid-template-columns: 6rem minmax(0, 1fr); }
  .button { flex: 1 1 100%; }
}

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

@media (forced-colors: active) {
  /* The two-colour wordmark would be invisible here, so it uses the system text colour. */
  .brand-name { background: none; color: CanvasText; }
  .row:hover, .row:focus-visible { outline: 2px solid CanvasText; }
  .facts, .facts dl, .fact { border-color: CanvasText; }
}

@media print {
  .site-header nav, .site-footer, .actions, .more, .copy-button { display: none; }
  .facts { position: static; }
  body { background: #fff; color: #000; }
}

/* ------------------------------------------------------------------ home masthead: the tan saddle */

.page-home .site-header, .intro-band { background: var(--band); color: var(--on-tan); }
.intro-band { margin-bottom: clamp(40px, 6vw, 72px); }
.intro-band .intro { padding-block: clamp(32px, 6vw, 72px) clamp(36px, 5vw, 64px); }
/* Sized so that each half of the sentence fits on one line on a desktop screen. */
.intro-band .intro-title { max-width: none; font-size: clamp(2.75rem, 0.9rem + 6.2vw, 6.75rem); line-height: 0.98; letter-spacing: -0.045em; margin-bottom: 0.36em; }
.intro-line { display: block; }
.intro-line--first { --casl: 0; }
/* "made by one person." starts in the same linear voice as the first line and relaxes into the casual voice: the precise work, and the person behind it. This is the only motion on the site that runs without a click. */
.intro-line--second { --casl: 1; animation: relax 1.5s cubic-bezier(0.65, 0, 0.25, 1) 0.4s both; }
@keyframes relax {
  from { font-variation-settings: "CASL" 0, "MONO" 0; }
  to { font-variation-settings: "CASL" 1, "MONO" 0; }
}
/* On the tan masthead the page itself is the tan of the coat, so the wordmark is all saddle. */
.page-home .brand-name { background: none; color: var(--on-tan); }
.intro-band .lede, .intro-band .latest { color: var(--on-tan); }
.intro-band a, .page-home .site-header a { color: var(--on-tan); }
.page-home .site-nav a:hover { border-bottom-color: rgb(28 26 23 / 0.35); }
.page-home .site-nav a[aria-current="page"] { border-bottom-color: var(--on-tan); }
.page-home .brand { color: var(--on-tan); }
.page-home .brand:hover .brand-name { text-decoration-color: var(--on-tan); }
.intro-band :focus-visible, .page-home .site-header :focus-visible { outline-color: var(--on-tan); }
.intro-band ::selection { background: var(--on-tan); color: var(--tan); }
@media (prefers-color-scheme: dark) {
  .page-home .site-nav a:hover { border-bottom-color: rgb(23 21 19 / 0.4); }
}

/* ------------------------------------------------------------------ home sections */

.home-section { padding-top: clamp(40px, 6vw, 80px); }
.page-home .intro-band { margin-bottom: 0; }
.section-head { margin-bottom: clamp(24px, 4vw, 44px); }
/* Section titles stay below the size of the project names, so the page reads as a list of things, not of headings. */
.section-title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem);
  line-height: 1; font-weight: 830; letter-spacing: -0.03em;
  --casl: var(--voice);
}
.section-intro { margin: 0; max-width: 52ch; font-size: 1.125rem; color: var(--ink-2); }
.home-section .group + .group { margin-top: clamp(40px, 5vw, 64px); }

/* The games band: the Alsatian's black saddle. Game art reads best on dark. */
:root { --saddle: #1C1A17; --saddle-text: #EEEAE3; --saddle-text-2: #B7B0A6; --saddle-rule: #4A443D; }
@media (prefers-color-scheme: dark) { :root { --saddle: #24201D; --saddle-rule: #4A443D; } }

.band--ink {
  background: var(--saddle); color: var(--saddle-text);
  margin-top: clamp(64px, 8vw, 112px);
  padding-block: clamp(48px, 7vw, 96px);
}
.band--ink .section-intro, .band--ink .tile-meta { color: var(--saddle-text-2); }
.band--ink a:not(.tile):not(.button) { color: #E0A964; }
.band--ink :focus-visible { outline-color: var(--tan); }
.band--ink .group-title { border-bottom-color: var(--saddle-text); }
.band--ink + .home-section { padding-top: clamp(56px, 7vw, 96px); }

.shelf {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
}
.shelf > li { display: flex; min-width: 0; }
.tile {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  padding: 10px 10px 16px;
  border-radius: 14px;
  color: inherit; text-decoration: none;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.tile-cover {
  width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 9px; margin-bottom: 10px; background: #2B2724;
}
.tile-name {
  margin: 0;
  font-size: clamp(1.375rem, 1rem + 1vw, 1.875rem); line-height: 1.1;
  font-weight: 780; letter-spacing: -0.02em;
  --casl: var(--voice);
}
.tile-meta { margin: 0; font-size: 0.9375rem; }
a.tile:hover, a.tile:focus-visible { background: var(--tan); color: #1C1A17; }
a.tile:hover .tile-meta, a.tile:focus-visible .tile-meta { color: #1C1A17; }
a.tile:focus-visible { outline: 3px solid var(--saddle-text); outline-offset: 0; }
.shelf-more { margin: clamp(24px, 3vw, 36px) 0 0; color: var(--saddle-text-2); }

/* "More games" under a game page uses the same band. */
.more.band--ink { margin-top: clamp(64px, 8vw, 112px); }
.more.band--ink .group-title { margin-bottom: 20px; }

/* ------------------------------------------------------------------ tracks (experiments) */

.tracks {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
}
.tracks > li { display: flex; min-width: 0; }
.track {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 8px 8px 14px; border-radius: 12px;
  color: var(--ink); text-decoration: none;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.media .track img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 8px; max-height: none; }
.track-title { font-weight: 750; font-size: 1.125rem; line-height: 1.25; }
.track-note { color: var(--ink-2); font-size: 0.9375rem; }
.track:hover, .track:focus-visible { background: var(--tan); color: var(--on-tan); }
.track:hover .track-note, .track:focus-visible .track-note { color: var(--on-tan); }

/* ------------------------------------------------------------------ updates by year */

.year + .year { margin-top: clamp(48px, 6vw, 72px); }
.year-title { margin: 0 0 12px; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); line-height: 1; font-weight: 830; letter-spacing: -0.035em; }

@media (max-width: 900px) {
  .shelf, .tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .shelf { grid-template-columns: minmax(0, 1fr); }
  .tracks { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-color-scheme: dark) {
  .row-icon--mono { box-shadow: inset 0 0 0 1px #3A3530; }
}
