/* misterpfister.net · Werkplatz 5 · core (page CSS loads after it) */

/* 1. Tokens */
:root,
:root[data-theme=dark] {
  color-scheme: dark;
  --bg-0: #07090A; --bg: #0B0D0F;
  --surface: #12161A;
  --panel-top: #161B1F;
  --surface-2: #181D21; --surface-3: #20272C;
  --field: #0E1114;
  --tint-grade: #1A2410; --tint-sleep: #1A1731; --tint-code: #11261F;
  --sleep-panel-a: #1A1731; --sleep-panel-b: #101019;
  --ink: #F2F4EC;
  --muted: #A9B2A5;
  --faint: #8A9485;
  --rule: #242B2E; --rule-strong: #323B3F;
  --control-rule: #6B786F;
  /* -text text-safe, -gfx >=3:1, -fill/-on filled */
  --grade-text: #CEF779; --grade-gfx: #CEF779; --grade-fill: #CEF779; --grade-on: #142006; --grade-soft: #1C2A12;
  --sleep-text: #C6B9FF; --sleep-gfx: #C6B9FF; --sleep-fill: #C6B9FF; --sleep-on: #1A1530; --sleep-soft: #221E3A;
  --data-text: #7DF3E1; --data-gfx: #7DF3E1; --data-soft: #0F2A26;
  --wisper-text: #FF9EC7; --wisper-gfx: #FF9EC7; --wisper-fill: #FF9EC7; --wisper-on: #2B0F1D; --wisper-soft: #2E1724; --tint-wisper: #2A1520;
  --rose: #FF9EC7;
  --danger: #FFB3A2; --danger-soft: #2C1714;
  --warm: #FFCF8A;
  --accent-text: var(--grade-text);
  --focus: #CEF779; --primary-bg: #CEF779; --primary-ink: #142006; --primary-hover: #DBFF94;
  --film-0: #CEF779; --film-1: #7DF3E1; --film-2: #C6B9FF; --film-3: #FF9EC7;
  --film: linear-gradient(100deg, var(--film-0) 0%, var(--film-1) 36%, var(--film-2) 68%, var(--film-3) 100%);
  --glass: rgb(12 14 16 / .86); --glass-edge: rgb(255 255 255 / .08); --glass-hi: rgb(255 255 255 / .14);
  --shadow-panel: 0 1px 0 var(--glass-hi) inset, 0 30px 80px -40px #000;
  --shadow-float: 0 18px 50px -18px rgb(0 0 0 / .7);
  --shadow-press: 0 1px 0 var(--glass-hi) inset, 0 6px 16px -8px #000;
  --glow-primary: 0 10px 30px -10px rgb(206 247 121 / .55);
  --glow: radial-gradient(60% 50% at 72% 10%, rgb(206 247 121 / .08), transparent 62%), radial-gradient(50% 42% at 94% 34%, rgb(198 185 255 / .09), transparent 70%);
  --grain-opacity: .045;
  /* Core extras, per-theme icons */
  --pill-raised: #262E34;
  --glint: rgb(255 255 255 / .5);
  --i-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFB3A2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.8 19.5h18.4ZM12 10v4.2M12 17.2v.1'/%3E%3C/svg%3E");
}
:root[data-theme=light] {
  color-scheme: light;
  --bg-0: #E6E8E1; --bg: #F2F3EE;
  --surface: #FBFBF8;
  --panel-top: #FFFFFF;
  --surface-2: #F1F3EC; --surface-3: #E5E8DF;
  --field: #FFFFFF;
  --tint-grade: #EEF6DC; --tint-sleep: #EFEBFF; --tint-code: #E7F5F2;
  --sleep-panel-a: #EFEBFF; --sleep-panel-b: #FBFAFF;
  --ink: #14180F;
  --muted: #4A5544;
  --faint: #5B6655;
  --rule: #D9DDD3; --rule-strong: #C3C9BB;
  --control-rule: #6F7B69;
  --grade-text: #3F6212; --grade-gfx: #5A8A1A; --grade-fill: #CEF779; --grade-on: #142006; --grade-soft: #EAF4D2;
  --sleep-text: #56459A; --sleep-gfx: #6A55C8; --sleep-fill: #56459A; --sleep-on: #FFFFFF; --sleep-soft: #ECE8FF;
  --data-text: #0B665D; --data-gfx: #12897C; --data-soft: #DDF2EE;
  --wisper-text: #9E2F66; --wisper-gfx: #B8487F; --wisper-fill: #9E2F66; --wisper-on: #FFFFFF; --wisper-soft: #F7E4EE; --tint-wisper: #FAE8F1;
  --rose: #9E2F66;
  --danger: #A3281A; --danger-soft: #FBE7E3;
  --warm: #7F4800;
  --accent-text: var(--grade-text);
  --focus: #3F6212; --primary-bg: #14180F; --primary-ink: #CEF779; --primary-hover: #262D1C;
  --film-0: #3F6212; --film-1: #0B665D; --film-2: #56459A; --film-3: #9E2F66;
  --glass: rgb(250 250 247 / .86); --glass-edge: rgb(20 24 15 / .08); --glass-hi: rgb(255 255 255 / .9);
  --shadow-panel: 0 1px 0 #fff inset, 0 24px 60px -30px rgb(40 48 30 / .28);
  --shadow-float: 0 18px 44px -20px rgb(40 48 30 / .35);
  --shadow-press: 0 1px 0 #fff inset, 0 6px 14px -8px rgb(40 48 30 / .3);
  --glow-primary: 0 10px 28px -12px rgb(20 24 15 / .45);
  --glow: radial-gradient(60% 50% at 72% 10%, rgb(180 230 90 / .16), transparent 62%), radial-gradient(50% 42% at 94% 34%, rgb(150 130 240 / .12), transparent 70%);
  --grain-opacity: .03;
  --pill-raised: #FFFFFF;
  --glint: rgb(206 247 121 / .28);
  --i-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3281A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.8 19.5h18.4ZM12 10v4.2M12 17.2v.1'/%3E%3C/svg%3E");
}
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-hero: clamp(40px, 11.4vw, 56px); --fs-h2: clamp(30px, 4.6vw, 68px); --fs-tool-h1: clamp(28px, 4.2vw, 60px);
  --fs-h3: 20px; --fs-lead: 16px; --fs-body: 16px; --fs-small: 14px; --fs-label: 11.5px; --fs-data: 13px;
  --fs-num-xl: clamp(56px, 6vw, 88px); --fs-num-l: clamp(36px, 3.4vw, 46px); --fs-input: 17px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;
  --s-9: 48px; --s-10: 64px; --s-11: 96px; --s-12: 128px;
  --section-gap: clamp(88px, 11vw, 160px);
  --gutter: 16px;
  --wrap-max: 1240px;
  --header-h: 60px;
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px; --r-pill: 999px; --r-panel: 20px;
  --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-in: cubic-bezier(.7, 0, .84, 0);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1); --ease-std: cubic-bezier(.22, .75, .2, 1);
  --spring: var(--ease-out); --spring-pop: cubic-bezier(.34, 1.56, .64, 1);
  --t-press: 120ms; --t-hover: 200ms; --t-ui: 280ms; --t-move: 420ms; --t-select: 520ms; --t-vt: 560ms;
  --t-reveal: 760ms; --t-morph: 700ms; --t-theme: 560ms;
  --stagger: 60ms;
  --z-stage: 0; --z-scene: 2; --z-hud: 3; --z-dock: 4; --z-header: 50; --z-compact: 55; --z-toast: 60;
  --z-skip: 100;
  /* .sleep-page and .wisper-page swap these */
  --tool-text: var(--grade-text); --tool-gfx: var(--grade-gfx); --tool-fill: var(--grade-fill);
  --tool-on: var(--grade-on); --tool-soft: var(--grade-soft);
  --mag-t: 500ms var(--spring-pop);
  /* Icon masks */
  --i-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237C8777' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E");
  --i-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 2.8 19.5h18.4ZM12 10v4.2M12 17.2v.1'/%3E%3C/svg%3E");
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1);
    --spring-pop: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  }
}
@media (min-width: 681px) {
  :root { --fs-hero: clamp(56px, 7.2vw, 112px); --fs-h3: 24px; --fs-lead: 18px; --fs-input: 16px; --gutter: 24px; --header-h: 76px; --r-panel: 24px; }
}
@media (min-width: 1151px) { :root { --gutter: 48px; } }
@media (min-width: 1600px) { :root { --wrap-max: 1360px; } }
.sleep-page { --tool-text: var(--sleep-text); --tool-gfx: var(--sleep-gfx); --tool-fill: var(--sleep-fill); --tool-on: var(--sleep-on); --tool-soft: var(--sleep-soft); }
.wisper-page { --tool-text: var(--wisper-text); --tool-gfx: var(--wisper-gfx); --tool-fill: var(--wisper-fill); --tool-on: var(--wisper-on); --tool-soft: var(--wisper-soft); }

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure { margin: 0; }
:where(button, input, select, textarea) { font: inherit; color: inherit; }
button, fieldset { min-width: 0; }
button { cursor: pointer; touch-action: manipulation; }
fieldset { border: 0; margin: 0; padding: 0; }
svg { display: block; }
summary { cursor: pointer; }
html {
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px);
  scrollbar-color: var(--rule-strong) transparent;
}
html:has(> body.tool-page) { scroll-padding-top: calc(var(--header-h) + 72px); }
body {
  margin: 0; position: relative; min-height: 100svh; font: var(--fs-body)/1.55 var(--font-sans);
  color: var(--ink); background: var(--bg); font-synthesis: none; font-kerning: normal;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
/* Glow + grain behind content (html has no background) */
body::after { content: ""; position: absolute; inset: 0 0 auto; height: 1100px; background: var(--glow); pointer-events: none; z-index: -1; }
body.tool-page::after { opacity: .55; }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: var(--grain-opacity);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 4 0 0 0 -2.1'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 160px;
}
:root[data-theme=light] body::before { filter: invert(1); }
::selection { background: color-mix(in srgb, var(--grade-gfx) 32%, transparent); }

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
h1 { font-size: var(--fs-tool-h1); font-weight: 680; line-height: .92; letter-spacing: -.055em; word-spacing: .04em; }
h2 { font-size: var(--fs-h2); font-weight: 650; line-height: .98; letter-spacing: -.045em; word-spacing: .03em; }
h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
p { text-wrap: pretty; }
.hero-description { hanging-punctuation: first; }
.num, output { font-variant-numeric: tabular-nums lining-nums; }
.wrap { width: min(var(--wrap-max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.icon { width: 24px; height: 24px; flex: none; stroke-linecap: round; stroke-linejoin: round; }
:where(.button, .icon-button, .theme-toggle, .text-cta, .round-arrow) .icon { width: 20px; height: 20px; }
:where(.back-link, .text-button, .button.small, .segmented label) .icon { width: 18px; height: 18px; }
:where(.local-badge, .privacy-line, .footer-row a) .icon { width: 16px; height: 16px; }
:where(.button, .back-link, .footer-row a) .icon { transition: translate var(--t-hover) var(--ease-out); }

/* 3. Focus, skip link, text links */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: var(--z-skip); padding: 12px 18px;
  border-radius: var(--r-pill); background: var(--primary-bg); color: var(--primary-ink); font-weight: 600;
  text-decoration: none; box-shadow: var(--shadow-float); transform: translateY(calc(-100% - 24px));
  transition: transform var(--t-ui) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); outline-color: var(--ink); }
a:not([class]) { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:not([class]):hover { text-decoration-thickness: 2px; }

/* 4. Glass surfaces and header */
.nav-shell, .glass, .toast, .compact-bar {
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%); border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-float);
}
.site-header { position: sticky; top: 0; z-index: var(--z-header); }
/* Named on the glass itself: a named ancestor would be its Backdrop Root and blank the blur */
.nav-shell { view-transition-name: site-header; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 var(--gutter); border-width: 0 0 1px; box-shadow: none; }
@media (min-width: 681px) {
  .site-header { padding: 12px var(--gutter) 4px; }
  .nav-shell { max-width: var(--wrap-max); margin-inline: auto; padding: 0 8px 0 10px; border-width: 1px; border-radius: var(--r-pill); box-shadow: var(--shadow-float); }
}
.brand { display: inline-flex; gap: 10px; align-items: center; min-height: 44px; min-width: 44px; color: var(--ink); text-decoration: none; border-radius: 12px; }
.brand-mark {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding-bottom: 2px;
  border-radius: 10px; background-color: var(--grade-fill); color: var(--grade-on);
  font: 800 18px/1 var(--font-display); letter-spacing: -.06em;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), inset 0 1px 0 rgb(255 255 255 / .5);
  transition: transform var(--t-hover) var(--ease-out);
}
.brand-word { font-weight: 600; font-size: 15px; letter-spacing: -.02em; white-space: nowrap; }
.brand-word span { color: var(--muted); font-weight: 500; }
.main-nav { margin-left: auto; display: flex; gap: 4px; }
.main-nav a, .back-link {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: var(--r-pill); color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none;
  white-space: nowrap; transition: color var(--t-hover), background-color var(--t-hover);
}
.main-nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 2px;
  background: var(--film); transform: scaleX(0); transform-origin: left center;
  transition: transform var(--t-ui) var(--ease-out);
}
.main-nav a[aria-current=page] { color: var(--ink); background: var(--surface-2); }
.back-link { gap: 4px; margin-left: 6px; padding-left: 8px; }
.back-link::before { content: ""; position: absolute; left: -9px; top: 12px; bottom: 12px; width: 1px; background: var(--rule-strong); }
.theme-toggle, .icon-button, .round-arrow { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; }
.theme-toggle {
  border-radius: 50%; border: 1px solid var(--glass-edge); background: var(--surface-2); color: var(--ink);
  transition: transform var(--t-hover) var(--ease-out), background-color var(--t-hover);
}
.theme-toggle:active { transform: scale(.94); transition-duration: var(--t-press); }
html:not(.js) .theme-toggle { display: none; }
@media (hover: hover) {
  .brand:hover .brand-mark { transform: rotate(-6deg); }
  .main-nav a:hover, .back-link:hover { color: var(--ink); }
  .main-nav a:not([aria-current]):hover::after { transform: scaleX(1); }
  .back-link:hover { background: var(--surface-2); }
  .back-link:hover .icon { translate: -2px 0; }
  .theme-toggle:hover { transform: translateY(-1px); background: var(--surface-3); }
}
@media (max-width: 680px) { .back-link { display: none; } .brand { margin-inline: -4px; padding-inline: 4px; } }
/* Phones keep both home links; the brand word gives way first */
@media (max-width: 520px) { .home-page .brand-word { display: none; } }
@media (max-width: 440px) { .tool-page .brand-word { display: none; } }
@media (max-width: 360px) {
  .brand-word { display: none; } .main-nav a { padding-inline: 12px; } .main-nav a::after { left: 12px; right: 12px; }
  .home-page .main-nav a { padding-inline: 8px; } .home-page .main-nav a::after { left: 8px; right: 8px; }
}

/* 5. Buttons */
[data-magnetic] { translate: var(--mag-x, 0) var(--mag-y, 0); }
[data-magnetic]:not(.button) { transition: translate var(--mag-t); }
[data-magnetic]:hover { --mag-t: 150ms linear; }
[data-magnetic]:focus-visible { translate: none; }
.button {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; min-height: 48px; padding: 0 20px; border-radius: var(--r-pill); border: 1px solid transparent;
  background: transparent; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.1;
  letter-spacing: -.01em; text-decoration: none; white-space: nowrap; touch-action: manipulation;
  transition: transform var(--press, var(--t-hover)) var(--ease-out), translate var(--mag-t), background-color var(--t-hover), border-color var(--t-hover), box-shadow var(--t-hover), color var(--t-hover);
}
.button:active { transform: scale(.97); --press: var(--t-press); }
.button:disabled, .button[aria-disabled=true] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button.primary { background-color: var(--primary-bg); color: var(--primary-ink); }
.button.primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(90px circle at var(--mx, 50%) var(--my, 0%), var(--glint), transparent 70%);
  opacity: 0; transition: opacity var(--t-hover);
}
:root:not([data-theme=light]) .button.primary:focus-visible { outline-color: var(--ink); }
.button.secondary { background-color: var(--surface-2); border-color: var(--control-rule); }
.button.ghost { border-color: var(--rule); }
.button.small { min-height: 44px; padding: 0 14px; font-size: 14px; gap: 8px; }
@media (hover: hover) {
  .button.primary:not(:disabled):hover { transform: translateY(-1px); background-color: var(--primary-hover); box-shadow: var(--glow-primary); }
  .button.primary:hover .icon { translate: 3px 0; }
  .button.secondary:not(:disabled):hover { background-color: var(--surface-3); border-color: var(--faint); }
  .button.ghost:not(:disabled):hover { background-color: var(--surface-2); }
}
@media (hover: hover) and (pointer: fine) { .button.primary:hover::before { opacity: 1; } }
.button.primary:not(:disabled):active { transform: scale(.97); }

.icon-button {
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); touch-action: manipulation;
  transition: background-color var(--t-hover), color var(--t-hover), transform var(--t-hover) var(--ease-out);
}
.icon-button:active { transform: scale(.94); transition-duration: var(--t-press); }
.text-button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; border: 0;
  border-radius: var(--r-xs); background: none; color: var(--accent-text); font-size: 15px; font-weight: 600;
  text-decoration: none; text-underline-offset: 4px; text-decoration-thickness: 1.5px; touch-action: manipulation;
}
.icon-button:disabled, .text-button:disabled { opacity: .45; cursor: not-allowed; }
@media (hover: hover) {
  .icon-button:not(:disabled):hover { background: var(--surface-2); color: var(--ink); }
  .text-button:not(:disabled):hover { text-decoration-line: underline; }
}
.danger-text, .text-button.danger-text { color: var(--danger); }
.text-cta { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.text-cta .icon { transition: translate var(--t-ui) var(--ease-out); }
.round-arrow {
  border-radius: 50%; border: 1px solid var(--rule-strong); color: var(--ink);
  transition: background-color var(--t-hover), border-color var(--t-hover);
}
.round-arrow .icon { transition: rotate var(--t-ui) var(--ease-out); }
@media (hover: hover) {
  :is(a, button):hover .text-cta .icon, .text-cta:hover .icon { translate: 4px 0; }
  :is(a, button):hover .round-arrow .icon { rotate: 45deg; }
}

/* 6. Eyebrows, tags, chips, badges */
.eyebrow, .tag, .data-table thead th { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { display: flex; gap: 8px; align-items: center; color: var(--accent-text); }
.status-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--grade-gfx);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--grade-gfx) 18%, transparent);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--rule-strong); color: var(--muted); letter-spacing: .1em; white-space: nowrap;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1px solid var(--rule-strong); background: var(--surface-2);
  color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background-color var(--t-hover), border-color var(--t-hover), color var(--t-hover), transform var(--t-move) var(--spring-pop);
}
.chip[aria-pressed=true] { background: var(--tool-fill); border-color: var(--tool-fill); color: var(--tool-on); }
.chip[aria-pressed=true]::before { content: ""; width: 16px; height: 16px; margin-left: -4px; background: currentColor; mask: var(--i-check) center / contain no-repeat; }
@media (hover: hover) { .chip:not([aria-pressed=true]):hover { border-color: var(--control-rule); } }
.chip:active { transform: scale(.96); transition-duration: var(--t-press); }
.local-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--rule-strong); color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.2;
  white-space: nowrap;
}
.film-text { color: var(--accent-text); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .film-text {
    background: var(--film); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  }
}
.mono-data { font-family: var(--font-mono); font-size: var(--fs-data); font-variant-numeric: tabular-nums slashed-zero; letter-spacing: 0; }

/* 7. Fields */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--muted); }
.field.grow { flex: 1; }
.small-field :where(input, select) { width: 88px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 370px) { .field-grid { grid-template-columns: minmax(0, 1fr); } }
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file]), select, textarea) {
  width: 100%; min-width: 0; height: 48px; margin: 0; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--control-rule); background-color: var(--field); color: var(--ink);
  font-size: var(--fs-input); font-weight: 500; line-height: normal;
  transition: border-color var(--t-hover), box-shadow var(--t-hover);
}
:where(textarea) { height: auto; min-height: 96px; padding-block: 12px; }
:where(input, textarea)::placeholder { color: var(--faint); opacity: 1; }
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file]), select, textarea):hover { border-color: var(--faint); }
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file]), select, textarea):focus {
  border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent);
  outline: none;
}
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file]), select, textarea)[aria-invalid=true] {
  border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file]), textarea)[aria-invalid=true] {
  padding-right: 40px; background-image: var(--i-invalid); background-repeat: no-repeat;
  background-position: right 12px center; background-size: 18px;
}
:where(input, select, textarea):disabled { opacity: .5; cursor: not-allowed; }
:where(select) {
  appearance: none; padding-right: 40px; cursor: pointer; text-overflow: ellipsis;
  background-image: var(--i-select); background-repeat: no-repeat; background-position: right 14px center;
  background-size: 18px;
}
.is-shake { animation: field-shake 180ms var(--ease-std); }
@keyframes field-shake { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

.input-unit {
  display: flex; align-items: center; height: 48px; border-radius: var(--r-sm);
  border: 1px solid var(--control-rule); background: var(--field); color: var(--ink);
  transition: border-color var(--t-hover), box-shadow var(--t-hover);
}
.input-unit:hover { border-color: var(--faint); }
.input-unit:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.input-unit:has([aria-invalid=true]) { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.input-unit input { flex: 1; height: 46px; border: 0; background-color: transparent; box-shadow: none; }
.input-unit input:focus, .input-unit input[aria-invalid=true] { box-shadow: none; }
.input-unit > :is(span, small) { flex: none; padding-right: 14px; color: var(--muted); font-size: 14px; font-weight: 500; }

.range {
  appearance: none; display: block; width: 100%; height: 44px; margin: 0; padding: 0; background: transparent;
  cursor: pointer; touch-action: pan-y; accent-color: var(--range-fill, var(--tool-gfx));
  --track: linear-gradient(90deg, var(--range-fill, var(--tool-gfx)) calc(13px + var(--p, 0) * (100% - 26px)), var(--surface-3) 0);
}
.range:focus-visible { outline: none; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--track); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--track); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  border: 2px solid var(--range-fill, var(--tool-gfx)); background: var(--panel-top);
  box-shadow: var(--shadow-press);
  transition: transform var(--t-hover) var(--ease-out), box-shadow var(--t-hover);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--range-fill, var(--tool-gfx));
  background: var(--panel-top); box-shadow: var(--shadow-press);
  transition: transform var(--t-hover) var(--ease-out), box-shadow var(--t-hover);
}
@media (hover: hover) {
  .range:hover::-webkit-slider-thumb { transform: scale(1.08); }
  .range:hover::-moz-range-thumb { transform: scale(1.08); }
}
.range:active::-webkit-slider-thumb { transform: scale(1.08); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--focus); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--focus); }
.range:disabled { opacity: .5; cursor: not-allowed; }
.range-scale {
  display: flex; justify-content: space-between; margin: -6px 13px 0; color: var(--faint);
  font-family: var(--font-mono); font-size: var(--fs-label); line-height: 1.4; font-variant-numeric: tabular-nums;
  pointer-events: none; user-select: none;
}
.range-scale > * { display: flex; justify-content: center; width: 0; white-space: nowrap; }

.segmented {
  container: seg / inline-size; position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--rule-strong);
}
.segmented::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: var(--r-pill); background: var(--pill-raised); box-shadow: var(--shadow-press);
  transition: translate var(--t-move) var(--spring-pop);
}
.segmented:has(label:nth-of-type(2) input:checked)::before { translate: 100% 0; }
.segmented label {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-height: 44px;
  min-width: 0; padding: 0 10px; border-radius: var(--r-pill); color: var(--muted); font-size: 15px;
  font-weight: 600; line-height: 1.15; text-align: center; text-wrap: balance; cursor: pointer;
  transition: color var(--t-ui);
}
.segmented label > span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
/* Own-width sizing (needs a definite width) */
@container seg (max-width: 420px) {
  .segmented label { font-size: 14px; padding: 0 6px; }
  .segmented label > span { gap: 6px; }
  .segmented label .icon { width: 16px; height: 16px; }
}
@container seg (max-width: 290px) { .segmented label .icon { display: none; } }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.segmented label:has(input:checked) { color: var(--ink); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) { .segmented label:not(:has(input:checked)):hover { color: var(--ink); } }
@supports not selector(:has(*)) {
  .segmented::before { display: none; }
  .segmented label { padding: 0; }
  .segmented label > span { width: 100%; min-height: 44px; border-radius: var(--r-pill); }
  .segmented input:checked + span { color: var(--ink); background: var(--pill-raised); box-shadow: var(--shadow-press); }
  .segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
}

.check-label { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ink); font-size: 15px; font-weight: 500; cursor: pointer; }
.switch input {
  appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 14px;
  border: 1px solid var(--control-rule); background: var(--surface-3); cursor: pointer;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.switch input::before,
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 0; width: 22px; height: 22px; border-radius: 50%;
  transform: translateX(2px);
  transition: transform 200ms var(--spring-pop), background-color 200ms var(--ease-out), opacity 200ms;
}
.switch input::before { background: var(--muted); box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.switch input::after { background: var(--tool-fill); opacity: 0; mask: var(--i-check) center / 14px no-repeat; }
:root[data-theme=light] .switch input:not(:checked)::before { background: var(--panel-top); box-shadow: 0 1px 3px rgb(40 48 30 / .4); }
.switch input:checked { background: var(--tool-fill); border-color: var(--tool-fill); }
.switch input:checked::before { background: var(--tool-on); transform: translateX(20px); }
.switch input:checked::after { opacity: 1; transform: translateX(20px); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.save-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.save-status { font-size: 13px; color: var(--muted); }
.save-status[data-error=true] { color: var(--danger); }
.form-message { min-height: 0; color: var(--danger); font-size: 14px; font-weight: 500; line-height: 1.4; }
.form-message:not(:empty) { display: flex; gap: 8px; align-items: flex-start; }
.form-message:not(:empty)::before {
  content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; background: currentColor;
  mask: var(--i-alert) center / contain no-repeat;
}
.fineprint { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* 8. Panels */
.panel {
  --panel-a: var(--panel-top); background: linear-gradient(180deg, var(--panel-a), var(--surface));
  border: 1px solid var(--glass-edge); border-radius: var(--r-panel); box-shadow: var(--shadow-panel);
  padding: clamp(16px, 2.2vw, 28px);
}
.panel.tint-grade { --panel-a: var(--tint-grade); }
.panel.tint-sleep { --panel-a: var(--tint-sleep); }
.panel.tint-code { --panel-a: var(--tint-code); }
.panel.tint-wisper { --panel-a: var(--tint-wisper); }
.panel:focus-within { border-color: transparent; background: linear-gradient(180deg, var(--panel-a), var(--surface)) padding-box, var(--film) border-box; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-heading :is(h2, h3) { font-size: var(--fs-h3); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }

/* 9. Toast, disclosure, table */
.toast {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 10px 10px 18px;
  border-radius: var(--r-pill); color: var(--ink); font-size: 14px; font-weight: 500;
  animation: toast-in 360ms var(--spring);
}
.toast > span:first-child { flex: 1 1 auto; min-width: 0; }
@keyframes toast-in { from { transform: translateY(16px); opacity: 0; } }

.disclosure { border-top: 1px solid var(--rule); interpolate-size: allow-keywords; }
.disclosure:first-child { border-top: 0; }
.disclosure > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; margin-inline: -8px; padding-inline: 8px;
  font-weight: 600; color: var(--ink); list-style: none; border-radius: var(--r-xs);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .icon,
.disclosure > summary:not(:has(.icon))::after { width: 20px; height: 20px; color: var(--muted); transition: rotate var(--t-ui) var(--ease-out), color var(--t-hover); }
.disclosure > summary:not(:has(.icon))::after { content: ""; flex: none; background: currentColor; mask: var(--i-plus) center / contain no-repeat; }
.disclosure[open] > summary .icon, .disclosure[open] > summary::after { rotate: 45deg; }
@media (hover: hover) { .disclosure > summary:hover :is(.icon), .disclosure > summary:hover::after { color: var(--ink); } }
.disclosure::details-content { block-size: 0; overflow: clip; transition: block-size 360ms var(--ease-out), content-visibility 360ms allow-discrete; }
.disclosure[open]::details-content { block-size: auto; }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.data-table :is(th, td) { padding: 14px 12px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.data-table :is(th, td):not(:first-child), .data-table .num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.data-table thead th { padding-block: 10px; color: var(--muted); }
.data-table tbody th { font-weight: 500; }
.data-table tbody tr[aria-current=true] > * { background: var(--grade-soft); }
.data-table tbody tr[aria-current=true] > :first-child { box-shadow: inset 3px 0 0 var(--grade-gfx); }
.data-table tfoot :is(th, td) { font-weight: 600; border-bottom: 0; }

/* 10. Tool intro */
.tool-intro { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding-block: 8px 20px; }
.tool-glyph { display: block; width: 88px; height: 88px; view-transition-name: glass-core; }
.tool-glyph svg { width: 100%; height: 100%; overflow: visible; }
.tool-intro .eyebrow { margin-bottom: 8px; }
@media (max-width: 900px) { .tool-intro { grid-template-columns: auto minmax(0, 1fr); } .tool-intro .local-badge { display: none; } }
.tool-lead { margin-top: 12px; font-size: 18px; line-height: 1.45; color: var(--muted); }
@media (max-width: 680px) {
  .tool-intro { grid-template-columns: 48px minmax(0, 1fr); gap: 4px 14px; padding-block: 8px 16px; }
  .tool-glyph { width: 48px; height: 48px; }
  .tool-lead { display: none; }
  .tool-intro .eyebrow { display: block; margin-bottom: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
@media (max-width: 480px) { .tool-intro .eyebrow-extra { display: none; } }

/* 11. Footer */
.site-footer { position: relative; margin-top: clamp(64px, 9vw, 128px); padding-block: 32px 0; color: var(--muted); overflow: clip; }
.site-footer::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: var(--film); opacity: .85;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; font-size: 14px; }
.footer-row a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); font-weight: 500;
  text-decoration: none; border-radius: var(--r-xs);
}
@media (hover: hover) {
  .footer-row a:hover { color: var(--accent-text); }
  .footer-row a:hover .icon { translate: 2px -2px; }
  .footer-row .footer-top:hover .icon { translate: 0 -3px; }
}
@media (min-width: 681px) {
  .footer-row > span:first-child, .footer-note { flex: 1 1 0; }
  .footer-note { text-align: center; }
  .footer-row > a:not(.footer-top) { margin-left: auto; }
}
@media (max-width: 680px) {
  .footer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; }
  .footer-row > span:first-child { grid-area: 1 / 1; }
  .footer-note { grid-area: 2 / 1; }
  .footer-row > a:not(.footer-top) { grid-area: 1 / 2; justify-self: end; }
  .footer-top { grid-area: 2 / 2; justify-self: end; }
}
/* % padding scales with the mark: room for the p descender inside the clipping footer (a margin would collapse out) */
.footer-mark { width: 100%; height: auto; margin-top: 28px; padding-bottom: 2%; overflow: visible; }
/* Fill over stroke hides variable-font contour overlaps */
.footer-mark text {
  fill: var(--bg); stroke: var(--rule-strong); stroke-width: 2.4px; paint-order: stroke;
  vector-effect: non-scaling-stroke; font: 800 170px var(--font-display); letter-spacing: -.02em;
  user-select: none;
}
.footer-mark .mark-lit {
  stroke: var(--grade-gfx); stroke-width: 3px; opacity: 0; transition: opacity 400ms var(--ease-out);
  mask-image: radial-gradient(160px circle at var(--mx, 50%) var(--my, 50%), #000, transparent);
}
@media (hover: hover) and (pointer: fine) { .footer-mark:hover .mark-lit { opacity: 1; } }

/* 12. Misc */
.compact-bar {
  position: fixed; top: calc(var(--header-h) + 8px); left: 50%; translate: -50% 0; z-index: var(--z-compact);
  display: flex; align-items: center; gap: 12px; min-height: 48px; max-width: calc(100% - 32px);
  padding: 0 8px 0 18px; border-radius: var(--r-pill); color: var(--ink); font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums; white-space: nowrap;
  transition: translate 280ms var(--ease-out), opacity 280ms;
}
.compact-bar .text-button { min-height: 44px; font-size: 14px; }
@starting-style { .compact-bar { translate: -50% -12px; opacity: 0; } }
.privacy-line {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 32px; font-size: 14px;
  line-height: 1.45; color: var(--muted); text-align: center; text-wrap: balance;
}
.noscript {
  margin-block: 16px; padding: 14px 18px; border-radius: var(--r-md); border: 1px solid var(--rule-strong);
  background: var(--surface); color: var(--ink); font-size: 15px;
}

/* 13. Motion */
/* Fill backwards; negative insets keep shadows */
.load-rise { animation: load-rise var(--t-reveal) var(--ease-out) backwards; animation-delay: calc(80ms + var(--i, 0) * var(--stagger)); }
@keyframes load-rise { from { transform: translateY(16px); clip-path: inset(-120px -120px 8% -120px); } to { clip-path: inset(-120px); } }
html:is(.vt-arrival, .vt-arrived) .load-rise { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    /* Ends when the block has fully entered: visible content is always settled */
    .reveal { animation: reveal-up linear backwards; animation-timeline: view(); animation-range: entry 10% entry 100%; }
    .parallax { animation: drift linear both; animation-timeline: view(); animation-range: cover; }
  }
  html.no-sda .reveal:not(.is-in) { transform: translateY(28px); clip-path: inset(-120px -120px 12% -120px); }
  html.no-sda .reveal.is-in { transition: transform var(--t-reveal) var(--ease-out), clip-path var(--t-reveal) var(--ease-out); clip-path: inset(-120px); }
}
@keyframes reveal-up { from { transform: translateY(32px) scale(.985); clip-path: inset(-120px -120px 14% -120px); } to { clip-path: inset(-120px); } }
@keyframes drift { from { transform: translateY(20px) rotate(-3deg); } to { transform: translateY(-20px) rotate(3deg); } }

/* theme.js: palette switches at once */
.changing-theme *, .changing-theme *::before, .changing-theme *::after { transition: none !important; }

/* View transitions */
@view-transition { navigation: auto; }
[data-transition-target=grade] { view-transition-name: grade-tool; }
[data-transition-target=sleep] { view-transition-name: sleep-tool; }
[data-transition-target=wisper] { view-transition-name: wisper-tool; }
::view-transition-group(*) { animation-duration: var(--t-vt); animation-timing-function: var(--ease-out); }
/* Roots fade through, never both at half opacity */
::view-transition-old(root) { animation: vt-root-out 160ms var(--ease-in) both; }
::view-transition-new(root) { animation: vt-root-in 380ms var(--ease-out) 140ms both; }
::view-transition-old(site-header) { animation: none; opacity: 0; }
::view-transition-new(site-header) { animation: none; }
/* Only the box morphs: snapshots stay 1:1, pinned top left, clipped by the box */
::view-transition-group(grade-tool), ::view-transition-group(sleep-tool), ::view-transition-group(wisper-tool) { animation-duration: 560ms; }
::view-transition-image-pair(grade-tool), ::view-transition-image-pair(sleep-tool), ::view-transition-image-pair(wisper-tool) { overflow: clip; border-radius: var(--r-panel); }
::view-transition-old(grade-tool), ::view-transition-old(sleep-tool), ::view-transition-old(wisper-tool) {
  animation: vt-fade-out 120ms linear both; height: 100%; object-fit: none; object-position: top left;
}
::view-transition-new(grade-tool), ::view-transition-new(sleep-tool), ::view-transition-new(wisper-tool) {
  animation: vt-fade-in 300ms var(--ease-out) 90ms both; height: 100%; object-fit: none; object-position: top left;
}
html.vt-out .home-page .module::after { display: none; }
::view-transition-group(glass-core) { animation-duration: 600ms; }
::view-transition-old(glass-core) { animation: vt-glass-out 600ms var(--ease-out) both; object-fit: contain; }
::view-transition-new(glass-core) { animation: vt-fade-in 420ms var(--ease-out) 180ms both; object-fit: contain; }
/* Own blocks: unknown pseudos drop only these */
html:active-view-transition-type(forward)::view-transition-new(root) { animation-name: vt-root-in-forward; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: vt-root-in-back; }
/* Back: the small glyph stays 1:1 instead of being blown up to stage size */
html:active-view-transition-type(back)::view-transition-old(glass-core) { animation: vt-fade-out 160ms linear both; object-fit: none; }
@keyframes vt-root-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-root-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes vt-root-in-forward { from { opacity: 0; transform: translateX(24px); } }
@keyframes vt-root-in-back { from { opacity: 0; transform: translateX(-24px); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-glass-out { to { opacity: 0; transform: perspective(900px) rotateY(-24deg) scale(.9); } }
/* Theme circle: only the root is captured */
html.theme-vt * { view-transition-name: none !important; }
html.theme-vt::view-transition-group(root) { animation: none; }
html.theme-vt::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-new(root) { animation: theme-reveal var(--t-theme) var(--ease-in-out) both; mix-blend-mode: normal; }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); } to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 0)); } }

/* Global reduced-motion rule */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .scene, .scene * { transition: none !important; animation: none !important; }
  .scene-stage { transform: none !important; }
  .load-rise { animation: none !important; }
  .disclosure::details-content { transition: none; }
  [data-magnetic] { translate: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  @view-transition { navigation: none; }
}

/* 14. Preferences, print */
@media (prefers-reduced-transparency: reduce) {
  :root, :root[data-theme] { --glass: var(--surface); }
  .nav-shell, .glass, .toast, .compact-bar { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root, :root[data-theme] { --rule: var(--control-rule); --glass-edge: var(--control-rule); }
  body::before { display: none; }
  .film-text { color: var(--accent-text); background: none; }
}
@media (forced-colors: active) {
  body::before, body::after, .glass-stage canvas, .glass-fallback { display: none; }
  .film-text { color: CanvasText; background: none; }
  .footer-mark text { stroke: CanvasText; }
  .footer-mark .mark-lit { display: none; }
  .chip[aria-pressed=true], .main-nav a[aria-current=page] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .segmented::before { background: Highlight; }
  .segmented label:has(input:checked) { forced-color-adjust: none; color: HighlightText; }
  .switch input:checked { background: Highlight; border-color: Highlight; }
  .range::-webkit-slider-runnable-track { background: CanvasText; }
}
@media print {
  body::before, body::after, .footer-mark, .glass-stage, .theme-toggle { display: none !important; }
  .site-header { position: static; }
  .nav-shell, .toast, .compact-bar, .glass { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .panel { box-shadow: none; break-inside: avoid; }
}
