/* Saina shared theme: palette, type, and layout primitives for every lesson and tool.
   Served at /common/css/theme.css. Link it before an app's own stylesheet, so the app can override anything:
     <link rel="stylesheet" href="/common/css/theme.css">
   App-specific layouts and components stay in each app's own stylesheet. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-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;
}

:root {
  color-scheme: dark;
  --bg: #10141f;
  --bg-deep: #0b0f18;
  --panel: #191f30;
  --panel-high: #20263a;
  --panel-low: #101624;
  --ink: #eef2ff;
  --muted: #a6b0c7;
  --faint: #6f7a93;
  --accent: #b5a1ff;
  --accent-strong: #9f87ff;
  --accent-ink: #19152b;
  --mint: #81e0c5;
  --gold: #ffd184;
  --coral: #ff9d9d;
  --sky: #8cc8ff;
  --line: #ffffff18;
  --line-strong: #ffffff2b;
  --shadow: 0 24px 70px #00000035;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", var(--font-body);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 8% -5%, #332855 0, transparent 48%),
    radial-gradient(ellipse at 93% 16%, #173f3b55 0, transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

button { touch-action: manipulation; }

a { color: var(--muted); text-decoration: none; }
a:hover { color: var(--ink); }

.site-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
}

.brand { color: var(--ink); font-weight: 850; letter-spacing: -.045em; }
.brand-mark { color: var(--mint); }

.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; }

.panel {
  background: linear-gradient(145deg, var(--panel-high), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.eyebrow {
  color: var(--mint);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 13px 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s var(--ease-out), filter .2s, box-shadow .2s, background .2s;
}

.button:hover { filter: brightness(1.1); box-shadow: 0 10px 28px #0004; transform: translateY(-1px); }
.button:active { transform: translateY(1px) scale(.99); }
.button:disabled { cursor: default; opacity: .38; filter: none; box-shadow: none; transform: none; }
.button.secondary { color: var(--ink); background: #ffffff0b; border: 1px solid var(--line-strong); }
.button.ghost { color: var(--muted); background: transparent; border: 1px solid transparent; }

:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }

.progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: #ffffff10; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--accent)); transition: width .6s var(--ease-out); }

.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;
}

@media (max-width: 680px) {
  .site-shell { width: min(100% - 24px, 1180px); }
  .site-nav { min-height: 68px; }
}

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