/* ==========================================================================
   Kanchi Academy — design tokens
   Palette drawn from Kanchipuram silk: maroon body, gold zari border,
   deep teal contrast pallu, ivory ground. Signature motif: a stepped
   gopuram-arch divider used between sections instead of a generic line.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Work+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --maroon: #6b1e2a;
  --maroon-dark: #45121b;
  --maroon-tint: #f6e9e9;
  --gold: #c1922f;
  --gold-light: #e7cd8f;
  --teal: #1b5e5a;
  --teal-dark: #123f3c;
  --ivory: #f8f3e8;
  --ivory-deep: #f1e8d6;
  --ink: #2a2119;
  --ink-soft: #5b4f45;
  --line: #e3d6bb;
  --white: #fffdf8;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 4px;
  --shadow-card: 0 12px 30px -18px rgba(42, 33, 25, 0.35);
  --wrap: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.5em; line-height: 1.15; color: var(--maroon-dark); }
p { margin: 0 0 1em; color: var(--ink-soft); }
ul { margin: 0; padding: 0; list-style: none; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

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

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

/* Eyebrow / mono labels */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--gold);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--maroon); color: var(--white); }
.btn-primary:hover { background: var(--maroon-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--maroon-dark); }
.btn-ghost:hover { border-color: var(--maroon); }
.btn-gold { background: var(--gold); color: var(--maroon-dark); }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-dark); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 15.5px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 243, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--maroon-dark); }
.brand-mark { color: var(--maroon); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.brand-tag { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-soft); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav-link {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
}
.nav-link:hover { color: var(--maroon); }
.nav-link.is-active { color: var(--maroon); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--gold);
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-phone { display: none; }
.nav-toggle {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--maroon-dark); display: block; }

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 8px 24px 18px;
  border-top: 1px solid var(--line);
  background: var(--ivory);
}
.nav-mobile a { padding: 12px 0; border-bottom: 1px dashed var(--line); font-weight: 600; }
.nav-mobile.is-open { display: flex; }

@media (min-width: 861px) { .header-phone { display: inline-flex; } }
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
}

/* ==========================================================================
   Gopuram divider — signature motif: a stepped temple-tower silhouette
   used between sections instead of a generic hairline.
   ========================================================================== */
.gopuram-divider {
  width: 100%;
  height: 30px;
  display: block;
  background-color: var(--gold);
  -webkit-mask-image: url("assets/images/gopuram-tile.svg");
  mask-image: url("assets/images/gopuram-tile.svg");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: auto 100%;
  mask-size: auto 100%;
  -webkit-mask-position: center;
  mask-position: center;
}
.gopuram-divider--flip { transform: scaleY(-1); }
.gopuram-divider--on-maroon { background-color: var(--gold-light); }
.gopuram-divider--teal { background-color: var(--teal); }

/* Kolam dot rule: small recurring accent used sparingly under hero titles */
.dot-rule { display: flex; gap: 7px; align-items: center; margin: 18px 0 26px; }
.dot-rule span { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.dot-rule span:nth-child(2) { background: var(--teal); }
.dot-rule span:nth-child(3) { background: var(--maroon); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--ivory) 0%, var(--ivory-deep) 100%);
  padding: 72px 0 0;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 56px;
}
.hero h1 { font-size: clamp(34px, 5vw, 54px); }
.hero .lede { font-size: 18px; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }

.hero-art {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  background: var(--maroon);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 6px solid var(--white);
}
.hero-art::before {
  content: "";
  position: absolute; inset: 10px;
  border: 1.5px solid var(--gold-light);
  border-radius: 4px;
  pointer-events: none;
}
.hero-art .hero-art-label {
  position: absolute; inset: auto 0 0 0;
  padding: 18px 20px;
  background: linear-gradient(0deg, rgba(20,10,10,0.75), transparent);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 40px;
}
.hero-stats div { background: var(--white); padding: 20px 18px; }
.hero-stats .stat-num { font-family: var(--font-display); font-size: 30px; color: var(--maroon); font-weight: 700; display: block; }
.hero-stats .stat-label { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Sections
   ========================================================================== */
section { padding: 76px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }

/* Brand showcase cards (home) */
.brand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.brand-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px 26px 26px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  opacity: 0; transform: translateY(16px);
}
.brand-card.is-visible { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.5s ease; }
.brand-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.brand-card .card-icon {
  width: 46px; height: 46px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--maroon-tint);
  color: var(--maroon);
}
.brand-card h3 { font-size: 21px; margin-bottom: 2px; }
.brand-card .card-tag { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal); }
.brand-card p { font-size: 14.5px; margin-bottom: 6px; }
.brand-card .card-link { margin-top: auto; font-weight: 700; color: var(--maroon); font-size: 14.5px; }

@media (max-width: 900px) { .brand-grid { grid-template-columns: 1fr; } }

/* Trust bar */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust-item { text-align: center; }
.trust-item .stat-num { font-family: var(--font-display); font-size: 34px; color: var(--maroon); font-weight: 700; }
.trust-item .stat-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
@media (max-width: 700px) { .trust-bar { grid-template-columns: 1fr 1fr; } }

/* Two-column feature rows */
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.feature-row.flip .feature-media { order: 2; }
.feature-media {
  aspect-ratio: 5/4;
  background: var(--ivory-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: center;
  padding: 20px;
}
@media (max-width: 860px) {
  .feature-row, .feature-row.flip { grid-template-columns: 1fr; }
  .feature-row.flip .feature-media { order: 0; }
}

/* Checklist */
.check-list { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 0; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink); }
.check-list .tick {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--teal); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; margin-top: 2px;
}

/* Programme grade cards */
.grade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.grade-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 20px;
  background: var(--white);
}
.grade-card .eyebrow { margin-bottom: 8px; }
.grade-card h4 { font-size: 18px; margin-bottom: 6px; }
.grade-card p { font-size: 14px; margin-bottom: 0; }

/* Timetable */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.schedule { width: 100%; border-collapse: collapse; background: var(--white); font-size: 14.5px; }
table.schedule th, table.schedule td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
table.schedule th { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; background: var(--ivory-deep); color: var(--ink-soft); }
table.schedule tr:last-child td { border-bottom: none; }

/* Timeline (day-in-the-life) */
.timeline { display: flex; flex-direction: column; border-left: 2px solid var(--gold-light); margin-left: 8px; }
.timeline-item { position: relative; padding: 0 0 30px 26px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute; left: -7px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal); border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--gold-light);
}
.timeline-time { font-family: var(--font-mono); font-size: 12px; color: var(--teal); text-transform: uppercase; letter-spacing: 0.05em; }
.timeline-item h4 { font-size: 16.5px; margin: 4px 0 2px; }
.timeline-item p { font-size: 14px; margin-bottom: 0; }

/* Testimonials */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.testi-card { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.testi-card p { font-style: italic; color: var(--ink); font-size: 15px; }
.testi-name { font-family: var(--font-mono); font-size: 12px; color: var(--teal); text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 900px) { .testi-grid { grid-template-columns: 1fr; } }

/* Gallery placeholder grid */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery-grid .g-item {
  aspect-ratio: 1;
  background: var(--ivory-deep);
  border: 1px dashed var(--line);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-family: var(--font-mono); font-size: 11px; text-align: center; padding: 8px;
}
@media (max-width: 700px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================================================
   Enquiry form
   ========================================================================== */
.enquiry-section { background: var(--maroon); position: relative; }
.enquiry-inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: start; padding: 70px 0; }
.enquiry-inner .section-head h2, .enquiry-inner .eyebrow { color: var(--white); }
.enquiry-inner .eyebrow { color: var(--gold-light); }
.enquiry-inner .eyebrow::before { background: var(--gold-light); }
.enquiry-inner .section-head p { color: rgba(255,255,255,0.78); }
.enquiry-contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.enquiry-contact-list a { color: var(--white); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.enquiry-contact-list a:hover { color: var(--gold-light); }

.enquiry-form {
  background: var(--white);
  border-radius: 10px;
  padding: 30px;
  box-shadow: var(--shadow-card);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14.5px;
  background: var(--ivory);
  color: var(--ink);
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-note { font-size: 13px; color: var(--teal); min-height: 18px; margin-top: 4px; }
@media (max-width: 860px) { .enquiry-inner { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--maroon-dark); color: rgba(255,255,255,0.82); padding-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 52px 0 32px; }
.footer-col h4 { color: var(--gold-light); font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-col a { display: block; padding: 5px 0; color: rgba(255,255,255,0.82); font-size: 14.5px; }
.footer-col a:hover { color: var(--gold-light); }
.footer-col p { color: rgba(255,255,255,0.7); font-size: 14.5px; }
.footer-brand .brand-name { color: var(--white); font-size: 20px; }
.social-row { display: flex; gap: 10px; margin-top: 14px; }
.social-row a {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px;
  padding: 0;
}
.social-row a:hover { border-color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 18px 0 26px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}

/* ==========================================================================
   Sticky WhatsApp button
   ========================================================================== */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--teal); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(27,94,90,0.6);
  transition: transform 0.15s ease;
}
.wa-float:hover { transform: scale(1.06); }

/* Reveal-on-scroll (used broadly, not just brand cards) */
[data-reveal] { opacity: 0; transform: translateY(16px); }
[data-reveal].is-visible { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }

/* Utility */
.mt-lg { margin-top: 40px; }
.text-center { text-align: center; }
.small-print { font-size: 12.5px; color: var(--ink-soft); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--maroon); background: var(--maroon-tint);
  padding: 5px 12px; border-radius: 20px; margin-bottom: 6px;
}
