/* ===========================================================
   MMS Science Olympiad — shared stylesheet
   =========================================================== */

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

:root {
  --purple-900: #3d1a5b;
  --purple-800: #4f2277;
  --purple-700: #5b2c83;
  --purple-600: #6f3b9e;
  --purple-500: #8a52bd;
  --purple-100: #f1e9f8;
  --purple-50:  #faf7fc;

  --navy-900: #10182b;
  --navy-800: #16213e;
  --navy-700: #1b2a4a;

  --gold-500: #f0b93d;
  --gold-600: #d99e1f;

  --ink-900: #1f1b2e;
  --ink-700: #423d54;
  --ink-500: #6b6478;
  --ink-300: #a29cb0;

  --bg: #ffffff;
  --bg-soft: #faf9fc;
  --border: #ece6f2;

  --shadow-sm: 0 1px 3px rgba(61, 26, 91, 0.08);
  --shadow-md: 0 8px 24px rgba(61, 26, 91, 0.10);
  --shadow-lg: 0 20px 48px rgba(61, 26, 91, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--purple-800);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; color: var(--ink-700); }

a { color: var(--purple-700); text-decoration: none; }
a:hover { color: var(--purple-900); }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-600);
  background: rgba(240, 185, 61, 0.14);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* ---------------- Skip link ---------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--purple-800);
  color: #fff;
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------------- Top bar ---------------- */
.topbar {
  background: var(--purple-800);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 24px;
  text-align: center;
  flex-wrap: wrap;
}
.topbar a { color: var(--gold-500); font-weight: 700; }
.topbar a:hover { color: #fff; }

/* ---------------- Navigation ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--purple-900);
}
.brand .mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-500);
  flex-shrink: 0;
  overflow: hidden;
  padding: 3px;
}
.brand .mark svg { width: 22px; height: 22px; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--ink-500);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--ink-700);
  font-weight: 600;
  font-size: 0.94rem;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-links a:hover { background: var(--purple-100); color: var(--purple-800); }
.nav-links a.active { background: var(--purple-800); color: #fff; }

.nav-cta {
  background: var(--gold-500);
  color: var(--navy-900) !important;
  font-weight: 700 !important;
  padding: 10px 20px !important;
  box-shadow: var(--shadow-sm);
}
.nav-cta:hover { background: var(--gold-600); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--purple-800);
}
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.96rem;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-800));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: #fff; }
.btn-gold {
  background: var(--gold-500);
  color: var(--navy-900);
  box-shadow: var(--shadow-md);
}
.btn-gold:hover { transform: translateY(-2px); background: var(--gold-600); box-shadow: var(--shadow-lg); }
.btn-ghost {
  background: #fff;
  color: var(--purple-800);
  border: 1.5px solid var(--purple-200, var(--border));
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--purple-600); color: var(--purple-900); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 480px at 15% -10%, rgba(240, 185, 61, 0.16), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(111, 59, 158, 0.18), transparent 55%),
    var(--bg-soft);
  padding: 96px 0 84px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  max-width: 820px;
  margin: 0 auto 20px;
}
.hero h1 .accent { color: var(--gold-600); }
.hero p.lead {
  max-width: 600px;
  margin: 0 auto 34px;
  font-size: 1.15rem;
  color: var(--ink-700);
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-mail {
  margin-top: 34px;
  font-size: 0.92rem;
  color: var(--ink-500);
}
.hero-mail a { font-weight: 700; }

.page-hero {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(240, 185, 61, 0.14), transparent 55%),
    var(--bg-soft);
  padding: 64px 0 56px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.page-hero p { max-width: 620px; margin: 0 auto; font-size: 1.05rem; }

/* ---------------- Sections ---------------- */
section { padding: 84px 0; }
section.tight { padding: 56px 0; }
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.bg-soft { background: var(--bg-soft); }

/* ---------------- Card grid (quick links) ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--purple-500); }
.card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: #fff;
}
.card .icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { flex: 1; font-size: 0.95rem; }
.card .btn { margin-top: 18px; align-self: flex-start; }

.icon-purple { background: linear-gradient(135deg, var(--purple-600), var(--purple-900)); }
.icon-gold   { background: linear-gradient(135deg, #f7cd6c, var(--gold-600)); }
.icon-navy   { background: linear-gradient(135deg, #2c3e6b, var(--navy-900)); }

/* ---------------- Announcements ---------------- */
.announce-list { display: flex; flex-direction: column; gap: 18px; max-width: 760px; margin: 0 auto; }
.announce-item {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 5px solid var(--gold-500);
  border-radius: var(--radius-sm);
  padding: 22px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.announce-item .dot {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--purple-100);
  color: var(--purple-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.announce-item .dot svg { width: 20px; height: 20px; }
.announce-item h4 { margin: 0 0 6px; font-size: 1.02rem; color: var(--ink-900); }
.announce-item p { margin: 0; font-size: 0.94rem; }
.announce-item .tbd { color: var(--purple-700); font-weight: 600; }

/* ---------------- Event guide (navy panel) ---------------- */
.event-panel {
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900));
  border-radius: var(--radius-lg);
  padding: 56px 40px 44px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.event-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 300px at 90% 0%, rgba(139, 82, 189, 0.35), transparent 60%);
  pointer-events: none;
}
.event-panel .eyebrow { background: rgba(240, 185, 61, 0.18); }
.event-panel h2 { color: #fff; font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.event-panel > p { color: rgba(255,255,255,0.72); max-width: 560px; margin: 0 auto 12px; }

.legend { display: flex; gap: 20px; justify-content: center; margin: 22px 0 36px; flex-wrap: wrap; font-size: 0.86rem; color: rgba(255,255,255,0.85); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.event-columns {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 28px 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  text-align: left;
  box-shadow: var(--shadow-lg);
}
.event-col { border-radius: var(--radius-md); padding: 22px; }
.event-col.build  { background: #fdf3df; }
.event-col.study  { background: #e9eefb; }
.event-col.hybrid { background: #f1e9f8; }
.event-col .icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: #fff; }
.event-col.build .icon  { background: linear-gradient(135deg, #f7cd6c, var(--gold-600)); }
.event-col.study .icon  { background: linear-gradient(135deg, #6d8cf7, #33469e); }
.event-col.hybrid .icon { background: linear-gradient(135deg, var(--purple-500), var(--purple-800)); }
.event-col h3 { font-size: 1.08rem; margin-bottom: 6px; color: var(--ink-900); }
.event-col > p { font-size: 0.86rem; margin-bottom: 16px; }
.event-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.event-col li {
  background: #fff;
  border-left: 3px solid;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.event-col.build li  { border-left-color: var(--gold-600); }
.event-col.study li  { border-left-color: #33469e; }
.event-col.hybrid li { border-left-color: var(--purple-700); }
.event-note { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 30px; max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------------- Forms / embeds ---------------- */
.form-shell {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.form-shell .form-head {
  background: linear-gradient(135deg, var(--purple-700), var(--purple-900));
  color: #fff;
  padding: 26px 30px;
}
.form-shell .form-head h3 { color: #fff; margin-bottom: 4px; font-size: 1.2rem; }
.form-shell .form-head p { color: rgba(255,255,255,0.78); margin: 0; font-size: 0.92rem; }
.form-shell iframe {
  width: 100%;
  border: none;
  display: block;
  min-height: 900px;
}
.form-fallback {
  padding: 18px 30px;
  font-size: 0.86rem;
  color: var(--ink-500);
  border-top: 1px solid var(--border);
  text-align: center;
}

.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.tab-btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--ink-700);
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.tab-btn:hover { border-color: var(--purple-500); color: var(--purple-800); }
.tab-btn.active { background: var(--purple-800); border-color: var(--purple-800); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.4s ease; }

/* ---------------- Coming soon ---------------- */
.coming-soon {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--purple-100);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
}
.coming-soon .icon-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-900));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.coming-soon .icon-circle svg { width: 30px; height: 30px; }
.coming-soon h3 { margin-bottom: 10px; }

/* ---------------- Team dues ---------------- */
.dues-card {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  text-align: center;
  border-top: 5px solid var(--gold-500);
}
.dues-card .field { text-align: left; margin-bottom: 18px; }
.dues-card label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; color: var(--ink-900); }
.dues-card select, .dues-card input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.98rem;
  font-family: 'Inter', sans-serif;
  color: var(--ink-900);
  background: #fff;
}
.dues-card select:focus, .dues-card input:focus { outline: none; border-color: var(--purple-600); }
.dues-card .paypal-submit { margin-top: 22px; }
.dues-card .paypal-submit img { margin: 0 auto; }
.dues-note { font-size: 0.82rem; color: var(--ink-500); margin-top: 20px; }
.trust-row { display: flex; gap: 14px; justify-content: center; margin-top: 18px; opacity: 0.8; flex-wrap: wrap; }

/* ---------------- Footer ---------------- */
footer {
  background: var(--navy-900);
  color: rgba(255,255,255,0.72);
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-family: 'Poppins', sans-serif; font-weight: 700; margin-bottom: 12px; }
footer h5 { color: #fff; font-family: 'Poppins', sans-serif; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 16px; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
footer a { color: rgba(255,255,255,0.72); font-size: 0.94rem; }
footer a:hover { color: var(--gold-500); }
footer p { color: rgba(255,255,255,0.6); font-size: 0.92rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* ---------------- Reveal-on-scroll animation ----------------
   Content is visible by default (progressive enhancement). Only
   once the "js" class lands on <html> (see inline script in
   <head>) do .reveal sections start hidden and fade in via the
   IntersectionObserver in main.js. If JS fails or is disabled,
   everything just stays visible. */
.reveal { transition: opacity 0.6s ease, transform 0.6s ease; }
html.js .reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1 !important; transform: translateY(0) !important; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

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

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    inset: 72px 16px auto 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    display: none;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .nav-toggle { display: inline-flex; }
  .hero { padding: 64px 0 56px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  section { padding: 60px 0; }
}
