/* Sahasra's Learning World — shared design system */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --fill: #eeeef0;
  --fill-2: #e4e4e8;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --blue: #0071e3;
  --green: #34c759;
  --red: #ff3b30;
  --hairline: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --fill: #2c2c2e;
    --fill-2: #3a3a3c;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #8e8e93;
    --blue: #0a84ff;
    --hairline: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.55);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* Minimal nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 52px;
  margin: 0 -24px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.nav a {
  color: var(--blue);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover { text-decoration: underline; }

/* Page header */
.page-head { padding: 56px 0 40px; }

h1 {
  font-size: clamp(2.3rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
}

.lede {
  margin-top: 12px;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  max-width: 46ch;
}

/* Surfaces */
.panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(28px, 5vw, 48px);
}

/* Pills & controls */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--fill);
  border-radius: 999px;
  padding: 6px 14px;
}

.seg {
  display: inline-flex;
  gap: 2px;
  background: var(--fill);
  border-radius: 12px;
  padding: 3px;
}

.seg button {
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap;
}

.seg button.active {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

@media (max-width: 480px) {
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 8px 6px; }
}

footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 0.85rem;
  color: var(--ink-3);
}
