/* ==========================================================================
   Velstand base styles — mobile-first (375px), min-width breakpoints only.
   Swiss / dark. All values come from tokens.css.
   ========================================================================== */

/* ---------------------------------------------------------------- Fonts */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var.woff2") format("woff2-variations"), url("/assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 800;   /* axes trimmed to what tokens.css uses: scripts/trim-fonts.sh */
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-height) + var(--space-4)); }
body {
  min-height: 100vh;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  font-stretch: var(--font-stretch-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; } /* component display rules must never un-hide */
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
ul[class], ol[class] { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-weight: var(--font-weight-semibold); line-height: var(--line-height-snug); text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--color-accent-primary); color: var(--color-text-on-accent); }

/* ---------------------------------------------------------------- Focus */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--border-radius-sm); }
main:focus { box-shadow: none; }

.skip-link {
  position: absolute; left: var(--space-4); top: var(--space-2); z-index: calc(var(--z-overlay) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-inverse); color: var(--color-text-inverse);
  font-weight: var(--font-weight-semibold);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

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

/* --------------------------------------------------------------- Layout */
.container {
  width: 100%;
  max-width: var(--max-width-page);
  margin-inline: auto;
  padding-inline: var(--space-page);
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--space-gutter);
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr)); } }

.section { padding-block: var(--space-section); }
.rule { border: 0; border-top: var(--border-width-hairline) solid var(--color-border-primary); }

/* ----------------------------------------------------------- Typography */
.display {
  font-family: var(--font-family-display);
  font-stretch: var(--font-stretch-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  text-transform: uppercase;
}
.display--4xl { font-size: var(--font-size-4xl); }
.display--3xl { font-size: var(--font-size-3xl); }
.display--2xl { font-size: min(var(--font-size-2xl), 9.6vw); }  /* 9.6vw only bites below 375 px: "ENGINEERING" fits at 320 */
.heading-xl { font-size: var(--font-size-xl); font-stretch: var(--font-stretch-label); font-weight: var(--font-weight-bold); letter-spacing: var(--letter-spacing-tight); }
.heading-lg { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
.lead { font-size: var(--font-size-md); color: var(--color-text-secondary); max-width: var(--max-width-content); }
.prose { max-width: var(--max-width-content); color: var(--color-text-secondary); }
.prose > * + * { margin-top: var(--space-4); }
.accent { color: var(--color-accent-primary); }
.keep-case { text-transform: none; }  /* e.g. "LiFePO4" inside uppercase display type */
.text-link { color: var(--color-text-link); }
/* A text link on its own (not inside running text) still needs a 44 px target. */
.text-link--standalone { display: inline-flex; align-items: center; min-height: var(--tap-target-min); }

.label {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}
.label--accent { color: var(--color-text-link); }

/* -------------------------------------------------------------- Buttons */
.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--button-height);
  padding-inline: var(--button-padding-x);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-stretch: var(--font-stretch-label);
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  text-wrap: balance;   /* long labels wrap at narrow widths instead of pushing the page wider */
  max-width: 100%;
  padding-block: var(--space-2);
  transition: background-color var(--duration-fast) var(--easing-default), color var(--duration-fast) var(--easing-default), box-shadow var(--duration-fast) var(--easing-default);
}
.button--primary { background: var(--color-accent-primary); color: var(--color-text-on-accent); }
.button--primary:hover { background: var(--color-accent-primary-hover); }
.button--primary:active { background: var(--color-accent-primary-active); }
.button--secondary { color: var(--color-text-primary); box-shadow: inset 0 0 0 1px var(--color-border-input); }
.button--secondary:hover { box-shadow: inset 0 0 0 1px var(--color-text-primary); }
.button--compact { min-height: var(--tap-target-min); padding-inline: var(--space-2); font-size: var(--font-size-xs); letter-spacing: 0.05em; }
.button:focus-visible { box-shadow: var(--shadow-focus); }

/* White light-sweep at the V angle (hover/focus). Motion task 3 extends this to cards. */
.button::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10% auto -10% 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.35), transparent);
  transform: translateX(-160%) skewX(calc(-1 * var(--v-lean)));
  pointer-events: none;
}
.button:hover::after, .button:focus-visible::after {
  transform: translateX(320%) skewX(calc(-1 * var(--v-lean)));
  transition: transform var(--duration-sweep) var(--easing-out);
}

.icon-button {
  flex: none;   /* never squeezed below 44 px in a flex row */
  display: inline-grid;
  place-items: center;
  width: var(--tap-target-min);
  height: var(--tap-target-min);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  box-shadow: inset 0 0 0 1px var(--color-border-primary);
  transition: box-shadow var(--duration-fast) var(--easing-default);
}
.icon-button:hover { box-shadow: inset 0 0 0 1px var(--color-text-secondary); }
/* The border is a box-shadow, so the focus ring has to be restated with it (same specificity
   as :focus-visible, declared later, would otherwise win). */
.icon-button:focus-visible { box-shadow: var(--shadow-focus), inset 0 0 0 1px var(--color-text-secondary); }
.icon-button svg { width: 1.125rem; height: 1.125rem; }

/* --------------------------------------------------------------- Header
   Compact on phones; on desktop it starts tall and compacts once you scroll. */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgb(10 13 20 / 0.86);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: var(--border-width-hairline) solid var(--color-border-secondary);
  transition: border-color var(--duration-normal) var(--easing-default);
}
.site-header.is-scrolled { border-bottom-color: var(--color-border-primary); }
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);   /* space-4 from 360 px; tight below so 320 px (400 % zoom) fits */
  height: var(--header-height-compact);
  transition: height var(--duration-normal) var(--easing-out);
}
.site-header__brand { display: flex; align-items: center; flex: none; min-height: var(--tap-target-min); color: var(--color-text-primary); padding-block: var(--space-2); }
.wordmark { width: auto; height: 1.375rem; transition: height var(--duration-normal) var(--easing-out); }
/* Phones: the V alone (link kept 44 px wide), leaving room for the call icon. Full wordmark from 440 px. */
.site-header__brand:has(.wordmark-v) { min-width: var(--tap-target-min); }
.wordmark-v { display: block; width: auto; height: 1.75rem; }
.site-header__brand .wordmark-v + .wordmark { display: none; }
.site-header__actions { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.site-header__phone { display: none; }
.site-nav { display: none; }

/* Menu button: two bars → X. The no-JS link version jumps to the footer nav. */
.site-header__menu-link { display: none; }
html:not(.js) .site-header__menu { display: none; }
html:not(.js) .site-header__menu-link { display: inline-grid; }
.menu-icon { display: grid; gap: 6px; width: 18px; }
.menu-icon span { display: block; height: 2px; background: currentColor; transition: transform var(--duration-normal) var(--easing-out), width var(--duration-normal) var(--easing-out); }
.menu-icon span:first-child { width: 100%; }
.menu-icon span:last-child { width: 70%; justify-self: end; }
[aria-expanded="true"] .menu-icon span:first-child { transform: translateY(4px) rotate(45deg); }
[aria-expanded="true"] .menu-icon span:last-child { width: 100%; transform: translateY(-4px) rotate(-45deg); }

/* ---------------------------------------------------------- Mobile menu
   Full-screen overlay under the header. Opening: a skewed band (dark fill led by
   red/white/navy stripes, at the V angle) sweeps left → right across the screen, then
   the items rise in. Closing runs it back. Reduced motion: no sweep, no rise. */
html.menu-open { overflow: hidden; }
html.menu-open .site-header { z-index: calc(var(--z-overlay) + 1); border-bottom-color: var(--color-border-primary); }
.menu {
  --vh: 100vh;
  --unit: clamp(0.75rem, 3vw, 1.5rem);
  --gap: calc(var(--unit) * 0.5);
  --lean-x: calc(var(--vh) * var(--v-slope));   /* how far the V edge leans over the full height */
  --stripes: calc(var(--unit) * (var(--v-ratio-red) + var(--v-ratio-white) + var(--v-ratio-navy)) + var(--gap) * 3);
  --fill: calc(100vw + var(--lean-x));
  --x-open: calc(-1 * var(--lean-x));
  --x-closed: calc(-1 * (var(--fill) + var(--stripes) + var(--lean-x) * 2));
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@supports (height: 100lvh) { .menu { --vh: 100lvh; } }
.menu__wipe {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  gap: var(--gap);
  transform-origin: 0 100%;
  transform: translateX(var(--x-closed)) skewX(calc(-1 * var(--v-lean)));
  transition: transform var(--duration-slow) var(--easing-in);
  pointer-events: none;
}
.menu__wipe span { flex: none; height: 100%; }
.menu__fill { width: var(--fill); background: var(--color-bg-primary); }
.menu__wipe span:nth-child(2) { width: calc(var(--unit) * var(--v-ratio-red)); background: var(--v-red); }
.menu__wipe span:nth-child(3) { width: calc(var(--unit) * var(--v-ratio-white)); background: var(--v-white); }
.menu__wipe span:nth-child(4) { width: calc(var(--unit) * var(--v-ratio-navy)); background: var(--v-navy); }
.menu[data-state="opening"] .menu__wipe,
.menu[data-state="open"] .menu__wipe {
  transform: translateX(var(--x-open)) skewX(calc(-1 * var(--v-lean)));
  transition: transform var(--duration-slower) var(--easing-out);
}

.menu__inner {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--space-7);
  min-height: 100%;
  padding-block: calc(var(--header-height-compact) + var(--space-6)) var(--space-8);
}
.menu__item {
  opacity: 0;
  transform: translateY(var(--space-4));
  transition: opacity var(--duration-fast) var(--easing-default), transform var(--duration-fast) var(--easing-default);
}
.menu[data-state="opening"] .menu__item,
.menu[data-state="open"] .menu__item {
  opacity: 1;
  transform: none;
  transition: opacity var(--duration-normal) var(--easing-default), transform var(--duration-slow) var(--easing-out);
  transition-delay: calc(160ms + var(--i, 0) * 45ms);
}
.menu__list { list-style: none; padding: 0; }
/* rules live on the items so they fade in with them, not before the wipe arrives */
.menu__list .menu__item { border-bottom: var(--border-width-hairline) solid var(--color-border-primary); }
.menu__list .menu__item:first-child { border-top: var(--border-width-hairline) solid var(--color-border-primary); }
.menu__link {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  min-height: var(--tap-target-min);
  padding-block: var(--space-4);
  text-decoration: none;
  color: var(--color-text-primary);
  transition: color var(--duration-fast) var(--easing-default);
}
.menu__num { flex: none; width: 2ch; color: var(--color-text-secondary); }
.menu__label { font-size: clamp(1.75rem, 8.6vw, 3.25rem); line-height: 1; }
.menu__link:hover, .menu__link[aria-current="page"] { color: var(--color-text-link); }
.menu__link[aria-current="page"] .menu__num { color: var(--color-text-link); }
.menu__meta { display: grid; justify-items: start; gap: var(--space-4); color: var(--color-text-secondary); }
.menu__phone {
  display: grid;
  gap: var(--space-1);
  min-height: var(--tap-target-min);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  text-decoration: none;
}
.menu__address { min-height: var(--tap-target-min); color: inherit; text-decoration: none; }
.menu__address:hover { color: var(--color-text-primary); }
.menu__faq { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap-target-min); font-weight: var(--font-weight-semibold); }
@media (min-width: 640px) {
  .menu__meta { grid-template-columns: auto auto; column-gap: var(--space-8); align-items: start; }
  .menu__faq { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .menu__wipe, .menu__item,
  .menu[data-state] .menu__wipe, .menu[data-state] .menu__item { transition: none; }
  .menu__item { transform: none; }
}

@media (min-width: 360px) {
  .site-header__inner { gap: var(--space-4); }
  .site-header__actions { gap: var(--space-2); }
  .button--compact { padding-inline: var(--space-3); }
}
@media (min-width: 400px) {
  .wordmark { height: 1.5rem; }
}
@media (min-width: 440px) {
  .site-header__brand:has(.wordmark-v) { min-width: 0; }
  .wordmark-v { display: none; }
  .site-header__brand .wordmark-v + .wordmark { display: block; }
}

@media (min-width: 960px) {
  .site-header__inner { height: var(--header-height); gap: var(--space-6); }
  .site-header.is-scrolled .site-header__inner { height: var(--header-height-compact); }
  .wordmark { height: 1.75rem; }
  .site-header.is-scrolled .wordmark { height: 1.5rem; }
  .site-header__menu, .site-header__call, html:not(.js) .site-header__menu-link, .menu { display: none; }
  .site-nav { display: block; margin-left: auto; }
  .site-nav__list { display: flex; gap: var(--space-5); padding: 0; list-style: none; }
  .site-header__actions { margin-left: 0; gap: var(--space-5); }
  .site-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: var(--tap-target-min);
    font-size: var(--font-size-sm);
    font-stretch: var(--font-stretch-label);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    transition: color var(--duration-fast) var(--easing-default);
  }
  .site-nav__link:hover { color: var(--color-text-primary); }
  .site-nav__link[aria-current="page"] { color: var(--color-text-primary); }
  /* current-page marker: a short red bar cut at the V angle */
  .site-nav__link::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 3px;
    background: var(--color-accent-primary);
    clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-normal) var(--easing-out);
  }
  .site-nav__link:hover::after { transform: scaleX(0.35); }
  .site-nav__link[aria-current="page"]::after { transform: scaleX(1); }
  .button--compact { padding-inline: var(--space-4); }
}

@media (min-width: 1120px) {
  .site-header__phone {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-target-min);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--easing-default);
  }
  .site-header__phone:hover { color: var(--color-text-primary); }
}

/* --------------------------------------------------------------- Footer */
.site-footer {
  position: relative;
  margin-top: var(--space-section);
  padding-block: var(--space-9) var(--space-6);
  background: var(--color-bg-secondary);
  border-top: var(--border-width-hairline) solid var(--color-border-primary);
  overflow: hidden;
}
/* Three V stripes bleeding off the top-right corner — decorative */
.site-footer__stripes {
  position: absolute;
  top: 0; right: calc(var(--space-page) + var(--space-6));
  display: flex;
  height: var(--space-8);
  transform: skewX(calc(-1 * var(--v-lean)));
  transform-origin: top;
}
.site-footer__stripes span { width: calc(0.75rem * var(--w)); }
.site-footer__stripes span:nth-child(1) { --w: var(--v-ratio-red); background: var(--v-red); }
.site-footer__stripes span:nth-child(2) { --w: var(--v-ratio-white); background: var(--v-white); }
.site-footer__stripes span:nth-child(3) { --w: var(--v-ratio-navy); background: var(--v-navy); }

.site-footer__top {
  display: grid;
  gap: var(--space-7);
  padding-bottom: var(--space-8);
  border-bottom: var(--border-width-hairline) solid var(--color-border-primary);
}
.site-footer__statement { display: grid; justify-items: start; gap: var(--space-5); }
.site-footer__mark { width: auto; height: var(--space-8); }
.site-footer__line {
  font-size: var(--font-size-xl);
  font-stretch: var(--font-stretch-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
  letter-spacing: var(--letter-spacing-tight);
  max-width: 16ch;
  text-wrap: balance;
}
.site-footer__col .label { margin-bottom: var(--space-4); }
.plain-list { list-style: none; padding: 0; }
.site-footer__col li + li { margin-top: var(--space-1); }
.site-footer__col a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target-min);
  min-width: var(--tap-target-min);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--easing-default), opacity var(--duration-fast) var(--easing-default);
}
.site-footer__col a:hover { color: var(--color-text-primary); }
.site-footer__products img { height: 1.75rem; width: auto; opacity: 0.75; transition: opacity var(--duration-fast) var(--easing-default); }
.site-footer__products a:hover img { opacity: 1; }
.site-footer__address { font-style: normal; display: grid; gap: var(--space-1); }
.site-footer__phone { font-family: var(--font-family-mono); color: var(--color-text-primary) !important; }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-6);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.badge__stripes { display: inline-flex; height: 1rem; transform: skewX(calc(-1 * var(--v-lean))); }
.badge__stripes span { width: calc(0.25rem * var(--w)); }
.badge__stripes span:nth-child(1) { --w: var(--v-ratio-red); background: var(--v-red); }
.badge__stripes span:nth-child(2) { --w: var(--v-ratio-white); background: var(--v-white); }
.badge__stripes span:nth-child(3) { --w: var(--v-ratio-navy); background: var(--v-navy); }

@media (min-width: 640px) {
  .site-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__statement { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  .site-footer__top { grid-template-columns: 5fr 2fr 2fr 3fr; gap: var(--space-gutter); }
  .site-footer__statement { grid-column: auto; }
  .site-footer__stripes { height: var(--space-10); }
}

/* ----------------------------------------------------- Intro (task 1)
   Temporary home intro; replaced by the animated hero in task 2. */
.intro { padding-block: var(--space-9) var(--space-section); }
.intro__eyebrow { margin-bottom: var(--space-5); }
.intro__title { max-width: 12ch; }
.intro__lead { margin-top: var(--space-6); }
.intro__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-7); }
.intro__meta {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-9);
  padding-top: var(--space-5);
  border-top: var(--border-width-hairline) solid var(--color-border-primary);
}
.intro__meta dt { margin-bottom: var(--space-2); }
.intro__meta dd { color: var(--color-text-secondary); }
@media (min-width: 640px) { .intro__meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-gutter); } }

/* ------------------------------------------------- Page transition (task 13)
   Cross-document View Transitions, CSS only. The new page arrives behind a band of
   red/white/navy stripes (the menu's ratio and gaps) that crosses the screen left →
   right at the V angle. The header has its own view-transition-name, so it stays put
   while the page under it changes.
   - One registered property, --vt-edge, is animated on ::view-transition-group(root).
     The new page is masked to the left of it, the stripes are the group's background,
     and the old page is masked to the right of it (it also shows through the gaps).
   - Only with prefers-reduced-motion: no-preference. Browsers without cross-document
     view transitions (Firefox) just navigate. Nothing is render-blocking, so the new
     page shows as soon as it would without the transition.
   - The wipe is the entrance for whatever is on screen: when a page arrives this way,
     the pagereveal hook in base.njk adds html.vt-arrival and motion.js skips the hero
     intro and reveals in-view elements at once (no double animation). */
@property --vt-edge {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 0%;
}
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
}
::view-transition-group(root) {
  --vt-angle: calc(90deg + var(--v-lean));
  --vt-unit: clamp(0.75rem, 3vw, 1.5rem);
  --vt-gap: calc(var(--vt-unit) * 0.5);
  --vt-band: calc(var(--vt-unit) * (var(--v-ratio-red) + var(--v-ratio-white) + var(--v-ratio-navy)) + var(--vt-gap) * 3);
  /* stripe stops, measured along the gradient line from the edge */
  --vt-r0: calc(var(--vt-edge) + var(--vt-gap));
  --vt-r1: calc(var(--vt-r0) + var(--vt-unit) * var(--v-ratio-red));
  --vt-w0: calc(var(--vt-r1) + var(--vt-gap));
  --vt-w1: calc(var(--vt-w0) + var(--vt-unit) * var(--v-ratio-white));
  --vt-n0: calc(var(--vt-w1) + var(--vt-gap));
  --vt-n1: calc(var(--vt-n0) + var(--vt-unit) * var(--v-ratio-navy));
  background: linear-gradient(var(--vt-angle),
    transparent var(--vt-r0),
    var(--v-red) var(--vt-r0) var(--vt-r1),
    transparent var(--vt-r1) var(--vt-w0),
    var(--v-white) var(--vt-w0) var(--vt-w1),
    transparent var(--vt-w1) var(--vt-n0),
    var(--v-navy) var(--vt-n0) var(--vt-n1),
    transparent var(--vt-n1));
  animation: vt-wipe var(--duration-page) var(--easing-in-out) both;
}
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) {
  mask-image: linear-gradient(var(--vt-angle), #000 var(--vt-edge), transparent var(--vt-edge));
}
::view-transition-old(root) {
  mask-image: linear-gradient(var(--vt-angle),
    transparent var(--vt-edge),
    #000 var(--vt-edge) var(--vt-r0),
    transparent var(--vt-r0) var(--vt-r1),
    #000 var(--vt-r1) var(--vt-w0),
    transparent var(--vt-w0) var(--vt-w1),
    #000 var(--vt-w1) var(--vt-n0),
    transparent var(--vt-n0) var(--vt-n1),
    #000 var(--vt-n1));
}
@keyframes vt-wipe {
  from { --vt-edge: calc(-1 * var(--vt-band)); }
  to   { --vt-edge: 100%; }
}
/* Header: a plain cross-fade in the same time (only the current-page link and the
   compact height can differ between pages). */
::view-transition-group(site-header),
::view-transition-old(site-header),
::view-transition-new(site-header) { animation-duration: var(--duration-page); }
