/* =========================================================
   KN Residential Cricket Academy — Stylesheet
   Design tokens, typography, layout helpers, animation states
   ========================================================= */

:root {
  --maroon: #6B0F1A;
  --burgundy: #430912;
  --dark: #12090B;
  --white: #FFFFFF;
  --offwhite: #F8F5F2;
  --gold: #C9A227;
  --grey: #EAEAEA;

  --maroon-rgb: 107, 15, 26;
  --gold-rgb: 201, 162, 39;
  --dark-rgb: 18, 9, 11;

  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--offwhite);
  color: var(--dark);
  font-family: 'Manrope', sans-serif;
  overflow-x: hidden;
}

::selection {
  background: var(--maroon);
  color: var(--white);
}

/* ---------- Typography ---------- */
.font-display {
  font-family: 'Cormorant Garamond', serif;
}

.font-stat {
  font-family: 'Oswald', sans-serif;
}

h1, h2, h3, .display-heading {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.eyebrow {
  font-family: 'Manrope', sans-serif;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
}

/* ---------- Scroll progress bar ---------- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--maroon));
  z-index: 60;
  transition: width 0.1s linear;
}

/* ---------- Navigation ---------- */
#site-nav {
  transition: background-color 0.5s var(--ease-premium), box-shadow 0.5s var(--ease-premium), padding 0.4s var(--ease-premium);
}

#site-nav.nav-solid {
  background-color: rgba(18, 9, 11, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.45);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 1px;
  background: var(--gold);
  transition: width 0.35s var(--ease-premium);
}

.nav-link:hover::after {
  width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 2rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 2px;
  transition: transform 0.4s var(--ease-premium), background-color 0.4s var(--ease-premium), color 0.4s var(--ease-premium), border-color 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--gold);
  color: var(--dark);
}

.btn-primary:hover {
  background-color: #dcb43a;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px rgba(201, 162, 39, 0.55);
}

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

.btn-outline:hover {
  border-color: var(--white);
  background-color: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

.btn-dark {
  background-color: var(--maroon);
  color: var(--white);
}

.btn-dark:hover {
  background-color: var(--burgundy);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px rgba(107, 15, 26, 0.55);
}

.btn-ghost-dark {
  border: 1px solid rgba(18,9,11,0.25);
  color: var(--dark);
  background: transparent;
}

.btn-ghost-dark:hover {
  border-color: var(--maroon);
  color: var(--maroon);
}

/* ---------- Hero ---------- */
/* Scale with both width and height so the heading never pushes the hero
   content up under the fixed nav on short (laptop / zoomed) screens. */
.hero-heading {
  font-size: clamp(2.4rem, min(6.5vw, 10svh), 5.5rem);
  line-height: 1.05;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  animation: hero-zoom 22s var(--ease-premium) forwards;
}

@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18,9,11,0.55) 0%, rgba(18,9,11,0.35) 35%, rgba(18,9,11,0.85) 100%),
    linear-gradient(90deg, rgba(67,9,18,0.55) 0%, rgba(18,9,11,0.15) 55%);
}

.scroll-cue {
  animation: scroll-cue-move 2.2s ease-in-out infinite;
}

@keyframes scroll-cue-move {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(10px); opacity: 1; }
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.9s var(--ease-premium), transform 0.9s var(--ease-premium);
}

.reveal-clip {
  clip-path: inset(0 0 100% 0);
}

.reveal-clip.is-visible {
  clip-path: inset(0 0 0% 0);
  transition: clip-path 1.1s var(--ease-premium);
}

/* ---------- Image hover zoom ---------- */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 1.1s var(--ease-premium);
}

.img-zoom:hover img {
  transform: scale(1.06);
}

/* ---------- Feature cards ---------- */
.feature-card {
  border-top: 1px solid rgba(18,9,11,0.1);
  transition: border-color 0.4s var(--ease-premium), transform 0.4s var(--ease-premium);
}

.feature-card:hover {
  border-top-color: var(--gold);
  transform: translateY(-4px);
}

/* ---------- Day / Night panels ---------- */
.dn-panel {
  position: relative;
  overflow: hidden;
}

.dn-panel img {
  transition: transform 1.2s var(--ease-premium), filter 1.2s var(--ease-premium);
}

.dn-panel:hover img {
  transform: scale(1.07);
}

.dn-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18,9,11,0.15) 0%, rgba(18,9,11,0.8) 100%);
}

/* ---------- Testimonial slider ---------- */
.testimonial-track {
  transition: transform 0.6s var(--ease-premium);
}

/* ---------- Accordion ---------- */
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-premium);
}

.accordion-item.open .accordion-panel {
  max-height: 400px;
}

.accordion-icon {
  transition: transform 0.4s var(--ease-premium);
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
}

/* ---------- Mobile floating CTA ---------- */
#mobile-cta-bar {
  box-shadow: 0 -10px 30px -10px rgba(0,0,0,0.35);
}

/* ---------- Desktop floating WhatsApp ---------- */
#wa-float {
  transition: transform 0.35s var(--ease-premium);
}

#wa-float:hover {
  transform: translateY(-3px) scale(1.05);
}

/* ---------- Number count ---------- */
.count-up {
  font-variant-numeric: tabular-nums;
}

/* ---------- Focus states ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Form ---------- */
.form-input {
  background-color: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.28);
  color: var(--white);
  padding: 0.7rem 0.1rem;
  transition: border-color 0.35s var(--ease-premium);
  color-scheme: dark;
}

.form-input::placeholder {
  color: rgba(255,255,255,0.45);
}

.form-input:focus {
  border-color: var(--gold);
}

/* ---------- Divider ---------- */
.stat-divider {
  border-left: 1px solid rgba(18,9,11,0.12);
}

/* 2 columns on mobile, 4 on desktop: divider only between items in a row */
.stat-item:nth-child(2n) {
  border-left: 1px solid rgba(18,9,11,0.12);
}

@media (min-width: 768px) {
  .stat-item:not(:first-child) {
    border-left: 1px solid rgba(18,9,11,0.12);
  }
}

/* ---------- Horizontal strip ---------- */
.scrollbar-none {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* ---------- Gallery masonry ---------- */
.gallery-grid {
  column-gap: 1rem;
}

@media (min-width: 768px) {
  .gallery-grid {
    column-count: 3;
  }
}

@media (max-width: 767px) {
  .gallery-grid {
    column-count: 1;
  }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
}

/* ---------- Utility ---------- */
.text-balance {
  text-wrap: balance;
}

.max-w-measure {
  max-width: 62ch;
}

/* Keep the fixed mobile CTA bar from covering the footer */
@media (max-width: 767px) {
  body {
    padding-bottom: 62px;
  }
}
