/* DM Sans, self-hosted (SIL Open Font License, fonts/OFL-DM-Sans.txt). Replaces the Adobe Fonts kit:
   no third-party connections before first paint, and font-display:swap so text is never invisible
   while the font loads. One variable file per style covers every weight the site uses (400-800).
   Family name kept as 'dm-sans' so no other CSS changes. Files are version-stamped (cached 1 year). */
html{font-variation-settings:'opsz' 14}   /* this file adjusts letter shapes to the text size (optical sizing); Adobe's 'dm-sans' was one fixed design,
   and at opsz 14 the site's layout boxes match it to the pixel (measured against the live site, 2026-11-29) */
@font-face{font-family:'dm-sans';font-style:italic;font-weight:100 1000;font-display:swap;src:url(/fonts/dm-sans-italic-latin-ext.v17.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'dm-sans';font-style:italic;font-weight:100 1000;font-display:swap;src:url(/fonts/dm-sans-italic-latin.v17.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'dm-sans';font-style:normal;font-weight:100 1000;font-display:swap;src:url(/fonts/dm-sans-latin-ext.v17.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'dm-sans';font-style:normal;font-weight:100 1000;font-display:swap;src:url(/fonts/dm-sans-latin.v17.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

/* Mixx Reality — The Living Globe. Mobile-first; brand tokens taken from mixxreality.com. */

:root {
  --blue: #5163F5; --blue-deep: #3b49c9; --ink: #171A2E; --muted: #5b6079;
  --orange: #E97A58; --green: #B8F975; --cyan: #39d0ff;
  --font: 'dm-sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;

  /* scene (always dark: the globe lives in space) */
  --space: radial-gradient(125% 95% at 50% 30%, #13244f 0%, #0a1430 42%, #050a1c 74%, #020409 100%);
  --scene-text: #eef1ff;
  --glass: rgba(13, 17, 34, .72);
  --glass-border: rgba(255, 255, 255, .16);
  --card-bg: rgba(12, 17, 38, .9);

  /* content panel (light by default, like the main site) */
  --panel-bg: #ffffff;
  --panel-text: #171A2E;
  --panel-muted: #535872;
  --panel-line: rgba(23, 26, 46, .12);
  --panel-soft: #f3f5ff;
  --link: #3b49c9;

  --topbar-h: 56px;
  --toolbar-h: 64px;
  --scene-h: 50vh;
  --radius: 14px;
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--blue);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
@supports (height: 100dvh) { :root { --scene-h: 50dvh; } }

@media (prefers-color-scheme: dark) {
  :root {
    --panel-bg: #0b1024; --panel-text: #eef1ff; --panel-muted: #a9b0d0;
    --panel-line: rgba(255, 255, 255, .12); --panel-soft: #131a36; --link: #9ea9ff;
  }
}
@media (prefers-contrast: more) {
  :root { --glass: #050a1c; --glass-border: #fff; --card-bg: #050a1c; --panel-muted: var(--panel-text); --panel-line: currentColor; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--panel-text); background: #050a1c;
  overflow: hidden; overscroll-behavior: none;
}
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: calc(8px + var(--safe-t)); }

/* ---------- layout ---------- */
.app {
  position: relative; height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: var(--scene-h) minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  transition: grid-template-rows .35s var(--ease);
}
.app[data-expanded="true"] { grid-template-rows: minmax(0, 1fr) calc(52px + var(--safe-b)); }

.topbar {
  position: absolute; z-index: 30; top: 0; left: 0; right: 0;
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) calc(12px + var(--safe-r)) 0 calc(14px + var(--safe-l));
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: linear-gradient(to bottom, rgba(2, 4, 9, .65), rgba(2, 4, 9, 0));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: inline-flex; padding: 6px; margin-left: -6px; }
.brand img { height: 26px; width: auto; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.lang select {
  appearance: none; -webkit-appearance: none; min-height: 44px; min-width: 56px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--scene-text);
  font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-align: center;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

.glass { background: var(--glass); border: 1px solid var(--glass-border); color: var(--scene-text); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; padding: 0; }
.icon-btn:hover { border-color: rgba(255, 255, 255, .35); }
.icon-btn[aria-pressed="true"], .icon-btn[aria-expanded="true"] { background: var(--blue); border-color: var(--blue); }

/* ---------- scene ---------- */
.scene { container-type: size; container-name: scene; position: relative; overflow: hidden; background: var(--space); color: var(--scene-text); isolation: isolate; }
/* !important: Leaflet writes an inline position:relative if it initialises before this stylesheet applies
   (seen in WebKit), which would collapse the map to 0 px tall */
.layer { position: absolute !important; inset: 0; z-index: 0; isolation: isolate; }
.layer-3d canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.app[data-mode="3d"] .layer-2d, .app[data-mode="ar"] .layer-2d { visibility: hidden; }

.overlay { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.overlay > * { pointer-events: auto; }
.connector { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none !important; overflow: visible; }
.connector line { stroke: rgba(255, 255, 255, .75); stroke-width: 1.25; }
.connector circle { fill: var(--cyan); }
.connector.off { display: none; }

.scene-loading { position: absolute; inset: 0; z-index: 12; display: grid; place-content: center; gap: 12px; justify-items: center; font-size: .9rem; color: var(--scene-text); background: rgba(5, 10, 28, .45); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--cyan); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.scene-toolbar {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; height: var(--toolbar-h);
  padding: 0 calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; pointer-events: none;
}
.scene-toolbar > * { pointer-events: auto; }
.app[data-expanded="true"] .scene-toolbar { padding-bottom: 10px; }
.modes { display: inline-flex; padding: 3px; border-radius: 14px; gap: 2px; }
.modes button {
  min-width: 52px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 11px; background: transparent;
  color: var(--scene-text); font-weight: 700; font-size: .9rem; letter-spacing: .04em;
}
.modes button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.modes button.is-unavailable { opacity: .5; text-decoration: line-through; text-decoration-thickness: 1px; }
.modes button:not([aria-pressed="true"]):hover { background: rgba(255, 255, 255, .08); }
.tools { display: inline-flex; gap: 6px; }

.panel-foot .attribution { margin-top: 4px; font-size: .72rem; }
.leaflet-control-attribution { display: none; }
.leaflet-top.leaflet-right { top: calc(var(--topbar-h) + var(--safe-t)); right: var(--safe-r); }
.leaflet-touch .leaflet-bar, .leaflet-bar { border: 1px solid var(--glass-border); border-radius: 12px; overflow: hidden; box-shadow: none; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 20px; background: var(--glass); color: var(--scene-text); border-bottom-color: var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.leaflet-bar a:hover, .leaflet-bar a:focus { background: #1b2550; color: #fff; }
.leaflet-bar a.leaflet-disabled { background: var(--glass); color: rgba(238, 241, 255, .35); }
.app[data-mode="3d"] .leaflet-control-container { display: none; }

/* 2D map */
.layer-2d.leaflet-container { background: transparent; font-family: var(--font); outline: none; }
.leaflet-container .leaflet-interactive:focus { outline: none; }
/* Leaflet places markers with transforms and relies on position:absolute; never override it */
.mk { position: absolute; display: grid; place-items: center; width: 44px !important; height: 44px !important; margin: -22px 0 0 -22px !important; background: none; border: 0; border-radius: 50%; }
.mk-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(57, 208, 255, .25), 0 0 12px rgba(57, 208, 255, .8); transition: transform .2s var(--ease); }
.mk.is-hq .mk-dot { background: var(--orange); box-shadow: 0 0 0 3px rgba(233, 122, 88, .3), 0 0 14px rgba(233, 122, 88, .85); }
.mk.is-selected .mk-dot { transform: scale(1.45); background: #fff; box-shadow: 0 0 0 4px var(--blue), 0 0 18px rgba(81, 99, 245, .9); }
.mk-label {
  position: absolute; left: 34px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-size: .78rem; font-weight: 600; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  padding: 2px 7px; border-radius: 7px; background: rgba(5, 10, 28, .55); pointer-events: none;
}
.mk.label-left .mk-label { left: auto; right: 34px; }
.mk.label-hidden .mk-label { opacity: 0; }
.mk:focus-visible, .mk-hit:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--blue); }
@media (hover: hover) { .mk:hover .mk-dot { transform: scale(1.3); } }

/* 3D markers (DOM, positioned each frame) */
.markers3d { position: absolute; inset: 0; pointer-events: none !important; }
.markers3d .mk { position: absolute; left: 0; top: 0; margin: 0 !important; pointer-events: none; will-change: transform; transition: opacity .2s; }
/* the tap target is a button holding only the dot; the name is a sibling, so iOS Safari's native
   button rendering can never clip it */
.mk-hit { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; -webkit-appearance: none; appearance: none; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.markers3d .mk.is-occluded { opacity: 0; pointer-events: none; visibility: hidden; }
.markers3d .mk.is-fading { opacity: .35; }

/* spatial card */
.spatial-card {
  position: absolute; left: 0; top: 0; z-index: 3; width: min(300px, calc(100% - 24px));
  background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: var(--radius);
  color: var(--scene-text); padding: 14px 14px 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: opacity .2s var(--ease); will-change: transform;
}
.spatial-card.is-hidden { opacity: 0; pointer-events: none; }
.spatial-card .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); margin: 0 0 4px; }
.spatial-card.is-hq .eyebrow { color: #ffb49c; }
.spatial-card h3 { margin: 0; font-size: 1.15rem; line-height: 1.2; padding-right: 40px; }
.spatial-card .country { margin: 2px 0 8px; font-size: .82rem; color: rgba(238, 241, 255, .7); }
.spatial-card p.network { margin: -4px 0 8px; font-size: .8rem; font-weight: 700; color: var(--green); }
.spatial-card p.sum { margin: 0 0 10px; font-size: .88rem; line-height: 1.45; }
.spatial-card .card-close { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: inherit; display: grid; place-items: center; }
.spatial-card .card-close:hover { background: rgba(255, 255, 255, .1); }
.spatial-card .card-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 11px; border: 0; background: var(--blue); color: #fff; font-weight: 600; font-size: .88rem; }
.spatial-card .card-more .i { width: 18px; height: 18px; }
/* short scenes (the 50/50 phone split): compact card — name, role, one action; details live in the panel */
@container scene (max-height: 560px) {
  .spatial-card { width: min(250px, calc(100% - 24px)); padding: 10px 12px; }
  .spatial-card p.sum { display: none; }
  .spatial-card h3 { font-size: 1.02rem; }
  .spatial-card .country { margin: 0 0 6px; font-size: .78rem; }
  .spatial-card .card-more { min-height: 40px; padding: 0 12px; font-size: .84rem; }
  .spatial-card .card-close { width: 40px; height: 40px; top: 2px; right: 2px; }
}

.occluded-chip { position: absolute; left: 50%; top: calc(var(--topbar-h) + var(--safe-t) + 6px); transform: translateX(-50%); min-height: 44px; padding: 0 16px; border-radius: 22px; font-weight: 600; font-size: .85rem; display: inline-flex; align-items: center; gap: 6px; }

/* tour bar */
.tour-bar {
  position: absolute; z-index: 25; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(var(--toolbar-h) + 6px);
  border-radius: var(--radius); padding: 10px 10px 10px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center;
  max-width: 560px; margin: 0 auto;
}
.tour-bar .t-step { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); font-weight: 700; }
.tour-bar .t-title { margin: 0; font-size: .98rem; line-height: 1.25; }
.tour-bar .t-text { margin: 2px 0 0; font-size: .85rem; color: rgba(238, 241, 255, .85); grid-column: 1 / -1; }
.tour-bar .t-ctrl { display: flex; gap: 2px; grid-row: 1 / span 2; grid-column: 2; }
.tour-bar .t-ctrl button { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; display: grid; place-items: center; }
.tour-bar .t-ctrl button:hover { background: rgba(255, 255, 255, .1); }
.tour-bar .t-progress { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.tour-bar .t-progress span { display: block; height: 100%; width: 0; background: var(--cyan); }

/* ---------- content panel ---------- */
.panel {
  position: relative; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--panel-bg); color: var(--panel-text);
  border-radius: 18px 18px 0 0; margin-top: -14px; z-index: 5; outline: none;
  padding-bottom: var(--safe-b);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .25);
}
.panel-inner { padding: 20px calc(18px + var(--safe-r)) 8px calc(18px + var(--safe-l)); max-width: 720px; margin: 0 auto; }
.panel-peek {
  display: flex; width: 100%; min-height: 52px; align-items: center; justify-content: center; gap: 8px;
  border: 0; background: transparent; color: var(--panel-text); font-weight: 600;
}
.panel-peek::before { content: ''; width: 36px; height: 4px; border-radius: 4px; background: var(--panel-line); position: absolute; top: 6px; left: 50%; transform: translateX(-50%); }
.app[data-expanded="true"] .panel { margin-top: 0; overflow: hidden; }
.app[data-expanded="true"] .panel-inner, .app[data-expanded="true"] .panel-foot { display: none; }
.panel-foot { padding: 12px 18px 24px; text-align: center; font-size: .8rem; color: var(--panel-muted); }
.panel-foot p { margin: 0; }

.panel-skeleton span { display: block; height: 16px; margin: 12px 0; border-radius: 6px; background: var(--panel-soft); }
.panel-skeleton span:first-child { width: 40%; height: 12px; }
.panel-skeleton span:nth-child(2) { width: 85%; height: 26px; }

.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -8px 0 4px -8px; padding: 0 10px 0 6px; border: 0; background: transparent; color: var(--link); font-weight: 600; border-radius: 10px; }
.crumb .i { width: 20px; height: 20px; }
.eyebrow-p { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
@media (prefers-color-scheme: dark) { .eyebrow-p { color: #9ea9ff; } }
.panel h2 { margin: 0 0 10px; font-size: clamp(1.45rem, 5.6vw, 1.9rem); line-height: 1.15; letter-spacing: -.01em; outline: none; }
.panel h3 { margin: 22px 0 8px; font-size: 1.1rem; line-height: 1.25; }
.panel p { margin: 0 0 12px; }
.lead { font-size: 1.05rem; color: var(--panel-text); }
.muted { color: var(--panel-muted); }
.hint { font-size: .9rem; color: var(--panel-muted); }
.panel ul.ticks { list-style: none; padding: 0; margin: 0 0 14px; }
.panel ul.ticks li { position: relative; padding: 6px 0 6px 26px; border-bottom: 1px solid var(--panel-line); }
.panel ul.ticks li:last-child { border-bottom: 0; }
.panel ul.ticks li::before { content: ''; position: absolute; left: 4px; top: 14px; width: 10px; height: 6px; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: .98rem; text-decoration: none; text-align: center;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.secondary { background: transparent; color: var(--panel-text); border-color: var(--panel-line); }
.btn.secondary:hover { border-color: var(--blue); }
.btn.block { width: 100%; }
.btn .i { width: 20px; height: 20px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.btn-row .btn { flex: 1 1 200px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 88px; padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--panel-line); background: var(--panel-soft); color: var(--panel-text);
  text-align: left; font-weight: 700; line-height: 1.25;
}
.tile small { font-weight: 400; font-size: .82rem; color: var(--panel-muted); }
.tile:hover { border-color: var(--blue); }
.tile.with-img { padding: 0; overflow: hidden; }
.tile.with-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tile.with-img .tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }

.loc-list { list-style: none; padding: 0; margin: 10px 0 16px; }
.loc-list button {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px;
  border: 0; border-bottom: 1px solid var(--panel-line); background: transparent; color: inherit; text-align: left;
}
.loc-list button:hover { background: var(--panel-soft); }
.loc-list .i { color: var(--blue); }
.loc-list .badge { margin-left: auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .74rem; font-weight: 700; background: var(--panel-soft); color: var(--panel-text); border: 1px solid var(--panel-line); }
.badge.network { background: #eef8e4; color: #2f5d12; border-color: #c9e8ad; }
@media (prefers-color-scheme: dark) { .badge.network { background: #1d2c14; color: #c9f59f; border-color: #3d5a28; } }
.badge.hq { background: #fff0ea; color: #9a3a1c; border-color: #f4c3b2; }
@media (prefers-color-scheme: dark) { .badge.hq { background: #3a1d12; color: #ffc6b2; border-color: #6b3524; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--panel-line); background: transparent; color: var(--panel-text); font-size: .9rem; font-weight: 600; }
.chip:hover { border-color: var(--blue); color: var(--link); }

.facts { display: grid; gap: 10px; margin: 12px 0; }
.fact { padding: 12px 14px; border-radius: var(--radius); background: var(--panel-soft); }
.fact h3 { margin: 0 0 4px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--panel-muted); }
.fact p { margin: 0; }

.example { margin: 16px 0; padding: 14px; border-radius: var(--radius); border: 1px dashed var(--panel-line); }
.example .tag { display: inline-block; margin-bottom: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.example img { margin-top: 10px; border-radius: 10px; }

.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.cap { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--panel-line); }
.cap strong { display: block; margin-bottom: 2px; }
.cap span { font-size: .9rem; color: var(--panel-muted); }

figure.shot { margin: 14px 0; }
figure.shot img { border-radius: 12px; border: 1px solid var(--panel-line); background: #fff; }
figure.shot figcaption { font-size: .78rem; color: var(--panel-muted); margin-top: 6px; }

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.plan { position: relative; padding: 14px; border-radius: var(--radius); border: 1px solid var(--panel-line); }
.plan.featured { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.plan .pname { font-weight: 700; }
.plan .pprice { font-size: 1.5rem; font-weight: 800; line-height: 1.1; margin: 6px 0 2px; }
.plan .punit { font-size: .8rem; color: var(--panel-muted); }
.plan .pnote { font-size: .85rem; margin-top: 6px; }
.plan .ptag { position: absolute; top: -10px; right: 10px; padding: 1px 8px; border-radius: 10px; font-size: .7rem; font-weight: 700; background: var(--blue); color: #fff; }
.kind { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--panel-muted); margin-bottom: 6px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; position: relative; padding: 10px 12px 10px 48px; border-radius: var(--radius); background: var(--panel-soft); }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 700; font-size: .85rem; }
.steps strong { display: block; }

.cta-band { margin: 26px 0 8px; padding: 18px; border-radius: 16px; background: linear-gradient(135deg, #1b2a6b, #5163F5); color: #fff; }
.cta-band h3 { margin: 0 0 6px; color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .9); }
.cta-band .btn.primary { background: #fff; color: var(--ink); }
.cta-band .btn.primary:hover { background: #e8ebff; }

/* form */
.form { display: grid; gap: 14px; margin: 14px 0 8px; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 600; font-size: .92rem; }
.field .req { color: var(--panel-muted); font-weight: 400; font-size: .8rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--panel-line); background: var(--panel-bg); color: var(--panel-text); font-size: 16px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { border-color: var(--blue); }
.field .err { color: #b3261e; font-size: .85rem; font-weight: 600; }
@media (prefers-color-scheme: dark) { .field .err { color: #ffb4ab; } }
.field [aria-invalid="true"] { border-color: #b3261e; border-width: 2px; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details.more { border: 1px solid var(--panel-line); border-radius: 12px; padding: 0 12px; }
details.more summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
details.more[open] { padding-bottom: 12px; }
details.more .field + .field { margin-top: 12px; }
.form-msg { padding: 14px; border-radius: 12px; background: var(--panel-soft); }
.form-msg.ok { border-left: 4px solid #2e7d32; }
.form-msg.fail { border-left: 4px solid #b3261e; }

/* ---------- menu drawer ---------- */
.menu-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(2, 4, 9, .55); }
.menu {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(340px, 88vw);
  background: var(--panel-bg); color: var(--panel-text); overflow-y: auto;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) 16px;
  box-shadow: -20px 0 40px rgba(0, 0, 0, .35); outline: none;
}
.menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.menu-head h2 { margin: 0; font-size: 1.05rem; }
.menu .icon-btn { border: 1px solid var(--panel-line); background: transparent; color: inherit; }
.menu ul { list-style: none; padding: 0; margin: 6px 0 14px; }
.menu li button, .menu li a {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px;
  border: 0; border-bottom: 1px solid var(--panel-line); background: transparent; color: inherit; text-decoration: none; text-align: left; font-weight: 600;
}
.menu li button[aria-current="true"] { color: var(--link); }
.menu .menu-group { margin: 14px 0 2px; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--panel-muted); }

/* ---------- AR sheet + overlay ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 520px; max-height: 92dvh;
  border-radius: 20px 20px 0 0; background: var(--panel-bg); color: var(--panel-text);
}
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 20px; } }
dialog.sheet::backdrop { background: rgba(2, 4, 9, .6); }
.sheet-body { padding: 22px 20px calc(20px + var(--safe-b)); }
.sheet-body h2 { margin: 0 0 10px; font-size: 1.35rem; }
.sheet-body ol { padding-left: 20px; margin: 0 0 14px; }
.sheet-body li { margin: 4px 0; }
.sheet-body .note { font-size: .9rem; padding: 10px 12px; border-radius: 10px; background: var(--panel-soft); }
.sheet-body .qr { width: 180px; height: 180px; margin: 10px auto; background: #fff; padding: 8px; border-radius: 10px; }
.sheet-body .qr img, .sheet-body .qr canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.ql-link { display: inline-flex; align-items: center; gap: 10px; }
.ql-link img { width: 40px; height: 40px; border-radius: 8px; }

.ar-overlay { position: fixed; inset: 0; z-index: 200; color: #fff; font-family: var(--font); touch-action: none; }
.ar-top { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ar-hint { padding: 10px 14px; border-radius: 12px; background: rgba(5, 10, 28, .75); font-weight: 600; font-size: .92rem; }
.ar-bottom { position: absolute; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ar-ctrls { display: flex; gap: 8px; }
.ar-ctrls button, .ar-exit { min-width: 48px; min-height: 48px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(5, 10, 28, .75); color: #fff; display: grid; place-items: center; padding: 0 14px; font-weight: 700; }
.ar-card { width: 100%; max-width: 420px; padding: 14px; border-radius: 14px; background: rgba(5, 10, 28, .88); }
.ar-card h3 { margin: 0 0 4px; }
.ar-card p { margin: 0; font-size: .9rem; }

.toast { position: fixed; z-index: 300; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: #0d1122; color: #fff; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }

.noscript { position: fixed; inset: 0; z-index: 999; background: #fff; color: #171A2E; padding: 24px; font-family: var(--font); }

/* ---------- desktop / tablet landscape: side-by-side ---------- */
@media (min-width: 1024px) and (min-aspect-ratio: 4/3) {
  .app { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) clamp(380px, 34vw, 480px); }
  .app[data-expanded="true"] { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 0px; }
  .panel { margin-top: 0; border-radius: 0; box-shadow: -10px 0 30px rgba(0, 0, 0, .25); padding-top: 8px; }
  .app[data-expanded="true"] .panel { visibility: hidden; }
  .topbar { right: clamp(380px, 34vw, 480px); }
  .app[data-expanded="true"] .topbar { right: 0; }
}

/* short landscape phones: give the scene more room */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1023px) {
  .app { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .app[data-expanded="true"] { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 0px; }
  .panel { margin-top: 0; border-radius: 0; }
  .topbar { right: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Mixx AI 2D robot (assets/mixx-ai/2d/mixx-ai-2d.js) — the rules its SVG used to carry inline */
.mx-svg { display: block; width: 100%; height: 100%; }
.mx-g { stroke: var(--glow); }
.mx-gf { fill: var(--glow); }
.mx-core-0 { stop-color: #cfe4ff; stop-opacity: .95; }
.mx-core-1 { stop-color: var(--glow); stop-opacity: .55; }
.mx-core-2 { stop-color: var(--glow); stop-opacity: 0; }

/* Tour presenter: Mixx AI at the left end of the tour bar.
   Rows: step label + controls / title / text / progress, so the title gets the full width */
.tour-bar.has-ai { grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; padding-left: 8px; }
.tour-bar.has-ai .t-head { display: contents; }
.tour-bar.has-ai .tour-ai { grid-column: 1; grid-row: 1 / span 4; align-self: center; width: 64px; height: 72px; pointer-events: none; }
.tour-bar.has-ai .t-step { grid-column: 2; grid-row: 1; align-self: center; }
.tour-bar.has-ai .t-ctrl { grid-column: 3; grid-row: 1; }
.tour-bar.has-ai .t-title { grid-column: 2 / -1; grid-row: 2; }
.tour-bar.has-ai .t-text { grid-column: 2 / -1; grid-row: 3; margin-top: 0; }
.tour-bar.has-ai .t-progress { grid-column: 2 / -1; grid-row: 4; margin-top: 4px; }
@media (max-width: 360px) { .tour-bar.has-ai { grid-template-columns: 52px minmax(0, 1fr) auto; } .tour-bar.has-ai .tour-ai { width: 52px; height: 60px; } }

/* AR: Mixx AI explainer + voice toggle */
.ar-top-btns { display: flex; gap: 8px; }
.ar-sound[aria-pressed="false"] { opacity: .75; }
.ar-about { min-height: 48px; max-width: 420px; padding: 0 18px; border-radius: 24px; border: 1px solid rgba(255, 255, 255, .35); background: var(--blue); color: #fff; font-weight: 700; font-size: .95rem; }
.ar-about:active { transform: scale(.98); }

/* AR story: "What is spatial communication?" */
.ar-story { width: 100%; max-width: 440px; padding: 12px 14px; border-radius: 16px; background: rgba(5, 10, 28, .88); color: #fff; }
.ar-story-head { display: flex; align-items: center; gap: 8px; }
.ar-story-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ar-story-head h3 { margin: 0; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-story-step { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cyan); font-weight: 700; white-space: nowrap; }
.ar-story-ctrls { display: flex; gap: 2px; }
.ar-story-ctrls button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: #fff; display: grid; place-items: center; }
.ar-story-ctrls button:active { background: rgba(255, 255, 255, .12); }
.ar-story-text { margin: 6px 0 0; font-size: 1rem; line-height: 1.4; min-height: 2.8em; }
.ar-story-end { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ar-story-end .ar-about { flex: 1 1 auto; }
.ar-story-replay { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 24px; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; font-weight: 600; }
.ar-story-replay .i { width: 18px; height: 18px; }
.ar-story-example img { width: 100%; height: auto; margin-top: 8px; border-radius: 10px; background: #fff; }
.ar-story-example p { margin: 8px 0; font-size: .92rem; }

/* "What is spatial communication?" on the web globe (reuses the AR story panel) */
.story-host { position: absolute; z-index: 25; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(var(--toolbar-h) + 6px); display: flex; justify-content: center; pointer-events: none; }
.story-host > * { pointer-events: auto; }
.ar-story.has-robot { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: end; }
.story-ai { width: 64px; height: 72px; pointer-events: none; }
.ar-story-voice { min-height: 36px; padding: 0 10px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.ar-story-voice[aria-pressed="false"] { opacity: .7; }
.story-ai .tour-ai { width: 100%; height: 100%; }

/* web story: title on its own line, voice + playback buttons below it (room for the robot column) */
.ar-story.has-robot .ar-story-head { flex-wrap: wrap; row-gap: 2px; }
.ar-story.has-robot .ar-story-titles { flex-basis: 100%; }
.ar-story.has-robot .ar-story-voice { margin-right: auto; }
