:root {
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Colors. Dark unless the browser asks for light. .theme-dark keeps an area
   dark either way (game screens, the home page's code sample). */
:root,
.theme-dark {
  color-scheme: dark;
  --bg: #0f1117;
  --bg-raised: #171a23;
  --bg-sunken: #0b0d12;
  --border: #262b38;
  --border-strong: #3a4152;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  /* Yellow fills (buttons, the logo) */
  --accent: #f7df1e;
  --accent-hover: #ffe94d;
  --on-accent: #14161c;
  /* Text in the accent color (links and labels) */
  --accent-text: #f7df1e;
  --focus-ring: rgb(247 223 30 / 0.5);
  --success-text: #8fe0aa;
  --danger-text: #ff8a80;
  --warning-text: #ffb74d;
  --info-text: #82aaff;
  --header-bg: rgb(15 17 23 / 0.8);
  --shadow: rgb(0 0 0 / 0.45);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f7f9;
    --bg-raised: #ffffff;
    --bg-sunken: #eceef2;
    --border: #dde1e8;
    --border-strong: #c3c9d4;
    --text: #171a21;
    --muted: #596071;
    --accent: #f7df1e;
    --accent-hover: #ecd20c;
    --on-accent: #14161c;
    --accent-text: #7a5f00;
    --focus-ring: rgb(122 95 0 / 0.55);
    --success-text: #177245;
    --danger-text: #bb2d24;
    --warning-text: #995200;
    --info-text: #2453c4;
    --header-bg: rgb(255 255 255 / 0.85);
    --shadow: rgb(15 17 23 / 0.12);
  }
}

/* Anything inside .theme-dark uses its colors, not the page's */
.theme-dark {
  color: var(--text);
}

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

/* Keep the hidden attribute working on elements whose class sets display (like .btn) */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* max-width and padding are set too, so a page's Bootstrap (whose .container
   has both) can't change the site's columns */
.container {
  width: min(1120px, 100% - 3rem);
  max-width: none;
  margin-inline: auto;
  padding-inline: 0;
}

/* Full width, from the header's toggle (narrow text columns stay readable) */
.is-full-width .container {
  width: calc(100% - 3rem);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.75rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition: background 0.15s, transform 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-small {
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--bg-raised);
  border-color: var(--muted);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Without JavaScript the links wrap onto more lines when they don't fit.
   With it they stay on one row and site.js hides the ones that don't fit
   (.is-overflow); the menu button's list (.site-menu) has every item. */
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 64px;
  padding-block: 0.6rem;
}

.has-js .header-inner {
  flex-wrap: nowrap;
  height: 64px;
  min-height: 0;
  padding-block: 0;
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 0.85rem var(--mono);
}

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

.brand-name span {
  color: var(--accent-text);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

/* Only as wide as the space beside the logo, so what doesn't fit sticks out
   on the right, where site.js looks for it */
.has-js .site-nav {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  margin-left: auto;
}

.has-js .site-nav > * {
  flex: none;
}

.site-nav > .is-overflow {
  display: none;
}

/* Items that are buttons (About site, and items added with $siteMenu) look like the links */
.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.site-nav a,
.nav-button {
  color: var(--muted);
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.nav-button:hover,
.nav-button[aria-current],
.nav-button.is-current,
.nav-button[aria-expanded="true"] {
  color: var(--text);
  text-decoration: none;
}

.nav-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Between the page's own items and the site's */
.site-nav-separator {
  width: 1px;
  height: 1.25rem;
  background: var(--border-strong);
}

.nav-chevron {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s;
}

[aria-expanded="true"] > .nav-chevron {
  transform: rotate(180deg);
}

/* An item's subitems, in the row */
.nav-group {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: -0.75rem;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: calc(100vw - 2rem);
  padding: 0.4rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
  box-shadow: 0 12px 24px var(--shadow);
}

.site-nav .nav-dropdown > .nav-dropdown-item {
  padding: 0.5rem 1rem;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.site-nav .nav-dropdown > .nav-dropdown-item:hover,
.site-nav .nav-dropdown > .nav-dropdown-item:focus-visible {
  background: var(--bg);
  text-decoration: none;
  outline: none;
}

.site-nav .nav-dropdown > .nav-dropdown-item[aria-current] {
  box-shadow: inset 3px 0 var(--accent-text);
}

/* The menu button (it works with JavaScript) and its list of every item */
.menu-toggle {
  display: none;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.menu-toggle .icon-close,
.is-menu-open .menu-toggle .icon-menu {
  display: none;
}

.is-menu-open .menu-toggle .icon-close {
  display: block;
}

.has-js .menu-toggle {
  display: grid;
}

.site-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  pointer-events: none;
}

.site-menu-inner {
  display: flex;
  justify-content: flex-end;
}

.site-menu-list {
  display: flex;
  flex-direction: column;
  width: min(300px, 100%);
  max-height: calc(100vh - 5rem);
  max-height: calc(100dvh - 5rem);
  overflow-y: auto;
  padding: 0.5rem 0;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg);
  box-shadow: 0 12px 24px var(--shadow);
  pointer-events: auto;
}

.site-menu-list > a,
.site-menu-list > button,
.site-menu-group > button,
.site-menu-subitems > * {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: auto;
  padding: 0.7rem 1.25rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.site-menu-subitems > * {
  padding-left: 2.25rem;
  font-size: 1rem;
}

.site-menu-list :is(a, button):hover,
.site-menu-list :is(a, button):focus-visible {
  background: var(--bg-raised);
  color: var(--text);
  text-decoration: none;
  outline: none;
}

.site-menu-list [aria-current],
.site-menu-list .is-current {
  color: var(--text);
  box-shadow: inset 3px 0 var(--accent-text);
}

.site-menu-group > button .nav-chevron {
  margin-left: auto;
}

.site-menu-separator {
  margin: 0.5rem 1.25rem;
  border: 0;
  border-top: 1px solid var(--border);
}


/* Full-width toggle, beside the menu button. It only shows when the window is
   wider than the normal width. */
.width-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.width-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.width-toggle:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.width-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.width-toggle .icon-collapse,
.is-full-width .width-toggle .icon-expand {
  display: none;
}

.is-full-width .width-toggle .icon-collapse {
  display: block;
}

@media (max-width: 1168px) {
  .width-toggle {
    display: none;
  }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0 5rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgb(247 223 30 / 0.14), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: center;
  gap: 4rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--muted);
  font-size: 0.85rem;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h1 em {
  font-style: normal;
  color: var(--accent-text);
}

.lead {
  margin: 0 0 2rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Code window */
.code-window {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  box-shadow: 0 30px 80px var(--shadow), 0 0 0 1px rgb(255 255 255 / 0.02);
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.code-window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a3f4d;
}

.code-window-bar small {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
}

.code-window pre {
  margin: 0;
  padding: 1.25rem 1.4rem 1.5rem;
  overflow-x: auto;
  font: 0.88rem/1.7 var(--mono);
  color: #d6dae4;
}

.tok-c { color: #6b7387; }
.tok-k { color: #c792ea; }
.tok-f { color: #82aaff; }
.tok-s { color: #c3e88d; }
.tok-n { color: #f78c6c; }

/* Features */
.features {
  padding: 2rem 0 5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition: border-color 0.15s;
}

.feature:hover {
  border-color: var(--border-strong);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  padding: 0 0.6rem;
  border-radius: 10px;
  background: rgb(247 223 30 / 0.1);
  color: var(--accent-text);
  font: 700 0.95rem var(--mono);
}

.feature h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

/* MyJS Pad demo */
.pad-demo {
  padding: 0 0 5rem;
}

.pad-demo h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.pad-demo-lead {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
}

/* MyJS Pad fills its container */
.pad-demo-console {
  height: 460px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Call to action */
.cta {
  padding: 0 0 5rem;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem 3rem;
  border: 1px solid rgb(247 223 30 / 0.25);
  border-radius: calc(var(--radius) * 1.5);
  background: linear-gradient(135deg, rgb(247 223 30 / 0.1), rgb(247 223 30 / 0.02));
}

.cta h2 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.cta p {
  margin: 0;
  color: var(--muted);
}

.cta .btn {
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner > span {
  white-space: nowrap;
}

/* Wraps onto more lines when the window is too narrow for all the links */
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1.5rem;
}

.footer-inner a {
  color: var(--muted);
}

.footer-inner a:hover {
  color: var(--text);
}

/* Inner pages */
.page-section {
  padding: 3.5rem 0 5rem;
}

.container.narrow {
  max-width: 720px;
}

.page-section h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.page-section .lead {
  margin-bottom: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}

.empty-state {
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.page-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition: border-color 0.15s, transform 0.15s;
}

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

.page-card.is-archived {
  opacity: 0.6;
}

.page-card-link {
  flex: 1;
  color: var(--text);
}

.page-card-link:hover {
  text-decoration: none;
}

.page-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.page-card-body {
  padding: 1.25rem 1.4rem 1.4rem;
}

.page-card-body h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.page-card-body p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.page-card[hidden] {
  display: none;
}

/* "Needs a computer" on the cards of apps that don't work on phones or tablets */
.device-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

.device-tag svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* /app/: All or Work on phones (shown by listing.js) */
.device-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: -0.75rem 0 1.5rem;
}

.device-filter[hidden],
.device-note[hidden] {
  display: none;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
}

.segmented button {
  padding: 0.35rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.segmented button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.segmented .count {
  margin-left: 0.25rem;
  opacity: 0.7;
}

.device-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* The home page's apps */
.apps-showcase {
  padding: 0 0 5rem;
}

.apps-showcase h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.apps-lead {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
}

.apps-showcase .page-card-body h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  letter-spacing: normal;
}

.flash {
  margin-top: 1.25rem;
  padding: 0.8rem 1.1rem;
  border: 1px solid rgb(80 200 120 / 0.35);
  border-radius: 10px;
  background: rgb(80 200 120 / 0.1);
  color: var(--success-text);
}

.flash-error {
  border-color: rgb(255 110 100 / 0.4);
  background: rgb(255 110 100 / 0.1);
  color: var(--danger-text);
}

.trace {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  color: var(--danger-text);
  font: 0.8rem/1.6 var(--mono);
  white-space: pre-wrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.footer-inner .link-button {
  color: var(--muted);
}

.footer-inner .link-button:hover {
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Pages and apps made in the admin (site layout). :where() keeps these at
   zero specificity so a page's own CSS always wins. */
.page-content {
  padding-block: 3rem 5rem;
}

:where(.page-content) > :first-child {
  margin-top: 0;
}

:where(.page-content) :is(h1, h2, h3, h4) {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

:where(.page-content) h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
}

:where(.page-content) h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.6rem;
}

:where(.page-content) h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.25rem;
}

:where(.page-content) :is(p, ul, ol, table, blockquote) {
  margin: 0 0 1.1rem;
}

:where(.page-content) a:hover {
  text-decoration: underline;
}

:where(.page-content) code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-raised);
  font-family: var(--mono);
  font-size: 0.9em;
}

:where(.page-content) pre {
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  font: 0.88rem/1.7 var(--mono);
}

:where(.page-content) pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

:where(.page-content) img {
  max-width: 100%;
  height: auto;
}

:where(.page-content) blockquote {
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--accent-text);
  color: var(--muted);
}

:where(.page-content) hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

:where(.page-content) table {
  border-collapse: collapse;
}

:where(.page-content) :is(th, td) {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

:where(.page-content) :is(input, select, textarea, button) {
  font: inherit;
}

/* /sitemap.html */
.sitemap-formats {
  color: var(--muted);
}

.sitemap-list {
  padding: 0;
  list-style: none;
}

.sitemap-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.sitemap-path {
  color: var(--muted);
  font: 0.85rem var(--mono);
  overflow-wrap: anywhere;
}

.sitemap-list time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Full height layout: a compact header that spans the window, no footer, and
   the page fills the rest of the window as a flex column (so margin: auto
   centers an element, and flex: 1 makes one fill the space) */
.layout-full {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.layout-full > main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.page-content.page-full {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0;
}

.layout-full .header-inner {
  width: calc(100% - 2rem);
}

.has-js .layout-full .header-inner {
  height: 48px;
}

.layout-full .site-header {
  font-size: 0.95rem;
}

.layout-full .site-nav {
  column-gap: 1.25rem;
}

.layout-full .brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 0.72rem;
}

.layout-full .brand-name {
  font-size: 1.1rem;
}

.layout-full .menu-toggle {
  width: 34px;
  height: 34px;
}

.layout-full .menu-toggle svg {
  width: 20px;
  height: 20px;
}

/* "Install app" (app-install.js): installs an installable app, or says how.
   Its own class names, since apps bring their own Bootstrap (.btn and all). */
.app-install {
  width: min(460px, 100% - 2rem);
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font: 1rem/1.55 var(--font);
  box-shadow: 0 24px 48px var(--shadow);
}

.app-install::backdrop {
  background: rgb(0 0 0 / 0.5);
}

.app-install-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}

.app-install-icon {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.app-install h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.25;
}

.app-install-lead {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.app-install-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
}

.app-install-steps li + li {
  margin-top: 0.35rem;
}

.app-install-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
}

.app-install .app-install-button {
  padding: 0.55rem 1.3rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 0.95rem/1.4 var(--font);
  cursor: pointer;
}

.app-install .app-install-button:hover {
  background: var(--accent-hover);
}

.app-install .app-install-button.is-secondary {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.app-install .app-install-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Dialogs: About site (full height layout) and Share */
.site-dialog {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--muted);
  font-size: 0.95rem;
  box-shadow: 0 24px 48px var(--shadow);
}

.site-dialog::backdrop {
  background: rgb(0 0 0 / 0.5);
}

.site-dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.site-dialog-close:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.site-dialog-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* About site: the footer's links */
.about-site {
  width: min(520px, 100% - 2rem);
}

.about-site .footer-inner {
  flex-direction: column;
  padding: 1.5rem 4rem 1.75rem 1.75rem;
}

.about-site .footer-inner nav {
  justify-content: flex-start;
  gap: 0.6rem 1.5rem;
}

/* Share: the page's link, its QR code, and buttons to copy or send it */
.share-page {
  width: min(400px, 100% - 2rem);
  padding: 1.5rem;
  text-align: center;
}

.share-page h2 {
  margin: 0 2.5rem 0.25rem;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.3;
}

.share-page-name {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

/* A yellow frame, outside the white border scanners need */
.share-page-qr {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1.25rem;
  border-radius: 14px;
  box-shadow: 0 0 0 5px var(--accent);
}

.share-page-note {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.share-page-link {
  display: flex;
  gap: 0.5rem;
}

.share-page-link input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: 0.85rem var(--mono);
}

.share-page-link input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.share-page-link .btn {
  flex: none;
}

.share-page-more {
  margin-top: 0.75rem;
}

/* Smaller screens */
@media (max-width: 900px) {
  .hero {
    padding: 4rem 0 3.5rem;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .cta-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
  }
}

@media (max-width: 520px) {

  .footer-inner nav {
    justify-content: flex-start;
    gap: 0.5rem 1.25rem;
  }

  .code-window pre {
    padding: 1rem;
    font-size: 0.75rem;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .brand-name {
    display: none;
  }
}

/* Log in */
.login-options {
  display: grid;
  gap: 0.75rem;
  max-width: 360px;
  margin-top: 2rem;
}

.login-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.8rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 600;
}

.login-option:hover {
  border-color: var(--muted);
  text-decoration: none;
}

.login-option svg {
  width: 20px;
  height: 20px;
}

.login-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Account */
.account-logins {
  display: grid;
  gap: 0.75rem;
  max-width: 520px;
  margin-top: 2rem;
}

.account-login {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.account-login > svg {
  flex: none;
  width: 24px;
  height: 24px;
}

.account-login-info {
  display: grid;
  flex: 1;
  min-width: 0;
}

.account-login-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
}

.account-login form {
  margin: 0;
}

.account-login-note {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

/* Games */
.game-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.game-page .lead {
  margin-bottom: 2rem;
}
