/* CADROLL Liquid Glass layer — see DESIGN.md. Tokens live here only. */

/* ========== 1. Tokens ========== */
:root {
  /* Colour roles (§4.3) */
  --cr-surface: #061331;
  --cr-surface-rgb: 6 19 49;
  --cr-surface-container-high: #142445;
  --cr-on-surface: #F7F3EB;
  --cr-on-surface-rgb: 247 243 235;
  --cr-on-surface-variant: #C3C9D4;
  --cr-primary: #E5C27E;
  --cr-primary-rgb: 229 194 126;
  --cr-on-primary: #061331;
  --cr-primary-deep: #9A6E2C;
  --cr-outline-variant: rgb(247 243 235 / .16);
  --cr-error: #E5484D;
  --cr-focus: #9A6E2C; /* 4.5:1 on white, 4:1 on navy */

  /* Glass recipe (§4.1) */
  --cr-glass-fill-small: .74; /* tuned up from .62: large bright headlines scroll under the nav */
  --cr-glass-fill-large: .78;
  --cr-glass-fill-small-b: .90;  /* Tier B */
  --cr-glass-fill-large-b: .97;
  --cr-glass-blur-small: 24px;
  --cr-glass-blur-large: 32px;
  --cr-glass-rim: linear-gradient(135deg, rgb(255 255 255 / .35), rgb(255 255 255 / .06) 45%, rgb(255 255 255 / 0) 70%);
  --cr-glass-shadow-small: 0 6px 24px rgb(var(--cr-surface-rgb) / .40);
  --cr-glass-shadow-large: 0 12px 40px rgb(var(--cr-surface-rgb) / .40);
  --cr-tint-mix: 35%;

  /* Shape (§4.2) — inner = outer − padding, min 8 */
  --cr-radius-capsule: 9999px;
  --cr-radius-panel: 28px;
  --cr-pad-panel: 16px;
  --cr-radius-panel-inner: max(8px, calc(var(--cr-radius-panel) - var(--cr-pad-panel)));
  --cr-pad-nav: 6px;
  --cr-radius-nav: 44px; /* capsule for the 76–88px tall nav; a length so it can morph from 0 */
  --cr-inset: 16px;

  /* Spacing scale (§4.4) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-12: 48px;

  /* Motion (§5.2): springs as stiffness/damping (read by cadroll-glass.js) + CSS linear() curves */
  --spring-press-k: 1500;  --spring-press-z: 1;
  --spring-release-k: 400; --spring-release-z: .7;
  --spring-select-k: 500;  --spring-select-z: .78;
  --spring-morph-k: 380;   --spring-morph-z: .82;
  --spring-settle-k: 800;  --spring-settle-z: 1;
  --spring-press: linear(0.002, 0.076, 0.222, 0.377, 0.518, 0.636, 0.729, 0.801, 0.855, 0.895, 0.925, 0.946, 0.962, 0.973, 0.981, 0.986, 0.99, 0.993, 0.995, 0.997, 0.998, 0.998, 0.999, 0.999, 1);
  --spring-press-ms: 263ms;
  --spring-release: linear(0, 0.076, 0.232, 0.414, 0.589, 0.738, 0.855, 0.938, 0.993, 1.025, 1.04, 1.044, 1.041, 1.034, 1.026, 1.018, 1.012, 1.006, 1.003, 1, 0.999, 0.998, 0.998, 0.998, 1);
  --spring-release-ms: 481ms;
  --spring-select: linear(0.001, 0.063, 0.2, 0.352, 0.511, 0.652, 0.76, 0.85, 0.915, 0.958, 0.988, 1.006, 1.014, 1.018, 1.018, 1.016, 1.013, 1.01, 1.008, 1.005, 1.004, 1.002, 1.001, 1, 1);
  --spring-select-ms: 400ms;
  --spring-morph: linear(0, 0.065, 0.196, 0.349, 0.499, 0.631, 0.74, 0.826, 0.89, 0.936, 0.967, 0.988, 1, 1.006, 1.009, 1.01, 1.009, 1.008, 1.006, 1.005, 1.004, 1.003, 1.002, 1.001, 1);
  --spring-morph-ms: 457ms;
  --spring-settle: linear(0.001, 0.074, 0.207, 0.352, 0.496, 0.61, 0.703, 0.781, 0.837, 0.879, 0.913, 0.936, 0.954, 0.967, 0.976, 0.983, 0.988, 0.991, 0.994, 0.996, 0.997, 0.998, 0.998, 0.999, 1);
  --spring-settle-ms: 344ms;
  --dur-micro: 120ms;
  --dur-short: 200ms;
  --dur-medium: 300ms;
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);

  /* Layout values measured by cadroll-glass.js */
  --cr-nav-bottom: 92px;
}

.cr-num { font-variant-numeric: tabular-nums; }

/* ========== 2. Focus (§8) ========== */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--cr-focus);
  outline-offset: 2px;
}

/* ========== 3. Nav: clear full-width bar at the top → glass capsule on scroll (§6.1) ========== */
/* Resting state (page at the top): no material, full width, sits on the hero. */
header.fixed.top-0 {
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  padding-block: 18px;
  border-radius: 0;
  background-color: transparent;
  isolation: isolate;
  box-shadow: none;
  transition:
    top var(--spring-morph-ms) var(--spring-morph),
    left var(--spring-morph-ms) var(--spring-morph),
    right var(--spring-morph-ms) var(--spring-morph),
    max-width var(--spring-morph-ms) var(--spring-morph),
    padding var(--spring-morph-ms) var(--spring-morph),
    border-radius var(--spring-morph-ms) var(--spring-morph),
    box-shadow var(--dur-medium) var(--ease-emphasized);
}
header.fixed.top-0 > .container { transition: padding var(--spring-morph-ms) var(--spring-morph); }
header.fixed.top-0::before, header.fixed.top-0::after {
  opacity: 0;
  transition: opacity var(--dur-medium) var(--ease-emphasized);
}
/* Scrolled: the bar materializes into a floating glass capsule. */
html[data-nav="float"] header.fixed.top-0 {
  top: var(--cr-inset);
  left: var(--cr-inset);
  right: var(--cr-inset);
  max-width: 1240px;
  padding-block: var(--cr-pad-nav);
  border-radius: var(--cr-radius-nav);
  box-shadow: var(--cr-glass-shadow-small);
}
html[data-nav="float"] header.fixed.top-0 > .container { padding-inline: 14px 8px; }
html[data-nav="float"] header.fixed.top-0::before,
html[data-nav="float"] header.fixed.top-0::after { opacity: 1; }
/* accessibility outlines belong to the capsule only, not the clear resting bar */
html:not([data-nav="float"]) header.fixed.top-0 { outline: none !important; }
/* fill + blur on a pseudo-element, so the header itself is not a backdrop root
   (the mobile menu inside it can blur the page) */
header.fixed.top-0::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgb(var(--cr-surface-rgb) / var(--cr-glass-fill-small-b));
}
/* rim highlight */
header.fixed.top-0::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--cr-glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header.fixed.top-0::before {
    background: rgb(var(--cr-surface-rgb) / var(--cr-glass-fill-small));
    -webkit-backdrop-filter: blur(var(--cr-glass-blur-small)) saturate(1.6);
    backdrop-filter: blur(var(--cr-glass-blur-small)) saturate(1.6);
  }
}

/* nav links: monochrome labels, pill instead of underline (§6.2) */
header nav { gap: 2px; position: relative; }
header nav > a {
  margin: 0 !important;            /* replaces space-x-* gaps with padding for the pill */
  padding: 8px 6px;
  border-radius: var(--cr-radius-capsule);
  color: var(--cr-on-surface-variant);
  z-index: 1;
  transition: color var(--dur-micro) ease;
}
@media (min-width: 1280px) { header nav > a { padding: 10px 12px; } header nav { gap: 4px; } }
header nav > a:hover, header nav > a:focus-visible { color: var(--cr-on-surface); }
header nav > a[aria-current="page"] { color: var(--cr-primary); }
header nav > a > span.absolute { display: none; } /* old underline */
.cr-pill {
  position: absolute;
  left: 0; top: 0;
  height: 0; width: 0;
  border-radius: var(--cr-radius-capsule);
  background: rgb(var(--cr-primary-rgb) / .16);
  box-shadow: inset 0 0 0 1px rgb(var(--cr-primary-rgb) / .22);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-micro) ease, background-color var(--dur-micro) ease;
  will-change: transform, width;
}
.cr-pill.is-visible { opacity: 1; }

/* Primary call-to-action buttons (the silver "bg-light-text" variant) use the logo gold */
.bg-light-text.border-light-text.text-primary { background-color: var(--cr-primary); border-color: var(--cr-primary); }
.bg-light-text.border-light-text.text-primary:hover { background-color: var(--white, #fff); border-color: var(--white, #fff); }

/* tinted primary action on the nav: the only tinted control (§4.1) */
header .justify-end > button.bg-light-text.border-light-text.text-primary {
  /* a tone over the glass, not a flat fill: gold at 90% lets the glass show at the edges */
  background-color: rgb(var(--cr-primary-rgb) / .9);
  border-color: transparent;
  color: var(--cr-on-primary);
  border-radius: var(--cr-radius-capsule);
}
header .justify-end > button.bg-light-text.border-light-text.text-primary:hover { background-color: var(--cr-on-surface); }

/* menu button: 44px target */
header button.lg\:hidden { min-width: 44px; min-height: 44px; }

/* ========== 4. Mobile menu: large glass panel (§6.4, §5.3 F) ========== */
header > div.fixed.inset-x-0 {
  top: calc(var(--cr-nav-bottom) + 12px);
  left: var(--cr-inset);
  right: var(--cr-inset);
  border: 0;
  border-radius: var(--cr-radius-panel);
  background: rgb(var(--cr-surface-rgb) / var(--cr-glass-fill-large-b));
  box-shadow: var(--cr-glass-shadow-large);
  translate: none !important;
  transform-origin: top right;
  transition: scale var(--spring-morph-ms) var(--spring-morph), opacity var(--dur-short) var(--ease-emphasized), border-radius var(--spring-morph-ms) var(--spring-morph);
  overflow: hidden;
}
header > div.fixed.inset-x-0.opacity-0 { scale: .6; border-radius: 40px; }
header > div.fixed.inset-x-0.opacity-100 { scale: 1; }
header > div.fixed.inset-x-0 > .container { transition: opacity var(--dur-short) var(--ease-emphasized) 60ms; padding: var(--cr-pad-panel); gap: 4px; }
header > div.fixed.inset-x-0.opacity-0 > .container { opacity: 0; transition-delay: 0ms; }
header > div.fixed.inset-x-0 > .container > a {
  width: 100%;
  min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--cr-radius-panel-inner);
  transition: background-color var(--dur-micro) ease, color var(--dur-micro) ease;
}
header > div.fixed.inset-x-0 > .container > a:hover { background: rgb(var(--cr-on-surface-rgb) / .06); }
header > div.fixed.inset-x-0 > .container > a[aria-current="page"] { background: rgb(var(--cr-primary-rgb) / .16); }
header > div.fixed.inset-x-0::after { /* rim */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--cr-glass-rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header > div.fixed.inset-x-0 {
    background: rgb(var(--cr-surface-rgb) / var(--cr-glass-fill-large));
    -webkit-backdrop-filter: blur(var(--cr-glass-blur-large)) saturate(1.6);
    backdrop-filter: blur(var(--cr-glass-blur-large)) saturate(1.6);
  }
}

/* ========== 5. Soft scroll edge under the floating nav (§5.3 H) ========== */
#cr-scroll-edge {
  position: fixed; top: 0; left: 0; right: 0;
  height: calc(var(--cr-nav-bottom) + 24px);
  z-index: 49;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-micro) ease;
  -webkit-mask: linear-gradient(#000 55%, transparent);
  mask: linear-gradient(#000 55%, transparent);
  display: none;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #cr-scroll-edge { display: block; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}
html[data-nav="float"] #cr-scroll-edge.is-on { opacity: 1; }

/* ========== 6. Content: systems panel back to tonal (rule 1) ========== */
main .backdrop-blur-2xl {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background-color: rgb(var(--cr-surface-rgb) / .86) !important;
  border-color: var(--cr-outline-variant) !important;
}

/* ========== 6b. Home hero (content layer) ========== */
/* Full-height stage, cinematic video, strong left-side legibility, warm gold ambience. */
section.min-h-\[90vh\] {
  min-height: 100svh;
  padding-top: clamp(128px, 16vh, 176px);
  padding-bottom: clamp(96px, 14vh, 144px);
  background-color: var(--cr-surface);
}
section.min-h-\[90vh\] video { opacity: .92; filter: contrast(1.08) brightness(1.05); }
/* ambient light: gold glow top-right + steel-blue depth bottom-left */
section.min-h-\[90vh\] .absolute.inset-0.z-10.mix-blend-multiply {
  mix-blend-mode: normal;
  background:
    radial-gradient(50% 55% at 88% 12%, rgb(var(--cr-primary-rgb) / .18), transparent 65%),
    radial-gradient(45% 55% at 0% 100%, rgb(37 80 127 / .35), transparent 70%);
}
/* legibility: dense navy behind the copy, opening up to the right; fades into the next section */
section.min-h-\[90vh\] .absolute.inset-0.z-10.bg-linear-to-r {
  background:
    linear-gradient(90deg, rgb(var(--cr-surface-rgb) / .97) 0%, rgb(var(--cr-surface-rgb) / .86) 34%, rgb(var(--cr-surface-rgb) / .45) 66%, rgb(var(--cr-surface-rgb) / .18) 100%),
    linear-gradient(180deg, rgb(var(--cr-surface-rgb) / .75) 0%, transparent 24%, transparent 70%, var(--cr-surface) 100%);
}
/* phones: copy spans the full width, so legibility comes from a vertical wash instead */
@media (max-width: 767px) {
  section.min-h-\[90vh\] .absolute.inset-0.z-10.bg-linear-to-r {
    background: linear-gradient(180deg, rgb(var(--cr-surface-rgb) / .72) 0%, rgb(var(--cr-surface-rgb) / .84) 45%, rgb(var(--cr-surface-rgb) / .92) 80%, var(--cr-surface) 100%);
  }
}
/* fine framing grid, like a drawing sheet, fading in from the right */
section.min-h-\[90vh\]::before {
  content: "";
  position: absolute; inset: 0; z-index: 10;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(var(--cr-on-surface-rgb) / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--cr-on-surface-rgb) / .05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask: linear-gradient(90deg, transparent 20%, #000 75%);
  mask: linear-gradient(90deg, transparent 20%, #000 75%);
}
/* eyebrow → tonal capsule with a status-style dot (content chip, not glass) */
section.min-h-\[90vh\] span.inline-block.tracking-wider {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: var(--space-6);
  padding: 8px 18px 8px 14px;
  border-radius: var(--cr-radius-capsule);
  background: rgb(var(--cr-primary-rgb) / .08);
  box-shadow: inset 0 0 0 1px rgb(var(--cr-primary-rgb) / .28);
  color: var(--cr-primary);
  font-size: 12px; line-height: 1.2; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
}
section.min-h-\[90vh\] span.inline-block.tracking-wider::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cr-primary);
  box-shadow: 0 0 0 4px rgb(var(--cr-primary-rgb) / .18);
}
/* headline: warm white, tight and confident; accent word in a gold gradient */
section.min-h-\[90vh\] h1 {
  color: var(--cr-on-surface);
  font-size: clamp(2.5rem, 5.4vw, 5.25rem);
  line-height: 1.04;
  letter-spacing: -.03em;
  font-weight: 600;
  max-width: 12.5em;
  margin-bottom: var(--space-6);
  text-wrap: balance;
}
section.min-h-\[90vh\] h1 > span {
  background: linear-gradient(100deg, #F6DCA2 0%, var(--cr-primary) 38%, #C9973F 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
/* supporting copy: calm silver, readable measure */
section.min-h-\[90vh\] p {
  color: var(--cr-on-surface-variant);
  font-size: clamp(1rem, 1.2vw, 1.175rem);
  font-weight: 400;
  line-height: 1.7;
  max-width: 36rem;
  margin-bottom: var(--space-12);
}
/* actions: capsules; secondary is a quiet tonal outline */
section.min-h-\[90vh\] .flex.flex-col.gap-6 { gap: var(--space-4); }
section.min-h-\[90vh\] .flex.flex-col.gap-6 > * { min-height: 54px; padding-inline: 32px; }
section.min-h-\[90vh\] a.border-white\/30 {
  background: rgb(var(--cr-on-surface-rgb) / .06);
  border-color: rgb(var(--cr-on-surface-rgb) / .28);
  color: var(--cr-on-surface);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
@media (min-width: 640px) { section.min-h-\[90vh\] .flex.flex-col.gap-6 > * { min-width: 230px; } }
/* scroll cue (decorative) */
section.min-h-\[90vh\]::after {
  content: "";
  position: absolute; left: 50%; bottom: 28px; z-index: 20;
  width: 1px; height: 56px; translate: -50% 0;
  background: linear-gradient(rgb(var(--cr-primary-rgb) / 0), rgb(var(--cr-primary-rgb) / .9));
  transform-origin: top;
  animation: cr-scroll-cue 1.2s var(--ease-emphasized) infinite alternate;
  pointer-events: none;
}
@keyframes cr-scroll-cue { from { scale: 1 .35; opacity: .5; } to { scale: 1 1; opacity: 1; } }
@media (max-width: 767px) { section.min-h-\[90vh\]::after { display: none; } }

/* All button-component CTAs are capsules (Apple: capsules for single actions) */
.group.inline-flex.justify-center.font-medium.rounded-lg { border-radius: var(--cr-radius-capsule); }

/* ========== 7. Press motion for buttons (§5.3 A) ========== */
.group.inline-flex.justify-center.font-medium {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition:
    scale var(--spring-release-ms) var(--spring-release),
    translate var(--spring-select-ms) var(--spring-select),
    background-color var(--dur-micro) ease, color var(--dur-micro) ease,
    border-color var(--dur-micro) ease, box-shadow var(--dur-medium) var(--ease-emphasized);
}
.group.inline-flex.justify-center.font-medium:active {
  scale: .96;
  transition-duration: var(--spring-press-ms), var(--spring-select-ms), var(--dur-micro), var(--dur-micro), var(--dur-micro), var(--dur-medium);
  transition-timing-function: var(--spring-press), var(--spring-select), ease, ease, ease, var(--ease-emphasized);
}
.group.inline-flex.justify-center.font-medium::after {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--cr-px, 50%) var(--cr-py, 50%), rgb(255 255 255 / .18), rgb(255 255 255 / 0) 65%);
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}
.group.inline-flex.justify-center.font-medium:active::after { opacity: 1; transition-duration: 220ms; }

/* ========== 8. Cursor lens (§6.6) ========== */
#cr-cursor {
  position: fixed; left: 0; top: 0;
  width: 32px; height: 32px;
  border-radius: 16px;
  pointer-events: none;
  z-index: 2147483000;
  opacity: 0;
  background: rgb(255 255 255 / .06);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / .55),
    0 0 0 1px rgb(var(--cr-surface-rgb) / .28),
    0 4px 14px rgb(var(--cr-surface-rgb) / .18);
  transition: opacity var(--dur-short) ease, background-color var(--dur-micro) ease;
  will-change: transform, width, height;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #cr-cursor { -webkit-backdrop-filter: blur(2px) saturate(1.4); backdrop-filter: blur(2px) saturate(1.4); }
}
#cr-cursor::after { /* rim highlight */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgb(255 255 255 / .35), rgb(255 255 255 / 0) 55%);
  opacity: .6;
}
#cr-cursor.is-visible { opacity: 1; }
#cr-cursor.is-morphed { background: rgb(255 255 255 / .08); }
#cr-cursor.is-pressed { background: radial-gradient(circle, rgb(255 255 255 / .18), rgb(255 255 255 / .04) 70%); }

/* ========== 9. Accessibility modes (§8) ========== */
/* Reduce transparency → identity glass */
@media (prefers-reduced-transparency: reduce) {
  header.fixed.top-0::before, header > div.fixed.inset-x-0 {
    background: var(--cr-surface-container-high) !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  header.fixed.top-0, header > div.fixed.inset-x-0 { outline: 1px solid var(--cr-outline-variant); }
  header.fixed.top-0::after, header > div.fixed.inset-x-0::after { display: none; }
  #cr-scroll-edge { display: none; }
  #cr-cursor { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
html[data-glass="off"] header.fixed.top-0::before, html[data-glass="off"] header > div.fixed.inset-x-0 {
  background: var(--cr-surface-container-high) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html[data-glass="off"] header.fixed.top-0, html[data-glass="off"] header > div.fixed.inset-x-0 { outline: 1px solid var(--cr-outline-variant); }
html[data-glass="off"] header.fixed.top-0::after, html[data-glass="off"] header > div.fixed.inset-x-0::after,
html[data-glass="off"] #cr-scroll-edge { display: none; }
html[data-glass="off"] #cr-cursor { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Increase contrast */
@media (prefers-contrast: more) {
  :root { --light-text: #E9ECF2; --cr-on-surface-variant: #E9ECF2; }
  header.fixed.top-0::before, header > div.fixed.inset-x-0 {
    background: var(--cr-surface) !important;
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  header.fixed.top-0, header > div.fixed.inset-x-0 { outline: 1.5px solid var(--cr-on-surface); }
  header .justify-end > button { background-color: var(--cr-primary); }
  header nav > a { color: var(--cr-on-surface); }
  .cr-pill { background: rgb(var(--cr-primary-rgb) / .3); box-shadow: inset 0 0 0 1.5px var(--cr-primary); }
}
html[data-contrast="more"] { --light-text: #E9ECF2; --cr-on-surface-variant: #E9ECF2; }
html[data-contrast="more"] header.fixed.top-0::before, html[data-contrast="more"] header > div.fixed.inset-x-0 {
  background: var(--cr-surface) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html[data-contrast="more"] header.fixed.top-0, html[data-contrast="more"] header > div.fixed.inset-x-0 { outline: 1.5px solid var(--cr-on-surface); }
html[data-contrast="more"] header .justify-end > button { background-color: var(--cr-primary); }
html[data-contrast="more"] header nav > a { color: var(--cr-on-surface); }
html[data-contrast="more"] .cr-pill { background: rgb(var(--cr-primary-rgb) / .3); box-shadow: inset 0 0 0 1.5px var(--cr-primary); }

/* Reduce motion (§5.4) */
@media (prefers-reduced-motion: reduce) {
  :root {
    --spring-press: linear(0, 1); --spring-release: var(--spring-settle);
    --spring-select: var(--spring-settle); --spring-morph: var(--spring-settle);
    --spring-release-ms: var(--spring-settle-ms); --spring-select-ms: var(--spring-settle-ms); --spring-morph-ms: var(--spring-settle-ms);
  }
  .group.inline-flex.justify-center.font-medium:active { scale: 1; }
  .group.inline-flex.justify-center.font-medium::after { display: none; }
  header > div.fixed.inset-x-0.opacity-0 { scale: 1; }
  [style*="opacity:0;transform:translate"], [style*="opacity: 0; transform: translate"] { opacity: 1 !important; transform: none !important; }
  #cr-cursor { display: none; }
  section.min-h-\[90vh\]::after { animation: none; }
}
html[data-motion="reduce"] section.min-h-\[90vh\]::after { animation: none; }
html[data-motion="reduce"] {
  --spring-press: linear(0, 1); --spring-release: var(--spring-settle);
  --spring-select: var(--spring-settle); --spring-morph: var(--spring-settle);
  --spring-release-ms: var(--spring-settle-ms); --spring-select-ms: var(--spring-settle-ms); --spring-morph-ms: var(--spring-settle-ms);
}
html[data-motion="reduce"] .group.inline-flex.justify-center.font-medium:active { scale: 1; }
html[data-motion="reduce"] .group.inline-flex.justify-center.font-medium::after { display: none; }
html[data-motion="reduce"] header > div.fixed.inset-x-0.opacity-0 { scale: 1; }
html[data-motion="reduce"] [style*="opacity:0;transform:translate"],
html[data-motion="reduce"] [style*="opacity: 0; transform: translate"] { opacity: 1 !important; transform: none !important; }
html[data-motion="reduce"] #cr-cursor { display: none; }

/* Forced colours (Windows High Contrast) */
@media (forced-colors: active) {
  header.fixed.top-0::before, header > div.fixed.inset-x-0 { background: Canvas !important; backdrop-filter: none !important; }
  header.fixed.top-0, header > div.fixed.inset-x-0 { outline: 1px solid CanvasText; box-shadow: none; }
  header.fixed.top-0::after, header > div.fixed.inset-x-0::after, #cr-scroll-edge, #cr-cursor { display: none; }
  .cr-pill { background: Highlight; forced-color-adjust: none; opacity: .35; }
}

/* Touch / no hover: no cursor lens */
@media not ((hover: hover) and (pointer: fine)) { #cr-cursor { display: none; } }
