/* spanglertech.com v2 — shared layout. Colors, type and motifs come from
   themes.css (ops, editorial, print) through custom properties. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: var(--body-size, 1.0625rem); line-height: var(--body-leading, 1.6);
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--link, var(--accent)); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus, var(--accent)); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 {
  font-family: var(--font-display); font-weight: var(--display-weight, 600);
  font-variation-settings: var(--display-variation, normal); letter-spacing: var(--display-tracking, 0);
  line-height: 1.12; margin: 0 0 0.5em; text-wrap: balance;
}
h1 { font-size: var(--h1-size, clamp(2.4rem, 1.5rem + 4vw, 4.2rem)); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: 66ch; }
ul { padding-left: 1.2em; }
li + li { margin-top: 0.3em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 60; background: var(--fg); color: var(--bg); padding: 0.6rem 1rem; }
.skip:focus { top: 1rem; }
.wrap { width: min(74rem, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }

/* ---------- header / nav ---------- */
.site-header { border-bottom: var(--rule, 1px solid var(--line)); background: var(--bg); view-transition-name: site-header; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; padding-block: 0.9rem; }
.mark { font-family: var(--font-display); font-weight: var(--display-weight, 600); font-variation-settings: var(--display-variation, normal); font-size: 1.1rem; color: var(--fg); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 1.1rem; margin: 0; padding: 0; list-style: none; }
.nav li + li { margin: 0; }
.nav a { color: var(--fg); text-decoration: none; font-size: 0.95rem; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--accent-text, var(--accent)); }
.nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.5rem; }
.button { display: inline-block; text-decoration: none; font-weight: 600; padding: 0.72rem 1.15rem; border-radius: var(--button-radius, 6px); background: var(--button-bg, var(--accent)); color: var(--button-fg, #fff); border: 2px solid var(--button-bg, var(--accent)); }
.button.secondary { background: transparent; color: var(--fg); border-color: var(--line-strong, var(--fg)); }
.button:hover { filter: brightness(1.08); }

/* ---------- sections ---------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { border-top: var(--rule, 1px solid var(--line)); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 1.6rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.page-head { padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
.page-head p { font-size: 1.15rem; color: var(--muted); }

/* ---------- home hero ---------- */
.home-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.intro { display: block; }
.intro h1 { margin: 0; }
.role { font-family: var(--font-role, var(--font-display)); font-size: clamp(1.1rem, 1rem + 0.7vw, 1.45rem); color: var(--accent-text, var(--accent)); margin: 0.2rem 0 0; }
.pitch { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.35rem); margin: 1.4rem 0 0.4rem; max-width: 34rem; }
.avail { color: var(--muted); margin: 0; }

/* work-order ticket (home) */
.ticket { position: relative; background: var(--ticket-bg, var(--panel)); color: var(--ticket-fg, var(--fg)); border: var(--ticket-border, 1px solid var(--line)); border-radius: var(--ticket-radius, 8px); padding: 1.3rem 1.4rem 1.4rem; font-family: var(--font-ticket, var(--font-body)); transform: var(--ticket-tilt, none); box-shadow: var(--ticket-shadow, none); }
.ticket header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.9rem; }
.ticket .t-title { font-weight: 700; font-size: 0.95rem; }
.ticket .t-no { color: var(--ticket-muted, var(--muted)); font-size: 0.85rem; }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; font-size: 0.92rem; }
.ticket dt { color: var(--ticket-muted, var(--muted)); }
.ticket dd { margin: 0; }
.ticket ul { margin: 0; padding-left: 1.1em; font-size: 0.92rem; }
.ticket .scan { display: flex; align-items: center; gap: 1rem; margin-top: 1.1rem; padding-top: 1rem; border-top: var(--ticket-divider, 1px dashed var(--line)); }
.ticket .scan svg { width: 80px; height: 80px; flex: none; color: var(--ticket-code, var(--ticket-fg, var(--fg))); background: var(--ticket-code-bg, transparent); padding: var(--ticket-code-pad, 0); }
.ticket .scan p { margin: 0; font-size: 0.84rem; color: var(--ticket-muted, var(--muted)); }
.status-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--ok, #2f9e5b); margin-right: 0.45rem; vertical-align: 0.05em; }

/* ---------- stats ---------- */
/* Fallback: as many 12rem columns as fit. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--stats-gap, 1rem); margin: 0; }
.stat { min-width: 0; container-type: inline-size; background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 8px); padding: 1rem 1.15rem; }
.stat strong { display: block; font-family: var(--font-display); font-weight: var(--display-weight, 600); font-variation-settings: var(--display-variation, normal); font-size: var(--stat-size, 2.1rem); line-height: 1.05; color: var(--stat-color, var(--accent-text, var(--accent))); overflow-wrap: anywhere; }
/* long unbroken values ("3,562,317") shrink with their cell instead of spilling out of it */
.stat-long strong { font-size: min(var(--stat-size, 2.1rem), var(--stat-fit, 15cqi)); }
.stat span { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.93rem; line-height: 1.35; }
/* With container queries: whole rows only. Four stats sit 4 across, 2 by 2 or stacked; three sit
   3 across, or 2 plus 1 full width; two sit side by side. Columns never drop under 12rem. */
@supports (container-type: inline-size) and selector(:has(*)) {
  .stats { container-type: inline-size; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .stat { grid-column: span 3; }
  :where(.stats:has(> :nth-child(3):last-child)) > .stat { grid-column: span 4; }
  :where(.stats:has(> :nth-child(2):last-child)) > .stat { grid-column: span 6; }
  :where(.stats:has(> :nth-child(1):last-child)) > .stat { grid-column: span 12; }
  @container (max-width: 51rem) {
    :where(.stats:has(> :nth-child(4))) > .stat { grid-column: span 6; }
  }
  @container (max-width: 38rem) {
    :where(.stats:has(> :nth-child(3):last-child)) > .stat { grid-column: span 6; }
    :where(.stats:has(> :nth-child(3):last-child)) > .stat:last-child { grid-column: span 12; }
  }
  @container (max-width: 25rem) {
    .stats > .stat { grid-column: span 12; }
  }
}

/* ---------- capability tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tile { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.3rem; background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 8px); color: inherit; text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile svg { width: 40px; height: 40px; color: var(--accent-text, var(--accent)); }
.tile h3 { margin: 0.3rem 0 0; }
.tile p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tile .go { margin-top: auto; padding-top: 0.4rem; font-weight: 600; font-size: 0.9rem; color: var(--accent-text, var(--accent)); }

/* ---------- project cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1.4rem; }
.card { background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 10px); overflow: hidden; transition: transform 0.2s ease, border-color 0.2s ease; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-link:focus-visible { outline-offset: -3px; }
.card-media { aspect-ratio: 3 / 2; background: var(--media-bg, var(--bg)); overflow: hidden; border-bottom: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-figure { width: 100%; height: 100%; display: grid; place-items: center; padding: 0.8rem; }
.card-figure svg { width: 100%; height: 100%; }
.card-body { padding: 1rem 1.15rem 1.25rem; }
.card-cat { margin: 0 0 0.3rem; font-size: 0.8rem; font-weight: 600; color: var(--accent-text, var(--accent)); }
.card-body h3 { margin: 0 0 0.4rem; font-size: 1.12rem; }
.card-body p:last-child { margin: 0; color: var(--muted); font-size: 0.94rem; }
.card[hidden] { display: none; }
.featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .featured-grid { grid-template-columns: 1fr; } }

/* work filters */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.8rem; padding: 0; list-style: none; }
.filters li + li { margin: 0; }
.filters button { cursor: pointer; font: inherit; font-size: 0.9rem; padding: 0.42rem 0.85rem; border-radius: var(--chip-radius, 999px); border: 1px solid var(--line-strong, var(--line)); background: transparent; color: var(--fg); }
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--button-fg, #fff); }
.filters .count { opacity: 0.7; margin-left: 0.3rem; }

/* gear strip */
.gear-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(10rem, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: 0.6rem; scroll-snap-type: x mandatory; }
.gear-strip figure { margin: 0; scroll-snap-align: start; }
.gear-strip img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--card-radius, 8px); border: 1px solid var(--line); background: var(--panel); }
.gear-strip figcaption { font-size: 0.86rem; color: var(--muted); margin-top: 0.4rem; }

/* CTA band */
.cta-band { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.cta-band > div { background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 8px); padding: 1.5rem; }
.cta-band h3 { font-size: 1.35rem; }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0; }
.tags li { margin: 0; font-size: 0.8rem; padding: 0.2rem 0.55rem; border-radius: var(--chip-radius, 999px); background: var(--chip-bg); color: var(--chip-fg, var(--fg)); border: var(--chip-border, 0); }

/* ---------- project page ---------- */
.project-hero { border-bottom: var(--rule, 1px solid var(--line)); }
.project-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; padding-block: clamp(2rem, 5vw, 3.5rem); }
.crumbs { font-size: 0.92rem; margin-bottom: 1rem; color: var(--muted); }
.project-play { margin-top: 1.25rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: start; }
.photo-grid figure { margin: 0; }
.photo-grid picture { display: block; }
.photo-grid img { display: block; width: 100%; height: auto; border-radius: 6px; }
.photo-full { margin: 0.6rem 0 0; }
.photo-full .button { font-size: 0.9rem; padding: 0.45rem 0.85rem; }
.photo-grid figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.4rem; }
.project-hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); }
.lede { font-size: 1.18rem; max-width: 40rem; }
.project-hero-media { margin: 0; }
.project-hero-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--card-radius, 10px); border: 1px solid var(--line); background: var(--panel); }
.project-hero-media figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.credit { opacity: 0.8; margin-left: 0.4rem; }
.hero-figure { background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 10px); padding: 1rem; }
.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17.5rem; gap: 3rem; align-items: start; padding-block: 2.2rem 3rem; }
.project-body > section, .project-body > figure { margin-bottom: 2.2rem; }
.project-body h2 { font-size: 1.4rem; }
.built { padding-left: 0; list-style: none; }
.built li { position: relative; padding-left: 1.6rem; margin-top: 0.7rem; }
.built li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.6rem; height: 0.6rem; border-radius: var(--bullet-radius, 50%); background: var(--accent); }
.figure { margin: 0; padding: 1.2rem; background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 10px); }
.figure figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.7rem; }
.lesson { border-left: 4px solid var(--accent); padding-left: 1.1rem; }
.lesson h2 { font-size: 1.1rem; }
.glance { position: sticky; top: 1.2rem; background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 10px); padding: 1.2rem 1.3rem; font-size: 0.95rem; }
.glance dl { margin: 0; }
.glance dt { color: var(--muted); font-size: 0.82rem; margin-top: 1rem; }
.glance dt:first-child { margin-top: 0; }
.glance dd { margin: 0.25rem 0 0; }
.gear-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.gear-mini li { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 0.9rem; }
.gear-mini img { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.related { padding-block: 0 2.5rem; }
.related h2 { font-size: 1.4rem; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding-block: 1.5rem 3rem; border-top: var(--rule, 1px solid var(--line)); }
.pager a { display: block; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--card-radius, 8px); text-decoration: none; color: var(--fg); background: var(--panel); }
.pager a:hover { border-color: var(--accent); }
.pager a span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.2rem; }
.pager a[rel="next"] { text-align: right; }

/* ---------- diagram / chart figures (classes used inside project SVGs) ---------- */
svg.fig { width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.fig-node { fill: var(--bg); stroke: var(--line-strong, var(--line)); stroke-width: 1.5; }
.fig-node-accent { fill: var(--chip-bg); stroke: var(--accent); stroke-width: 2; }
.fig-label { fill: var(--fg); font-size: 16px; font-weight: 600; }
.fig-sub { fill: var(--muted); font-size: 13px; }
.fig-num { fill: var(--accent-text, var(--accent)); font-size: 20px; font-weight: 700; font-family: var(--font-display); }
.fig-edge { fill: none; stroke: var(--muted); stroke-width: 2; }
.fig-edge-dashed { stroke-dasharray: 6 5; }
.fig-arrow { fill: var(--muted); }
.fig-bar { fill: var(--accent); }
.fig-bar-muted { fill: var(--line-strong, var(--muted)); }
.fig-axis { stroke: var(--line); stroke-width: 1; fill: none; }
.fig-dot { fill: var(--accent); }

/* ---------- about ---------- */
.about-top { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2.5rem; align-items: start; max-width: 70rem; }
.about-portrait { display: block; width: 15rem; height: 15rem; max-width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 70%; border-radius: 50%; }
.principles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.principles li { margin: 0; padding: 1rem 1.1rem; background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 8px); }
.principles strong { display: block; margin-bottom: 0.25rem; }
.path { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; counter-reset: path; }
.path li { margin: 0; position: relative; padding: 1rem; border-top: 4px solid var(--accent); background: var(--panel); border-radius: 0 0 var(--card-radius, 8px) var(--card-radius, 8px); }
.path .yrs { display: block; font-size: 0.85rem; color: var(--muted); }
.path strong { display: block; margin: 0.2rem 0; }
.path p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.toolbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem; }
.toolbox section { padding: 1.1rem 1.2rem; background: var(--panel); border: var(--card-border, 1px solid var(--line)); border-radius: var(--card-radius, 8px); }
.toolbox h3 { font-size: 1.02rem; margin-bottom: 0.7rem; }

/* ---------- contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; font-size: 1.1rem; }
.contact-list li { margin: 0; }
.contact-list span { display: inline-block; min-width: 5.5rem; color: var(--muted); font-size: 0.95rem; }

/* ---------- credits ---------- */
.credits-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.credits-table th, .credits-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.credits-table img { width: 72px; height: 48px; object-fit: cover; border-radius: 4px; }

/* ---------- footer ---------- */
.site-footer { border-top: var(--rule, 1px solid var(--line)); padding-block: 1.8rem 5.5rem; color: var(--muted); font-size: 0.9rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
/* keep the footer clear of the floating look switcher (bottom right, about 9.5rem wide with its
   label): reserve 11rem from the window's right edge, less the margin the .wrap already has */
.site-footer .footer-row { padding-right: max(0px, 11rem - max((100% - 74rem) / 2, 1rem)); }
.footer-row p { margin: 0; max-width: none; }

/* ---------- look switcher ---------- */
.looks { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; font-family: var(--font-body); view-transition-name: looks; }
.looks > button { display: flex; align-items: center; gap: 0.55rem; cursor: pointer; background: var(--switch-bg, var(--fg)); color: var(--switch-fg, var(--bg)); border: 0; border-radius: 999px; padding: 0.6rem 1rem 0.6rem 0.7rem; font: inherit; font-size: 0.9rem; font-weight: 600; box-shadow: 0 6px 20px rgb(0 0 0 / 0.25); }
.swatch { display: inline-flex; width: 1.4rem; height: 1.4rem; border-radius: 50%; overflow: hidden; border: 2px solid currentColor; }
.swatch i { flex: 1; }
.looks-menu { position: absolute; right: 0; bottom: calc(100% + 0.6rem); width: 16rem; background: var(--menu-bg, var(--panel)); color: var(--fg); border: 1px solid var(--line-strong, var(--line)); border-radius: 10px; padding: 0.5rem; box-shadow: 0 10px 30px rgb(0 0 0 / 0.3); }
.looks-menu[hidden] { display: none; }
.looks-menu p { margin: 0.3rem 0.5rem 0.5rem; font-size: 0.82rem; color: var(--muted); }
.looks-menu button { display: flex; width: 100%; align-items: center; gap: 0.65rem; text-align: left; cursor: pointer; background: transparent; color: inherit; border: 0; border-radius: 6px; padding: 0.55rem 0.5rem; font: inherit; font-size: 0.95rem; }
.looks-menu button:hover { background: var(--chip-bg); }
.looks-menu button[aria-pressed="true"] { font-weight: 700; }
.looks-menu button[aria-pressed="true"]::after { content: "✓"; content: "✓" / ""; margin-left: auto; color: var(--accent-text, var(--accent)); }

/* ---------- page turn between pages (cross-document view transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 0.55s; }
::view-transition-old(root) { animation: page-leave 0.55s cubic-bezier(0.45, 0, 0.2, 1) both; transform-origin: left center; }
::view-transition-new(root) { animation: page-enter 0.55s cubic-bezier(0.2, 0, 0.1, 1) both; transform-origin: right center; }
@keyframes page-leave {
  to { transform: perspective(1800px) translateX(-4%) rotateY(-14deg); opacity: 0; filter: brightness(0.85); }
}
@keyframes page-enter {
  from { transform: perspective(1800px) translateX(6%) rotateY(10deg); opacity: 0; }
}
/* going back turns the page the other way */
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: page-leave-back; transform-origin: right center; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: page-enter-back; transform-origin: left center; }
@keyframes page-leave-back { to { transform: perspective(1800px) translateX(4%) rotateY(14deg); opacity: 0; filter: brightness(0.85); } }
@keyframes page-enter-back { from { transform: perspective(1800px) translateX(-6%) rotateY(-10deg); opacity: 0; } }
::view-transition-group(site-header), ::view-transition-group(looks) { animation-duration: 0.3s; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path, .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .home-hero .wrap, .project-hero-grid, .project-grid, .about-top, .cta-band { grid-template-columns: 1fr; }
  .glance { position: static; }
}
@media (max-width: 640px) {
  .tiles, .path, .principles { grid-template-columns: 1fr; }
  .intro { gap: 0.3rem 1rem; }
  .pager { grid-template-columns: 1fr; }
  .pager a[rel="next"] { text-align: left; }
  .looks > button { padding: 0.55rem; }
  .looks-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav { gap: 0.2rem 0.8rem; }
  .site-footer .footer-row { padding-right: 3.5rem; } /* the switcher is a 2.75rem circle here */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}
/* Windows High Contrast and other forced-color modes drop background colors, so selected
   states get system highlight colors instead */
@media (forced-colors: active) {
  /* html:root outranks the looks' own rules for these states in themes.css */
  html:root .filters button[aria-pressed="true"] {
    forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight;
  }
  /* plain nav links: only the current page keeps its underline */
  html:root .nav a { forced-color-adjust: none; color: LinkText; border-bottom-color: transparent; }
  html:root .nav a[aria-current="page"] { border-bottom-color: Highlight; border-bottom-width: 3px; }
}

/* ---------- printing (Ctrl+P) ----------
   Every look prints black on white without backgrounds. The résumé page is left alone:
   resume.css prints its designed sheet onto one page. */
@media print {
  .looks, .site-header .nav, .skip, [data-filters], [data-look-note] { display: none !important; }
  body:not(.page-resume) {
    --bg: #fff; --panel: #fff; --fg: #000; --muted: #333; --line: #999; --line-strong: #666;
    --accent: #000; --accent-text: #000; --link: #000; --ok: #000; --focus: #000;
    --chip-bg: #fff; --chip-fg: #000; --chip-border: 1px solid #999; --button-bg: #fff; --button-fg: #000;
    --stat-color: #000; --media-bg: #fff; --rule: 1px solid #000; --card-border: 1px solid #999;
    --ticket-bg: #fff; --ticket-fg: #000; --ticket-muted: #333; --ticket-border: 1px solid #000;
    --ticket-divider: 1px dashed #000; --ticket-tilt: none; --ticket-shadow: none; --ticket-code: #000; --ticket-code-bg: #fff;
    --portrait-shadow: none; --portrait-border: 1px solid #000;
    color: #000; background: #fff; font-size: 11pt; line-height: 1.45;
  }
  body:not(.page-resume) *, body:not(.page-resume) *::before, body:not(.page-resume) *::after {
    background-color: transparent !important; background-image: none !important;
    box-shadow: none !important; text-shadow: none !important; filter: none !important; outline: 0 !important;
  }
  body:not(.page-resume) a { color: #000; text-decoration: underline; }
  body:not(.page-resume) .mark, body:not(.page-resume) .card-link, body:not(.page-resume) .tile, body:not(.page-resume) .pager a { text-decoration: none; }
  body:not(.page-resume) .button { color: #000; border: 1px solid #000; padding: 0.3rem 0.7rem; text-decoration: none; }
  body:not(.page-resume) .stat strong { color: #000 !important; display: block !important; }
  body:not(.page-resume) .path li { border-top-color: #000 !important; }
  /* decorations drawn with backgrounds: bullets become solid borders, the rest are dropped */
  body:not(.page-resume) .built li::before { border: 0.3rem solid #000; }
  .status-dot, .site-header::after, .site-footer .wrap::before { display: none !important; }
  /* single columns, so nothing is pushed whole onto the next page (the print look's home page
     used to start with a blank one) */
  .home-hero .wrap, .project-grid, .project-hero-grid, .about-top { display: block; }
  .home-hero .wrap { padding-block: 0 1rem; }
  .home-hero .ticket, .project-hero-media, .glance { margin: 1rem 0 0; max-width: 32rem; }
  .project-hero-grid { padding-block: 1rem; }
  .glance { position: static; }
  .section, .page-head { padding-block: 1rem; }
  .site-footer { padding-block: 0.8rem 0; }
  .site-footer .footer-row { padding-right: 0; }
  .gear-strip { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
  .card-body { padding: 0.6rem 0.75rem 0.75rem; }
  .card-body h3 { font-size: 1rem; }
  .card-body p:last-child { font-size: 0.85rem; }
  .card:hover { transform: none; }
  h1, h2, h3, .section-head { break-after: avoid; }
  img, svg, figure, .card, .tile, .stat, .figure, .glance, .ticket, .path li, .principles li, .toolbox section,
  .cta-band > div, .pager a, .gear-strip figure, tr { break-inside: avoid; }
}

/* spacing helpers (no inline styles: the site's content policy forbids them) */
.page-body { padding-bottom: 3.5rem; }
.contact-list.spaced { margin-bottom: 2.5rem; }
.spaced-top { margin-top: 1.5rem; }

/* Project diagrams stay collapsed until the reader opens them. */
.project-diagram { margin-block: 2rem; border: 1px solid var(--line); border-radius: var(--radius, .4rem); padding: 1rem; }
.project-diagram summary { cursor: pointer; font-weight: 700; }
.project-diagram summary:focus-visible { outline: 2px solid var(--accent); outline-offset: .3rem; }
.project-diagram .figure { margin-bottom: 0; }
@media print { .project-diagram { break-inside: avoid; } }

.start-photo-link { display: block; color: inherit; }
.start-photo-link:focus-visible { outline-offset: -3px; }
