:root {
  --ink: #102033;
  --muted: #607086;
  --line: #dce8f6;
  --paper: #ffffff;
  --mist: #f5f9ff;
  --blue: #1967d2;
  --blue-2: #e7f1ff;
  --gold: #c69b2d;
  --saffron: #f28c28;
  --green: #15803d;
  --red: #c62828;
  --shadow: 0 18px 45px rgba(25, 103, 210, .13);
  --soft-shadow: 0 10px 24px rgba(16, 32, 51, .08);
  --radius: 8px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Merriweather, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(25, 103, 210, .10), transparent 28rem),
    radial-gradient(circle at 90% 4%, rgba(242, 140, 40, .09), transparent 24rem),
    linear-gradient(180deg, #fff 0%, #f7fbff 45%, #fff 100%);
  font-family: var(--font-sans);
  line-height: 1.65;
}

body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 3000;
  background: var(--blue);
  color: #fff;
  padding: .7rem 1rem;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid rgba(25, 103, 210, .14);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: max-content;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: .2px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: conic-gradient(from 35deg, var(--saffron), #fff 28%, var(--green) 55%, var(--blue) 78%, var(--saffron));
  box-shadow: 0 8px 22px rgba(25, 103, 210, .18);
}
.brand-mark::after {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: #fff;
}
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.nav-links a, .nav-control {
  border: 0;
  background: transparent;
  padding: .58rem .72rem;
  border-radius: 999px;
  color: #24364b;
  cursor: pointer;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active, .nav-control:hover {
  background: var(--blue-2);
  color: var(--blue);
}
.lang-select {
  max-width: 138px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem .75rem;
  color: var(--blue);
  background: #fff;
}
.mobile-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
}
.mobile-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.progress-bar {
  position: fixed;
  inset: 0 auto auto 0;
  width: 0%;
  height: 3px;
  z-index: 2000;
  background: linear-gradient(90deg, var(--blue), var(--gold), var(--saffron));
}

.hero {
  min-height: calc(100vh - 66px);
  display: grid;
  align-items: center;
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 5vw, 4rem) 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.95), rgba(255,255,255,.78), rgba(255,255,255,.50)),
    url("assets/images/hero-collage.svg");
  background-size: cover;
  background-position: center;
}
.hero::after {
  content: "";
  position: absolute;
  right: -8rem;
  bottom: 8%;
  width: min(46vw, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(25,103,210,.18);
  background: repeating-conic-gradient(from 0deg, rgba(25,103,210,.12) 0 2deg, transparent 2deg 9deg);
  animation: spin 28s linear infinite;
}
.hero-content { position: relative; z-index: 1; max-width: 850px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--blue);
  background: rgba(231, 241, 255, .88);
  border: 1px solid rgba(25,103,210,.14);
  border-radius: 999px;
  padding: .45rem .75rem;
  font-weight: 800;
  font-size: .88rem;
}
.hero h1, .page-hero h1 {
  margin: 1.2rem 0 .8rem;
  font-family: var(--font-serif);
  font-size: clamp(2.45rem, 8vw, 5.8rem);
  line-height: 1.03;
  letter-spacing: 0;
  color: #0d2a4c;
}
.hero .malayalam {
  display: block;
  color: var(--blue);
  font-size: clamp(1.6rem, 4.4vw, 3.8rem);
}
.hero p, .page-hero p {
  max-width: 700px;
  color: #41536a;
  font-size: clamp(1rem, 2vw, 1.25rem);
}
.hero-actions, .action-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.7rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .78rem 1.15rem;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(25, 103, 210, .20);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.secondary {
  background: #fff;
  color: var(--blue);
  border-color: rgba(25,103,210,.24);
  box-shadow: none;
}
.btn.gold { background: linear-gradient(135deg, var(--gold), #e2b94d); color: #1d2735; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.section { padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem); }
.section.compact { padding-top: 2rem; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto 1.5rem;
  max-width: 1180px;
}
.section-title {
  margin: 0;
  font-family: var(--font-serif);
  color: #12345a;
  font-size: clamp(1.8rem, 4vw, 3rem);
}
.section-kicker { margin: 0 0 .35rem; color: var(--blue); font-weight: 900; text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; }
.section-copy { color: var(--muted); margin: .4rem 0 0; max-width: 720px; }
.grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card, .glass-card, .party-card, .fighter-card, .language-card, .article-shell, .verify-card {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(25, 103, 210, .13);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}
.card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 1.2rem;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--saffron), #fff, var(--green), var(--blue));
}
.card:hover, .party-card:hover, .fighter-card:hover, .language-card:hover {
  transform: translateY(-5px);
  border-color: rgba(25,103,210,.34);
  box-shadow: var(--shadow);
}
.card h3, .party-card h3, .fighter-card h3 { margin: .5rem 0 .45rem; color: #102f52; font-family: var(--font-serif); }
.card p, .party-card p, .fighter-card p { color: var(--muted); margin: .35rem 0; }
.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-2);
  color: var(--blue);
  font-weight: 900;
}
.mini-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .28rem .58rem;
  font-size: .78rem;
  font-weight: 800;
  background: var(--blue-2);
  color: var(--blue);
}
.pill.green { color: var(--green); background: #e9f8ef; }
.pill.red { color: var(--red); background: #ffecec; }
.pill.gold { color: #7a5600; background: #fff4d6; }

.page-hero {
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem) 2.5rem;
  background:
    linear-gradient(120deg, rgba(255,255,255,.96), rgba(231,241,255,.82)),
    radial-gradient(circle at 75% 0%, rgba(25,103,210,.18), transparent 27rem);
  border-bottom: 1px solid var(--line);
}
.page-hero-inner { max-width: 1180px; margin: 0 auto; }

.search-panel {
  max-width: 1180px;
  margin: -1.3rem auto 1.5rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: center;
}
.search-input, .captcha-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .9rem 1rem;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.search-input:focus, .captcha-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(25,103,210,.10); }

.timeline {
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  padding-left: 2.2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: .78rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(var(--blue), var(--gold), var(--green));
}
.timeline-item {
  position: relative;
  margin: 0 0 1rem;
}
.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 1.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--blue);
  box-shadow: 0 0 0 6px rgba(25,103,210,.10);
}
.timeline-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(25,103,210,.14);
  background: rgba(255,255,255,.9);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.timeline-year { color: var(--blue); font-size: 1.25rem; font-weight: 900; }
.timeline-details {
  display: none;
  padding: .9rem 1rem 1rem;
  margin-top: .25rem;
  border-left: 3px solid var(--gold);
  color: var(--muted);
  background: #fff;
}
.timeline-item.open .timeline-details { display: block; animation: fadeUp .25s ease; }

.language-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.language-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 1.4rem;
  cursor: pointer;
}
.language-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -45% 20%;
  height: 100px;
  background: radial-gradient(circle, rgba(25,103,210,.18), transparent 65%);
}
.language-card strong { display: block; font-size: 1.85rem; color: #0d2a4c; }
.language-card span { color: var(--muted); }

.fighter-card { overflow: hidden; }
.portrait {
  height: 210px;
  display: grid;
  place-items: end start;
  padding: 1rem;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(13,42,76,.18), rgba(25,103,210,.86)),
    var(--portrait, linear-gradient(135deg, #dbeafe, #fff));
}
.portrait .initials {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.20);
  border: 1px solid rgba(255,255,255,.55);
  font-weight: 900;
  font-size: 1.45rem;
}
.fighter-body { padding: 1rem; }
.list { padding-left: 1.2rem; color: var(--muted); }
.list li { margin: .3rem 0; }

.party-card { padding: 1rem; transition: transform .25s ease, box-shadow .25s ease; }
.party-top { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.party-year { color: var(--blue); font-weight: 900; }
.accordion {
  margin-top: .85rem;
  border-top: 1px solid var(--line);
}
.accordion button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  background: transparent;
  border: 0;
  color: var(--blue);
  padding: .75rem 0 0;
  font-weight: 900;
  cursor: pointer;
}
.accordion-panel { display: none; color: var(--muted); padding-top: .55rem; }
.party-card.open .accordion-panel { display: block; }

.article-layout {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  gap: 1rem;
  align-items: start;
}
.article-shell { padding: clamp(1rem, 3vw, 2rem); }
.article-cover {
  min-height: 280px;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  background:
    linear-gradient(135deg, rgba(25,103,210,.72), rgba(242,140,40,.55)),
    url("assets/images/article-cover.svg") center/cover;
}
.toc, .related-box {
  position: sticky;
  top: 88px;
  padding: 1rem;
}
.toc a {
  display: block;
  padding: .42rem 0;
  color: var(--muted);
}
.toc a.active, .toc a:hover { color: var(--blue); font-weight: 800; }
.article-body h2 { color: #12345a; font-family: var(--font-serif); margin-top: 2rem; }
.quote-slider blockquote {
  margin: 0;
  padding: 1rem;
  border-left: 4px solid var(--gold);
  background: #fff8e8;
  color: #634813;
  border-radius: var(--radius);
}

.verify-wrap {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.verify-card {
  width: min(560px, 100%);
  padding: clamp(1.2rem, 4vw, 2rem);
  text-align: center;
}
.fake-recaptcha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
  text-align: left;
}
.checkline { display: flex; align-items: center; gap: .7rem; }
.checkline input { width: 24px; height: 24px; accent-color: var(--blue); }
.success-burst {
  display: none;
  margin: 1rem auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid #d9fbe6;
  color: var(--green);
  place-items: center;
  font-weight: 900;
}
.success-burst.show { display: grid; animation: pop .35s ease; }

.counter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1180px;
  margin: 1.2rem auto 0;
}
.counter { padding: 1rem; text-align: center; }
.counter strong { display: block; color: var(--blue); font-size: 2rem; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(16,32,51,.45);
}
.modal.show { display: flex; }
.modal-card {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 30px 80px rgba(16,32,51,.25);
}
.modal-close {
  float: right;
  border: 0;
  background: var(--blue-2);
  color: var(--blue);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 900;
}

.footer {
  padding: 2.5rem clamp(1rem, 5vw, 4rem);
  background: #0e2036;
  color: #dbeafe;
}
.footer-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 1.2rem;
}
.footer a { display: block; color: #e7f1ff; margin: .25rem 0; }
.footer small { color: #9db7d5; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 50% { transform: scale(1.14); } }

@media (max-width: 980px) {
  .mobile-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 65px 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-control, .lang-select { width: 100%; max-width: none; text-align: left; }
  .grid, .grid.two, .grid.four, .language-grid, .counter-row, .article-layout { grid-template-columns: 1fr; }
  .toc, .related-box { position: static; }
  .search-panel { grid-template-columns: 1fr; margin-top: 1rem; }
  .hero::after { opacity: .25; }
}

@media (max-width: 560px) {
  .hero { min-height: 88vh; }
  .hero-actions .btn, .action-row .btn { width: 100%; }
  .section-head { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .party-top { display: block; }
  .timeline { padding-left: 1.65rem; }
  .timeline-dot { left: -1.55rem; }
}
