@charset "UTF-8";
/* ==========================================================================
   Aspirant Atlas — design system
   Cartographic language: survey paper, contour ochre, ink indigo.
   Everything is themed through custom properties on [data-theme].
   ========================================================================== */

/* ---------- 1. Tokens ---------- */

:root {
  /* Light — "survey paper" */
  --paper:        #E9ECE5;
  --surface:      #FBFCF9;
  --surface-2:    #F1F4ED;
  --surface-3:    #E4E9DF;
  --ink:          #152238;
  --ink-2:        #3E5068;
  --ink-3:        #6C7C90;
  --line:         rgba(21, 34, 56, .15);
  --line-strong:  rgba(21, 34, 56, .30);
  --primary:      #0E6E5A;
  --primary-hov:  #0A5647;
  --primary-soft: rgba(14, 110, 90, .10);
  --on-primary:   #FBFCF9;
  --contour:      #A0691F;
  --contour-soft: rgba(160, 105, 31, .12);
  --signal:       #AC3E2C;
  --signal-soft:  rgba(172, 62, 44, .10);
  --info:         #235D8C;
  --info-soft:    rgba(35, 93, 140, .10);
  --shadow-pop:   0 10px 34px -12px rgba(21, 34, 56, .38);
  --shadow-lift:  0 2px 10px -4px rgba(21, 34, 56, .28);
  --hero-wash:    radial-gradient(120% 90% at 78% 6%, rgba(160,105,31,.12), transparent 62%);
  color-scheme: light;
}

[data-theme="dark"] {
  /* Dark — "night survey" */
  --paper:        #0B1320;
  --surface:      #111B29;
  --surface-2:    #172333;
  --surface-3:    #1F2C3E;
  --ink:          #E0E6DE;
  --ink-2:        #A8B6C4;
  --ink-3:        #7B8B9C;
  --line:         rgba(224, 230, 222, .15);
  --line-strong:  rgba(224, 230, 222, .32);
  --primary:      #46B597;
  --primary-hov:  #5FC7AA;
  --primary-soft: rgba(70, 181, 151, .14);
  --on-primary:   #06121A;
  --contour:      #D9A05B;
  --contour-soft: rgba(217, 160, 91, .14);
  --signal:       #E4795F;
  --signal-soft:  rgba(228, 121, 95, .14);
  --info:         #74AEDD;
  --info-soft:    rgba(116, 174, 221, .14);
  --shadow-pop:   0 14px 40px -14px rgba(0, 0, 0, .78);
  --shadow-lift:  0 2px 12px -5px rgba(0, 0, 0, .7);
  --hero-wash:    radial-gradient(120% 90% at 78% 6%, rgba(217,160,91,.10), transparent 62%);
  color-scheme: dark;
}

:root {
  /* Type */
  --font-ui: "Archivo", ui-sans-serif, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: "Source Serif 4", Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;

  --t-2xs: .6875rem;
  --t-xs:  .75rem;
  --t-sm:  .8125rem;
  --t-md:  .9375rem;
  --t-base: 1rem;
  --t-lg:  1.125rem;
  --t-xl:  1.375rem;
  --t-2xl: 1.75rem;
  --t-3xl: clamp(1.9rem, 1.3rem + 2vw, 2.6rem);
  --t-4xl: clamp(2.4rem, 1.4rem + 3.6vw, 3.9rem);

  /* Space — 4px base */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px; --s10: 80px;

  /* Radii vary by hierarchy on purpose: data is square, panels are soft. */
  --r-flat: 0;
  --r-tight: 3px;
  --r-panel: 9px;
  --r-float: 15px;
  --r-pill: 999px;

  --wrap: 1200px;
  --wrap-narrow: 720px;
  --header-h: 62px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- 2. Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font-ui);
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-wrap: break-word;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary-hov); }
ul, ol { padding-left: 1.15em; }
table { border-collapse: collapse; width: 100%; }
summary { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

:focus-visible {
  outline: 2px solid var(--contour);
  outline-offset: 2px;
  border-radius: var(--r-tight);
}

::selection { background: var(--primary-soft); }

/* ---------- 3. Headings & prose ---------- */

h1, h2, h3, h4, h5 {
  font-family: var(--font-ui);
  font-weight: 620;
  line-height: 1.15;
  letter-spacing: -.018em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
h5 { font-size: var(--t-base); }

.lede { font-size: var(--t-lg); color: var(--ink-2); line-height: 1.5; max-width: 62ch; }
.muted { color: var(--ink-3); }
.dim   { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.tiny  { font-size: var(--t-xs); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right  { text-align: right; }
.strong { font-weight: 640; }

/* Long-form study content reads in the serif. */
.prose {
  font-family: var(--font-read);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  max-width: 70ch;
}
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: 1.5rem; margin-top: 1.9em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.6em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-ui); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose blockquote {
  border-left: 3px solid var(--contour);
  padding: var(--s2) 0 var(--s2) var(--s5);
  color: var(--ink-2);
  font-style: italic;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .875em;
  background: var(--surface-2);
  padding: .1em .35em;
  border-radius: var(--r-tight);
}
.prose img { border-radius: var(--r-panel); border: 1px solid var(--line); margin-inline: auto; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-family: var(--font-ui); font-size: var(--t-sm); color: var(--ink-3); margin-top: var(--s2); }
.prose table { font-family: var(--font-ui); font-size: var(--t-md); }
.prose a { font-weight: 550; }
.prose mark { background: var(--contour-soft); color: inherit; padding: .05em .2em; border-radius: 2px; }

/* ---------- 4. Layout ---------- */

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s5); }
.wrap-narrow { max-width: var(--wrap-narrow); }
.section { padding-block: var(--s9); }
.section-sm { padding-block: var(--s7); }
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.stack-lg > * + * { margin-top: var(--s7); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row-wrap { flex-wrap: wrap; }
.row-top { align-items: flex-start; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hide { display: none !important; }

.grid { display: grid; gap: var(--s5); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.g-auto-sm { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); }
.sidebar-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: var(--s7); align-items: start; }
.sidebar-layout.right { grid-template-columns: minmax(0, 1fr) 300px; }

@media (max-width: 960px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-layout, .sidebar-layout.right { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
}
@media (max-width: 620px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .section { padding-block: var(--s7); }
  .wrap { padding-inline: var(--s4); }
}

/* Section heading with a contour rule that encodes position, not decoration */
.sec-head { margin-bottom: var(--s6); }
.sec-head h2 { display: flex; align-items: baseline; gap: var(--s3); }
.sec-head p { color: var(--ink-2); margin-top: var(--s2); max-width: 66ch; }

/* ---------- 5. Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 9px 17px;
  border-radius: var(--r-tight);
  border: 1px solid transparent;
  font-size: var(--t-md);
  font-weight: 560;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hov); color: var(--on-primary); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }
.btn-solid { background: var(--surface-3); color: var(--ink); }
.btn-solid:hover { background: var(--line); color: var(--ink); }
.btn-danger { background: var(--signal); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-quiet { color: var(--ink-2); padding: 6px 10px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-lg { padding: 13px 25px; font-size: var(--t-base); }
.btn-sm { padding: 6px 12px; font-size: var(--t-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }

/* ---------- 6. Surfaces ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: var(--s5);
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-hd {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  flex-wrap: wrap;
}
.panel-hd h3, .panel-hd h4 { font-size: var(--t-base); }
.panel-bd { padding: var(--s5); }
.panel-ft { padding: var(--s3) var(--s5); border-top: 1px solid var(--line); background: var(--surface-2); }
.panel-tint { background: var(--surface-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s3);
  text-decoration: none; color: inherit;
}
a.card:hover { border-color: var(--primary); color: inherit; }
a.card:hover .card-title { color: var(--primary); }
.card-title { font-weight: 620; font-size: var(--t-base); letter-spacing: -.01em; }
.card-meta { font-size: var(--t-xs); color: var(--ink-3); }

/* Subject cards carry a coloured spine — the colour is a wayfinding cue */
.subject-card { position: relative; padding-left: calc(var(--s5) + 5px); }
.subject-card::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px;
  background: var(--sc, var(--primary)); border-radius: 0 3px 3px 0;
}

/* ---------- 7. Chips, tags, badges ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--t-xs);
  font-weight: 520;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-primary { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.chip-contour { background: var(--contour-soft); border-color: transparent; color: var(--contour); }
.chip-signal  { background: var(--signal-soft);  border-color: transparent; color: var(--signal); }
.chip-info    { background: var(--info-soft);    border-color: transparent; color: var(--info); }
.chip-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.badge-lock {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-xs); font-weight: 560; color: var(--contour);
}

/* ---------- 8. Forms ---------- */

.field { display: block; }
.field > .label { display: block; font-size: var(--t-sm); font-weight: 560; margin-bottom: 5px; color: var(--ink-2); }
.field > .hint { font-size: var(--t-xs); color: var(--ink-3); margin-top: 5px; }
.field > .err { font-size: var(--t-xs); color: var(--signal); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-tight);
  font-size: var(--t-md);
  color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
.select { appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px), calc(100% - 10px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.input-sm { padding: 6px 9px; font-size: var(--t-sm); }

.check { display: flex; align-items: flex-start; gap: var(--s2); font-size: var(--t-md); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }

/* Segmented control — for Prelims / Mains / Both */
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-tight); gap: 2px; }
.seg button {
  padding: 6px 15px; border-radius: 2px; font-size: var(--t-sm); font-weight: 550; color: var(--ink-2);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }

/* ---------- 9. Tables ---------- */

.table { font-size: var(--t-md); }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; font-size: var(--t-sm); color: var(--ink-2); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table-fixed { table-layout: fixed; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 10. Utility bits ---------- */

.divider { height: 1px; background: var(--line); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s4); top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-tight);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: var(--s3); color: var(--paper); }

.empty {
  text-align: center; padding: var(--s8) var(--s5); color: var(--ink-2);
  border: 1px dashed var(--line-strong); border-radius: var(--r-panel);
}
.empty h4 { margin-bottom: var(--s2); }
.empty p { max-width: 46ch; margin-inline: auto; font-size: var(--t-md); }

.skeleton { background: var(--surface-2); border-radius: var(--r-tight); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.meter { height: 6px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--primary); border-radius: var(--r-pill); transition: width .5s var(--ease); }
.meter-contour > i { background: var(--contour); }
.meter-signal > i { background: var(--signal); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s4); font-size: var(--t-md); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 550; text-align: right; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: var(--t-2xl); font-weight: 660; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: var(--t-xs); color: var(--ink-3); }
