/* Copyright (c) 2026 Sharvesh Vijayakumar. All rights reserved. */
/* ═══ StudyRace v7 — Shared site styles ═══ */

:root {
  --cream: #F5EFE2; --cream-2: #FBF8F2; --paper: #FFFFFF;
  --ink: #1C1F1A; --ink-soft: #4A5147; --ink-mute: #7A8077;
  --emerald: #1B6B45; --emerald-2: #155235;
  --emerald-soft: #DCEEE3; --emerald-tint: #EEF5EE;
  --line: #D6CAB0; --line-soft: #E8DFCE;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  background: var(--cream-2); color: var(--ink);
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.serif { font-family: 'Fraunces', Georgia, serif; font-weight: 400; letter-spacing: -0.02em; }
.mono  { font-family: 'JetBrains Mono', monospace; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

nav.top {
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(12px);
  background: rgba(251, 248, 242, 0.92);
}
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 18px 32px;
  display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 22px;
  letter-spacing: -0.025em;
  display: flex; align-items: center; gap: 10px;
}
.logo-flag { width: 14px; height: 14px; border-radius: 4px; background: var(--emerald); position: relative; }
.logo-flag::after { content: ''; position: absolute; inset: 3px; border-radius: 1px;
  background: repeating-linear-gradient(45deg, var(--cream-2), var(--cream-2) 2px, transparent 2px, transparent 4px); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-size: 14px; color: var(--ink-soft); font-weight: 500; transition: color 0.15s; position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.current { color: var(--ink); }
.nav-links a.current::after {
  content: ''; position: absolute; bottom: -22px; left: 0; right: 0; height: 2px; background: var(--emerald);
}
.nav-cta { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 100px;
  font-size: 14px; font-weight: 500;
  transition: all 0.18s; white-space: nowrap;
  cursor: pointer; border: none; font-family: inherit;
}
.btn-emerald { background: var(--emerald); color: white; }
.btn-emerald:hover { background: var(--emerald-2); transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(27,107,69,0.4); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--cream-2); }
.btn-ghost { color: var(--ink-soft); font-weight: 500; }
.btn-ghost:hover { color: var(--ink); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn .arrow { transition: transform 0.18s; }
.btn:hover .arrow { transform: translateX(3px); }

.section { padding: 100px 0; border-bottom: 1px solid var(--line-soft); }
.section.cream { background: var(--cream); }
.section.paper { background: var(--cream-2); }
.section.dark { background: var(--ink); color: var(--cream-2); border-bottom: none; }

.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--emerald); font-weight: 500; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.section-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--emerald); }
.section-title {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.1; letter-spacing: -0.025em; color: var(--ink); margin-bottom: 20px;
}
.section.dark .section-title { color: var(--cream-2); }
.section-title em { font-style: italic; color: var(--emerald); font-weight: 500; }
.section.dark .section-title em { color: #6BD4A0; }
.section-sub { font-size: 17px; color: var(--ink-soft); line-height: 1.6; max-width: 560px; margin-bottom: 50px; }
.section.dark .section-sub { color: rgba(251,248,242,0.7); }

.grid-2 { display: grid; grid-template-columns: 1fr 1.1fr; gap: 70px; align-items: center; }
.media-img { border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; }
.media-img img { width: 100%; height: 100%; object-fit: cover; }

.cards-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--paper); border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-soft);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -16px rgba(28,31,26,0.1); }
.card-img { aspect-ratio: 16/10; overflow: hidden; background: var(--cream); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 28px 26px; display: flex; flex-direction: column; flex: 1; }
.card-tag {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--emerald); font-weight: 500; margin-bottom: 12px;
}
.card h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 12px; color: var(--ink); }
.card p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 18px; flex: 1; }
.card-cta { font-size: 14px; font-weight: 500; color: var(--emerald); border-bottom: 1.5px solid var(--emerald); padding-bottom: 1px; align-self: flex-start; }
.card-cta:hover { color: var(--emerald-2); }

footer { background: var(--ink); color: var(--cream-2); padding: 70px 0 30px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 50px; padding-bottom: 50px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .logo { color: var(--cream-2); margin-bottom: 16px; }
.footer-brand p { font-size: 14px; color: rgba(251,248,242,0.55); line-height: 1.6; max-width: 320px; }
.footer-col h6 {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(251,248,242,0.45); margin-bottom: 18px; font-weight: 500;
}
.footer-col a { display: block; font-size: 13.5px; color: rgba(251,248,242,0.75); padding: 5px 0; transition: color 0.15s; }
.footer-col a:hover { color: var(--cream-2); }
.footer-bottom { display: flex; justify-content: space-between; font-size: 12.5px; color: rgba(251,248,242,0.4); flex-wrap: wrap; gap: 12px; }
.footer-pricing-link { color: rgba(251,248,242,0.55) !important; font-size: 12.5px !important; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .grid-2 { grid-template-columns: 1fr; gap: 40px; }
  .cards-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 60px 0; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .nav-cta .btn-ghost { display: none; }
}

/* Reusable nav + footer partials so all pages stay consistent */
.nav-partial { /* placeholder for JS-injected if used */ }

@media (max-width: 768px) {
  .nav-cta { gap: 6px; }
  .nav-cta .btn { padding: 8px 14px; font-size: 12.5px; }
  .nav-links { display: none; }
  .container { padding: 0 18px; }
  .section { padding: 50px 0; }
  .section-title { font-size: 28px !important; }
  .hero h1 { font-size: 36px !important; }
  .hero p.lead { font-size: 15px; }
  .feature-row { gap: 28px !important; }
  .feature-row.reverse { direction: ltr !important; }
  .cards-row { grid-template-columns: 1fr !important; }
  .pricing-grid { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr !important; }
  .hero-actions, .cta-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn, .cta-actions .btn { width: 100%; justify-content: center; }
}

/* ── Mobile navigation (hamburger menu) ──────────────────── */
.nav-burger { display: none; }
.nav-mobile { display: none; }

@media (max-width: 900px) {
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center;
    align-items: center; gap: 5px;
    width: 40px; height: 40px;
    background: transparent; border: 0; cursor: pointer; padding: 0;
    margin-left: 6px;
  }
  .nav-burger span {
    display: block; width: 22px; height: 2px;
    background: var(--ink); border-radius: 2px;
    transition: transform .22s ease, opacity .15s ease;
  }
  nav.top.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  nav.top.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
  nav.top.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-mobile {
    display: block;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream);
    border-bottom: 1px solid var(--line-soft);
    max-height: 0; overflow: hidden;
    transition: max-height .28s ease;
    box-shadow: 0 18px 36px -22px rgba(20,30,20,0.18);
  }
  nav.top.nav-open .nav-mobile { max-height: 85vh; }
  .nav-mobile-inner {
    display: flex; flex-direction: column;
    padding: 8px 22px 22px;
  }
  .nav-mobile-inner a {
    font-size: 16px; font-weight: 500;
    color: var(--ink-soft); text-decoration: none;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line-soft);
  }
  .nav-mobile-inner a.current { color: var(--ink); }
  .nav-mobile-inner a:last-child { border-bottom: 0; }
  .nav-mobile-inner a.mob-btn {
    margin-top: 14px; text-align: center;
    border: 1px solid var(--ink); border-radius: 100px;
    padding: 12px 18px;
  }
  .nav-mobile-inner a.mob-btn-emerald {
    background: var(--emerald); border-color: var(--emerald); color: #fff;
  }
  body.nav-locked { overflow: hidden; }
}
