:root {
  --bg: #ffffff;
  --text: #0f172a; /* slate-900 */
  --muted: #334155; /* slate-700 */
  --accent: #b3002d; /* IITD red-ish */
  --border: #e2e8f0; /* slate-200 */
  --card: #ffffff;
  --footer-bg: #f1f5f9; /* more distinct footer bg */
  --maxw: 72rem; /* ~1152px */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #ff375f;
    --border: #1f2937;
    --card: #0f172a;
    --footer-bg: #0d1526; /* distinct from page bg in dark */
  }
}
* { box-sizing: border-box; }
html { height: 100%; scrollbar-gutter: stable both-edges; }
body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
p { margin: 0.5rem 0 1rem; color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 1rem; }
.section { padding: 2.25rem 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: none; }
/* Header */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #ffffff; backdrop-filter: saturate(150%) blur(8px); border-bottom: 1px solid var(--border); box-shadow: 0 2px 10px rgba(15,23,42,0.06); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent); opacity: 0.3; }
@media (prefers-color-scheme: dark) { .site-header { background: rgba(11,18,32,0.92); box-shadow: 0 2px 12px rgba(0,0,0,0.35); } }
.site-header .nav { display: flex; align-items: center; justify-content: space-between; max-width: var(--maxw); margin: 0 auto; padding: 0.75rem 1rem; }
.brand { display: inline-grid; grid-auto-flow: column; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; border-radius: 6px; }
.brand-text { font-weight: 700; letter-spacing: 0.01em; }
.nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: var(--text); opacity: 0.8; }
.nav-links a[aria-current="page"], .nav-links a:hover { opacity: 1; color: var(--accent); }
/* Ensure content is not hidden behind fixed header */
main { padding-top: var(--header-h, 64px); }
.page-offset { padding-top: calc(var(--header-h, 64px) + 12px); }
/* Mobile menu */
.menu-toggle { display: none; appearance: none; background: transparent; border: 0; padding: 0.25rem; margin-left: 0.25rem; cursor: pointer; }
.menu-toggle .bar { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: transform 0.2s ease; }
#nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: blur(1px); opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
#nav-overlay.active { opacity: 1; pointer-events: auto; }
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; top: var(--header-h, 64px); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0.75rem 1rem 1rem; gap: 0.5rem; z-index: 1001; }
  .nav-links a { padding: 0.5rem 0.25rem; font-size: 1.05rem; }
}
/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; background: var(--footer-bg); }
.site-footer::before { content: ""; display: block; height: 1px; background: var(--accent); opacity: 0.2; }
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1rem; color: var(--muted); font-size: 0.95rem; }
.site-footer h4 { margin: 0 0 0.4rem; font-size: 1rem; color: var(--text); }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col div { margin: 0.1rem 0; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.footer-list a { color: var(--muted); }
.footer-list a:hover { color: var(--accent); text-decoration: none; }
.footer-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
