/* Thorios⁹⁰: shared tokens, type, header, footer, buttons. Page-specific rules live in css/<page>.css. */

@font-face { font-family: 'Geist'; src: url('/fonts/geist.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #ffffff;
  --ink: #0a0a0b;
  --ink-2: #2b2c30;
  --muted: #74757b;
  --faint: #a4a5ab;
  --line: #e7e8ec;
  --dash: #c4c6cc;
  --panel: #f6f7f9;
  --black: #050507;
  --black-2: #0e0f13;
  --black-line: #23252c;
  --blue: #1f4fff;
  --blue-2: #3d6bff;
  --blue-ink: #1336d1;
  --blue-soft: #eaf0ff;
  --blue-glow: rgba(31, 79, 255, 0.35);
  --good: #12a150;
  --bad: #e5484d;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --wrap: 1280px;
  --gutter: 40px;
  --header-h: 80px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  /* surfaces and theme-dependent tints */
  --surface: #ffffff;
  --surface-2: #fcfcfd;
  --page-tint: #fbfbfc;
  --leg-out: #f3f5fa;
  --grid: rgba(10, 12, 20, .035);
  --dotgrid: rgba(10, 12, 20, .09);
  --glass: rgba(255, 255, 255, .86);
  --glass-head: rgba(255, 255, 255, .92);
  --shadow: rgba(20, 30, 70, .08);
  --shadow-2: rgba(10, 12, 20, .12);
  --backdrop: rgba(10, 12, 20, .35);
  --on-ink: #ffffff;
  --mark-bg: #050507;
  --mark-ink: #ffffff;
  --mark-sup: #6f93ff;
  --blue-line: #c9d6ff;
  --warn-ink: #9a6700; --warn-bg: #fff8e6; --warn-line: #f1dca2;
  --bad-ink: #b4232a; --bad-bg: #fff1f1; --bad-line: #f6c7c8;
  --ok-ink: #0c6b37; --ok-bg: #ebf8f0;
  --orange-ink: #b25e00;
  --giant-a: #eef0f4; --giant-b: #f7f8fa; --giant-stroke: #e3e5ea;
  --dot-rgb: 10, 10, 12;
  --accent-rgb: 31, 79, 255;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0b0c10;
  --ink: #f1f2f5;
  --ink-2: #c9ccd4;
  --muted: #8b8f9a;
  --faint: #5d616c;
  --line: #23262e;
  --dash: #3a3e48;
  --panel: #15171d;
  --black: #030304;
  --black-2: #0e0f13;
  --black-line: #22252d;
  --blue: #3d6bff;
  --blue-2: #6a8cff;
  --blue-ink: #a9bdff;
  --blue-soft: #151d3a;
  --blue-glow: rgba(61, 107, 255, 0.4);
  --good: #3fcf7f;
  --bad: #ff6b70;
  --surface: #121419;
  --surface-2: #161820;
  --page-tint: #0b0c10;
  --leg-out: #0e1015;
  --grid: rgba(255, 255, 255, .035);
  --dotgrid: rgba(255, 255, 255, .07);
  --glass: rgba(18, 20, 25, .82);
  --glass-head: rgba(11, 12, 16, .86);
  --shadow: rgba(0, 0, 0, .45);
  --shadow-2: rgba(0, 0, 0, .5);
  --backdrop: rgba(0, 0, 0, .6);
  --on-ink: #0a0a0b;
  --mark-bg: #ffffff;
  --mark-ink: #050507;
  --mark-sup: #1f4fff;
  --blue-line: #2c3c78;
  --warn-ink: #f0c04a; --warn-bg: #2a2310; --warn-line: #5a4716;
  --bad-ink: #ff8a8e; --bad-bg: #2b1314; --bad-line: #5c2427;
  --ok-ink: #6fe0a0; --ok-bg: #0f2619;
  --orange-ink: #ffab5c;
  --giant-a: #15171d; --giant-b: #101217; --giant-stroke: #24272f;
  --dot-rgb: 236, 238, 244;
  --accent-rgb: 112, 150, 255;
  color-scheme: dark;
}
@media (max-width: 720px) { :root { --gutter: 16px; --header-h: 64px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sup { font-size: .5em; vertical-align: super; line-height: 0; font-weight: 600; color: var(--blue); letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ brand mark */
.mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 7px; background: var(--mark-bg); color: var(--mark-ink); font-weight: 700; font-size: 15px; letter-spacing: -0.04em; line-height: 1; flex: none; }
.mark b { font-weight: 700; }
.mark i { font-style: normal; font-size: 8.5px; font-weight: 700; color: var(--mark-sup); transform: translateY(-5px); margin-left: 1px; letter-spacing: 0; }
.wordmark { font-weight: 600; letter-spacing: -0.02em; }
.wordmark i { font-style: normal; font-size: .58em; vertical-align: super; line-height: 0; color: var(--blue); font-weight: 700; margin-left: 1px; }

/* ------------------------------------------------------------------ buttons and links */
.pill { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px; border-radius: 999px; border: 1px dashed var(--dash); background: var(--glass); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; transition: border-color .25s, background .25s, color .25s, box-shadow .25s; backdrop-filter: blur(6px); }
.pill:hover { border-color: var(--blue); color: var(--blue-ink); box-shadow: 0 0 0 4px var(--blue-soft); }
.pill.solid { background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); }
.pill.solid:hover { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 28px var(--blue-glow); }
.pill.blue { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
.pill.blue:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; box-shadow: 0 8px 28px var(--blue-glow); }
.pill.dark { background: transparent; color: #fff; border-color: #4a4d57; }
.pill.dark:hover { border-color: var(--blue-2); color: #fff; box-shadow: 0 0 0 4px rgba(61, 107, 255, .18); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.dashlink { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; padding-bottom: 3px; background-image: linear-gradient(90deg, currentColor 50%, transparent 0); background-size: 5px 1px; background-repeat: repeat-x; background-position: 0 100%; transition: color .2s; }
.dashlink:hover { color: var(--blue); }
.arrow-ne { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ header */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h); transition: background-color .35s, border-color .35s, color .35s; border-bottom: 1px solid transparent; }
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; }
.site-header.solid { background: var(--glass-head); backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.site-header.on-dark.solid { background: rgba(5, 5, 7, .82); border-bottom-color: var(--black-line); color: #fff; }
.site-header.on-dark .mark { background: #fff; color: var(--black); }
.site-header.on-dark .mark i { color: var(--blue); }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand .wordmark { font-size: 15px; opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .3s; }
.site-header.solid .brand .wordmark { opacity: 1; transform: none; }
.nav { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 30px; font-size: 14px; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.site-header.hide-nav .nav { opacity: 0; pointer-events: none; transform: translate(-50%, -40%); }
.nav > a, .nav .dd > button { display: inline-flex; align-items: center; gap: 5px; height: 40px; color: inherit; opacity: .86; transition: opacity .2s, color .2s; }
.nav > a:hover, .nav .dd > button:hover, .nav > a[aria-current='page'] { opacity: 1; color: var(--blue); }
.site-header.on-dark .nav > a:hover, .site-header.on-dark .nav .dd > button:hover { color: #9db4ff; }
.nav .badge { font-size: 10px; font-weight: 600; letter-spacing: .02em; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--blue); color: #fff; }
.chev { width: 10px; height: 10px; transition: transform .25s; }
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 10px); left: 50%; min-width: 260px; transform: translate(-50%, 6px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 24px 60px var(--shadow-2); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility 0s linear .2s; }
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s, transform .2s; }
.dd.open .chev { transform: rotate(180deg); }
.dd-menu a { display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; padding: 10px 12px; border-radius: 9px; }
.dd-menu a:hover { background: var(--blue-soft); }
.dd-menu a .ico { grid-row: span 2; width: 28px; height: 28px; border-radius: 7px; border: 1px dashed var(--dash); display: grid; place-items: center; color: var(--blue); }
.dd-menu a .ico svg { width: 14px; height: 14px; }
.dd-menu a b { font-weight: 500; font-size: 14px; }
.dd-menu a small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.head-right { display: flex; align-items: center; gap: 18px; }
.burger { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px dashed var(--dash); align-items: center; justify-content: center; }
.burger svg { width: 18px; height: 18px; }
.mobile-menu { position: fixed; inset: 0; z-index: 60; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; padding: 18px var(--gutter) 32px; transform: translateY(-100%); transition: transform .45s var(--ease); overflow-y: auto; }
.mobile-menu.open { transform: none; }
.mobile-menu .mm-top { display: flex; align-items: center; justify-content: space-between; height: 46px; }
.mobile-menu nav { margin-top: 28px; display: grid; gap: 2px; }
.mobile-menu nav a { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px dashed var(--line); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.mobile-menu nav a small { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.mobile-menu .mm-foot { margin-top: auto; padding-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 1040px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .head-right .dashlink { display: none; }
}

/* ------------------------------------------------------------------ section heads */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow b { color: var(--blue); font-weight: 500; }
.h-xl { font-size: clamp(36px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 400; margin: 0; }
.h-lg { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 400; margin: 0; }
.lead { font-size: clamp(16px, 1.3vw, 19px); color: var(--muted); line-height: 1.55; max-width: 620px; }

/* ------------------------------------------------------------------ status chips */
.chip { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.chip.live { color: var(--blue-ink); border-color: var(--blue-line); background: var(--blue-soft); }
.chip.live::before { background: var(--blue); animation: pulse 1.6s infinite; }
.chip.stale { color: var(--warn-ink); border-color: var(--warn-line); background: var(--warn-bg); }
.chip.stale::before { background: #d4a017; }
.chip.down { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.chip.down::before { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 79, 255, .5); } 70% { box-shadow: 0 0 0 7px rgba(31, 79, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 79, 255, 0); } }

/* ------------------------------------------------------------------ footer */
.site-footer { position: relative; background: var(--bg); color: var(--ink); overflow: hidden; border-top: 1px solid var(--line); }
.foot-top { display: grid; grid-template-columns: 1.3fr 2.7fr; gap: 48px; padding-top: 96px; padding-bottom: 72px; position: relative; z-index: 2; }
.foot-tag { font-size: 24px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; margin: 0; max-width: 440px; }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.foot-cols h4 { margin: 0 0 16px; font-size: 14px; font-weight: 500; }
.foot-cols a { display: block; font-size: 13px; color: var(--muted); padding: 5px 0; transition: color .2s; }
.foot-cols a:hover { color: var(--blue); }
.foot-giant { position: relative; height: clamp(200px, 26vw, 380px); }
.foot-giant > svg { position: absolute; left: 50%; bottom: -6%; transform: translateX(-50%); width: 118%; max-width: none; height: auto; }
.foot-giant text { font-family: var(--sans); font-weight: 700; letter-spacing: -0.04em; }
.foot-bar { position: absolute; left: 0; right: 0; top: 34%; z-index: 2; }
.foot-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.foot-bar small { font-size: 13px; color: var(--muted); }
.socials { display: flex; gap: 14px; align-items: center; }
.socials a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; transition: color .2s, background .2s; }
.socials a:hover { color: var(--blue); background: var(--blue-soft); }
.socials svg { width: 17px; height: 17px; }
@media (max-width: 900px) {
  .foot-top { grid-template-columns: 1fr; padding-top: 64px; padding-bottom: 40px; }
  .foot-cols { grid-template-columns: repeat(2, 1fr); }
  .foot-bar { top: 18%; }
  .foot-bar .wrap { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------------ inner page shell */
.page { padding-top: calc(var(--header-h) + 56px); min-height: 70vh; }
.page-head { padding-bottom: 40px; border-bottom: 1px dashed var(--line); margin-bottom: 48px; }
.page-head .h-xl { margin-top: 14px; }
.page-head .lead { margin-top: 18px; }
.prose { max-width: 760px; }
.prose h2 { font-size: 28px; letter-spacing: -0.025em; font-weight: 500; margin: 56px 0 14px; scroll-margin-top: 110px; }
.prose h3 { font-size: 18px; font-weight: 600; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.prose a { color: var(--blue-ink); background-image: linear-gradient(90deg, currentColor 50%, transparent 0); background-size: 4px 1px; background-repeat: repeat-x; background-position: 0 100%; }
.prose code, code.inline { font-family: var(--mono); font-size: .88em; background: var(--panel); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; word-break: break-all; }
.prose ul { padding-left: 20px; }
.callout { border: 1px dashed var(--dash); border-radius: 14px; padding: 18px 20px; background: var(--panel); font-size: 14px; color: var(--ink-2); }
.callout b { color: var(--ink); }

/* corner-bracket frame used by cards across pages */
.frame { position: relative; border: 1px dashed var(--dash); background: var(--surface); }
.frame::before, .frame::after, .frame > .c1, .frame > .c2 { content: ''; position: absolute; width: 12px; height: 12px; border: 0 solid var(--ink); pointer-events: none; }
.frame::before { left: -1px; top: -1px; border-left-width: 2px; border-top-width: 2px; }
.frame::after { right: -1px; top: -1px; border-right-width: 2px; border-top-width: 2px; }
.frame > .c1 { left: -1px; bottom: -1px; border-left-width: 2px; border-bottom-width: 2px; }
.frame > .c2 { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------------ theme switch */
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; border: 1px dashed var(--dash); display: inline-grid; place-items: center; color: inherit; transition: color .2s, border-color .2s, background .2s; }
.theme-toggle:hover { color: var(--blue); border-color: var(--blue); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .t-sun, .theme-toggle .t-moon { display: grid; place-items: center; grid-area: 1 / 1; transition: opacity .25s, transform .35s var(--ease); }
.theme-toggle[data-mode='light'] .t-sun, .theme-toggle[data-mode='dark'] .t-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
.site-header.on-dark .theme-toggle { border-color: #4a4d57; }
:root[data-theme='dark'] .site-header.on-dark .mark { background: #fff; color: #050507; }
:root[data-theme='dark'] img[src^='/img/stocks/'] { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
:root[data-theme='dark'] .pill.dark { border-color: var(--dash); }
:root[data-theme='dark'] .worlds, :root[data-theme='dark'] .loop, :root[data-theme='dark'] .compound-panel { border-top: 1px solid var(--black-line); border-bottom: 1px solid var(--black-line); }
html { transition: background-color .3s; }
body { transition: background-color .3s, color .3s; }
