/* ══════════════════════════ Corpus – Design ══════════════════════════ */
:root {
  --bg: #05070d;
  --bg-2: #0b0f19;
  --text: #f5f5f7;
  --muted: #9a9aa6;
  --stroke: rgba(255, 255, 255, .12);
  --stroke-2: rgba(255, 255, 255, .2);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, .095), rgba(255, 255, 255, .035));
  --glass-solid: rgba(18, 21, 30, .62);
  --accent: #3aa0ff;
  --accent-2: #bf5af2;
  --ok: #30d158;
  --bad: #ff453a;
  --warn: #ff9f0a;
  --radius: 22px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Helvetica Neue", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(58, 160, 255, .35); }

/* Aurora-Hintergrund */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .32; animation: drift 26s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: #ff3b5c; top: -25vmax; left: -15vmax; }
.aurora span:nth-child(2) { background: #3a6bff; top: 20vh; right: -25vmax; animation-delay: -8s; opacity: .26; }
.aurora span:nth-child(3) { background: #9b4dff; bottom: -30vmax; left: 20vw; animation-delay: -16s; opacity: .2; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.12); } }

.glass {
  background: var(--glass), var(--glass-solid);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--stroke); box-shadow: var(--shadow);
}

/* ══════════ Navigation ══════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 56px;
  display: flex; align-items: center; gap: 24px; padding: 0 max(16px, calc((100vw - 1180px) / 2));
  transition: background .3s, border-color .3s; border-bottom: 1px solid transparent;
}
.nav.scrolled, .nav.menu-open {
  background: rgba(8, 10, 16, .62); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border-bottom-color: var(--stroke);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 18px; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(from 200deg, #ff5a5f, #bf5af2, #3aa0ff, #30d158, #ff5a5f); box-shadow: 0 0 18px rgba(191, 90, 242, .5); }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-size: 14px; color: #d0d0d8; }
.nav-links a { opacity: .8; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.nav-cta { font-size: 13px; font-weight: 600; padding: 7px 16px; border-radius: 999px; background: var(--text); color: #000; }
.menu-btn { display: none; width: 36px; height: 36px; position: relative; }
.menu-btn span { position: absolute; left: 9px; right: 9px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s; }
.menu-btn span:first-child { top: 13px; } .menu-btn span:last-child { top: 21px; }
.nav.menu-open .menu-btn span:first-child { transform: translateY(4px) rotate(45deg); }
.nav.menu-open .menu-btn span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ══════════ Buttons & Controls ══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(255, 255, 255, .09); border: 1px solid var(--stroke); transition: background .2s, transform .15s, border-color .2s;
}
.btn:hover { background: rgba(255, 255, 255, .16); border-color: var(--stroke-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #57b0ff; }
.btn.good { background: rgba(48, 209, 88, .18); border-color: rgba(48, 209, 88, .4); color: #7ef0a0; }
.btn.bad { background: rgba(255, 69, 58, .15); border-color: rgba(255, 69, 58, .38); color: #ff8b82; }
.btn.lg { padding: 13px 26px; font-size: 16px; }
.link { color: var(--accent); font-size: 13px; font-weight: 500; }
.link:hover { text-decoration: underline; }
.link.center { display: block; margin: 10px auto 0; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); flex: none; transition: background .2s; }
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn.small { width: 28px; height: 28px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }

.switch { position: relative; width: 42px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, .16); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--stroke); color: #b8b8c2; transition: all .2s;
}
.chip em { font-style: normal; font-size: 11px; opacity: .6; }
.chip.on { background: rgba(255, 255, 255, .16); color: #fff; border-color: var(--stroke-2); }
.chip:hover { border-color: var(--stroke-2); }

.seg { display: flex; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--stroke); gap: 3px; }
.seg button { flex: 1; padding: 7px 6px; border-radius: 9px; font-size: 12px; color: #a9a9b4; display: flex; flex-direction: column; align-items: center; line-height: 1.2; transition: all .2s; }
.seg button b { font-size: 15px; }
.seg button.on { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.mini-seg { display: inline-flex; border-radius: 10px; }
.mini-seg button { padding: 5px 10px; flex: none; border-radius: 7px; }
.mini { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: #d0d0d8; }
.mini:hover { background: rgba(255, 255, 255, .16); }
.mini-wrap { display: inline-flex; gap: 4px; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c, #fff) 18%, transparent); color: color-mix(in srgb, var(--c, #fff) 70%, #fff); border: 1px solid color-mix(in srgb, var(--c, #fff) 35%, transparent); }
.badge.ghost { --c: #9a9aa6; }
.badge.ok { --c: #30d158; }

/* ══════════ Hero ══════════ */
.hero { min-height: 88svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 110px 20px 60px; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--warn); margin: 0 0 14px; text-transform: none; }
h1 { font-size: clamp(48px, 9vw, 112px); line-height: 1.02; letter-spacing: -.045em; margin: 0; font-weight: 800; }
.grad { background: linear-gradient(100deg, #ff5a5f 0%, #ff9f6b 28%, #bf5af2 60%, #3aa0ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 2vw, 21px); color: #b9b9c4; max-width: 640px; margin: 22px auto 0; line-height: 1.45; }
.hero-cta { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }
.stats { display: flex; gap: clamp(18px, 4vw, 48px); margin-top: 64px; flex-wrap: wrap; justify-content: center; }
.stats div { display: flex; flex-direction: column; align-items: center; }
.stats b { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.03em; }
.stats span { font-size: 13px; color: var(--muted); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ══════════ Atlas / Viewer ══════════ */
.atlas { padding: 64px 16px 20px; scroll-margin-top: 0; }
.viewer {
  position: relative; max-width: 1480px; margin: 0 auto; height: calc(100svh - 84px); min-height: 580px; max-height: 1000px;
  border-radius: 32px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 80% at 50% 10%, #1b2236 0%, #0b0e18 55%, #06080e 100%);
  border: 1px solid var(--stroke); box-shadow: 0 40px 120px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.viewer::before { content: ""; position: absolute; inset: 0; background: radial-gradient(40% 30% at 50% 60%, rgba(58, 160, 255, .08), transparent 70%); pointer-events: none; z-index: 0; }
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 1; outline: none; }
.disclaimer { text-align: center; font-size: 12px; color: #6f6f7a; margin: 12px 0 0; }

.loading { position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: 14px; background: #070910; color: var(--muted); font-size: 14px; transition: opacity .6s .2s, visibility .6s .2s; }
.loading.done { opacity: 0; visibility: hidden; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.panel { position: absolute; z-index: 5; border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.panel h3 { margin: 0; font-size: 17px; letter-spacing: -.01em; }

/* Suche */
.searchbar { position: absolute; z-index: 8; top: 16px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 720px)); min-width: 260px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 999px; color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: 15px; height: 100%; }
.searchbar input::placeholder { color: #80808c; }
.searchbar input::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }
kbd { font-family: var(--font); font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--stroke-2); color: var(--muted); }
.results { position: absolute; top: 54px; left: 0; right: 0; border-radius: 18px; padding: 6px; display: none; max-height: 380px; overflow: auto; }
.results.show { display: block; }
.res { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; }
.res span:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.res b { font-size: 14px; font-weight: 600; color: var(--text); }
.res i { font-size: 12.5px; color: var(--muted); }
.res:hover, .res.active { background: rgba(255, 255, 255, .1); }
.results .empty { padding: 12px; color: var(--muted); font-size: 14px; }

/* Ebenen */
.layers { left: 16px; top: 16px; bottom: 88px; width: 312px; display: flex; flex-direction: column; overflow: hidden; }
.layers-body { overflow-y: auto; padding: 4px 10px 14px; flex: 1; overscroll-behavior: contain; scrollbar-width: thin; }
.sys { border-radius: 16px; padding: 4px 6px; margin-bottom: 4px; transition: background .2s; }
.sys.open { background: rgba(255, 255, 255, .04); }
.sys.off .sys-name { opacity: .45; }
.sys-row { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.sys-name { flex: 1; font-weight: 600; font-size: 14.5px; display: flex; flex-direction: column; line-height: 1.2; }
.sys-name small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.chev, .chev-ph { width: 24px; height: 24px; display: grid; place-items: center; color: var(--muted); transition: transform .3s; flex: none; }
.sys.open .chev { transform: rotate(90deg); }
.sys-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.2, .7, .2, 1); }
.sys.open .sys-body { grid-template-rows: 1fr; }
.sys-inner { overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.sys.open .sys-inner { padding-bottom: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 2px 4px 6px 34px; }
.sys .sys-inner > .row { padding-left: 0; }
.lbl { font-size: 12px; color: var(--muted); font-weight: 500; flex: none; }
.lbl-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.skin-row .row { padding-left: 34px; }
.hidden-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 6px 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 159, 10, .12); border: 1px solid rgba(255, 159, 10, .3); font-size: 12.5px; color: #ffc46b; }
.hidden-note[hidden] { display: none; }

/* Info */
.info { right: 16px; top: 16px; width: 380px; max-height: calc(100% - 104px); overflow-y: auto; padding: 18px 20px 20px; overscroll-behavior: contain;
  transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .4s; scrollbar-width: thin; }
.info.open { transform: none; opacity: 1; }
.info-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.info h3 { font-size: 26px; line-height: 1.12; letter-spacing: -.025em; margin: 14px 0 6px; }
.latin { display: flex; align-items: center; gap: 10px; color: #8ec9ff; font-style: italic; font-size: 16.5px; }
.desc { color: #d4d4dc; font-size: 14.5px; margin: 14px 0; }
.facts { margin: 0; display: grid; gap: 1px; border-radius: 14px; overflow: hidden; border: 1px solid var(--stroke); }
.facts div { background: rgba(255, 255, 255, .04); padding: 9px 12px; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-size: 13.5px; color: #e6e6ec; }
.wiki { margin-top: 16px; }
.wiki figure { margin: 0 0 12px; border-radius: 14px; overflow: hidden; background: #fff; display: grid; place-items: center; max-height: 260px; }
.wiki img { max-width: 100%; max-height: 260px; object-fit: contain; display: block; }
.extract { font-size: 13.5px; color: #c4c4cd; margin: 0 0 8px; }
.wiki a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); font-weight: 500; }
.credit { font-size: 11px; color: #6f6f7a; margin: 6px 0 0; }
.skeleton { height: 120px; border-radius: 14px; background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin-bottom: 8px; }
.skeleton.short { height: 14px; width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.info-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.info-actions .btn { flex: 1; padding: 9px 10px; font-size: 13px; }

/* Toolbar */
.toolbar { position: absolute; z-index: 9; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.toolbar button { height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: #d6d6de; flex: none; transition: background .2s, color .2s; }
.toolbar button svg { width: 19px; height: 19px; }
.toolbar button:hover:not(:disabled) { background: rgba(255, 255, 255, .12); color: #fff; }
.toolbar button.on { background: rgba(58, 160, 255, .9); color: #fff; }
.toolbar button:disabled { opacity: .3; cursor: default; }
.toolbar .tb-quiz { background: rgba(255, 159, 10, .16); color: #ffc46b; }
.toolbar .tb-quiz.on { background: var(--warn); color: #1b1000; }
.sep { width: 1px; height: 22px; background: var(--stroke); margin: 0 4px; flex: none; }
.tb-layers { display: none !important; }

/* Quiz */
.quiz { position: absolute; z-index: 10; left: 50%; bottom: 76px; width: min(540px, calc(100% - 24px)); border-radius: 24px; padding: 14px 16px 16px;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: all .45s cubic-bezier(.2, .8, .2, 1); }
.quiz.open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.quiz-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score { margin-left: auto; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.quiz-prompt { font-size: 18px; font-weight: 600; margin: 14px 2px 10px; letter-spacing: -.01em; }
.quiz-prompt b { color: #ffc46b; }
.hl { color: var(--warn); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { padding: 12px 12px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid var(--stroke); text-align: left; font-size: 14px; font-weight: 500; transition: all .2s; line-height: 1.25; }
.opt:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.opt.ok { background: rgba(48, 209, 88, .25); border-color: var(--ok); color: #fff; }
.opt.bad { background: rgba(255, 69, 58, .22); border-color: var(--bad); }
.opt:disabled { cursor: default; }
.feedback { margin-top: 10px; font-size: 14px; color: #d4d4dc; }
.feedback:empty { display: none; }
.good { color: #6cf08f; font-weight: 700; }
.feedback .bad, .quiz .bad:not(.opt) { color: #ff7d74; font-weight: 700; }
.quiz-row { display: flex; gap: 8px; margin-top: 10px; }
.quiz-row .btn { flex: 1; }

/* Hint, Tooltip, Toast */
.hint { position: absolute; z-index: 4; left: 50%; bottom: 76px; transform: translateX(-50%); display: flex; gap: 18px; font-size: 12.5px; color: #a7a7b3; white-space: nowrap; pointer-events: none; transition: opacity .6s; }
.hint b { color: #e8e8ee; font-weight: 600; }
.hint.gone { opacity: 0; }
.tooltip { position: absolute; z-index: 12; top: 0; left: 0; pointer-events: none; padding: 8px 12px; border-radius: 12px; background: rgba(12, 14, 22, .85); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--stroke); display: flex; flex-direction: column; line-height: 1.25; opacity: 0; transition: opacity .15s; max-width: 260px; }
.tooltip.show { opacity: 1; }
.tooltip b { font-size: 13.5px; }
.tooltip i { font-size: 12px; color: #8ec9ff; }
.toast { position: absolute; z-index: 15; top: 72px; left: 50%; transform: translate(-50%, -10px); padding: 9px 16px; border-radius: 99px; background: rgba(20, 22, 32, .9); border: 1px solid var(--stroke); font-size: 13px; opacity: 0; transition: all .3s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ══════════ Sektionen ══════════ */
.section { max-width: 1180px; margin: 0 auto; padding: 120px 20px 20px; scroll-margin-top: 20px; }
.section-head { text-align: center; margin-bottom: 52px; }
h2 { font-size: clamp(36px, 6vw, 64px); line-height: 1.05; letter-spacing: -.04em; margin: 0; font-weight: 800; }

.systems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.sys-card { border-radius: 28px; padding: 26px; display: flex; flex-direction: column; position: relative; overflow: hidden; transition: transform .4s cubic-bezier(.2, .8, .2, 1), border-color .3s; }
.sys-card::before { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; top: -70px; border-radius: 50%; background: var(--c); filter: blur(70px); opacity: .28; }
.sys-card:hover { transform: translateY(-4px); border-color: var(--stroke-2); }
.sys-card-top { display: flex; justify-content: space-between; align-items: center; }
.orb { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--c) 35%, color-mix(in srgb, var(--c) 50%, #000) 100%); box-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.count { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.sys-card h3 { font-size: 24px; margin: 20px 0 0; letter-spacing: -.02em; }
.latin-sm { font-style: italic; color: #8ec9ff; margin: 2px 0 10px; font-size: 14px; }
.sys-card p { color: #c0c0ca; font-size: 14.5px; margin: 0 0 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tags span { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: #b8b8c2; }
.sys-card .btn { margin-top: auto; align-self: flex-start; }

.learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.learn-card { border-radius: 28px; padding: 26px; display: flex; flex-direction: column; align-items: flex-start; }
.learn-card h3 { margin: 18px 0 6px; font-size: 22px; letter-spacing: -.02em; }
.learn-card p { color: #c0c0ca; font-size: 14.5px; margin: 0 0 20px; flex: 1; }
.learn-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 45%, #000)); box-shadow: 0 10px 30px color-mix(in srgb, var(--c) 40%, transparent); }
.learn-split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-top: 16px; }
.flashcards, .progress { border-radius: 28px; padding: 24px; }
.fc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.fc-head h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.fc-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
select { background: rgba(255, 255, 255, .08); border: 1px solid var(--stroke); border-radius: 10px; padding: 6px 10px; font-size: 13px; outline: none; }
select option { background: #151824; }
.fc-stage { perspective: 1400px; }
.fc-card { position: relative; height: 250px; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .8, .2, 1); cursor: pointer; outline: none; border-radius: 22px; }
.fc-card.flipped { transform: rotateY(180deg); }
.fc-card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.fc-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 22px; padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)); border: 1px solid var(--stroke-2); }
.fc-back { transform: rotateY(180deg); background: linear-gradient(160deg, rgba(58, 160, 255, .2), rgba(191, 90, 242, .1)); }
.fc-face h4 { margin: 6px 0 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; line-height: 1.15; }
.fc-back p { font-size: 13.5px; color: #d0d0d8; margin: 4px 0 0; max-width: 460px; }
.fc-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.fc-actions .btn { min-width: 120px; }
.progress-grid { display: grid; gap: 12px; margin-bottom: 14px; }
.prog { display: flex; align-items: center; gap: 14px; }
.prog > div:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.prog small { color: var(--muted); font-size: 12.5px; }
.ring { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255, 255, 255, .1) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #10131d; }
.ring span { position: relative; font-size: 12px; font-weight: 700; }

.lex-tools { display: flex; flex-direction: column; gap: 14px; align-items: center; margin-bottom: 26px; }
.lex-search { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 18px; border-radius: 999px; width: min(560px, 100%); color: var(--muted); }
.lex-search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 16px; color: var(--text); }
#lexFilter { justify-content: center; }
.lex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.lex-card { display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 18px; box-shadow: none; transition: transform .25s, border-color .25s, background .25s; }
.lex-card .dot { margin-top: 6px; }
.lex-card:hover { transform: translateY(-2px); border-color: var(--stroke-2); }
.lex-text { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.lex-text b { font-size: 14.5px; }
.lex-text i { font-size: 13px; color: #8ec9ff; }
.lex-text small { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.tick { color: var(--ok); font-weight: 800; }

.footer { max-width: 1180px; margin: 100px auto 0; padding: 30px 20px 50px; border-top: 1px solid var(--stroke); display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer p { margin: 8px 0 0; max-width: 460px; }

/* ══════════ Responsive ══════════ */
@media (max-width: 1180px) {
  .tb-layers { display: inline-flex !important; }
  span.sep.tb-layers { display: block !important; }
  .layers { bottom: auto; max-height: calc(100% - 160px); top: 72px; transform: translateX(calc(-100% - 40px)); opacity: 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
  .layers.open { transform: none; opacity: 1; }
  .searchbar { width: calc(100% - 32px); max-width: 520px; }
  .info { top: 72px; max-height: calc(100% - 160px); width: 360px; }
}
@media (max-width: 900px) {
  .learn-grid { grid-template-columns: 1fr; }
  .learn-split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links { position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; gap: 0; margin: 0; padding: 8px 16px 16px; background: rgba(8, 10, 16, .92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-bottom: 1px solid var(--stroke); display: none; }
  .nav-links a { padding: 12px 4px; font-size: 17px; border-bottom: 1px solid var(--stroke); }
  .nav.menu-open .nav-links { display: flex; }
  .nav-cta { margin-left: auto; }
  .menu-btn { display: block; }
  .atlas { padding: 60px 8px 12px; }
  .viewer { height: calc(100svh - 72px); min-height: 520px; border-radius: 24px; }
  .searchbar { top: 10px; height: 42px; width: calc(100% - 20px); }
  .searchbar kbd { display: none; }
  .layers, .info { left: 8px; right: 8px; width: auto; top: auto; bottom: 66px; max-height: 58%; border-radius: 24px; transform: translateY(calc(100% + 80px)); }
  .layers.open, .info.open { transform: none; }
  .info { padding: 16px 16px 18px; }
  .info h3 { font-size: 22px; margin-top: 10px; }
  .toolbar { bottom: 10px; padding: 4px; }
  .toolbar button { height: 38px; min-width: 38px; padding: 0 9px; font-size: 12.5px; }
  .toolbar button .txt { font-size: 12px; }
  .tb-layers span, .tb-quiz span { display: none; }
  .tb-zoom { display: none !important; }
  .toolbar .sep { margin: 0 2px; }
  .quiz { bottom: 62px; padding: 12px; }
  .quiz-prompt { font-size: 16px; }
  .opt { padding: 10px; font-size: 13px; }
  .hint { bottom: 62px; flex-direction: column; gap: 2px; align-items: center; }
  .toast { top: 60px; }
  .section { padding-top: 90px; }
  .stats { margin-top: 44px; }
}
@media (hover: none) { .tooltip { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
