/* ajmyers.net: resume cover page.
   System fonts only, and no inline styles or scripts: the CSP allows same-origin resources only.
   The scripts are hero.js (the home page's background animation) and highlight.js (colours code).
   Palette: whites, greys, blues and near-black. The hero and the contact panel are always dark. */

/* Tokens and chrome are shared with pages outside this repo; see each file's header */
@import url("tokens.css");
@import url("chrome.css");

/* Dark surfaces re-scope the palette, so everything inside them just works */
.hero-shell, .contact {
  --ink: #f3f6fb;
  --ink-soft: #c3cbd8;
  --muted: #8b95a7;
  --rule: rgba(255, 255, 255, 0.1);
  --accent: #60a5fa;
  --accent-2: #93c5fd;
  --accent-ink: #05070d;
  --chip: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }

/* ---- Hero ------------------------------------------------------------- */

.hero-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: calc(-1 * var(--bar));   /* run under the sticky masthead */
  padding-top: var(--bar);
  background:
    radial-gradient(ellipse 55% 60% at 78% 42%, rgba(37, 99, 235, 0.32), transparent 70%),
    radial-gradient(ellipse 45% 40% at 8% 0%, rgba(96, 165, 250, 0.14), transparent 70%),
    linear-gradient(180deg, #05070d 0%, #070c18 100%);
}

.hero-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

/* Fine dot texture across the whole hero */
.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 85%);
}

/* Canvas drawn by hero.js: the scrolling grid floor, cubes driving along it with light trails, and
   shooting stars. Stays empty without JavaScript. */
.hero-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-cube {
  position: absolute;
  top: 50%;
  right: max(0rem, calc((100% - var(--wrap)) / 2 - 3rem));
  width: min(46vw, 34rem);
  height: auto;
  translate: 0 -50%;
  filter: drop-shadow(0 0 32px rgba(59, 130, 246, 0.35));
  animation: float 9s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.hero {
  position: relative;
  padding-block: clamp(4.5rem, 12vw, 8.5rem) clamp(3.5rem, 8vw, 5.5rem);
}
.hero-shell .hero > * { max-width: 36rem; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.4rem;
  padding: 0.35rem 0.8rem 0.35rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.6); }
  80%, 100% { box-shadow: 0 0 0 9px rgba(96, 165, 250, 0); }
}

h1 {
  margin: 0;
  font: 700 clamp(2.9rem, 8vw, 5.25rem)/1 var(--sans);
  letter-spacing: -0.045em;
}
.hero-shell .hero h1 {
  background: linear-gradient(100deg, #ffffff 30%, #9cc6ff 75%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;  /* keep descenders inside the clipped background */
}

.role-line {
  margin: 1rem 0 0;
  color: var(--ink);
  font: 500 clamp(1.2rem, 2.6vw, 1.5rem)/1.3 var(--sans);
  letter-spacing: -0.015em;
}

.lead { margin: 1.4rem 0 0; color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.7; }

/* Where the work was done: the names a skimming reader looks for */
.employers {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
  margin: 1.5rem 0 0;
  color: var(--ink);
  font: 600 1.0625rem/1.3 var(--sans);
  letter-spacing: -0.01em;
}
.employers span {
  color: var(--muted);
  font: 500 0.72rem/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--chip);
  color: var(--ink);
  font: 500 0.9375rem/1.2 var(--sans);
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.button:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-1px); }

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 6px 24px -6px rgba(37, 99, 235, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.button.primary:hover { box-shadow: 0 10px 32px -6px rgba(37, 99, 235, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.button.primary::after { content: "→"; transition: translate 0.2s; }
.button.primary:hover::after { translate: 3px 0; }
/* A primary button that jumps down the page points down */
.button.primary[href^="#"]::after, .button.primary[href$=".pdf"]::after { content: "↓"; }
.button.primary[href^="#"]:hover::after, .button.primary[href$=".pdf"]:hover::after { translate: 0 3px; }

@media (max-width: 52rem) {
  .hero-cube { right: -18%; width: 80vw; opacity: 0.35; }
}

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

main { counter-reset: section; }

.section {
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  gap: 0 2.5rem;
  padding-block: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--bar);
  counter-increment: section;
}
.hero-shell + .section { border-top: 0; }

.section-label {
  margin: 0.3rem 0 1.5rem;
  color: var(--ink);
  font: 600 0.78rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section-label::before {
  content: counter(section, decimal-leading-zero) " / ";
  color: var(--accent);
}

@media (max-width: 48rem) {
  .section { grid-template-columns: 1fr; }
}

h3 { margin: 0; font: 600 1.25rem/1.3 var(--sans); letter-spacing: -0.015em; }

/* ---- Experience timeline ---------------------------------------------- */

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
  border-left: 1px solid var(--rule);
}

/* Dates sit on the right of the title line, like a printed resume */
.role { position: relative; }
.timeline .role + .role { margin-top: 3rem; }

/* Node on the rail */
.timeline .role::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem - 5px);
  top: 0.5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.timeline .role:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.when {
  position: absolute;
  top: 0.3rem;
  right: 0;
  margin: 0;
  color: var(--muted);
  font: 0.8rem/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.role-body h3 { padding-right: 12rem; }
/* The dates follow the company in the markup (title, company, dates: the order a reader and a
   resume parser expect) and are lifted to the right of the title on wide screens */
.role-body > .when { margin: 0; color: var(--muted); }

.role-body > p { margin: 0.75rem 0 0; color: var(--ink-soft); }
.role-body .org { margin-top: 0.2rem; color: var(--accent); font-weight: 600; }
.role-body .org span { color: var(--muted); font-weight: 400; }
.note { color: var(--muted); font-weight: 400; font-size: 1rem; }

.points { margin: 1rem 0 0; padding: 0; list-style: none; }
.points li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--ink-soft);
}
.points li + li { margin-top: 0.6rem; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--accent);
  rotate: 45deg;
}
.points strong { color: var(--ink); font-weight: 600; }

@media (max-width: 40rem) {
  .when, .role-body > .when { position: static; margin: 0.2rem 0 0; }
  .role-body h3 { padding-right: 0; }
}

.more-link { margin: 2.25rem 0 0; font-weight: 500; }

/* ---- Resume page (/resume/) ------------------------------------------- */

.resume .hero { padding-block: clamp(3rem, 7vw, 4.5rem) clamp(2.5rem, 5vw, 3.5rem); }
.resume h1 { font-size: clamp(2.4rem, 6vw, 3.5rem); }
.resume .lead { max-width: 46rem; }
.print-only { display: none; }

/* ---- Expertise --------------------------------------------------------- */

.expertise {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 40rem) { .expertise { grid-template-columns: 1fr; } }

.skill-group {
  padding: 1.25rem 1.35rem 1.35rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.skill-group h3 { font-size: 1.05rem; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--chip);
  color: var(--ink-soft);
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* ---- Education --------------------------------------------------------- */

.education .when { top: 0.3rem; }

/* ---- Tools ------------------------------------------------------------- */

.section-intro { margin: 0 0 1.5rem; color: var(--ink-soft); max-width: 40rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 40rem) { .cards { grid-template-columns: 1fr; } }

.card {
  position: relative;
  overflow: hidden;
  padding: 1.4rem 1.4rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
/* Thin blue light along the top edge */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  opacity: 0.7;
}
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--rule));
  box-shadow: 0 12px 36px -14px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-2px);
}
/* The live project: full width, with an example command beside the text */
.card.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  align-items: center;
  padding: 1.6rem;
}
.card.featured h3 { font-size: 1.2rem; }
@media (max-width: 56rem) { .card.featured { grid-template-columns: minmax(0, 1fr); } }

/* A terminal window, always dark */
.term {
  margin: 0;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 10px;
  background: #0a1122;
  color: #dbe6f5;
  overflow: hidden;
}
.term figcaption {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #8b95a7;
  font: 500 0.7rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.term figcaption::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 1.5rem;
  border-radius: 50%;
  background: #3b4a66;
  box-shadow: 0.85rem 0 0 #3b4a66, 1.7rem 0 0 #3b4a66;
}
.term pre { margin: 0; padding: 0.9rem 1rem 1rem; font-size: 0.8125rem; line-height: 1.7; overflow-x: auto; }
.term code { font-size: 1em; }
.term-note { color: #6f8fc2; }

/* The project rows (src/projects.mjs): text on one side and the project's visual on the other,
   alternating sides. The visuals are skipcheck.io's (/visual.css) */
.rows { display: grid; gap: 1rem; }
.card.featured.text-only { grid-template-columns: minmax(0, 1fr); }
.badge.version { text-transform: none; letter-spacing: 0.02em; }

.subhead {
  margin: 2.25rem 0 0.9rem;
  color: var(--muted);
  font: 600 0.72rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.cards.compact { grid-template-columns: repeat(3, 1fr); }
.cards.compact.two { grid-template-columns: repeat(2, 1fr); }
.cards.compact .card { padding: 1.1rem 1.15rem; }
.cards.compact .card h3 { font-size: 0.95rem; }
.cards.compact .card p { font-size: 0.875rem; }
@media (max-width: 56rem) { .cards.compact { grid-template-columns: 1fr; } }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.card h3 { font: 600 1.05rem/1.3 var(--mono); letter-spacing: 0; }
.card p { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.card .card-links { margin-top: 0.85rem; font-weight: 500; }

.badge {
  flex: none;
  padding: 0.15rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font: 600 0.65rem/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Contact: a dark panel that bookends the hero -------------------- */

.contact {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, 5vw, 2.75rem);
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(ellipse 60% 90% at 100% 0%, rgba(37, 99, 235, 0.35), transparent 70%),
    linear-gradient(160deg, #0a1122, var(--night));
}
.contact::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent 30%, #000);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
  pointer-events: none;
}
.contact > * { position: relative; z-index: 1; }
.contact-line { margin: 0; font: 600 clamp(1.35rem, 2.8vw, 1.85rem)/1.3 var(--sans); letter-spacing: -0.025em; }
.contact .actions { margin-top: 1.5rem; }

/* ---- 404 --------------------------------------------------------------- */

.notfound { padding-block: clamp(5rem, 16vw, 9rem); }
.notfound h1 { font-size: clamp(2.5rem, 7vw, 4rem); }
.notfound p { margin: 1.25rem 0 0; color: var(--ink-soft); font-size: 1.125rem; }

/* ---- Code ---------------------------------------------------------------- */

code, pre { font-family: var(--mono); font-size: 0.875em; }

/* Syntax colours for code blocks, set by /highlight.js on <code class="lang-…">.
   c comment, s string, k keyword, a annotation/variable/flag, n number, t type,
   f function or command, p property key. */
:root {
  --tok-c: #677285; --tok-s: #0f7b4f; --tok-k: #7c3aed; --tok-a: #b45309;
  --tok-n: #b45309; --tok-t: #0e7490; --tok-f: #2563eb; --tok-p: #2563eb;
}
/* Dark as in tokens.css: the system's setting unless data-color-mode says otherwise */
@media (prefers-color-scheme: dark) {
  :root:not([data-color-mode="light"]) {
    --tok-c: #7f8aa0; --tok-s: #7dd3a8; --tok-k: #c4a7ff; --tok-a: #f5c26b;
    --tok-n: #f5c26b; --tok-t: #67d5e8; --tok-f: #8ab8ff; --tok-p: #8ab8ff;
  }
}
:root[data-color-mode="dark"] {
  --tok-c: #7f8aa0; --tok-s: #7dd3a8; --tok-k: #c4a7ff; --tok-a: #f5c26b;
  --tok-n: #f5c26b; --tok-t: #67d5e8; --tok-f: #8ab8ff; --tok-p: #8ab8ff;
}
/* The home page's terminal is dark in both schemes */
.term {
  --tok-c: #6f8fc2; --tok-s: #7dd3a8; --tok-k: #c4a7ff; --tok-a: #f5c26b;
  --tok-n: #f5c26b; --tok-t: #67d5e8; --tok-f: #8ab8ff; --tok-p: #8ab8ff;
}
.tok-c { color: var(--tok-c); font-style: italic; }
.tok-s { color: var(--tok-s); }
.tok-k { color: var(--tok-k); }
.tok-a { color: var(--tok-a); }
.tok-n { color: var(--tok-n); }
.tok-t { color: var(--tok-t); }
.tok-f { color: var(--tok-f); }
.tok-p { color: var(--tok-p); }

/* ---- Motion ------------------------------------------------------------ */

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

/* ---- Print: a clean one-pager ----------------------------------------- */

@media print {
  @page { margin: 1.2cm 1.5cm; }

  /* The extra root selectors match the dark rules' specificity (tokens.css), so print stays
     black on white whatever the colour mode */
  :root, :root[data-color-mode], :root:not([data-color-mode]), .hero-shell, .contact {
    --paper: #fff; --surface: #fff; --ink: #000; --ink-soft: #222; --muted: #555;
    --rule: #ccc; --accent: #000; --accent-2: #555; --chip: #fff;
  }
  :root[data-color-mode] { color-scheme: light; }

  body { font-size: 9.5pt; line-height: 1.45; }
  .masthead, .skip, .actions, .hero-art, .kicker, #projects, #contact { display: none; }
  .wrap { width: auto; max-width: none; }

  .hero-shell { margin: 0; padding: 0; background: none; }
  .hero, .resume .hero { padding: 0 0 0.8rem; }
  .print-only { display: block; margin: 0.3rem 0 0; color: #333; font-size: 9pt; }
  .hero-shell .hero > * { max-width: none; }
  /* Normal letter spacing in print: with the tight screen spacing, PDF text extraction (and so
     resume parsers) read "Andrew Myers" as one word */
  h1, .hero h1, .resume h1 { font-size: 26pt; background: none; color: #000; letter-spacing: 0; word-spacing: 0.08em; }
  .role-line { font-size: 12pt; margin-top: 0.3rem; }
  .lead, .resume .lead { font-size: 9.5pt; margin-top: 0.7rem; max-width: none; }

  .section { grid-template-columns: 1fr; padding-block: 0.5rem; }
  .section-label { break-after: avoid; }
  #education { break-inside: avoid; }
  /* No letter spacing: spaced capitals are extracted as "E X P E R I E N C E", which parsers
     don't recognise as a section heading */
  .section-label { margin: 0 0 0.5rem; letter-spacing: 0; }
  /* Nothing positioned: browsers paint positioned elements after the rest, and the PDF's text
     follows paint order, so positioned blocks were extracted after everything else on the page */
  .hero, .timeline, .role, .points li { position: static; }
  .section-label::before { content: none; }
  .timeline { padding-left: 0; border-left: 0; }
  .timeline .role::before { content: none; }
  .role { break-inside: avoid; }
  /* One column, in reading order: resume parsers read the PDF's text top to bottom, and dates
     positioned to the right of a title, or skills in two columns, come out scrambled */
  .when, .role-body > .when { position: static; margin: 0.05rem 0 0; font-size: 8.5pt; }
  .role-body h3 { padding-right: 0; }
  .timeline .role + .role { margin-top: 0.6rem; }
  h3 { font-size: 11pt; }
  .points { margin-top: 0.35rem; }
  .points li + li { margin-top: 0.2rem; }
  /* Ordinary list bullets: the screen's drawn markers need a positioned list item */
  .points { padding-left: 1.1rem; list-style: disc; }
  .points li { padding-left: 0.15rem; }
  .points li::before { content: none; }

  .expertise { grid-template-columns: 1fr; gap: 0.3rem; }
  .skill-group h3 { font-size: 10pt; }
  .skill-group { padding: 0; border: 0; }
  .chips { gap: 0.1rem 0.5rem; margin-top: 0.15rem; }
  .chips li { padding: 0; border: 0; background: none; font-size: 9pt; }
  /* Commas: the separator resume parsers split a skills list on most reliably */
  .chips li:not(:last-child)::after { content: ","; }

  /* The resume PDF needs no site footer; other pages keep a small one */
  .footer { padding: 0.6rem 0 0; font-size: 7.5pt; }
  .resume ~ .footer { display: none; }
  a { color: inherit; text-decoration: none; }
}

/* A section's label, with the code windows' view control under it (/visual.js), kept in sight while
   its projects scroll by */
.section-side { align-self: start; position: sticky; top: calc(var(--bar, 3.5rem) + 1.5rem); }
.section-side .pv-view { flex-direction: column; align-items: stretch; margin-bottom: 1.5rem; color: var(--ink); }
.section-side .pv-view button { text-align: left; }
@media (max-width: 48rem) {
  .section-side { position: static; }
  .section-side .pv-view { flex-direction: row; }
}

/* A row with a visual is a window (src/projects.mjs): a title bar across the card, with the dots and
   the project's name, then the text and the visual side by side, the visual always on the right.
   Collapsed (the yellow dot, or Presentation), the visual slides away and the text takes the width;
   opened, it slides back out. The visual keeps its own header, for its tabs, without its dots */
.card.featured.window {
  --text-col: minmax(0, 0.8fr);
  --code-col: minmax(0, 1.2fr);
  grid-template-columns: var(--text-col) var(--code-col);
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 0;
  align-items: stretch;
  /* Clips, as the visual slides and at the corners, without being a scroll container, which would
     keep the sticky text from sticking to the page */
  overflow: clip;
  transition: grid-template-columns 0.4s ease;
}
.card.featured.window:has(.pv-view-min:checked) { --text-col: minmax(0, 1fr); --code-col: minmax(0, 0fr); }
.card-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 2.9rem;
  padding: 0.5rem 1.1rem 0.5rem 1.15rem;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.card-bar .card-head { flex: 1; align-items: center; justify-content: flex-start; gap: 0.7rem; min-width: 0; }
/* The window's title: the site's headings' face, not the code's, so it doesn't compete with it */
.card.window .card-bar h3 {
  overflow: hidden;
  font: 600 1.0625rem/1.3 var(--sans);
  letter-spacing: -0.012em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-kind {
  padding-left: 0.7rem;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  font: 500 0.66rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.card-bar .badge { margin-left: auto; }
@media (max-width: 34rem) { .card-kind { display: none; } }
.card-bar .pv-dots { margin-right: 0.25rem; }
.card-bar .pv-dot { background: color-mix(in srgb, var(--ink) 22%, transparent); }
/* At the top, under the title, wherever the code ends; with a long window, it stays in sight */
.card-text { grid-row: 2; grid-column: 1; align-self: start; position: sticky; top: calc(var(--bar, 3.5rem) + 0.5rem); padding: 1.3rem 1.6rem 1.5rem; }
.card-text > p:first-child { margin-top: 0; }
.card.featured.window > .pv { grid-row: 2; grid-column: 2; border: 0; border-left: 1px solid var(--rule); border-radius: 0; }
.card.featured.window > .pv .pv-bar .pv-dots { display: none; }
/* Collapsed: the visual stays, so it can slide, but gives the row none of its height */
.card.featured.window > .pv { transition: visibility 0s; }
.card.featured.window > .pv:has(.pv-view-min:checked) { contain: size; border-color: transparent; visibility: hidden; transition: visibility 0s 0.4s; }
.card.featured.window > .pv > .pv-view-min:checked ~ :is(.pv-fold, .pv-code, .pv-panes) { display: block; }
.card.featured.window > .pv > .pv-view-min:checked ~ :is(.pv-more, .pv-status) { display: flex; }
@media (max-width: 56rem) {
  .card.featured.window { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .card.featured.window > .card-text { grid-column: 1; grid-row: 3; position: static; }
  .card.featured.window > .pv { grid-column: 1; border-inline: 0; border-bottom: 1px solid var(--rule); }
  .card.featured.window > .pv:has(.pv-view-min:checked) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .card.featured.window { transition: none; } }

