:root {
  --saffron: #FF9933;
  --saffron-dark: #E6851F;
  --india-green: #138808;
  --navy: #0B1F3A;
  --ink: #1A1A2E;
  --paper: #FFFDF8;
  --cream: #FFF7EC;
  --line: #EAE3D6;
  --muted: #6B6558;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(11, 31, 58, 0.08);
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { font-family: 'Fraunces', serif; margin: 0; }

a { color: inherit; text-decoration: none; }

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

/* Topbar */
.topbar { background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #FF5252; display: inline-block; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 253, 248, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; }
.brand-mark { color: var(--saffron); font-size: 18px; }
.brand-name strong { color: var(--india-green); }
.nav-links { display: flex; gap: 28px; font-size: 14px; font-weight: 600; }
.nav-links a { opacity: 0.75; }
.nav-links a:hover { opacity: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; border: 1px solid transparent; cursor: pointer; transition: 0.15s; }
.btn-primary { background: var(--saffron); color: #fff; }
.btn-primary:hover { background: var(--saffron-dark); }
.btn-outline { border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost { color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn:disabled { opacity: 0.6; cursor: default; }

/* Hero */
.hero { padding: 64px 24px 40px; }
.hero-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.eyebrow { font-weight: 700; color: var(--india-green); text-transform: uppercase; letter-spacing: 0.06em; font-size: 13px; margin-bottom: 16px; }
.hero-copy h1 { font-size: 48px; line-height: 1.08; font-weight: 700; margin-bottom: 20px; }
.hero-sub { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 520px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-note { font-size: 13px; color: var(--muted); font-style: italic; }

.hero-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.hero-card-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 20px; }
.badge-rank { background: var(--cream); color: var(--saffron); padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.medal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.medal-cell { border-radius: 12px; padding: 16px 8px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.medal-cell.gold { background: #FFF4D6; }
.medal-cell.silver { background: #F1F3F5; }
.medal-cell.bronze { background: #FBE7D9; }
.medal-cell.total { background: var(--navy); color: #fff; }
.medal-count { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; }
.medal-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
.hero-card-foot { display: flex; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* Stats */
.stats { background: var(--navy); color: #fff; padding: 36px 24px; }
.stats-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat strong { display: block; font-family: 'Fraunces', serif; font-size: 32px; }
.stat span { font-size: 13px; opacity: 0.75; }

/* Sections */
.section { padding: 72px 24px; }
.section.alt { background: var(--cream); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.section-head h2 { font-size: 32px; margin-bottom: 8px; }
.section-head p { color: var(--muted); margin: 0; }
.controls { display: flex; gap: 12px; flex-wrap: wrap; }
.controls input, .controls select { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); font-family: 'Manrope', sans-serif; font-size: 14px; background: #fff; }
.controls input { min-width: 220px; }

/* Athlete cards */
.athlete-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.athlete-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: 0.15s; }
.athlete-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.athlete-avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--saffron), var(--india-green)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: 'Fraunces', serif; font-size: 18px; }
.athlete-name { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; }
.athlete-sport { font-size: 13px; color: var(--india-green); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.athlete-event { font-size: 13px; color: var(--muted); }
.athlete-status { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status-gold { background: #FFF4D6; color: #8A6D1A; }
.status-silver { background: #F1F3F5; color: #5B6570; }
.status-bronze { background: #FBE7D9; color: #8A4A1A; }
.status-live { background: #FDE2E1; color: #C0392B; }
.status-upcoming { background: #E7F0FF; color: #1D5FB0; }
.no-results { color: var(--muted); font-style: italic; padding: 24px 0; }

/* Story cards */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.story-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.story-tag { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; }
.tag-web { background: #E7F0FF; color: #1D5FB0; }
.tag-x { background: #111111; color: #fff; }
.story-title { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; }
.story-excerpt { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0; }
.story-athlete { font-size: 13px; font-weight: 700; }
.story-link { font-size: 13px; font-weight: 700; color: var(--saffron); }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.step-no { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--saffron); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }
.steps h3 { font-size: 17px; margin-bottom: 8px; }
.steps p { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0; }

/* CTA */
.cta { background: var(--india-green); color: #fff; padding: 64px 24px; text-align: center; }
.cta-inner { max-width: 560px; margin: 0 auto; }
.cta h2 { font-size: 28px; margin-bottom: 8px; }
.cta p { opacity: 0.85; margin-bottom: 24px; }
.notify-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.notify-form input { flex: 1; min-width: 220px; padding: 12px 16px; border-radius: 999px; border: none; font-family: 'Manrope', sans-serif; font-size: 14px; }
.notify-form .btn-primary { background: var(--navy); }

/* Footer */
.footer { padding: 28px 24px; border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* Responsive */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .hero-copy h1 { font-size: 34px; }
  .nav-links { display: none; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .medal-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Sports grid */
.sports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.sport-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: 0.15s; text-align: left; }
.sport-card:hover, .sport-card:focus-visible { box-shadow: var(--shadow); transform: translateY(-2px); outline: none; }
.sport-emoji { font-size: 28px; }
.sport-card-name { font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600; }
.sport-card-meta { font-size: 13px; color: var(--muted); }
.sport-card-cta { font-size: 13px; font-weight: 700; color: var(--saffron); margin-top: auto; }

.sport-status { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status-completed { background: #E9F7EE; color: #1B7A3E; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(11, 31, 58, 0.55); z-index: 100; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.open { display: flex; }
body.modal-open { overflow: hidden; }
.modal { background: var(--paper); border-radius: var(--radius); max-width: 720px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 32px; position: relative; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 18px; cursor: pointer; line-height: 1; }
.modal-close:hover { background: var(--cream); }
.modal-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-right: 40px; }
.modal-header h2 { font-size: 24px; margin-bottom: 6px; }
.modal-emoji { font-size: 36px; }
.modal-schedule { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.modal-section { margin-bottom: 24px; }
.modal-section h3 { font-size: 16px; margin-bottom: 10px; }
.modal-medal-chance { background: var(--cream); border-radius: 12px; padding: 16px; font-size: 14px; line-height: 1.6; margin: 0 0 8px; }
.modal-caveat { font-size: 12px; color: var(--muted); font-style: italic; margin: 0 0 12px; }
.modal-contingent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.modal-athlete-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.modal-athlete-row .modal-athlete-event { color: var(--muted); text-align: right; }
.modal-stories-empty { color: var(--muted); font-style: italic; font-size: 14px; }

@media (max-width: 600px) {
  .modal { padding: 24px 20px; }
  .modal-contingent-list { grid-template-columns: 1fr; }
}
