/* =========================================================
   MATH4120 course site — MARS brand stylesheet
   Headlines: Plus Jakarta Sans (Google Fonts) — stand-in for Geomanist Medium
              To upgrade: drop Geomanist-Medium.woff2 into assets/fonts/ and
              add @font-face + update stacks (see CLAUDE.md)
   Body:      Inter (Google Fonts) — stand-in for Aktiv Grotesk
              To upgrade: same pattern with AktivGrotesk-Regular.woff2
   MARS Blue      #1a1a34
   Neon Green     #89e990
   Electro Purple #6472e2
   Hyper Violet   #c5a9ff
   Pixel Pine     #1a3d36
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.65;
  color: #1a1a34;
  background: #fff;
}

a { color: #6472e2; text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
   SITE TOPBAR (landing + notes pages)
   ========================================================= */

.site-topbar {
  background: #1a1a34;
  display: flex;
  justify-content: center;
  padding: 0.9rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-logo {
  height: 1.6rem;
  display: block;
  flex-shrink: 0;
}

.topbar-x {
  color: rgba(137, 233, 144, 0.45);
  font-size: 1rem;
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-weight: 500;
  flex-shrink: 0;
  line-height: 1;
}

.topbar-uni {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: "Inter", Arial, sans-serif;
  letter-spacing: 0.01em;
}

/* ---- Notes pages: nav strip ---- */
.site-nav {
  background: #1a1a34;
  display: flex;
  align-items: center;
  padding: 0.75rem 2rem;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.site-nav .nav-logo { height: 1.4rem; display: block; flex-shrink: 0; }
.site-nav .nav-sep  { color: rgba(137,233,144,0.4); flex-shrink: 0; }
.site-nav a         { color: rgba(255,255,255,0.7); font-weight: 500; }
.site-nav a:hover   { color: #89e990; text-decoration: none; }

/* =========================================================
   HERO (landing page only)
   ========================================================= */

.site-hero {
  background: #1a1a34;
  padding: 3rem 2rem 3.5rem;
  position: relative;
  overflow: hidden;
}

/* Neon green rule at the very bottom of the hero */
.site-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: #89e990;
}

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Illustrations — flanking the hero text, scaled to hero height */
.hero-shape {
  position: absolute;
  bottom: 0;
  pointer-events: none;
  user-select: none;
  /* height-based sizing prevents vertical clipping */
  width: auto;
}

.hero-shape-left {
  left: 0;
  height: 80%;
  opacity: 0.85;
}

.hero-shape-right {
  right: 0;
  height: 100%;
  opacity: 0.92;
}

.hero-tag {
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #89e990;
  margin: 0 0 1rem;
}

.site-hero h1 {
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.4rem;
  letter-spacing: -1.5px;
  line-height: 1.05;
}

.hero-subtitle {
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 0.5rem;
  letter-spacing: -0.2px;
}

.hero-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.38);
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
}

/* =========================================================
   INTRO + PDF BUTTON
   ========================================================= */

.intro {
  max-width: 760px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
  color: #444;
}
.intro p { margin: 0.5rem 0; font-size: 0.97rem; }

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.55rem 1.4rem;
  background: #1a1a34;
  color: #fff;
  border-radius: 6px;
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.btn-pdf:hover { background: #2e2e5a; text-decoration: none; }

/* =========================================================
   WEEK CARDS
   ========================================================= */

.weeks {
  max-width: 820px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
}

.week {
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* Active weeks get a green left accent */
.week:not(.coming-soon) {
  border-left: 3px solid #89e990;
}
.week:not(.coming-soon):hover {
  border-color: #89e990;
  box-shadow: 0 2px 12px rgba(26, 26, 52, 0.07);
}

.week.coming-soon { opacity: 0.42; }

.week-info {
  flex: 1 1 260px;
  min-width: 0;
}

/* Week number pill badge */
.week-number {
  display: inline-block;
  background: #1a1a34;
  color: #89e990;
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
  margin-bottom: 0.35rem;
}

.week-title {
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1a1a34;
  line-height: 1.35;
}

.week-desc {
  font-size: 0.83rem;
  color: #666;
  margin-top: 0.2rem;
}

.week-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* ---- Action buttons ---- */
.btn {
  display: inline-block;
  padding: 0.32rem 0.85rem;
  border-radius: 6px;
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.btn-notes {
  border: 1.5px solid #c5c5d6;
  color: #1a1a34;
  background: #fff;
}
.btn-notes:hover { background: #f4f4f8; border-color: #1a1a34; text-decoration: none; }

.btn-view {
  border: 1.5px solid #6472e2;
  color: #6472e2;
  background: #fff;
}
.btn-view:hover { background: #f0effd; text-decoration: none; }

.btn-run {
  border: 1.5px solid #89e990;
  background: #89e990;
  color: #1a1a34;
  font-weight: 600;
}
.btn-run:hover { background: #6dcf77; border-color: #6dcf77; text-decoration: none; }

.btn-lab {
  border: 1.5px solid #1a3d36;
  background: #1a3d36;
  color: #fff;
}
.btn-lab:hover { background: #0f2520; border-color: #0f2520; text-decoration: none; }

.coming-label {
  font-size: 0.8rem;
  color: #aaa;
  font-style: italic;
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #aaa;
  padding: 2rem 1rem;
  border-top: 1px solid #eee;
}
.site-footer .footer-logo { height: 1rem; opacity: 0.35; }

/* =========================================================
   NOTES PAGES  (pandoc-generated week*.html)
   ========================================================= */

body.notes-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

body.notes-page h1 {
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #1a1a34;
  border-bottom: 3px solid #89e990;
  padding-bottom: 0.4rem;
  margin-top: 2rem;
}
body.notes-page h2 {
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a34;
  margin-top: 2rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.2rem;
}
body.notes-page h3 {
  font-family: "Plus Jakarta Sans", "Geomanist", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #333;
  margin-top: 1.5rem;
}

/* Tables (booktabs style) */
body.notes-page table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
body.notes-page th {
  border-top: 2px solid #1a1a34;
  border-bottom: 1px solid #1a1a34;
  padding: 0.4rem 1.2rem 0.4rem 0;
  text-align: left;
  font-weight: 600;
}
body.notes-page td {
  padding: 0.35rem 1.2rem 0.35rem 0;
  border: none;
}
body.notes-page tr:last-child td {
  border-bottom: 2px solid #1a1a34;
}

/* Code */
body.notes-page code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: #f4f4f4;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* Custom environments */
.definition,
.example,
.exercise,
.keyidea {
  margin: 1.75rem 0;
  padding: 0.9rem 1.1rem 0.9rem 1.3rem;
  border-radius: 0 6px 6px 0;
}

/* Definition: MARS Blue border, pale Fractal Frost body */
.definition { border-left: 5px solid #1a1a34; background: #e4eef5; }
/* Example: Electro Purple border, pale Hyper Violet body */
.example    { border-left: 5px solid #6472e2; background: #f2eeff; }
/* Exercise: Pixel Pine border, pale Neural body */
.exercise   { border-left: 5px solid #1a3d36; background: #e6f8f3; }
/* Key idea: Neon Green border, pale Lumi body */
.keyidea    { border-left: 5px solid #89e990; background: #f5fcd9; }

.definition > p:first-child,
.example    > p:first-child,
.exercise   > p:first-child,
.keyidea    > p:first-child {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
/* Title text colors: brand-approved combos from p.17 */
.definition > p:first-child strong { color: #1a1a34; }   /* MARS Blue on Fractal Frost */
.example    > p:first-child strong { color: #6472e2; }   /* Electro Purple on Hyper Violet */
.exercise   > p:first-child strong { color: #1a3d36; }   /* Pixel Pine on Neural */
.keyidea    > p:first-child strong { color: #1a1a34; }   /* MARS Blue on Lumi */

.definition > p:last-child,
.example    > p:last-child,
.exercise   > p:last-child,
.keyidea    > p:last-child {
  margin-bottom: 0;
}

/* Math display spacing */
.math.display { overflow-x: auto; }

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .site-hero h1 { font-size: 2.2rem; letter-spacing: -0.5px; }
  .hero-shape-left, .hero-shape-right { display: none; }
  .week { flex-direction: column; align-items: flex-start; }
  .week-links { width: 100%; }
  .btn { font-size: 0.8rem; padding: 0.3rem 0.7rem; }
  .site-topbar { padding: 0.75rem 1rem; }
  .site-hero { padding: 2rem 1rem 2.5rem; }
}
