/* ==========================================================================
   Sahityotsav — Modern Minimal Design System
   ========================================================================== */

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

:root{
  /* Palette */
  --ink:        #12151a;
  --ink-soft:   #4a4f58;
  --paper:      #faf9f6;
  --paper-dim:  #f1efe9;
  --line:       #e7e4dc;
  --white:      #ffffff;

  --brand:      #0e7c66;   /* deep emerald */
  --brand-dark: #095948;
  --brand-tint: #e7f3ef;

  --accent:     #d7263d;   /* warm red, used sparingly (live) */
  --gold:       #e3b23c;

  /* Type */
  --font-head: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --container: 1120px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --ease: cubic-bezier(.16,.8,.24,1);

  --shadow-sm: 0 2px 10px rgba(18,21,26,.06);
  --shadow-md: 0 12px 30px rgba(18,21,26,.08);
  --shadow-lg: 0 24px 60px rgba(18,21,26,.14);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

h1, h2, h3, h4{
  font-family: var(--font-head);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p{ margin: 0; }

::selection{ background: var(--brand); color: #fff; }

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

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow::before{
  content: '';
  width: 18px;
  height: 2px;
  background: var(--brand);
  display: inline-block;
}

/* ---------------------------------- Buttons ---------------------------------- */
.btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 34px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: transform .45s var(--ease), background .35s ease, color .35s ease, box-shadow .35s ease;
  z-index: 1;
}
.btn::after{
  content: '';
  position: absolute;
  inset: 0;
  background: var(--brand);
  transform: translateY(101%);
  transition: transform .45s var(--ease);
  z-index: -1;
}
.btn:hover{
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.btn:hover::after{ transform: translateY(0); }

.btn-outline{
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.5);
}
.btn-outline::after{ background: var(--white); }
.btn-outline:hover{ color: var(--ink); border-color: var(--white); }

.btn-light{
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--white);
}
.btn-light::after{ background: var(--ink); }
.btn-light:hover{ color: var(--white); border-color: var(--ink); }

/* ---------------------------------- Nav ---------------------------------- */
.site-nav{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  transition: background .4s ease, padding .4s ease, box-shadow .4s ease, backdrop-filter .4s ease;
}
.site-nav.scrolled{
  background: rgba(250,249,246,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 32px;
  box-shadow: 0 1px 0 var(--line);
}
.site-nav.scrolled .brand-mark,
.site-nav.scrolled .nav-link{ color: var(--ink); }
.site-nav.scrolled .icon-line{ background: var(--ink); }

.brand-mark{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .01em;
  transition: color .4s ease;
}
.brand-mark img{ width: 30px; height: 30px; }

.nav-links{
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-link{
  color: var(--white);
  font-size: 14.5px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color .4s ease;
}
.nav-link::after{
  content:'';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: currentColor;
  transition: width .35s var(--ease);
}
.nav-link:hover::after{ width: 100%; }

.nav-desktop{ display: flex; align-items: center; gap: 40px; }

.nav-toggle{
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  transition: border-color .4s ease;
}
.icon-line{
  width: 18px; height: 2px;
  background: var(--white);
  transition: background .4s ease, transform .35s var(--ease), opacity .3s ease;
}

.nav-drawer{
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity .5s var(--ease), visibility .5s, transform .5s var(--ease);
}
.nav-drawer.open{
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-drawer .nav-link{
  font-size: 30px;
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--white);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.nav-drawer.open .nav-link{ opacity: 1; transform: translateY(0); }
.nav-drawer.open .nav-link:nth-child(1){ transition-delay: .08s; }
.nav-drawer.open .nav-link:nth-child(2){ transition-delay: .14s; }
.nav-drawer.open .nav-link:nth-child(3){ transition-delay: .2s; }

.drawer-socials{
  display: flex;
  gap: 20px;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease) .3s, transform .5s var(--ease) .3s;
}
.nav-drawer.open .drawer-socials{ opacity: 1; transform: translateY(0); }
.drawer-socials a{
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  transition: background .3s ease, border-color .3s ease, transform .3s ease;
}
.drawer-socials a:hover{ background: var(--brand); border-color: var(--brand); transform: translateY(-3px); }

body.nav-open{ overflow: hidden; }

/* ---------------------------------- Hero ---------------------------------- */
.hero{
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
  background: var(--ink);
}
.hero-bg{
  position: absolute; inset: 0;
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  animation: heroZoom 16s ease-out forwards;
}
@keyframes heroZoom{ to{ transform: scale(1); } }

.hero::before{
  content:'';
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0;
  animation: riseIn .9s var(--ease) .1s forwards;
}
.hero-date{
  font-size: 15px;
  letter-spacing: .1em;
  color: rgba(255,255,255,.8);
  font-weight: 500;
  opacity: 0;
  animation: riseIn .9s var(--ease) .85s forwards;
}
.hero-inner{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  padding: 0 20px;
}
.hero-mark{
  width: 84px;
  opacity: 0;
  animation: riseIn .9s var(--ease) .2s forwards;
}
.hero-title{
  max-width: 640px;
  width: 100%;
  opacity: 0;
  animation: riseIn 1s var(--ease) .45s forwards;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.25));
}
.hero-sub{
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  font-weight: 500;
  opacity: 0;
  animation: riseIn .9s var(--ease) .7s forwards;
}
@keyframes riseIn{
  from{ opacity: 0; transform: translateY(26px); }
  to{ opacity: 1; transform: translateY(0); }
}

.scroll-cue{
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.65);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: 0;
  animation: riseIn .8s var(--ease) 1.1s forwards;
}
.scroll-cue span{
  width: 1px; height: 34px;
  background: rgba(255,255,255,.5);
  position: relative;
  overflow: hidden;
}
.scroll-cue span::after{
  content:'';
  position: absolute;
  top: -100%; left: 0; right: 0;
  height: 100%;
  background: var(--white);
  animation: cueDrop 1.8s ease-in-out infinite;
}
@keyframes cueDrop{
  0%{ top: -100%; }
  60%{ top: 100%; }
  100%{ top: 100%; }
}

/* ---------------------------------- Reveal on scroll ---------------------------------- */
/* Visible by default (no-JS / JS-failure safe). JS adds .reveal-init to opt into the
   animated hidden state, then swaps in .is-visible once the element scrolls into view. */
.reveal.reveal-init{
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.reveal-init.is-visible{ opacity: 1; transform: translateY(0); }

.reveal-stagger.reveal-init > *{
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal-stagger.reveal-init.is-visible > *{ opacity: 1; transform: translateY(0); }
.reveal-stagger.reveal-init.is-visible > *:nth-child(1){ transition-delay: .05s; }
.reveal-stagger.reveal-init.is-visible > *:nth-child(2){ transition-delay: .12s; }
.reveal-stagger.reveal-init.is-visible > *:nth-child(3){ transition-delay: .19s; }
.reveal-stagger.reveal-init.is-visible > *:nth-child(4){ transition-delay: .26s; }
.reveal-stagger.reveal-init.is-visible > *:nth-child(5){ transition-delay: .33s; }
.reveal-stagger.reveal-init.is-visible > *:nth-child(n+6){ transition-delay: .4s; }

/* ---------------------------------- Section shell ---------------------------------- */
.section{
  padding: 110px 0;
  position: relative;
}
.section-tight{ padding: 80px 0; }
.section-head{
  text-align: center;
  max-width: 620px;
  margin: 0 auto 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.section-head h2{ font-size: clamp(28px, 4vw, 42px); }
.section-head p{ color: var(--ink-soft); font-size: 16px; line-height: 1.6; }

.section-dark{ background: var(--ink); color: var(--paper); }
.section-dark .section-head p{ color: rgba(250,249,246,.65); }
.section-brand{ background: var(--brand); color: var(--white); }
.section-brand .eyebrow, .section-brand .eyebrow::before{ color: rgba(255,255,255,.85); background: rgba(255,255,255,.85); }

/* ---------------------------------- Live section ---------------------------------- */
.live-badge{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 26px;
}
.pulse-dot{
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #ff5a5a;
  box-shadow: 0 0 0 rgba(255,90,90,.6);
  animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot{
  0%{ box-shadow: 0 0 0 0 rgba(255,90,90,.55); }
  70%{ box-shadow: 0 0 0 12px rgba(255,90,90,0); }
  100%{ box-shadow: 0 0 0 0 rgba(255,90,90,0); }
}

/* ---------------------------------- Team Points / Leaderboard ---------------------------------- */
.leaderboard{
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lb-row{
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.lb-row:hover{ transform: translateY(-3px); box-shadow: var(--shadow-md); }
.lb-rank{
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-weight: 700;
  font-family: var(--font-head);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lb-row:nth-child(1) .lb-rank{ background: var(--gold); color: var(--ink); }
.lb-row:nth-child(2) .lb-rank{ background: #d9d9d9; color: var(--ink); }
.lb-row:nth-child(3) .lb-rank{ background: #e6c19c; color: var(--ink); }
.lb-name{
  flex: 1;
  text-align: left;
  font-weight: 600;
  font-size: 16.5px;
}
.lb-bar-wrap{
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--paper-dim);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
}
.lb-row{ position: relative; overflow: hidden; }
.lb-bar{
  position: absolute; left: 0; bottom: 0; height: 3px;
  background: var(--brand);
  width: 0;
  transition: width 1.2s var(--ease);
  border-radius: 0 0 0 var(--radius-md);
}
.lb-row.is-visible .lb-bar{ width: var(--pct, 0%); }
.lb-score{
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  min-width: 60px;
  text-align: right;
}
.lb-caption{ text-align: center; margin-bottom: 34px; }
.lb-caption-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 100px;
}

/* ---------------------------------- About ---------------------------------- */
.about-grid{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: center;
}
.about-grid img{
  border-radius: var(--radius-lg);
}
.about-grid p{
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.85;
}

/* ---------------------------------- CTA blocks ---------------------------------- */
.cta-block{
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.cta-block img{ width: 64px; margin-bottom: 6px; }
.cta-block h2{ font-size: clamp(26px, 4vw, 40px); }
.cta-block p{ opacity: .85; max-width: 480px; }

/* ---------------------------------- Footer ---------------------------------- */
.site-footer{
  background: var(--ink);
  color: rgba(250,249,246,.75);
  padding: 56px 0 28px;
}
.footer-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}
.footer-social{
  display: flex;
  gap: 16px;
}
.footer-social a{
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(250,249,246,.18);
  display: flex; align-items: center; justify-content: center;
  transition: background .3s ease, border-color .3s ease, transform .3s ease;
}
.footer-social a:hover{ background: var(--brand); border-color: var(--brand); transform: translateY(-3px); }
.footer-fine{ font-size: 13px; color: rgba(250,249,246,.45); }
.footer-fine a{ color: rgba(250,249,246,.75); font-weight: 600; }
.footer-fine a:hover{ color: var(--white); }

/* ---------------------------------- Responsive ---------------------------------- */
@media (max-width: 900px){
  .about-grid{ grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .about-grid img{ width: 160px; margin: 0 auto; }
}

@media (max-width: 760px){
  .nav-desktop{ display: none; }
  .nav-toggle{ display: flex; }
  .section{ padding: 80px 0; }
  .lb-row{ padding: 16px 18px; }
}

/* ---------------------------------- Results page ---------------------------------- */
.results-page{
  padding-top: 150px;
  padding-bottom: 110px;
}
.form-card{
  max-width: 480px;
  margin: 0 auto 50px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}
.field{ margin-bottom: 20px; text-align: left; }
.field label{
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field select,
.field input[type="text"],
.field input[type="number"],
.field input[type="password"]{
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.field select{
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath fill='none' stroke='%234a4f58' stroke-width='1.6' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.field select:focus,
.field input:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.form-card .btn{
  width: 100%;
  background: var(--brand);
  border-color: var(--brand);
}
.form-card .btn::after{ background: var(--brand-dark); }

#resultsContainer{
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-margin-top: 120px;
}
.result-card{
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(16px);
  animation: cardIn .6s var(--ease) forwards;
}
@keyframes cardIn{ to{ opacity: 1; transform: translateY(0); } }
.result-card .result-icon{
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brand-tint);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.result-card .result-icon img{ width: 22px; height: 22px; }
.result-card .text{
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.result-card .text b{ font-size: 16px; font-weight: 600; }
.result-card .division{ font-size: 13px; color: var(--ink-soft); }
.result-card .chest-number{
  background: var(--ink);
  color: var(--white);
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.result-card .chest-number img{ width: 12px; height: auto; filter: brightness(0) invert(1); }
.no-result{
  text-align: center;
  color: var(--ink-soft);
  padding: 30px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
}
.back-home{
  display: block;
  text-align: center;
  margin-top: 40px;
  font-weight: 600;
  color: var(--brand);
}
.back-home:hover{ color: var(--brand-dark); }

/* ---------------------------------- Admin ---------------------------------- */
.admin-page{
  min-height: 100vh;
  background: var(--paper-dim);
  padding: 60px 20px 80px;
}
.admin-shell{
  max-width: 640px;
  margin: 0 auto;
}
.admin-card{
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}
.admin-head{ margin-bottom: 32px; }
.admin-head .eyebrow{ margin-bottom: 10px; }
.admin-head h1{ font-size: 28px; }
.admin-alert{
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  border: 1px solid rgba(14,124,102,.18);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 26px;
}
.admin-alert.is-error{
  background: #fdeceb;
  color: var(--accent);
  border-color: rgba(215,38,61,.2);
}
.division-row{
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: end;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.division-row:first-of-type{ border-top: none; padding-top: 0; }
.division-row .field{ margin-bottom: 0; }
.division-index{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.admin-card .btn{
  width: 100%;
  background: var(--brand);
  border-color: var(--brand);
  margin-top: 28px;
}
.admin-card .btn::after{ background: var(--brand-dark); }

@media (max-width: 560px){
  .division-row{ grid-template-columns: 1fr; }
  .admin-card{ padding: 28px 22px; }
}
