/* ==========================================================================
   Ridgeline: the design system for geoffleediker.com
   Two themes share one set of tokens: Night (default) and Daytime (Clear morning).
   A theme is set with data-theme="night" | "day" on <html>, or on any element
   to force that theme inside it.
   ========================================================================== */

/* ---------- Tokens: Night (default) ---------- */

:root,
[data-theme="night"] {
  /* Scene */
  --sky: #13222A;
  --ridge-far: #1A2E36;
  --ridge-mid: #1C333B;
  --ridge-near: #16282F;
  --sun: #F28C38;
  --sun-left: 78.5%;        /* across the ridge box */
  --sun-bottom: 63%;        /* up from the bottom of the ridge box: low, at the ridgeline */
  --sun-opacity: 0.85;
  --sun-glow: 0;
  --stars: 0.8;

  /* Surfaces */
  --bg: #0F1A1F;
  --surface: #1A2C33;
  --border: #2B444D;
  --rule: #4C6670;          /* dashed lines, nav separators */
  --control-bg: rgba(15, 26, 31, 0.6);

  /* Text */
  --text: #F0ECE2;
  --text-soft: #CFCABD;
  --text-muted: #A3A69E;

  /* Accent and status */
  --accent: #F28C38;
  --on-accent: #0F1A1F;
  --status-live: #9DDCB2;
  --status-beta: #F2CB7A;
  --status-dev: #A3A69E;

  /* The live sky recolors text inside the hero; the caption chip keeps the page's own. */
  --page-text-soft: var(--text-soft);
  --chip-bg: rgba(15, 26, 31, 0.8);

  color-scheme: dark;
}

/* ---------- Tokens: Daytime (Clear morning) ---------- */

[data-theme="day"] {
  --sky: #CFE3EC;
  --ridge-far: #A3BEC8;
  --ridge-mid: #7FA2A2;
  --ridge-near: #4E7766;
  --sun: #FFF1C9;
  --sun-left: 75%;
  --sun-bottom: 81%;        /* high in the morning sky */
  --sun-opacity: 1;
  --sun-glow: 0.45;
  --stars: 0;

  --bg: #F4F2EC;
  --surface: #FFFFFF;
  --border: #D9D3C5;
  --rule: #9AABAB;
  --control-bg: rgba(255, 255, 255, 0.6);

  --text: #15262B;
  --text-soft: #3C4D51;
  --text-muted: #53605F;    /* dark enough for small labels on the sky too */

  --accent: #A84A16;
  --on-accent: #FFFFFF;
  --status-live: #276B43;
  --status-beta: #85570C;
  --status-dev: #53605F;

  --page-text-soft: var(--text-soft);
  --chip-bg: rgba(244, 242, 236, 0.9);

  color-scheme: light;
}

/* On narrower screens the morning sun sits further right and lower, so its
   glow stays clear of the hero text. */
@media (max-width: 1024px) {
  [data-theme="day"] {
    --sun-left: 85%;
    --sun-bottom: 62%;
  }
}

/* ---------- Web fonts (self-hosted, Latin set, SIL Open Font License) ----------
   Variable fonts from Google Fonts: one file covers every weight used.
   Licenses are in assets/fonts/OFL-*.txt. */

@font-face {
  font-family: "Bitter";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../fonts/bitter-latin.woff2") format("woff2");
  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: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin.woff2") format("woff2");
  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: "Source Sans 3";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-italic-latin.woff2") format("woff2");
  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: "Source Code Pro";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/source-code-pro-latin.woff2") format("woff2");
  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;
}

/* ---------- Fallback fonts ----------
   While the web fonts load, text shows in a local font scaled to the same width,
   so nothing re-wraps or jumps when Bitter and Source Sans 3 arrive. */

@font-face {
  font-family: "Bitter Fallback";
  src: local("Georgia Bold"), local("Georgia-Bold");
  font-weight: 600 700;
  size-adjust: 91.3%;
  ascent-override: 102.4%;
  descent-override: 29%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Sans Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  font-weight: 400 500;
  size-adjust: 92.4%;
}

@font-face {
  font-family: "Source Sans Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold");
  font-weight: 600 700;
  size-adjust: 92.4%;
}

/* ---------- Tokens shared by both themes ---------- */

:root {
  --font-display: "Bitter", "Bitter Fallback", Georgia, serif;
  --font-body: "Source Sans 3", "Source Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, "SF Mono", Menlo, monospace;

  --text-base: 18px;
  --text-small: 15px;
  --text-label: 12px;
  --size-hero: clamp(40px, 6.4vw, 80px);
  --size-section: clamp(30px, 3.6vw, 42px);
  --size-project: clamp(22px, 2.4vw, 28px);

  --radius: 12px;
  --radius-sm: 10px;
  --wrap: 1120px;
  --gutter: 28px;

  --theme-duration: 1.4s;
}

@media (max-width: 600px) {
  :root {
    --text-base: 17px;
    --gutter: 20px;
  }
}

/* ---------- Base ---------- */

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

a:hover {
  color: var(--accent);
}

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

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

/* Small mono label used for eyebrows, dates and metadata. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Theme change animation ----------
   ridgeline.js adds .theme-anim to <html> for the length of a theme switch, so
   colors cross-fade only then (not on page load or on hover). */

.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition:
    background-color var(--theme-duration) ease,
    color var(--theme-duration) ease,
    border-color var(--theme-duration) ease,
    fill var(--theme-duration) ease,
    opacity var(--theme-duration) ease,
    transform var(--theme-duration) ease !important;
}

/* ---------- Navigation ---------- */

.site-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 0;
}

.site-nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 23px;
  text-decoration: none;
}

.site-nav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  font-weight: 500;
}

.site-nav__links li + li::before {
  content: "/";
  margin-right: 16px;
  color: var(--rule);
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav__link[aria-current] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.site-nav__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

/* The theme button shows a sun at night (go to day) and a moon by day. */
.theme-toggle .icon-moon,
[data-theme="day"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="day"] .theme-toggle .icon-moon {
  display: block;
}

.menu-toggle {
  display: none;
}

/* The theme button needs JavaScript; hide it when scripts can't run. */
html:not(.js) .theme-toggle {
  display: none;
}

/* On phones the links fold into a menu, but only when JavaScript is running
   (html.js); without it the links simply wrap. */
@media (max-width: 720px) {
  .js .menu-toggle {
    display: inline-flex;
  }

  .js .site-nav__brand {
    flex: 1;
  }

  .js .site-nav__links {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
  }

  .js .site-nav.is-open .site-nav__links {
    display: flex;
  }

  .js .site-nav__links li + li::before {
    content: none;
  }

  .js .site-nav__links li + li {
    border-top: 1px solid var(--border);
  }

  .js .site-nav__link {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-bottom: 0;
    border-left: 3px solid transparent;
    color: var(--text);
  }

  .js .site-nav__link[aria-current] {
    border-left-color: var(--accent);
  }

  .site-nav__brand {
    font-size: 20px;
  }
}

/* ---------- Hero with the ridge scene ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--sky);
}

.hero__scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: #F0ECE2;
  opacity: var(--stars);
}

/* The ridge drawing stretches to fit; the sun sits in the same box but is its
   own element so it stays round at every screen width. */
.ridges-box {
  --sun-size: 96px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;             /* tuck under the edge so no sky seam shows */
  height: 420px;
}

.ridges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sun {
  position: absolute;
  left: var(--sun-left);
  bottom: var(--sun-bottom);
  width: var(--sun-size);
  height: var(--sun-size);
  transform: translate(-50%, 50%);
}

.sun__disc,
.sun__glow {
  position: absolute;
  border-radius: 50%;
  background: var(--sun);
}

.sun__disc {
  inset: 0;
  opacity: var(--sun-opacity);
}

.sun__glow {
  inset: -70%;
  opacity: var(--sun-glow);
}

.theme-anim .sun {
  transition: left var(--theme-duration) ease, bottom var(--theme-duration) ease !important;
}

.ridge--far  { fill: var(--ridge-far); }
.ridge--mid  { fill: var(--ridge-mid); }
.ridge--near { fill: var(--ridge-near); }
.ridge--base { fill: var(--bg); }

/* The far ridge drifts slowly, like moving haze. */
@keyframes ridge-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-40px); }
}

.ridge--far {
  animation: ridge-drift 40s ease-in-out infinite alternate;
}

.hero__body {
  position: relative;
  max-width: 780px;
  padding: 100px 0 300px;
}

.hero__eyebrow {
  margin-bottom: 18px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}

.hero__title {
  font-size: var(--size-hero);
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.hero__lede {
  max-width: 580px;
  margin-top: 26px;
  font-size: 20px;
  color: var(--text-soft);
}

.hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 34px;
}

/* Shorter hero for project pages and blog posts. */
.hero--compact .ridges-box {
  --sun-size: 52px;
  height: 170px;
}

.hero--compact .hero__body {
  padding: 40px 0 170px;
}

.hero--compact .hero__title {
  font-size: clamp(36px, 5.4vw, 64px);
}

@media (max-width: 600px) {
  /* Stars would sit behind the headline on a phone. */
  .stars {
    display: none;
  }

  .ridges-box {
    --sun-size: 56px;
    height: 220px;
  }

  .hero__body {
    padding: 44px 0 240px;
  }

  .hero__lede {
    font-size: 17px;
  }

  .hero--compact .ridges-box {
    --sun-size: 36px;
    height: 120px;
  }

  .hero--compact .hero__body {
    padding: 24px 0 120px;
  }
}

/* ---------- Live sky (homepage hero, driven by assets/js/sky.js) ----------
   sky.js sets the scene variables (--sky, --sky-top, ridges, sun, --moon, --fog,
   --veil, hero text colors) inline on .hero[data-sky]. Without JavaScript, or when a
   visitor pins night or day, none of this shows and the classic scene stays. */

.hero[data-sky] {
  color: var(--text);
}

.sky__top {
  position: absolute;
  inset: 0;
  background: var(--sky-top, var(--sky));
  /* The upper sky holds past the hero text; the horizon color glows in below it,
     so text keeps AA contrast even at dawn and dusk. */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 42%, rgba(0, 0, 0, 0.93) 52%, rgba(0, 0, 0, 0.75) 64%, rgba(0, 0, 0, 0.45) 77%, rgba(0, 0, 0, 0.16) 90%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 42%, rgba(0, 0, 0, 0.93) 52%, rgba(0, 0, 0, 0.75) 64%, rgba(0, 0, 0, 0.45) 77%, rgba(0, 0, 0, 0.16) 90%, transparent 100%);
}

.moon {
  position: absolute;
  left: 76%;
  top: 20%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  opacity: var(--moon, 0);
}

/* sky.js draws the lit part for tonight's phase; the rest shows faintly. */
.moon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.moon__dark {
  fill: rgba(233, 228, 212, 0.1);
}

.moon__lit {
  fill: #E9E4D4;
  filter: drop-shadow(0 0 8px rgba(233, 228, 212, 0.4));
}

.sky-clouds,
.sky-veil,
.sky-precip {
  position: absolute;
  inset: 0;
}

.sky-precip {
  width: 100%;
  height: 100%;
}

@keyframes sky-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--drift)); }
}

.sky-cloud {
  position: absolute;
  will-change: transform;
  animation: sky-drift var(--dur) ease-in-out var(--delay) infinite alternate;
}

.sky-cloud svg {
  display: block;
  overflow: visible;
}

/* Mist pooled between the ridges (sizes follow the ridge box: 420px, 220px on phones). */
.sky-fog {
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent, var(--fog-color, #ECEFED), transparent);
  opacity: var(--fog, 0);
}

.sky-fog--high { bottom: 197px; height: 168px; }
.sky-fog--low  { bottom: 71px;  height: 140px; }

/* Rain haze: softens the distance, strongest near the ridges. */
.sky-veil {
  background: linear-gradient(180deg, transparent 35%, var(--sky) 75%, transparent 100%);
  opacity: var(--veil, 0);
}

/* Changes in the live sky cross-fade (sky.js adds this after the first paint). */
.hero.sky-smooth,
.hero.sky-smooth .sky__top,
.hero.sky-smooth .stars,
.hero.sky-smooth .moon,
.hero.sky-smooth .sun,
.hero.sky-smooth .sun__disc,
.hero.sky-smooth .sun__glow,
.hero.sky-smooth .ridge,
.hero.sky-smooth .sky-cloud,
.hero.sky-smooth .sky-cloud stop,
.hero.sky-smooth .sky-cloud path,
.hero.sky-smooth .sky-fog,
.hero.sky-smooth .sky-veil,
.hero.sky-smooth .hero__eyebrow,
.hero.sky-smooth .hero__lede,
.hero.sky-smooth .site-nav__link {
  transition:
    background-color var(--theme-duration) ease,
    color var(--theme-duration) ease,
    fill var(--theme-duration) ease,
    stop-color var(--theme-duration) ease,
    opacity var(--theme-duration) ease,
    left var(--theme-duration) ease,
    bottom var(--theme-duration) ease;
}

.hero.sky-paused .ridge--far,
.hero.sky-paused .sky-cloud {
  animation-play-state: paused;
}

/* Caption chip: "Live from Beaverton · 8:15 PM · Overcast, 56°F" + pause. */
.hero > .wrap {
  position: relative;
}

.sky-chip {
  position: absolute;
  left: var(--gutter);
  bottom: 22px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 5px 5px 5px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--page-text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
}

.sky-chip[hidden] {
  display: none;
}

.sky-chip__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.sky-chip.is-pinned .sky-chip__dot {
  background: currentColor;
  opacity: 0.6;
}

.sky-chip__pause,
.sky-chip__back {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.sky-chip__pause {
  width: 30px;
  padding: 0;
  border-radius: 50%;
}

.sky-chip__pause svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.sky-chip__pause .icon-play,
.sky-chip__pause[aria-pressed="true"] .icon-pause {
  display: none;
}

.sky-chip__pause[aria-pressed="true"] .icon-play {
  display: block;
}

.sky-chip__back {
  padding: 0 12px;
  border-radius: 999px;
}

.sky-chip__back[hidden],
.sky-chip__pause[hidden] {
  display: none;
}

/* On tablets and phones the moon sits low by the ridges, like the sun, clear of the text. */
@media (max-width: 1024px) {
  .moon {
    left: 85%;
    top: auto;
    bottom: 260px;
    transform: translate(-50%, 50%);
  }
}

/* Until sky.js decides (a moment after load), don't flash the classic sun. */
html.js:not([data-pin]) .hero[data-sky]:not(.sky-ready) .sun {
  visibility: hidden;
}

@media (max-width: 600px) {
  .sky-fog--high { bottom: 103px; height: 88px; }
  .sky-fog--low  { bottom: 37px;  height: 73px; }

  .moon {
    bottom: 136px;
    width: 40px;
    height: 40px;
  }

  /* Phones: "Live from Beaverton" on the first line, time and weather below. */
  .sky-chip {
    bottom: 14px;
    border-radius: 18px;
    font-size: 11px;
  }

  .sky-chip__sep {
    display: none;
  }

  .sky-chip__rest {
    display: block;
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sky-cloud {
    animation: none;
  }
}

@media print {
  .sky-chip {
    display: none !important;
  }
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  color: var(--on-accent);
  filter: brightness(1.08);
}

.text-link {
  font-weight: 500;
  text-underline-offset: 5px;
}

/* Accent link with a trailing arrow, e.g. "See it in action →". */
.link-arrow {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.link-arrow:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 600px) {
  .hero__actions .btn {
    width: 100%;
  }
}

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

.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section--first {
  padding-top: 40px;
  border-top: 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.section__title {
  font-size: var(--size-section);
}

@media (max-width: 600px) {
  .section {
    padding: 40px 0;
  }
}

/* ---------- Status stamps ---------- */

.stamp {
  --stamp-color: var(--status-dev);
  --tilt: 0deg;
  display: inline-block;
  padding: 3px 10px;
  border: 1.5px solid var(--stamp-color);
  color: var(--stamp-color);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(var(--tilt));
}

.stamp--live { --stamp-color: var(--status-live); --tilt: -2deg; }
.stamp--beta { --stamp-color: var(--status-beta); --tilt: 1.5deg; }
.stamp--dev  { --stamp-color: var(--status-dev);  --tilt: 2deg; }
.stamp--open { --stamp-color: var(--accent);      --tilt: -2deg; }

/* ---------- Spec list (ROLE / STACK / PROOF) ---------- */

.spec {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0;
  font-size: 16px;
}

.spec dt {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.spec dd {
  margin: 0;
}

.spec--boxed {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- Project bars (click to open) ----------
   Built on <details>/<summary>, so they work without JavaScript. Giving every
   project the same name="" makes only one open at a time. */

.projects {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}

.project__bar::-webkit-details-marker {
  display: none;
}

.project__bar:hover,
.project[open] > .project__bar {
  border-color: var(--accent);
}

.project__name {
  flex: 1 1 220px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--size-project);
  line-height: 1.15;
}

.project__line {
  flex: 0 1 280px;
  font-size: 16px;
  color: var(--text-soft);
}

/* The round +/− button at the end of a bar. */
.project__sign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.project__sign::before {
  content: "+";
}

.project[open] .project__sign::before {
  content: "\2212";
}

.project__body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 28px;
  align-items: start;
  padding: 22px 4px 18px;
}

.project__media img,
.project__media .placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.project__text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project__text p {
  color: var(--text-soft);
}

/* On phones: name and +/− on the first row, then the stamp, then the one-liner. */
@media (max-width: 600px) {
  .project__bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name sign"
      "stamp stamp"
      "line line";
    gap: 8px 12px;
    padding: 14px 16px;
  }

  .project__name { grid-area: name; }
  .project__sign { grid-area: sign; }
  .project__line { grid-area: line; }

  .project__bar > .stamp {
    grid-area: stamp;
    justify-self: start;
  }
}

/* Stand-in box for media that doesn't exist yet. */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}

/* Smaller dashed cards for secondary work. */
.mini-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  text-decoration: none;
}

.mini-card:hover {
  border-color: var(--accent);
  color: inherit;
}

.mini-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}

.mini-card__text {
  font-size: var(--text-small);
  color: var(--text-soft);
}

/* Blog post preview card. */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
}

.post-card:hover {
  border-color: var(--accent);
  color: inherit;
}

.post-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

.post-card__excerpt {
  font-size: var(--text-small);
  color: var(--text-soft);
}

/* Previous / next links at the bottom of project and blog pages. */
.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 14px;
}

.pager__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  line-height: 1.4;
}

.pager__link:hover {
  border-color: var(--accent);
  color: inherit;
}

.pager__link--next {
  text-align: right;
}

.pager__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

/* Highlighted note, e.g. "What didn't work". */
.callout {
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--accent);
  background: var(--surface);
}

.callout h3 {
  margin: 14px 0 10px;
  font-size: 24px;
}

.callout p {
  color: var(--text-soft);
}

/* ---------- Chips and tags ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--text-small);
}

.tag {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--text-soft);
}

/* ---------- Timeline ("The trail so far") ---------- */

.trail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 24px;
  margin: 0;
  padding: 22px 0 0;
  list-style: none;
  border-top: 2px dashed var(--rule);
}

.trail__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trail__when {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.trail__where {
  font-size: var(--text-small);
  color: var(--text-muted);
}

/* On phones the line runs down the left side instead of across the top. */
@media (max-width: 600px) {
  .trail {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 0 0 20px;
    border-top: 0;
    border-left: 2px dashed var(--rule);
  }
}

/* ---------- Media ---------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: 28px;
}

.figure {
  margin: 0;
}

.figure img,
.figure video {
  width: 100%;
  border-radius: var(--radius);
}

.figure figcaption {
  margin-top: 10px;
  font-size: var(--text-small);
  color: var(--text-muted);
}

/* ---------- Long-form text (blog posts, case studies) ---------- */

.prose {
  max-width: 720px;
  margin: 0 auto;
  font-size: 19px;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 24px;
}

.prose h2 {
  margin-top: 44px;
  font-size: 30px;
  line-height: 1.2;
}

.prose h3 {
  margin-top: 36px;
  font-size: 24px;
}

.prose a {
  color: var(--accent);
}

.prose blockquote {
  margin: 36px 0;
  padding: 20px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.4;
}

.prose code {
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li + li {
  margin-top: 8px;
}

.prose figure {
  margin: 36px 0;
}

.prose hr {
  margin: 44px 0;
  border: 0;
  border-top: 1px dashed var(--border);
}

@media (max-width: 600px) {
  .prose {
    font-size: 18px;
  }

  .prose blockquote {
    font-size: 20px;
  }
}

/* ---------- Inner pages (projects, case study, services, blog) ---------- */

.page-head__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-small);
  color: var(--text-soft);
  text-decoration: none;
}

.page-head__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 8px;
}

.page-head__sub {
  margin-top: 12px;
  font-size: 20px;
  color: var(--text-soft);
}

.page-head .tag-row {
  margin-top: 18px;
}

/* Blog posts: header lines up with the 720px reading column. */
.page-head--narrow {
  max-width: 720px;
  margin: 0 auto;
}

/* Intro text beside a boxed spec list. */
.overview {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  padding: 24px 0 56px;
}

.overview__main {
  flex: 2 1 480px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.overview__aside {
  flex: 1 1 280px;
  align-self: flex-start;
}

.overview__lede {
  font-size: 20px;
}

.overview__main > p:not(.overview__lede) {
  color: var(--text-soft);
}

/* Links inside running text */
.overview__main p a,
.section p a,
.list a,
.callout a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 6px;
}

/* Bulleted list with bold lead-ins ("Deterministic. The same seed…"). */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: var(--text-soft);
}

.list strong {
  color: var(--text);
}

/* Short facts as tiles ("What emerges"). */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tiles li {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
}

.tiles strong {
  font-family: var(--font-display);
  color: var(--text);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 40px;
  align-items: start;
}

.section__intro {
  max-width: 720px;
  margin-bottom: 28px;
  color: var(--text-soft);
}

.note {
  font-size: var(--text-small);
  color: var(--text-muted);
}

.section h3 {
  margin: 32px 0 14px;
  font-size: 22px;
}

/* Media grid variants */
.figure a {
  display: block;
}

.media-grid--crop img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
}

/* Mixed shapes in one grid: same frame for every image, nothing cropped. */
.media-grid--even img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #0B1114;
}

.media-grid--phones {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 560px;
}

.media-grid--phones img {
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
}

.figure img,
.figure video {
  border: 1px solid var(--border);
}

.figure video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

/* Architecture diagram (case study): layers top to bottom, joined by dashed links. */
.arch {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.arch__layer {
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.arch__layer h3 {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.arch__sub {
  margin-bottom: 14px;
  font-size: var(--text-small);
  color: var(--text-soft);
}

.arch__nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arch__node {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.arch__node strong {
  display: block;
  font-size: 16px;
}

.arch__node span {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
}

.arch__flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--text-muted);
  text-align: center;
}

.arch__flow::before {
  content: "";
  height: 18px;
  margin-bottom: 6px;
  border-left: 2px dashed var(--rule);
}

/* Cost table (case study) */
.table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cost-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 16px;
}

.cost-table th,
.cost-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cost-table th[scope="row"] {
  text-align: left;
  font-weight: 500;
  color: var(--text-soft);
}

.cost-table thead th {
  background: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  vertical-align: bottom;
}

.cost-table thead th:first-child {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
}

.cost-table thead th span {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 400;
  color: var(--text-muted);
}

.cost-table tfoot th,
.cost-table tfoot td {
  border-bottom: 0;
  background: var(--surface);
  font-weight: 700;
  color: var(--text);
}

/* Services */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 16px;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.service-card h3 {
  margin: 0;
  font-size: 24px;
}

.service-card__outcome {
  font-weight: 600;
}

.service-card ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  font-size: 16px;
  color: var(--text-soft);
}

.service-card .link-arrow {
  margin-top: auto;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-soft);
  counter-increment: step;
}

.steps li strong {
  color: var(--text);
}

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
}

/* Blog index */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-list .post-card__title {
  font-size: 26px;
}

.post-list .tag-row {
  margin-top: 6px;
}

.post-page {
  padding: 24px var(--gutter) 40px;
}

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

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 88px 0 64px;
  border-top: 1px solid var(--border);
}

.site-footer__title {
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 1.05;
}

.site-footer__text {
  max-width: 560px;
  color: var(--text-soft);
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  color: var(--text-muted);
}

.site-footer__meta a {
  color: inherit;
}

/* Shorter footer for inner pages: title and button on one row. */
.site-footer--compact {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 48px 0 56px;
}

.site-footer--compact .site-footer__title {
  font-size: clamp(26px, 3vw, 32px);
}

.site-footer--compact .site-footer__meta {
  width: 100%;
  margin-top: 4px;
}

/* The quiet "How this site works" strip inside the footer. */
.how-strip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}

.how-strip__title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.how-strip__steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-small);
  color: var(--text-soft);
}

.how-strip__steps li:not(:last-child)::after {
  content: "\2192";
  margin-left: 10px;
  color: var(--accent);
}

.how-strip__text {
  max-width: 760px;
  font-size: 14px;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .site-footer {
    padding: 48px 0 56px;
  }

  .site-footer .btn {
    width: 100%;
  }
}

/* ---------- Games: the menu cards and the arcade bezel ----------
   The bezel is a physical "cabinet" around each game, so it stays dark in both
   themes. Each game page sets its own colors on .bezel with --a1, --a2,
   --marquee, --marquee-ink and --marquee-glow. games.js loads the game into the
   screen only when Play is pressed, and handles full screen. */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 32px;
}

.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.game-card__shot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-bottom: 4px solid var(--card-accent, var(--accent));
}

.game-card__shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card__play {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 10, 20, 0.75);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 15px;
}

.game-card__play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.game-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px 24px;
}

.game-card__title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.game-card__title {
  font-size: var(--size-project);
}

.game-card__tagline {
  margin: 0;
  color: var(--text-soft);
}

.game-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.game-needs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--text-soft);
  font-size: var(--text-small);
}

.game-needs svg {
  width: 18px;
  height: 18px;
}

.game-card__cta {
  color: var(--accent);
  font-weight: 600;
}

/* The arcade bezel */
.bezel {
  --a1: #F28C38;
  --a2: #F28C38;
  --marquee: #1A2C33;
  --marquee-ink: #F0ECE2;
  --marquee-glow: none;
  max-width: 1040px;
  margin: 0 auto;
  overflow: hidden;
  border-left: 9px solid var(--a1);
  border-right: 9px solid var(--a2);
  border-radius: 18px;
  background: #0B0B12;
  color: #CFCABD;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.bezel__marquee {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(56px, 8vw, 86px);
  padding: 0 16px;
  background: var(--marquee);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
}

.bezel__name {
  font-family: Futura, "Avenir Next", "Trebuchet MS", sans-serif;
  font-size: clamp(24px, 4.5vw, 48px);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--marquee-ink);
  text-shadow: var(--marquee-glow);
  white-space: nowrap;
}

.bezel__glass {
  padding: 20px 22px 0;
}

.bezel__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 10px solid #000;
  border-radius: 6px;
  background: #000;
}

.bezel__screen > img,
.bezel__screen > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

/* The game runs at a fixed 1280-pixel width (games.js sets the size) and is
   shrunk to fit the screen, so it always sees the same window and nothing gets
   cut off on smaller screens. */
.bezel__screen > iframe {
  right: auto;
  bottom: auto;
  width: var(--game-w, 100%);
  height: var(--game-h, 100%);
  transform: scale(var(--game-scale, 1));
  transform-origin: top left;
}

/* Full screen: just the game, edge to edge, at its real size. */
.bezel__screen:fullscreen {
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

.bezel__screen:fullscreen > iframe {
  width: 100%;
  height: 100%;
  transform: none;
}

.bezel__play {
  position: absolute;
  inset: 0;
  width: 96px;
  height: 96px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(10, 10, 20, 0.62);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.bezel__play:hover {
  transform: scale(1.06);
  background: rgba(10, 10, 20, 0.8);
}

.bezel__play:focus-visible,
.bezel__fs:focus-visible,
.bezel__note button:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 3px;
}

.bezel__play svg {
  width: 38px;
  height: 38px;
  margin-left: 5px;
  fill: currentColor;
}

/* Shown instead of Play when a keyboard-only game is opened on a touch screen,
   and as the no-JavaScript message. */
.bezel__note {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(92%, 460px);
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10, 10, 20, 0.86);
  color: #F0ECE2;
  text-align: center;
  font-size: 16px;
  line-height: 1.4;
}

.bezel__note p {
  margin: 0;
}

.bezel__note button {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.bezel__deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 22px 18px;
}

.bezel__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.bezel__led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #F28C38;
  box-shadow: 0 0 8px #F28C38;
}

.bezel.is-playing .bezel__led {
  background: #9DDCB2;
  box-shadow: 0 0 8px #9DDCB2;
}

.bezel__buttons {
  display: inline-flex;
  gap: 10px;
}

.bezel__buttons span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--a1);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
}

.bezel__buttons span + span {
  background: var(--a2);
}

.bezel__fs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: #F0ECE2;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.bezel__fs:hover {
  background: rgba(255, 255, 255, 0.08);
}

.bezel__fs svg {
  width: 16px;
  height: 16px;
}

/* Hidden means hidden, even for parts with their own display. */
.bezel [hidden] {
  display: none !important;
}

/* Without JavaScript the game can't load, so there's no Play button. */
html:not(.js) .bezel__play,
html:not(.js) .bezel__fs {
  display: none;
}

.game-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 40px 56px;
  max-width: 1040px;
  margin: 48px auto 0;
}

.game-info h2 {
  margin-bottom: 14px;
  font-size: var(--size-project);
}

.game-info p {
  color: var(--text-soft);
}

.controls {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 16px;
  margin: 16px 0 0;
}

.controls dt {
  margin: 0;
}

.controls dd {
  margin: 0;
  color: var(--text-soft);
}

.game-needs-line {
  margin-top: 20px;
}

kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 8px;
  margin-right: 4px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 600px) {
  .bezel {
    border-left-width: 6px;
    border-right-width: 6px;
    border-radius: 14px;
  }

  .bezel__glass {
    padding: 12px 12px 0;
  }

  .bezel__screen {
    border-width: 6px;
  }

  .bezel__play {
    width: 72px;
    height: 72px;
  }

  .bezel__play svg {
    width: 28px;
    height: 28px;
  }

  .bezel__deck {
    padding: 12px 12px 14px;
  }

  .bezel__buttons {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-card,
  .bezel__play {
    transition: none;
  }

  .game-card:hover,
  .bezel__play:hover {
    transform: none;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .ridge--far {
    animation: none;
  }

  .theme-anim,
  .theme-anim *,
  .theme-anim *::before,
  .theme-anim *::after {
    transition: none !important;
  }
}

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

/* Printing always uses dark ink on white paper, whatever theme is showing. */
@media print {
  :root,
  [data-theme] {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --sky: #FFFFFF;
    --border: #C9C9C9;
    --rule: #999999;
    --text: #111111;
    --text-soft: #333333;
    --text-muted: #555555;
    --accent: #8A3A10;
    --on-accent: #FFFFFF;
    --status-live: #1F5A37;
    --status-beta: #6E4A0A;
    --status-dev: #555555;
  }

  body {
    font-size: 11pt;
  }

  .hero__scene,
  .site-nav__links,
  .site-nav__controls,
  .skip-link,
  .project__sign,
  .how-strip {
    display: none !important;
  }

  .hero {
    background: none;
  }

  .hero__body,
  .hero--compact .hero__body {
    padding: 0 0 20px;
  }

  .site-nav {
    padding: 0 0 12px;
  }

  .section {
    padding: 24px 0;
  }

  .btn {
    min-height: 0;
    padding: 0;
    background: none;
    color: var(--text);
    text-decoration: underline;
  }

  /* Show where outside links go. */
  .hero__actions a[href^="http"]::after,
  .actions a[href^="http"]::after,
  .hero__actions a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: var(--text-muted);
    word-break: break-all;
  }

  .project,
  .post-card,
  .mini-card,
  .arch__layer,
  .figure,
  .trail__item,
  .service-card,
  .callout,
  .cost-table tr {
    break-inside: avoid;
  }

  .media-grid img,
  .project__media img {
    max-height: 7cm;
    width: auto;
    aspect-ratio: auto;
  }

  .section__head .eyebrow {
    display: none;
  }
}
