/* ============================================================
   RoboMath — site styles
   Clean academic project site, Berkeley accents.
   ============================================================ */

:root {
  --berkeley-blue: #003262;
  --california-gold: #FDB515;
  --ink: #1a1a1a;
  --muted: #5a6470;
  --rule: #e3e6ea;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --max-w: 1080px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--berkeley-blue); text-decoration: none; border-bottom: 1px solid rgba(0,50,98,.25); }
a:hover { border-bottom-color: var(--berkeley-blue); }

code {
  font-family: var(--mono);
  background: var(--bg-soft);
  padding: .12em .35em;
  border-radius: 4px;
  font-size: .92em;
  border: 1px solid var(--rule);
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: .92rem;
  line-height: 1.55;
}
pre code { background: transparent; border: none; padding: 0; }

/* ===================== NAV ===================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 600;
  color: var(--ink);
  border: none;
  letter-spacing: -0.01em;
}

.site-nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: .94rem;
}
.site-nav nav a {
  color: var(--muted);
  border: none;
}
.site-nav nav a:hover { color: var(--berkeley-blue); }
.site-nav nav a.active { color: var(--berkeley-blue); font-weight: 600; }

/* ===================== HERO ===================== */

.hero {
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
  border-bottom: 1px solid var(--rule);
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4.5rem 1.25rem 3.5rem;
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  color: var(--berkeley-blue);
  font-weight: 600;
  margin: 0 0 1rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.tagline {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--muted);
  max-width: 720px;
  margin: 0 auto 1.4rem;
}

.byline {
  color: var(--muted);
  font-size: .95rem;
  margin: 0 0 2.5rem;
}

/* ===================== SECTIONS ===================== */

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.25rem 2rem;
  border-top: 1px solid var(--rule);
}
.section:first-of-type { border-top: none; }

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}
.section h2 .num {
  color: var(--california-gold);
  font-variant-numeric: tabular-nums;
  margin-right: .35em;
}

.section h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 .6rem;
  letter-spacing: -0.005em;
}

.section h4 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 1.5rem 0 .4rem;
  color: var(--berkeley-blue);
  font-family: var(--mono);
}

.section p, .section li { color: #2a2f36; }

.section ul, .section ol { padding-left: 1.4rem; }
.section li { margin-bottom: .4rem; }

.section ol.modules { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: mod; }
.section ol.modules li {
  counter-increment: mod;
  position: relative;
  padding: 1rem 1.1rem 1rem 3.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: .7rem;
}
.section ol.modules li::before {
  content: counter(mod);
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  width: 1.6rem; height: 1.6rem;
  border-radius: 50%;
  background: var(--berkeley-blue);
  color: white;
  font-weight: 600;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

ol.steps { counter-reset: step; }
ol.steps li { margin-bottom: .55rem; }

/* ===================== FIGURES ===================== */

.diagram {
  margin: 1.8rem 0;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
}
.diagram img { max-width: 100%; height: auto; }
.diagram figcaption,
.figure-grid figcaption {
  color: var(--muted);
  font-size: .9rem;
  margin-top: .7rem;
  text-align: left;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}
.figure-grid figure { margin: 0; }
.figure-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--bg-soft);
  aspect-ratio: 4/3;
  object-fit: contain;
  image-orientation: none;
}

/* ===================== VIDEO ===================== */

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
  background: #000;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.hero-video { max-width: 880px; margin-left: auto; margin-right: auto; }

/* ===================== TABLE ===================== */

table.parts {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: .95rem;
}
table.parts th, table.parts td {
  text-align: left;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.parts thead th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--berkeley-blue);
}

/* ===================== TEAM ===================== */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  margin: 1.5rem 0;
}
.team-card {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
}
.team-card img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: var(--shadow);
  margin-bottom: .8rem;
  background: var(--rule);
}
.team-card h3 { margin: .2rem 0 .4rem; font-size: 1.05rem; }
.team-card .bio { font-size: .9rem; color: var(--muted); margin: 0 0 .8rem; }
.team-card .contrib { font-size: .88rem; text-align: left; }

/* ===================== MATERIALS ===================== */

.materials { padding-left: 1.2rem; }
.materials li { margin-bottom: .6rem; }

/* ===================== FOOTER ===================== */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero-inner { padding: 3rem 1rem 2.5rem; }
  .section { padding: 3rem 1rem 1.5rem; }
  .site-nav nav { gap: .6rem; font-size: .85rem; }
  .nav-inner { flex-direction: column; align-items: flex-start; }
}
