/* XR Adoption Readiness — design system
   Type and motion follow sepafshar.com (Chakra Petch display, pill controls, .32/.72/0/1 easing);
   palette follows the CLG atlas (indigo accent, glass chrome, graticule grid). */
@view-transition { navigation: auto; }

:root {
  --head: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --font: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --fs: 1.0625rem;
  --lh: 1.6;
  --radius: 20px;
  --radius-sm: 12px;

  /* dark (default) */
  --bg: #0b1020;
  --bg-2: #0e1428;
  --surface: #121a30;
  --surface-2: #19223c;
  --glass: rgba(16, 21, 40, .78);
  --border: rgba(170, 182, 217, .14);
  --border-strong: rgba(170, 182, 217, .30);
  --text: #f2f5fa;
  --muted: #a9b3cc;
  --accent: #7c9cff;
  --accent-ink: #0b0d12;
  --accent-soft: rgba(124, 156, 255, .15);
  --teal: #5eead4;
  --grid: rgba(124, 156, 255, .10);
  --high: #5eead4;  --high-soft: rgba(94, 234, 212, .13);
  --med: #ffc46b;   --med-soft: rgba(255, 196, 107, .13);
  --low: #ff8a95;   --low-soft: rgba(255, 138, 149, .13);
  --ev-data: #5eead4;
  --ev-weak: #ffc46b;
  --ev-plan: #a9bdff;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fc; --bg-2: #eef0fa; --surface: #ffffff; --surface-2: #f1f3fb;
    --glass: rgba(255, 255, 255, .82);
    --border: rgba(19, 23, 41, .09); --border-strong: rgba(19, 23, 41, .20);
    --text: #0b0d12; --muted: #4b5270;
    --accent: #3b4bd1; --accent-ink: #ffffff; --accent-soft: rgba(59, 75, 209, .09);
    --teal: #0b8a78; --grid: rgba(59, 75, 209, .10);
    --high: #0b7d6c; --high-soft: rgba(11, 125, 108, .09);
    --med: #a35d00;  --med-soft: rgba(163, 93, 0, .09);
    --low: #c0313f;  --low-soft: rgba(192, 49, 63, .08);
    --ev-data: #0b7d6c; --ev-weak: #a35d00; --ev-plan: #3b4bd1;
    --shadow: 0 1px 2px rgba(19,23,41,.04), 0 18px 40px -22px rgba(19, 23, 41, .25);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f7fc; --bg-2: #eef0fa; --surface: #ffffff; --surface-2: #f1f3fb;
  --glass: rgba(255, 255, 255, .82);
  --border: rgba(19, 23, 41, .09); --border-strong: rgba(19, 23, 41, .20);
  --text: #0b0d12; --muted: #4b5270;
  --accent: #3b4bd1; --accent-ink: #ffffff; --accent-soft: rgba(59, 75, 209, .09);
  --teal: #0b8a78; --grid: rgba(59, 75, 209, .10);
  --high: #0b7d6c; --high-soft: rgba(11, 125, 108, .09);
  --med: #a35d00;  --med-soft: rgba(163, 93, 0, .09);
  --low: #c0313f;  --low-soft: rgba(192, 49, 63, .08);
  --ev-data: #0b7d6c; --ev-weak: #a35d00; --ev-plan: #3b4bd1;
  --shadow: 0 1px 2px rgba(19,23,41,.04), 0 18px 40px -22px rgba(19, 23, 41, .25);
  color-scheme: light;
}
/* High contrast toggle (and OS preference) */
:root.hc {
  --bg: #000; --bg-2: #000; --surface: #000; --surface-2: #0a0a0a; --glass: #000;
  --border: #fff; --border-strong: #fff; --text: #fff; --muted: #f0f0f0;
  --accent: #ffd400; --accent-ink: #000; --accent-soft: rgba(255, 212, 0, .2);
  --teal: #4dffb8; --grid: transparent;
  --high: #4dffb8; --high-soft: rgba(77,255,184,.15); --med: #ffd400; --med-soft: rgba(255,212,0,.15); --low: #ff8080; --low-soft: rgba(255,128,128,.15);
  --ev-data: #4dffb8; --ev-weak: #ffd400; --ev-plan: #9ecbff; --shadow: none;
  color-scheme: dark;
}
:root.readable { --fs: 1.2rem; --lh: 1.75; }
@media (prefers-contrast: more) { :root { --border: var(--border-strong); --muted: var(--text); } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs); line-height: var(--lh);
  color: var(--text); background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, var(--grid) 1.2px, transparent 1.6px),
    radial-gradient(1000px 560px at 8% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(800px 520px at 100% 0%, color-mix(in srgb, var(--teal) 9%, transparent), transparent 62%);
  background-size: 24px 24px, auto, auto;
  background-attachment: fixed;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); font-weight: 600; letter-spacing: -.02em; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }
.muted { color: var(--muted); }
.small { font-size: .93em; }
.tiny { font-size: .83em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 10px; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 999px; z-index: 100; font-weight: 700; }
.skip:focus { left: 12px; }
.container { width: min(1140px, 100% - 32px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding: 10px 0; }
.site-header .bar {
  display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 6px 8px 6px 14px;
  background: var(--glass); border: 1px solid var(--border); border-radius: 999px;
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 10px; flex: none; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand b { font-family: var(--head); font-weight: 700; font-size: 1.08rem; letter-spacing: 0; display: block; line-height: 1.1; }
.brand small { display: block; font-weight: 600; color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav a {
  position: relative; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .96rem;
  padding: 9px 14px; border-radius: 999px; transition: color .25s var(--ease), background .25s var(--ease);
}
.nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.nav .tools { display: flex; gap: 6px; margin-left: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 12%, transparent);
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 14%, transparent); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-btn { display: none; }
@media (max-width: 820px) {
  .menu-btn { display: inline-grid; margin-left: auto; }
  .nav {
    position: absolute; top: calc(100% + 4px); left: 16px; right: 16px; flex-direction: column; align-items: stretch;
    padding: 10px; background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; visibility: hidden;
    transition: opacity .3s var(--ease), transform .4s var(--ease), visibility 0s .3s;
  }
  .nav.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .3s var(--ease), transform .4s var(--ease); }
  .nav a { padding: 13px 14px; font-size: 1.05rem; }
  .nav .tools { margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
}

main { flex: 1; padding: 30px 0 64px; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(20px, 2.6vw, 30px); box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.eyebrow { font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.lead { font-size: 1.16em; color: var(--muted); max-width: 64ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: .98rem; line-height: 1.2;
  padding: 12px 20px; min-height: 46px; border-radius: 999px; border: 0;
  background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--text);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 12%, transparent);
  cursor: pointer; text-decoration: none;
  transition: background .25s var(--ease), transform .3s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { background: color-mix(in srgb, var(--text) 15%, transparent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 24px -10px var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.btn.ghost:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.btn.sm { padding: 8px 14px; min-height: 38px; font-size: .9rem; }
.btn[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Badges ---------- */
.level {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-family: var(--head); font-weight: 700; letter-spacing: .08em; font-size: .92rem;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.level::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.level.high { color: var(--high); background: var(--high-soft); }
.level.medium { color: var(--med); background: var(--med-soft); }
.level.low { color: var(--low); background: var(--low-soft); }
.level.none { color: var(--muted); background: var(--surface-2); }
.ev {
  display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px currentColor; white-space: nowrap; background: color-mix(in srgb, currentColor 8%, transparent);
}
.ev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ev.data { color: var(--ev-data); }
.ev.weak { color: var(--ev-weak); }
.ev.plan { color: var(--ev-plan); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 120px; height: 120px; border-radius: 50%; background: var(--accent-soft); filter: blur(10px); }
.stat b { font-family: var(--head); display: block; font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .92rem; position: relative; z-index: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: .96rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
tbody tr { transition: background .2s var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Callouts ---------- */
.note { border: 1px solid var(--border); border-left: 4px solid var(--ev-weak); background: var(--surface-2); border-radius: var(--radius-sm); padding: 13px 16px; font-size: .94rem; }
.note.info { border-left-color: var(--accent); }
details.disclose { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
details.disclose > summary { cursor: pointer; padding: 13px 16px; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .35s var(--ease); }
details.disclose[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
details.disclose > div { padding: 0 16px 16px; color: var(--muted); }
details.disclose[open] > div { animation: fadeUp .45s var(--ease) both; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 36px; color: var(--muted); font-size: .92rem; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; }
.site-footer .fbrand { display: flex; align-items: center; gap: 10px; }
.site-footer .fbrand img { width: 26px; height: 26px; border-radius: 8px; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

.a11y-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
:root.reduce-motion [data-reveal] { opacity: 1 !important; transform: none !important; }

@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #333; --border: #bbb; --border-strong: #888; --shadow: none; }
  body { background: #fff; }
  .site-header, .site-footer, .no-print, .a11y-bar { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- Accessibility panel ---------- */
.site-header .container { position: relative; }
.a11y-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(320px, calc(100vw - 32px)); z-index: 60;
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); box-shadow: var(--shadow);
  animation: fadeUp .35s var(--ease) both;
}
.a11y-panel h2 { font-size: 1rem; margin: 0 0 4px; }
.a11y-panel p { font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 4px; background: none; border: 0; border-top: 1px solid var(--border); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.switch .track { flex: none; width: 44px; height: 26px; border-radius: 999px; background: color-mix(in srgb, var(--text) 18%, transparent); position: relative; transition: background .3s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .35s var(--ease); }
.switch[aria-checked="true"] .track { background: var(--accent); }
.switch[aria-checked="true"] .track::after { transform: translateX(18px); }
.switch small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
