/* =====================================================================
   Math with Suva Sir — public site stylesheet
   Design tokens
   ---------------------------------------------------------------
   --ink      : primary text / brand navy
   --paper    : page background (soft paper, not stark white)
   --gold     : accent (brass/chalk gold) — used sparingly
   --slate    : secondary text
   --line     : hairline borders
   --card     : card background
   --green    : available / success
   ===================================================================== */

:root {
  --ink: #1b2a4a;
  --ink-soft: #2c3e63;
  --paper: #f6f4ee;
  --card: #ffffff;
  --gold: #b8863b;
  --gold-soft: #e8d9b8;
  --slate: #55617a;
  --line: #ddd7c7;
  --green: #2f6f4e;
  --font-display: "Newsreader", "Georgia", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(27, 42, 74, 0.08), 0 8px 24px rgba(27, 42, 74, 0.06);
}

@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600;6..72,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap");

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* -------------------- Header / Nav -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}

.brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: #e9e6da;
  font-size: 0.94rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  color: #fff;
  width: 40px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* -------------------- Hero -------------------- */
.hero {
  background:
    linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%);
  color: #f4f1e8;
  padding: 64px 20px 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "\222B  \2211  \03C0  \221A  \0394  \2264  \2265  \221E";
  position: absolute;
  right: -10px;
  top: 10px;
  font-family: var(--font-display);
  font-size: 3.6rem;
  letter-spacing: 22px;
  color: rgba(232, 217, 184, 0.08);
  white-space: nowrap;
  pointer-events: none;
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--gold-soft);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 16px;
  max-width: 20ch;
}

.hero p {
  max-width: 56ch;
  color: #cfd4e0;
  font-size: 1.05rem;
  margin: 0 0 28px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e9e6da;
  font-size: 0.85rem;
}

.visitor-badge strong {
  color: var(--gold-soft);
  font-family: var(--font-mono);
}
/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: #c99542; }

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.35);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.08); }

.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: var(--ink-soft); }

.btn-sm { padding: 7px 13px; font-size: 0.82rem; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }

/* -------------------- Section headers (numbered — mirrors a worked proof) -------------------- */
.section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 30px;
}

.section-head .step-no {
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 0.95rem;
  border: 1px solid var(--gold-soft);
  background: #fbf6ea;
  padding: 3px 9px;
  border-radius: 20px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0;
}

.section-sub {
  color: var(--slate);
  margin: -18px 0 30px;
  max-width: 60ch;
}

/* -------------------- Cards grid (home page links) -------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(27,42,74,0.1), 0 14px 28px rgba(27,42,74,0.1);
}

.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0;
}

.card p {
  color: var(--slate);
  font-size: 0.92rem;
  margin: 0;
  flex-grow: 1;
}

.card .card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
}

/* -------------------- Resource list (syllabus/papers/ebooks/materials) -------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.filter-bar select,
.filter-bar input[type="text"] {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink);
}

.filter-bar input[type="text"] { flex: 1; min-width: 180px; }

.resource-list {
  display: grid;
  gap: 14px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.resource-item .file-badge {
  flex-shrink: 0;
  width: 46px;
  height: 52px;
  background: #fdeee0;
  border: 1px solid var(--gold-soft);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: #b1531f;
  letter-spacing: 0.02em;
}

.resource-info { flex-grow: 1; min-width: 0; }

.resource-info h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--slate);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: #eef1f8;
  color: var(--ink-soft);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--slate);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* -------------------- Video grid -------------------- */
.video-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  overflow: hidden;
}

.video-thumb img { width: 100%; height: 100%; object-fit: cover; }

.video-thumb .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27,42,74,0.15);
}

.video-thumb .play span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--ink);
}

.video-card .video-body { padding: 14px 16px; }
.video-card h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.02rem; }
.video-card p { margin: 0; color: var(--slate); font-size: 0.85rem; }

/* -------------------- Footer -------------------- */
.site-footer {
  background: var(--ink);
  color: #cfd4e0;
  padding: 40px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 24px;
}

.footer-grid h5 {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 12px;
}

.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { text-decoration: none; color: #cfd4e0; font-size: 0.9rem; }
.footer-grid a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 18px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: #98a1b8;
}

/* -------------------- Alerts / flash messages -------------------- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-success { background: #e9f5ee; color: var(--green); border-color: #bfe3cc; }
.alert-error { background: #fbeaea; color: #a23636; border-color: #f0c6c6; }

/* -------------------- Responsive -------------------- */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    padding: 8px 20px 16px;
    display: none;
    border-bottom: 3px solid var(--gold);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 8px; }

  .hero { padding: 44px 0 40px; }
  .hero::before { display: none; }
  .section { padding: 40px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .resource-item { flex-wrap: wrap; }
  .resource-item .btn { width: 100%; }
}

@media (max-width: 480px) {
  .filter-bar { flex-direction: column; }
  .filter-bar select, .filter-bar input[type="text"] { width: 100%; }
}
