/* WorldWise Learning — Interactive Institutional Experience
   Self-hosted fonts (SIL Open Font License) and presentation-shell styles.
   No inline styles in markup: compatible with style-src 'self'. */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 300 600; font-stretch: 100%; font-display: swap; src: url('fonts/plex-sans-var-latin.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: 'IBM Plex Sans'; font-style: normal; font-weight: 300 600; font-stretch: 100%; font-display: swap; src: url('fonts/plex-sans-var-latin-ext.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 300 600; font-stretch: 100%; font-display: swap; src: url('fonts/plex-sans-var-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/plex-mono-400-latin.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: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/plex-mono-400-latin-ext.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/plex-mono-400-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/plex-mono-500-latin.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: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/plex-mono-500-latin-ext.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/plex-mono-500-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-latin.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: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-latin-ext.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-italic-latin.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: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-italic-latin-ext.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --deep: #030a12; --bg: #06131f; --ink: #eaf2f7; --mute: #a3b7c7; --dim: #627a8d;
  --cyan: #46d6f2; --aqua: #62e6d8; --mint: #86f0c4; --gold: #e6bd6e;
  --glass: rgba(6, 19, 31, 0.78); --line: rgba(130, 210, 240, 0.22);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--deep); color: var(--ink); overflow: hidden; }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#app { position: fixed; inset: 0; }
.noscript { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; font: 400 16px/1.6 var(--sans); color: var(--mute); }
.noscript a { color: var(--mint); }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

.app { position: absolute; inset: 0; overflow: hidden; background: var(--deep); }
.app.chrome-hidden { cursor: none; }
.stage { will-change: transform; contain: layout paint; }

/* ---------- boot / loading ---------- */
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--deep); }
.boot img { width: 72px; height: 72px; opacity: .9; }
.boot span { font: 500 12px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }

/* ---------- home ---------- */
.home { position: absolute; inset: 0; display: flex; flex-direction: column; }
.home-veil { position: absolute; inset: 0; background:
  radial-gradient(900px 600px at 50% 45%, rgba(3, 10, 18, 0.55), rgba(3, 10, 18, 0.88) 70%),
  linear-gradient(180deg, rgba(3, 10, 18, 0.55), rgba(3, 10, 18, 0.92)); }
.home-inner { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 72px 16px 24px; }
.home-logo { width: clamp(64px, 9vh, 104px); height: auto; filter: drop-shadow(0 0 40px rgba(98, 230, 216, 0.28)); }
.kicker { margin: 22px 0 0; font: 500 clamp(10px, 1.1vw, 13px)/1.4 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--aqua); }
.wordmark { margin: 14px 0 0; font: 500 clamp(30px, 5.4vw, 76px)/1.05 var(--sans); letter-spacing: .1em; text-indent: .1em; color: var(--ink); }
.home-title { margin: 12px 0 0; font: italic 400 clamp(24px, 3.2vw, 44px)/1.15 var(--serif); color: var(--gold); }
.pillars { margin: 18px 0 0; font: 400 clamp(13px, 1.35vw, 18px)/1.5 var(--sans); letter-spacing: .04em; color: var(--mute); }
.pillars i { font-style: normal; color: var(--cyan); padding: 0 .35em; }
.home-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: clamp(26px, 4.5vh, 44px); }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; font: 500 13px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; transition: background .18s, border-color .18s, transform .18s; }
.btn.primary { background: var(--mint); color: var(--deep); box-shadow: 0 0 40px rgba(134, 240, 196, 0.25); }
.btn.primary:hover { background: #a6f6d6; transform: translateY(-1px); }
.btn.ghost { border-color: rgba(234, 242, 247, 0.32); color: var(--ink); background: rgba(3, 10, 18, 0.4); }
.btn.ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn.sm { min-height: 40px; padding: 0 18px; font-size: 11.5px; }
.btn svg { width: 16px; height: 16px; }
.home-settings { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: center; margin-top: 28px; }
.setting { display: flex; align-items: center; gap: 12px; }
.setting-label { font: 500 11px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.segctl { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: rgba(3, 10, 18, 0.55); }
.segctl button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; font: 500 12px var(--mono); letter-spacing: .1em; color: var(--mute); min-width: 44px; }
.segctl button.on { background: rgba(98, 230, 216, 0.18); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(98, 230, 216, 0.5); }
.segctl.small button { padding: 5px 9px; min-width: 36px; font-size: 11px; }
.linkish { margin-top: 22px; border: 0; background: none; cursor: pointer; font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); text-decoration: underline; text-decoration-color: rgba(163, 183, 199, 0.35); text-underline-offset: 6px; padding: 8px; }
.linkish:hover { color: var(--mint); }
.home-foot { position: relative; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 28px 20px; font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }

/* ---------- top bar ---------- */
.topbar { position: absolute; left: 0; right: 0; top: 0; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: linear-gradient(180deg, rgba(3, 10, 18, 0.85), rgba(3, 10, 18, 0)); transition: opacity .35s, transform .35s; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 6px; min-width: 0; }
.brand img { width: 28px; height: 28px; }
.brand-name { font: 600 14px var(--sans); letter-spacing: .02em; white-space: nowrap; }
.brand-sub { font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-btn { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: var(--glass); border-radius: 999px; padding: 7px 12px 7px 16px; cursor: pointer; min-height: 40px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.section-btn .num { font: 500 12px var(--mono); letter-spacing: .12em; color: var(--cyan); }
.section-btn .ttl { font: 500 14px var(--sans); color: var(--ink); white-space: nowrap; }
.section-btn svg { color: var(--mute); }

/* ---------- controls ---------- */
.controls { position: absolute; left: 12px; right: 12px; bottom: 12px; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); transition: opacity .35s, transform .35s; z-index: 5; }
.grp { display: flex; align-items: center; gap: 4px; flex: none; }
.ic { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--ink); }
.ic:hover { background: rgba(130, 210, 240, 0.12); }
.ic.main { background: rgba(134, 240, 196, 0.16); color: var(--mint); }
.ic.exit span { font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.progress { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.segs { flex: 1; display: flex; gap: 4px; min-width: 0; }
.seg { flex-basis: 0; min-width: 6px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; }
.seg-track { display: block; width: 100%; height: 4px; border-radius: 4px; background: rgba(163, 183, 199, 0.22); overflow: hidden; transition: height .15s; }
.seg:hover .seg-track, .seg.on .seg-track { height: 6px; }
.seg-fill { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--mint)); transform-origin: 0 50%; }
.clock { font: 500 12px var(--mono); letter-spacing: .08em; color: var(--mute); white-space: nowrap; }
.chrome-hidden .topbar { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.chrome-hidden .controls { opacity: 0; transform: translateY(8px); pointer-events: none; }

/* ---------- captions outside the stage (narrow screens) ---------- */
.ext-caption { position: absolute; left: 16px; right: 16px; text-align: center; font: 500 16px/1.45 var(--sans); color: #f3f8fb; transition: opacity .15s; pointer-events: none; }

/* ---------- toasts / end card ---------- */
.toast { position: absolute; left: 50%; top: 72px; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--aqua); z-index: 6; }
.toast.warn { color: var(--gold); top: 116px; }
.endcard { position: absolute; left: 50%; bottom: 86px; transform: translateX(-50%); width: min(980px, calc(100% - 24px)); padding: 16px 20px 14px; border-radius: 16px; background: rgba(3, 10, 18, 0.86); border: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); z-index: 5; text-align: center; }
.end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.disclaimer { margin: 12px auto 0; max-width: 860px; font: 400 12.5px/1.5 var(--sans); color: var(--mute); }
.disclaimer.vi { margin-top: 4px; color: var(--dim); }

/* ---------- section menu ---------- */
.menu-backdrop { position: absolute; inset: 0; z-index: 10; background: rgba(3, 10, 18, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.menu { width: min(760px, 100%); max-height: 100%; overflow: auto; border-radius: 18px; background: rgba(6, 19, 31, 0.96); border: 1px solid var(--line); box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); }
.menu-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 22px; background: rgba(6, 19, 31, 0.98); font: 500 12px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--aqua); }
.menu-list { list-style: none; margin: 0; padding: 6px 12px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.menu-list button { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; background: rgba(130, 210, 240, 0.04); cursor: pointer; }
.menu-list button:hover { border-color: var(--line); background: rgba(130, 210, 240, 0.09); }
.menu-list button.on { border-color: rgba(98, 230, 216, 0.55); background: rgba(98, 230, 216, 0.1); }
.menu-list .n { font: 500 13px var(--mono); color: var(--cyan); letter-spacing: .08em; }
.menu-list .t { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu-list .t b { font: 500 15px var(--sans); color: var(--ink); }
.menu-list .t em { font: 400 12.5px var(--sans); font-style: normal; color: var(--dim); }
.menu-list .d { font: 500 11px var(--mono); color: var(--dim); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .brand-sub { display: none; }
  .clock { display: none; }
}
@media (max-width: 720px) {
  .controls { flex-wrap: wrap; left: 8px; right: 8px; bottom: 8px; gap: 6px 8px; }
  .progress { order: -1; flex-basis: 100%; }
  .grp { flex: 1; justify-content: space-between; }
  .ic.exit span { display: none; }
  .section-btn .ttl { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
  .menu-list { grid-template-columns: 1fr; }
  .home-foot .keys { display: none; }
  .endcard { bottom: 124px; }
  .brand-name { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .home-settings, .linkish, .pillars { display: none; }
  .home-inner { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .topbar, .controls, .seg-track { transition: none; }
}
@media print { .controls, .topbar { display: none; } }
