/* Self-hosted latin subsets.
   Fraunces: SIL OFL 1.1, see assets/fonts/Fraunces-OFL.txt
   Source Sans 3: SIL OFL 1.1, see assets/fonts/SourceSans3-LICENSE.md */

@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 500 650;
  font-display: swap;
  src: url("../fonts/fraunces-roman.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: Fraunces;
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fraunces-italic-500.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-roman.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;
}

:root {
  color-scheme: light;
  --bg: #f4f0e7;
  --bg-raised: #fbf8f2;
  --ink: #1b1814;
  --muted: #5c564e;
  --line: rgba(27, 24, 20, 0.14);
  --line-strong: rgba(27, 24, 20, 0.32);
  --accent: #1c5c43;
  --wash: rgba(28, 92, 67, 0.09);
  --shadow: 0 18px 40px rgba(27, 24, 20, 0.08);
  --header-h: 4.25rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12110f;
  --bg-raised: #1c1b18;
  --ink: #f3efe6;
  --muted: #b7aea2;
  --line: rgba(243, 239, 230, 0.14);
  --line-strong: rgba(243, 239, 230, 0.34);
  --accent: #b7d7c6;
  --wash: rgba(183, 215, 198, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12110f;
    --bg-raised: #1c1b18;
    --ink: #f3efe6;
    --muted: #b7aea2;
    --line: rgba(243, 239, 230, 0.14);
    --line-strong: rgba(243, 239, 230, 0.34);
    --accent: #b7d7c6;
    --wash: rgba(183, 215, 198, 0.08);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Source Sans 3", "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 72rem 28rem at 8% -8%, var(--wash), transparent 60%);
  text-rendering: optimizeLegibility;
}

html.theme-ready body,
html.theme-ready .site-header,
html.theme-ready .slot {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

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

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
.work-title,
.brand-name,
.brand-mark,
.contact-email,
.quote blockquote p,
.slot :is(h2, h3),
.subsection h2,
.project h2 {
  font-family: Fraunces, "Iowan Old Style", Palatino, Georgia, serif;
  font-optical-sizing: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 75%, var(--ink));
}

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: color-mix(in srgb, var(--accent) 28%, var(--bg));
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  z-index: 30;
}

.skip-link:focus {
  transform: none;
}

.shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav tools";
  align-items: center;
  column-gap: 1.25rem;
  min-height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

@supports (background: color-mix(in srgb, white 92%, transparent)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
  }
}

@supports (backdrop-filter: blur(12px)) {
  .site-header {
    backdrop-filter: blur(14px);
  }
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 2.75rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-weight: 560;
  font-size: 0.78rem;
  letter-spacing: -0.04em;
  line-height: 1;
  border-radius: 2px;
}

.brand-name {
  font-weight: 560;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.site-nav {
  grid-area: nav;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.98rem;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.header-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.theme-toggle,
.nav-toggle {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
}

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  padding: 0;
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
}

.nav-toggle {
  display: none;
  min-height: 2.5rem;
  padding: 0 0.9rem;
}

.hero {
  padding: clamp(2.75rem, 8vw, 5.75rem) 0 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero h1 {
  margin: 0.7rem 0 0;
  font-weight: 560;
  font-size: clamp(2.8rem, 15vw, 7.25rem);
  line-height: 0.9;
  letter-spacing: -0.045em;
}

.hero h1 span {
  display: block;
}

.hero-grid {
  display: grid;
  gap: 1.25rem 3rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.lede {
  margin: 0;
  max-width: 18em;
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.support {
  margin: 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.55;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 1.15rem;
}

.arrow-link {
  font-weight: 600;
  text-decoration: none;
}

.arrow-link::after {
  content: "\2192";
  display: inline-block;
  margin-left: 0.35rem;
}

.work {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(3rem, 7vw, 5rem);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.section-heading h2,
.subsection h2,
.page-header h1,
.project h2 {
  font-weight: 560;
  letter-spacing: -0.03em;
}

.section-heading h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.15rem);
}

.work-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}

.work-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  column-gap: 1rem;
  align-items: baseline;
  padding: 1.3rem 0.15rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.work-list li:last-child .work-row {
  border-bottom: 1px solid var(--line);
}

.work-index {
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-optical-sizing: auto;
  color: var(--accent);
  font-size: 1.05rem;
}

.work-title {
  display: block;
  margin: 0;
  font-weight: 560;
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.work-summary {
  display: block;
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.work-meta {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.page {
  padding: clamp(2.4rem, 6vw, 4.25rem) 0 clamp(3rem, 8vw, 5.5rem);
}

.narrow {
  max-width: 40rem;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.94;
}

.page-header .lede {
  margin-top: 1rem;
  max-width: 22em;
}

.prose p,
.project p,
.subsection > p,
.slot p {
  font-size: 1.125rem;
  line-height: 1.7;
}

.prose p {
  margin: 1.05rem 0 0;
}

.quote {
  margin: 1.6rem 0 0;
}

.quote blockquote {
  margin: 0;
  padding: 0 0 0 1rem;
  border-left: 2px solid var(--accent);
}

.quote blockquote p {
  margin: 0;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.3rem, 2.4vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.quote figcaption {
  margin: 0.55rem 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.facts {
  margin: 2rem 0 0;
  padding: 0;
}

.facts div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.facts div:last-child {
  border-bottom: 1px solid var(--line);
}

.facts dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.facts dd {
  margin: 0;
}

.bio-slot {
  margin-top: 2.5rem;
}

.project {
  margin-top: 2.35rem;
  padding-top: 2.35rem;
  border-top: 1px solid var(--line);
}

.project-kicker {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-kicker .index {
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  color: var(--accent);
}

.project h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.08;
}

.project p {
  margin: 0.8rem 0 0;
  max-width: 38rem;
}

.project .note {
  color: var(--muted);
  font-size: 1rem;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.2rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  font-weight: 600;
}

.resource-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.subsection {
  margin-top: 3.25rem;
}

.subsection h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.15rem);
}

.subsection > p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

.slot {
  margin-top: 1rem;
  padding: 1.15rem 1.2rem 1.25rem;
  background: var(--bg-raised);
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
}

.slot-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.slot :is(h2, h3) {
  margin: 0.35rem 0 0;
  font-weight: 560;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.slot .slot-label {
  margin: 0;
}

.slot p:last-child {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.contact-email {
  display: inline-block;
  margin-top: 1.35rem;
  font-weight: 560;
  font-size: clamp(1.35rem, 4.6vw, 2.45rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-block {
  margin-top: 2rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  border-top: 1px solid var(--line);
  padding: 1.35rem 0 1.75rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.15rem;
}

.footer-links a {
  overflow-wrap: anywhere;
}

@media (min-width: 800px) {
  .shell {
    width: min(72rem, calc(100% - 4rem));
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
    align-items: start;
  }
}

@media (max-width: 860px) {
  .site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5rem;
  }

  .brand {
    margin-right: auto;
  }

  .theme-toggle {
    order: 2;
  }

  .nav-toggle {
    order: 3;
    display: inline-flex;
    align-items: center;
  }

  .site-nav {
    display: none;
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    justify-self: stretch;
    margin-top: 0.35rem;
    padding: 0.35rem 0 0.85rem;
    border-top: 1px solid var(--line);
  }

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

  .site-nav a {
    padding: 0.7rem 0.1rem;
  }
}

@media (max-width: 640px) {
  .work-row {
    grid-template-columns: 2.2rem minmax(0, 1fr);
    row-gap: 0.15rem;
  }

  .work-meta {
    grid-column: 2;
    white-space: normal;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

@media (max-width: 420px) {
  .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (hover: hover) {
  .site-nav a:hover {
    color: var(--ink);
  }

  .work-row:hover .work-title,
  .arrow-link:hover,
  .contact-email:hover {
    color: var(--accent);
  }

  .arrow-link::after {
    transition: transform 160ms ease;
  }

  .arrow-link:hover::after {
    transform: translateX(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.theme-ready body,
  html.theme-ready .site-header,
  html.theme-ready .slot,
  .arrow-link::after {
    transition: none;
  }
}

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

@media print {
  .theme-toggle,
  .nav-toggle,
  .skip-link {
    display: none !important;
  }

  .site-header {
    position: static;
    background: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    text-decoration: underline;
  }
}

.work + .work {
  padding-top: 0;
}

.play-note {
  margin-top: 1rem;
  max-width: 38rem;
}

.stage,
.stage canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.stage {
  position: relative;
  width: min(100%, 50rem);
  margin-top: 1.35rem;
  background: var(--bg);
  border: 1px solid var(--line);
}

.stage canvas {
  display: block;
  cursor: pointer;
}

#putt-canvas {
  cursor: crosshair;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  align-items: center;
  justify-content: center;
  padding: 0.9rem;
  pointer-events: none;
}

.stage-overlay:not([hidden]) {
  display: flex;
}

.stage-card {
  pointer-events: auto;
  max-width: 22rem;
  padding: 0.9rem 1rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  text-align: center;
  touch-action: manipulation;
}

.overlay-title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stage-card p + p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.fly-button {
  appearance: none;
  margin-top: 0.8rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  min-height: 3rem;
  min-width: 7.5rem;
  padding: 0.55rem 1.35rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.fly-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

[data-theme="dark"] .fly-button:hover {
  color: #12110f;
}

.scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.35rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.scoreboard strong {
  color: var(--ink);
  font-weight: 600;
}

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

.stage-overlay.is-centered {
  align-items: center;
  justify-content: center;
}

.stage-overlay.is-centered .stage-card {
  text-align: center;
  max-width: 24rem;
}

.ride-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "back gas"
    "fwd brake";
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.65rem;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.ride-key[data-act="back"] { grid-area: back; }
.ride-key[data-act="gas"] { grid-area: gas; }
.ride-key[data-act="fwd"] { grid-area: fwd; }
.ride-key[data-act="brake"] { grid-area: brake; }

.ride-key {
  appearance: none;
  min-height: 4.5rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 1rem;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.ride-key.is-held {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.ride-key:hover {
  border-color: var(--accent);
}

/* Learning Terminal is a portrait game. The bezel is about 390×780 on a wide page and full width on a phone. */
.phone-frame {
  width: min(100%, calc(390px + 1.25rem));
  margin-top: 1.2rem;
  padding: 0.7rem 0.625rem 0.625rem;
  background: #1b1814;
  border: 1px solid var(--line-strong);
  border-radius: 2rem;
  box-shadow: var(--shadow);
}

.phone-frame::before {
  content: "";
  display: block;
  width: 4.25rem;
  height: 0.28rem;
  margin: 0.05rem auto 0.5rem;
  border-radius: 999px;
  background: rgba(244, 240, 231, 0.38);
}

.phone-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 390 / 780;
  overflow: hidden;
  border-radius: 1.4rem;
  background: #040308;
}

.phone-screen iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #040308;
}

@media (max-width: 520px) {
  .phone-frame {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .phone-frame::before {
    display: none;
  }

  .phone-screen {
    border: 1px solid var(--line);
    border-radius: 2px;
  }
}

/* Play pages are a phone in portrait first. Desktop gets a framed stage below. */
html:has(body.play) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.play {
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.play .shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.play .site-header {
  padding-top: env(safe-area-inset-top);
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}

body.play .page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.7rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom));
}

body.play .page-header h1 {
  font-size: 1.7rem;
  line-height: 1;
}

body.play .page-header .lede {
  margin-top: 0.3rem;
  font-size: 1.02rem;
  line-height: 1.35;
}

body.play .play-note,
body.play .site-footer {
  display: none;
}

body.play .scoreboard {
  margin-top: 0.4rem;
  gap: 0.25rem 0.9rem;
  font-size: 0.95rem;
}

body.play .stage {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin-top: 0.55rem;
}

body.play .stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rotate-hint {
  display: none;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 900px) and (orientation: portrait) {
  body.play-dirt .rotate-hint {
    display: block;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  body.play .site-header {
    min-height: 2.75rem;
  }

  body.play .page-header {
    display: none;
  }

  body.play .page {
    padding-top: 0.35rem;
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom));
  }

  body.play .scoreboard,
  body.play .stage {
    margin-top: 0.3rem;
  }

  body.play-dirt .ride-pad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "back fwd brake gas";
    gap: 0.4rem;
    margin-top: 0.4rem;
  }

  body.play-dirt .ride-key {
    min-height: 3.25rem;
    border-radius: 0.8rem;
  }
}

@media (min-width: 960px) {
  html:has(body.play) {
    height: auto;
    overflow: auto;
  }

  body.play {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  body.play .shell {
    width: min(72rem, calc(100% - 4rem));
    height: auto;
    min-height: 100vh;
    margin-inline: auto;
    padding-left: 0;
    padding-right: 0;
  }

  body.play .site-header {
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
  }

  body.play .page {
    display: block;
    padding: clamp(2.4rem, 6vw, 4.25rem) 0 clamp(3rem, 8vw, 5.5rem);
  }

  body.play .page-header h1 {
    font-size: clamp(3rem, 7vw, 5rem);
    line-height: 0.94;
  }

  body.play .page-header .lede {
    display: block;
    margin-top: 1rem;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    line-height: 1.28;
  }

  body.play .play-note {
    display: block;
  }

  body.play .site-footer {
    display: flex;
  }

  body.play .scoreboard {
    margin-top: 0.85rem;
    font-size: 1rem;
  }

  body.play .stage {
    flex: none;
    width: min(100%, 50rem);
    height: min(68vh, 34rem);
    margin-top: 1.35rem;
  }

  body.play .ride-pad {
    width: min(100%, 50rem);
    margin-top: 0.85rem;
  }

  body.play .ride-key {
    min-height: 3rem;
  }
}

body.site-games {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.site-games .site-header {
  padding-top: env(safe-area-inset-top);
}

body.site-games .site-footer {
  padding-bottom: calc(1.75rem + env(safe-area-inset-bottom));
}
