/*
 * sandpapermelon.com: an isometric floor grid (the .spm-scene canvas, js/site.js) behind everything;
 * the content on a sand-colored sheet on the left; on the right the panel: the melon resting in its
 * hole beside the name, the menu under it. Brand: ink #160729, purple #461d7b (the profile's primary),
 * lilac #ab8cd4, melon yellow #ffde00 (the accent: links, and the logo's MELON, only), soft yellow #dad470
 * (--spm-hi: every other highlight: prompts, cursors, figures, icons, the form), sandpaper #d7b27a.
 */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url(/sites/sandpapermelon.com/fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(/sites/sandpapermelon.com/fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap; src: url(/sites/sandpapermelon.com/fonts/poppins-latin-800-normal.woff2) format("woff2"); }

:root {
  --spm-ink: #160729;
  --spm-lilac: #ab8cd4;
  --spm-sand: #f5efe3;
  --spm-paper: #d7b27a;
  --spm-hi: #dad470;   /* highlights that aren't links (links keep the melon yellow, --accent) */
  --spm-scan: repeating-linear-gradient(to bottom, rgb(255 255 255 / .025) 0 1px, transparent 1px 3px);   /* console scanlines */
  --spm-panel: 40vw;   /* the right panel's width (desktop): puts the logo in the upper middle-right */
  --spm-gap: 1.25rem;  /* half the space between the console and the logo/menu (each side brings one) */
  --bs-body-font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-bg: var(--spm-ink);
  --bs-body-color: #241634;
}

/* Keep the scrollbar's room even while the intro locks scrolling, so the fixed panel (and the logo
   the ball has to land on) never shifts sideways when it unlocks. */
html { scrollbar-gutter: stable; }

body.spm {
  position: relative;
  min-height: 100vh;
  background: var(--spm-ink);
  font-family: var(--bs-body-font-family);
}

.spm-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The floor: fixed behind everything (on a phone it's only the top, behind the panel; see below). */
.spm-scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* The wordmark (sizes are SVG user units: the melon's radius is 60). */
.spm .w-1, .spm .w-2 { font-family: "Poppins", sans-serif; font-weight: 800; }
.spm .w-1 { font-size: 46px; fill: #fff; }
.spm .w-2 { font-size: 72px; fill: var(--accent); }

/* ---- The right panel: logo + menu ---- */
.spm-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--spm-panel);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;   /* logo + menu hug the console; the panel's spare width is on their right */
  padding: 17vh 2rem 2rem var(--spm-gap);
}
.spm-logo { display: block; line-height: 0; }
/* The tagline patch under the word MELON (in the logo's svg, in the melon's units — see _SiteNav). */
.spm-badge { transition: opacity .7s ease; }
.spm-badge-edge { fill: rgb(11 4 22 / .85); stroke: var(--spm-hi); stroke-width: 2.4; }
.spm-badge text {
  font: 700 18.5px ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  fill: var(--spm-hi);
}
.spm-logo svg { width: min(25rem, 30vw); height: auto; overflow: visible; }
/* Once the scene draws the 3-D ball over it, the SVG melon (the no-JS logo) steps aside. */
html.spm-has-ball .spm-logo-melon { visibility: hidden; }

.spm-menu { width: min(25rem, 30vw); margin-top: 3.6rem; }   /* room for the badge under the melon */
.spm-nav { display: flex; flex-direction: column; gap: .35rem; }
.spm-nav a {
  align-self: flex-start;
  color: rgb(255 255 255 / .85);
  font-weight: 600;
  font-size: 1.2rem;
  text-decoration: none;
  padding: .2rem 0 .2rem 1.1rem;
  border-left: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
/* Hover: a lilac bar on the left only. Active: yellow on the left and underneath (a corner). */
.spm-nav a:hover, .spm-nav a:focus-visible { color: #fff; border-left-color: var(--spm-lilac); }
/* The active corner is drawn, not a border: a ::before over the border box with two bars whose
   lengths (--spm-l down the left, --spm-b along the bottom) are animatable (@property). Switching
   pages draws it like the console: the old item's corner fades out while the header is cleared,
   then the new one draws top left → bottom right while the new page
   types and prints (≈1.35s, the length of a swap; js/site.js moves .is-active at the click). */
@property --spm-l { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --spm-b { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.spm-nav a { position: relative; }
.spm-nav a::before {
  content: "";
  position: absolute;
  inset: 0 0 -3px -3px;   /* over the left and bottom borders */
  pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 3px var(--spm-l) no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / var(--spm-b) 3px no-repeat;
  opacity: 0;
  transition: opacity .3s ease, --spm-l 0s .3s, --spm-b 0s .3s;   /* leaving: fade, then reset unseen */
}
.spm-nav a.is-active::before {
  --spm-l: 100%;
  --spm-b: 100%;
  opacity: 1;
  transition: opacity 0s, --spm-l .45s cubic-bezier(.5, 0, .3, 1) .3s, --spm-b .6s cubic-bezier(.4, 0, .2, 1) .75s;
}
.spm-nav a.is-active { color: var(--accent); transition: color .3s ease .3s, border-color .15s; }
/* The shared nav's grow-in hover underline (site.css .nav-cv/.nav-me::after) isn't used here. */
.spm-nav a::after { content: none; }
/* ... nor its capitals and letter-spacing for the default page's link (.nav-cv): all items match. */
.spm-nav a { text-transform: none; letter-spacing: normal; }
/* The second menu (e.g. Client Login): set apart from the pages as a terminal-style key, outlined,
   in the console's monospace, instead of a menu line. */
.spm-nav-ext { margin-top: 1.6rem; }
.spm-nav.spm-nav-ext a {   /* outranks the phone row's .spm-nav a */
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .9rem;
  font: 600 .82rem/1.2 ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--spm-lilac);
  background: rgb(11 4 22 / .55);
  border: 1px solid rgb(171 140 212 / .55);
  border-radius: 4px;
  transition: color .15s, border-color .15s, background-color .15s, box-shadow .15s;
}
.spm-nav-ext a::before { content: none; }   /* never a page: no drawn corner */
.spm-nav-ext a .nav-icon { font-size: .75rem; }
.spm-nav.spm-nav-ext a:hover, .spm-nav.spm-nav-ext a:focus-visible, .spm-nav.spm-nav-ext a.is-active {   /* outranks the phone row's underline hover */
  color: var(--spm-hi);
  border-color: var(--spm-hi);
  background: rgb(11 4 22 / .8);
  box-shadow: 0 0 0 3px rgb(218 212 112 / .12);
}

/* ---- The content (left) ---- */
.spm-main {
  position: relative;
  z-index: 1;
  margin-right: var(--spm-panel);
  min-height: 100vh;
  padding: clamp(2.75rem, 5vh, 3.5rem) var(--spm-gap) 1.5rem clamp(1.25rem, 3vw, 3rem);   /* top: at least clear of the replay button */
  display: flex;
  flex-direction: column;
}
/* ---- The content as a terminal window ---- */
.spm-sheet {
  --spm-mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --spm-text: #d9d1e8;
  --spm-dim: #8f82aa;
  max-width: 52rem;
  width: 100%;
  margin-left: auto;
  background: rgb(11 4 22 / .86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgb(171 140 212 / .28);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgb(0 0 0 / .55), 0 0 48px rgb(171 140 212 / .08);
  overflow: hidden;
  color: var(--spm-text);
  font-family: var(--spm-mono);
  font-size: .95rem;
  line-height: 1.7;
  font-weight: 400;
}
.spm-sheet ::selection { background: var(--spm-hi); color: var(--spm-ink); }

.spm-term-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1rem;
  background: rgb(171 140 212 / .1);
  border-bottom: 1px solid rgb(171 140 212 / .2);
  font-size: .8rem;
  color: var(--spm-dim);
}
.spm-term-dots { display: flex; gap: .45rem; }
.spm-term-dots i { width: .75rem; height: .75rem; border-radius: 50%; background: var(--spm-paper); }
.spm-term-dots i:nth-child(2) { background: var(--spm-lilac); }
.spm-term-dots i:nth-child(3) { background: var(--spm-hi); }
.spm-term-title { flex: 1; text-align: center; margin-right: 3.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spm-term-path { color: var(--spm-text); font-weight: 600; }

/* The header (prompt line + tagline) sits above a dashed rule; the content scrolls past below it. */
.spm-term-head {
  padding: clamp(1.25rem, 3.5vw, 2.75rem) clamp(1.25rem, 3.5vw, 2.75rem) 1.25rem;
  border-bottom: 1px dashed rgb(171 140 212 / .3);
}
/* Faint scanlines on the screen under the text (not the header): they stay while the text is deleted,
   printed or scrolled past, since only the text area inside is masked or scrolls. */
.spm-term-screen { background-image: var(--spm-scan); }
.spm-term-body {
  padding: 1.75rem clamp(1.25rem, 3.5vw, 2.75rem) clamp(1.25rem, 3.5vw, 2.75rem);
}

.spm-term-head h1 {
  font-family: var(--spm-mono);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  color: #fff;
  margin: 0 0 1.75rem;
}
.spm-prompt { color: var(--spm-hi); }
/* The tagline's "output": what it means, dim, indented under the prompt. */
.spm-term-head h1:has(+ .spm-page-sub:not([hidden])) { margin-bottom: .5rem; }
.spm-term-head h1 { margin-bottom: 0; min-height: 1.25em; }
.spm-page-sub { margin: 0; min-height: 1.7em; padding-left: calc(clamp(1.6rem, 3.2vw, 2.35rem) * 1.2); color: var(--spm-dim); font-size: 1.05rem; }   /* = the "$ " (2 mono chars) at the h1 size */
.spm-cursor {
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-left: .2em;
  vertical-align: -.12em;
  background: var(--spm-hi);
  animation: spm-blink 1.1s steps(1) infinite;
}
@keyframes spm-blink { 50% { opacity: 0; } }
/* While a heading is being typed the cursor stays solid, like a real one. */
.spm-term-head.is-typing .spm-cursor { animation: none; opacity: 1; }
.spm-page-meta { display: none; }

/* Sections: no bands, just a dashed rule between them; headings read like a shell. */
.spm .spm-sheet .band { padding: 0; background: none; color: inherit; }
.spm .spm-sheet .band + .band { margin-top: 2.25rem; padding-top: 2rem; border-top: 1px dashed rgb(171 140 212 / .25); }
.spm .spm-sheet .band h2 {
  display: block;
  border: 0;
  padding: 0;
  margin: 0 0 1.1rem;
  font-family: var(--spm-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--spm-lilac);
}
/* Each section opens with the command that "prints" it, named from its anchor (#why-us → why-us.md). */
.spm .spm-sheet section.band[id]::before {
  content: "❯ cat " attr(id) ".md";
  display: block;
  margin-bottom: .3rem;
  font-size: .8rem;
  color: var(--spm-dim);
}
.spm .spm-sheet .sub-heading {
  font-family: var(--spm-mono);
  font-size: 1.22rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--spm-paper);
  margin: 1.9rem 0 .95rem;
}
.spm .spm-sheet .sub-heading::before { content: "## "; color: var(--spm-dim); font-weight: 400; }
.spm .spm-sheet .sub-heading:first-child { margin-top: 0; }   /* only when nothing comes before it */
.spm .spm-sheet .prose-text { color: var(--spm-text); }
.spm .spm-sheet .prose-text p { margin: 0 0 .75rem; }
.spm .spm-sheet .prose-text li::marker { color: var(--spm-hi); }
.spm .spm-sheet a { color: var(--accent); }
.spm .spm-sheet a:hover { color: #fff; }

/* Text links (SourceLink) read as commands: a prompt in front, no underline until hovered. */
.spm .spm-sheet .source-link { text-decoration: none; font-weight: 600; }
/* The prompt is an inline-block so the link's hover underline (text only) doesn't run under it; and it
   is the marker, so any icon on the link is dropped. */
.spm .spm-sheet .source-link::before { content: "❯"; display: inline-block; margin-right: .5em; color: var(--spm-lilac); font-weight: 400; }
.spm .spm-sheet .source-link i { display: none; }
.spm .spm-sheet .source-link:hover { text-decoration: underline; }

/* The contact form, console style: dark fields, a mono prompt for each label, a yellow "Transmit". */
.spm .spm-sheet .ps-contact-block { margin: 1.25rem 0 .5rem; }
.spm .spm-sheet .ps-contact-inline { max-width: none; }
.spm .spm-sheet .ps-contact-form label { font-family: var(--spm-mono); font-size: .82rem; font-weight: 400; color: var(--spm-dim); text-transform: lowercase; gap: .4rem; }
.spm .spm-sheet .ps-contact-form label::before { content: "❯ "; color: var(--spm-hi); }
.spm .spm-sheet .ps-contact-form label { display: grid; grid-template-columns: auto 1fr; }
.spm .spm-sheet .ps-contact-form label > input, .spm .spm-sheet .ps-contact-form label > textarea { grid-column: 1 / -1; }
.spm .spm-sheet .ps-contact-form input, .spm .spm-sheet .ps-contact-form textarea {
  font-family: var(--spm-mono);
  font-size: .92rem;
  color: var(--spm-text);
  background: rgb(0 0 0 / .3);
  border: 1px solid rgb(171 140 212 / .35);
  border-radius: 4px;
  padding: .6rem .75rem;
  caret-color: var(--spm-hi);
}
.spm .spm-sheet .ps-contact-form input:focus, .spm .spm-sheet .ps-contact-form textarea:focus {
  outline: none;
  border-color: var(--spm-hi);
  box-shadow: 0 0 0 3px rgb(218 212 112 / .12);
}
/* Browser autofill paints its own light fill; keep the console dark. */
.spm .spm-sheet .ps-contact-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--spm-text);
  -webkit-box-shadow: 0 0 0 40px #120821 inset;
  transition: background-color 9999s;
}
.spm .spm-sheet .ps-contact-send {
  font-family: var(--spm-mono);
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--spm-hi);
  color: var(--spm-ink);
  border: 0;
  border-radius: 4px;
  padding: .6rem 1.4rem;
  cursor: pointer;
}
.spm .spm-sheet .ps-contact-send:hover { box-shadow: 0 0 18px rgb(218 212 112 / .3); }
.spm .spm-sheet .ps-contact-status { font-family: var(--spm-mono); font-size: .85rem; }
.spm .spm-sheet .ps-contact-status[data-kind="ok"] { color: #9be28f; }
.spm .spm-sheet .ps-contact-status[data-kind="error"] { color: #ff8a8a; }
/* The client sign-in form (/apps/login): the same fields, narrower, with a lock on its button. */
.spm .spm-sheet .spm-login-form { max-width: 26rem; padding: 0; }
.spm .spm-sheet .spm-login-form .ps-contact-send { justify-self: start; display: inline-flex; align-items: center; gap: .5rem; }
.spm .spm-sheet .spm-login-form .ps-contact-send:disabled { opacity: .6; cursor: progress; }
.spm .spm-sheet .spm-login-error { margin: 0; }
.spm-login-org { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Cards: numbered console panels. */
.spm .card-grid { grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: .9rem; counter-reset: spm-card; margin: .9rem 0 1.1rem; }
.spm .ps-card {
  border: 1px solid rgb(171 140 212 / .32);
  border-radius: 6px;
  background: rgb(171 140 212 / .05);
  padding: 1.05rem 1.1rem 1rem;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.spm .ps-card::before {
  counter-increment: spm-card;
  content: "[" counter(spm-card, decimal-leading-zero) "]";
  position: absolute;
  top: .65rem;
  right: .8rem;
  font-size: .75rem;
  color: var(--spm-dim);
}
.spm .ps-card:hover { border-color: rgb(218 212 112 / .55); box-shadow: 0 0 22px rgb(218 212 112 / .08); transform: translateY(-2px); }
.spm .ps-card-icon { color: var(--spm-hi); font-size: 1.2rem; margin-bottom: .6rem; }
.spm .ps-card-title { font-family: var(--spm-mono); font-size: 1rem; font-weight: 700; color: var(--spm-paper); margin-bottom: .3rem; }
.spm .ps-card-text { font-size: .9rem; line-height: 1.6; color: var(--spm-text); }

/* Callouts: a dossier panel. A dashed frame in the highlight yellow, the title as a small stamped
   label, a big icon beside the text (M.O.'s "Service record"). */
.spm .spm-sheet .ps-callout {
  gap: 1.1rem;
  margin: 2rem 0 1.5rem;
  padding: 1.15rem 1.3rem 1.2rem;
  border: 1px dashed rgb(218 212 112 / .45);
  border-radius: 4px;
  background: rgb(218 212 112 / .04);
}
.spm .spm-sheet .ps-callout-icon { font-size: 1.75rem; margin-top: .35rem; color: var(--spm-hi); opacity: .9; }
.spm .spm-sheet .ps-callout-title {
  display: inline-block;
  margin: 0 0 .55rem;
  padding: .1rem .5rem;
  border: 1px solid rgb(218 212 112 / .55);
  border-radius: 2px;
  font-family: var(--spm-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--spm-hi);
  transform: rotate(-1.5deg);   /* stamped, not typeset */
}
.spm .spm-sheet .ps-callout-text { color: var(--spm-text); }
.spm .spm-sheet .ps-callout-action { color: var(--accent); }

/* Stats: a ruled row, not boxes: rules top and bottom with bracket ticks at the four corners, dashed
   dividers between the columns, the figure big and glowing. */
.spm .stat-row {
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0;
  margin: 1.9rem 0 1.7rem;   /* room from the paragraph above and the heading below */
  border-block: 1px solid rgb(171 140 212 / .4);
  background:
    linear-gradient(rgb(171 140 212 / .7) 0 0) left top / 1px 9px no-repeat,
    linear-gradient(rgb(171 140 212 / .7) 0 0) right top / 1px 9px no-repeat,
    linear-gradient(rgb(171 140 212 / .7) 0 0) left bottom / 1px 9px no-repeat,
    linear-gradient(rgb(171 140 212 / .7) 0 0) right bottom / 1px 9px no-repeat;
}
/* Compact: the figure, then "years in Label" on one line. */
.spm .ps-stat { display: block; text-align: center; padding: .65rem .5rem .6rem; }
.spm .ps-stat + .ps-stat { border-left: 1px dashed rgb(171 140 212 / .3); }
.spm .ps-stat-figure {
  font-family: var(--spm-mono);
  display: block;
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 800;
  color: var(--spm-hi);
  text-shadow: 0 0 18px rgb(218 212 112 / .25);
}
.spm .ps-stat-unit { font-family: var(--spm-mono); font-size: .76rem; color: var(--spm-dim); }
.spm .ps-stat-label { font-family: var(--spm-mono); font-size: .8rem; font-weight: 700; color: var(--spm-paper); line-height: 1.35; margin-left: .35em; }
/* On a phone the row stays one row (three narrow columns) rather than wrapping 2 + 1. */
@media (max-width: 640px) {
  .spm .stat-row { grid-template-columns: repeat(auto-fit, minmax(5.25rem, 1fr)); }
  .spm .ps-stat { padding-inline: .25rem; }
  .spm .ps-stat-figure { font-size: 1.5rem; }
  .spm .ps-stat-unit { display: block; font-size: .68rem; }   /* narrow columns: stack again */
  .spm .ps-stat-label { display: block; margin-left: 0; font-size: .72rem; }
}

/* Tiles: lighter dashed modules, tags as code-style brackets. Every tile has the same inner grid: a
   top row (icon + title) always tall enough for a two-line title, the title centred in it, so one- and
   two-line titles line up across the grid; and a bottom strip reserved for tags, there whether a tile
   has tags or not, so every tile is the same shape. */
.spm .tile-grid { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .7rem; margin: .9rem 0 1.1rem; }
.spm .ps-tile {
  display: grid;
  grid-template-columns: 2rem 1fr;
  grid-template-rows: minmax(2.5rem, auto) 1.1rem;
  align-items: center;
  gap: .35rem .7rem;
  border: 1px dashed rgb(171 140 212 / .4);
  border-radius: 4px;
  padding: .75rem .85rem;
  transition: border-color .15s, background-color .15s;
}
.spm .ps-tile:hover { border-style: solid; border-color: var(--spm-lilac); background: rgb(171 140 212 / .06); }
.spm .ps-tile-icon {
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  background: rgb(171 140 212 / .16);
  color: var(--spm-lilac);
  font-size: .95rem;
}
.spm .ps-tile-title { grid-row: 1; grid-column: 2; font-family: var(--spm-mono); font-size: .92rem; font-weight: 700; color: #fff; line-height: 1.35; }
.spm .ps-tile-tags { grid-row: 2; grid-column: 1 / -1; align-self: end; gap: .6rem; line-height: 1.1rem; }   /* the bottom strip */
.spm .tile-grid:not(:has(.ps-tile-tags)) .ps-tile { grid-template-rows: minmax(2.5rem, auto); }   /* no tags in this grid: no strip */
.spm .ps-tile-tags li { background: none; padding: 0; border-radius: 0; font-size: .78rem; color: var(--spm-hi); text-transform: lowercase; }
.spm .ps-tile-tags li::before { content: "["; color: var(--spm-dim); }
.spm .ps-tile-tags li::after { content: "]"; color: var(--spm-dim); }
.spm .spm-sheet code { color: var(--spm-hi); background: rgb(218 212 112 / .08); padding: .05em .3em; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) { .spm-cursor { animation: none; } }
/* The shared default-page intro (tagline + lead) isn't used: the page heading carries the tagline. */
.spm .cv-intro { display: none; }

.spm-footer {
  max-width: 52rem;
  width: 100%;
  margin: 1.25rem 0 0 auto;
  color: rgb(171 140 212 / .7);
  font-size: .8rem;
  text-align: center;
}

/* ---- Desktop: the console is one fixed window ----
   The content column is exactly one screen tall; the footer takes its own height and the console
   fills the rest (flex, so no magic numbers), with the title bar and typed header fixed and only the
   text area scrolling, on a thin lilac scrollbar. (A very short screen falls back to page scroll.) */
@media (min-width: 961px) {
  .spm-main { height: 100vh; height: 100dvh; min-height: 30rem; }
  .spm-sheet { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .spm-term-bar, .spm-term-head { flex: none; }
  .spm-term-screen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .spm-term-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgb(171 140 212 / .45) transparent;
  }
}

/* ---- Narrow screens: the panel becomes the top of the page, the floor only behind it ---- */
@media (max-width: 960px) {
  :root { --spm-panel: 0px; }
  .spm-scene { position: absolute; height: var(--spm-scene-h, 22rem); }
  .spm-panel { position: relative; width: auto; align-items: center; padding: 3.5rem 1.25rem 1.5rem; }
  .spm-logo svg, .spm-menu { width: min(24rem, 86vw); }
  .spm-menu { margin-top: 2.6rem; }
  .spm-nav { flex-direction: row; flex-wrap: wrap; gap: .25rem 1.25rem; }
  .spm-nav a { padding: .2rem 0; border-left: 0; border-bottom: 3px solid transparent; }
  /* A row of tabs here: the active mark is just the underline (drawn left to right). */
  .spm-nav a::before {
    inset: 0 0 -3px 0;
    background: linear-gradient(var(--accent), var(--accent)) left bottom / var(--spm-b) 3px no-repeat;
  }
  .spm-nav a:hover, .spm-nav a:focus-visible { border-bottom-color: var(--spm-lilac); }
  .spm-nav a.is-active { border-bottom-color: var(--accent); }
  /* One row, centred: the pages and the client button, all the same distance apart. */
  /* Scales with the screen; under ~350px (where it can't fit) the button drops to its own line. */
  .spm-menu { --spm-tab-gap: clamp(.55rem, 2.8vw, 1.25rem); width: 100%; max-width: 52rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem var(--spm-tab-gap); }
  .spm-nav { flex-wrap: nowrap; gap: .25rem var(--spm-tab-gap); }
  .spm-nav a { font-size: clamp(.9rem, 4.1vw, 1.2rem); white-space: nowrap; }
  .spm-nav-ext { margin-top: 0; flex: none; }
  .spm-nav.spm-nav-ext a { padding: .32rem .45rem; gap: .3rem; font-size: clamp(.58rem, 2.75vw, .78rem); letter-spacing: .02em; white-space: nowrap; }
  .spm-main { min-height: 0; padding-top: 0; }
  .spm-sheet { margin: 0 auto; }
  .spm-footer { margin-inline: auto; }
}

/* ---- The intro: menu and content wait while the melon rolls in (js/site.js lifts this) ---- */
.spm-main, .spm-menu { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
html.spm-intro-on .spm-main { opacity: 0; transform: translateX(-2rem); animation: spm-failsafe 0s 6s forwards; }
html.spm-intro-on .spm-menu { opacity: 0; transform: translateY(1rem); animation: spm-failsafe 0s 6s forwards; }
html.spm-intro-on .spm-badge { opacity: 0; animation: spm-failsafe-badge 0s 6s forwards; }
@keyframes spm-failsafe-badge { to { opacity: 1; } }
/* Failsafe: if the script never runs, show everything anyway after a few seconds. */
@keyframes spm-failsafe { to { opacity: 1; transform: none; } }
html.spm-intro-on body { overflow: hidden; }
/* Until the script takes over, the logo waits too (the ball rolls in; the name slides out). */
html.spm-intro-on:not(.spm-running) .spm-logo { visibility: hidden; animation: spm-failsafe-vis 0s 6s forwards; }
@keyframes spm-failsafe-vis { to { visibility: visible; } }

.spm-skip { display: none; }
html.spm-intro-on .spm-skip {
  display: block;
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 3;
  background: none;
  border: 1px solid rgb(171 140 212 / .4);
  border-radius: 99px;
  color: var(--spm-lilac);
  font: 600 .75rem/1 var(--bs-body-font-family);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .45rem .9rem;
}
.spm-skip:hover { color: #fff; border-color: var(--spm-lilac); }

/* Dev-only testing button (the layout renders it only in Development). */
.spm-replay {   /* top left, clear of the admin shortcut (top right) when signed in */
  position: fixed;
  top: .6rem;
  left: .75rem;
  z-index: 3;
  background: var(--spm-ink);
  color: var(--accent);
  font: 600 .75rem/1 var(--bs-body-font-family);
  padding: .45rem .75rem;
  border-radius: 99px;
  border: 1px solid rgb(171 140 212 / .35);
  text-decoration: none;
}
.spm-replay:hover { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .spm-main, .spm-menu, .spm-badge, .spm-nav a, .spm-nav a::before, .spm-nav a.is-active::before { transition: none; }
}

/* ---- Page swaps, as a terminal scroll (site.js runs each swap in a View Transition) ----
   The window frame, its title bar, the text area and the footer are separate transition layers:
   - the frame's snapshot is hidden and its group draws the window itself (background, border,
     corners), so the window's bottom edge glides to the new page's height;
   - the text area is blank on both sides of the swap: js/site.js has already deleted the old page
     (and prints the new one afterwards), so nothing in it moves;
   - the footer rides along with the bottom edge. */
.spm main[data-page] { view-transition-name: none; }   /* not the shared crossfade (site.css "page") */
.spm-sheet { view-transition-name: spm-win; }
.spm-term-bar { view-transition-name: spm-bar; }
.spm-term-head { view-transition-name: spm-head; }   /* already re-typed when the swap runs: holds still */
.spm-term-screen { view-transition-name: spm-screen; }   /* its scanlines, unchanged by the swap */
.spm-term-body { view-transition-name: spm-body; }
.spm-footer { view-transition-name: spm-foot; }
.spm-menu { view-transition-name: spm-menu; }   /* live, so its drawing corner isn't crossfaded with a frozen copy */
::view-transition-group(spm-menu), ::view-transition-new(spm-menu) { animation: none; }
::view-transition-old(spm-menu) { display: none; }

::view-transition-group(spm-win),
::view-transition-group(spm-bar),
::view-transition-group(spm-head),
::view-transition-group(spm-screen),
::view-transition-group(spm-body),
::view-transition-group(spm-foot) {
  animation-duration: .26s;
  animation-timing-function: cubic-bezier(.45, 0, .2, 1);
}
::view-transition-group(spm-win) {
  box-sizing: border-box;
  background: rgb(11 4 22 / .94);
  border: 1px solid rgb(171 140 212 / .28);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgb(0 0 0 / .55), 0 0 48px rgb(171 140 212 / .08);
}
::view-transition-old(spm-win), ::view-transition-new(spm-win) { animation: none; opacity: 0; }

::view-transition-group(spm-body) { overflow: clip; }
::view-transition-old(spm-body), ::view-transition-new(spm-body) { mix-blend-mode: normal; }
::view-transition-old(spm-body), ::view-transition-new(spm-body) { animation: none; }

/* Printing: js/site.js reveals the new page with a mask: everything above the current row (--spm-done),
   plus the current row up to the write head (--spm-x, --spm-y, row height --spm-lh), with a block
   cursor riding the head. */
.spm-term-body { position: relative; }
.spm-term-body.is-printing {
  -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 0, 0 var(--spm-y, 0px);
  mask-position: 0 0, 0 var(--spm-y, 0px);
  -webkit-mask-size: 100% var(--spm-done, 0px), var(--spm-x, 0px) var(--spm-lh, 0px);
  mask-size: 100% var(--spm-done, 0px), var(--spm-x, 0px) var(--spm-lh, 0px);
}
.spm-print-cursor {
  position: absolute;
  width: .6em;
  height: 1.15em;
  background: var(--spm-hi);
  pointer-events: none;
}
/* Where each page's output ends, the terminal waits: a blinking block after its last character. */
.spm-end-cursor {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: .2em;
  vertical-align: -.15em;
  background: var(--spm-hi);
  animation: spm-blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) { .spm-end-cursor { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(spm-win), ::view-transition-group(spm-bar), ::view-transition-group(spm-body),
  ::view-transition-group(spm-foot), ::view-transition-old(spm-body), ::view-transition-new(spm-body) { animation: none; }
}
