:root {
  --bg: #fff6ea;
  --ink: #101321;
  --muted: #4a5164;
  --accent: #e75f1c;
  --accent-dark: #b44714;
  --line: #e8d9c6;
  --card: rgba(255, 255, 255, 0.82);
  --shadow: 0 20px 45px rgba(52, 34, 7, 0.15);
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Sora", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, #ffe2c6 0%, transparent 40%),
    radial-gradient(circle at 92% 20%, #ffdcb8 0%, transparent 32%),
    linear-gradient(180deg, #fff8ef 0%, var(--bg) 70%);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.45;
}

.shape-1 {
  width: 260px;
  height: 260px;
  background: #ffbe8a;
  top: -60px;
  right: -70px;
}

.shape-2 {
  width: 220px;
  height: 220px;
  background: #ffdf9f;
  left: -80px;
  bottom: 10%;
}

.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}

.topbar {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.2rem auto 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  background: rgba(255, 250, 244, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: static;
  top: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 88px;
  max-width: 25vw;
  height: auto;
}

.brand-seal {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #f3c08e;
  background: #fff;
  object-fit: contain;
  padding: 4px;
}

.top-nav {
  display: flex;
  gap: 1.2rem;
}

.top-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.top-nav a:hover {
  color: var(--accent);
}

.cta-button,
.ghost-button {
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cta-button {
  background: linear-gradient(135deg, var(--accent), #f28739);
  color: #fff;
  padding: 0.78rem 1.2rem;
  box-shadow: 0 10px 20px rgba(231, 95, 28, 0.28);
}

.ghost-button {
  color: var(--ink);
  border: 1px solid #d8bfa2;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.72rem 1.15rem;
}

.cta-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 2rem auto 0;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin-top: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 4.3vw, 3.7rem);
  margin-bottom: 0.8rem;
}

h1 span {
  color: var(--accent);
}

.hero-text {
  color: var(--muted);
  max-width: 58ch;
  margin-bottom: 1.3rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.75rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.8rem;
  box-shadow: var(--shadow);
}

.stat-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.stat-label {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.hero-visual {
  display: grid;
  place-items: center;
}

.abacus-shell {
  /* Colors sampled from reference image (dominant palette) */
  --abacus-dark: #080605;
  --abacus-highlight: #f1f4f4;
  --abacus-wood-dark: #592110;
  --abacus-wood-mid: #a02508;
  --abacus-wood-high: #eb5608;
  --abacus-accent: #8ee11f;

  width: min(420px, 100%);
  border-radius: 22px;
  /* lighter shell background to match reference image */
  background: linear-gradient(160deg, color-mix(in srgb, var(--abacus-highlight) 40%, var(--abacus-wood-high) 60%), color-mix(in srgb, var(--abacus-highlight) 25%, var(--abacus-wood-mid) 75%));
  padding: 1rem 1rem 0.9rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(239, 215, 189, 0.6);
}

/* Slideshow styles */
.slideshow {
  max-width: 980px;
  margin: 1.1rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
}

.slides {
  position: relative;
  width: 100%;
  padding-top: 42%; /* 21:9-ish wide banner feel */
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fff6f0);
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slideshow-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
}

.prev,
.next {
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--line);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.25rem;
}

.dots { display:flex; gap:0.5rem; align-items:center; }
.dot { width:10px; height:10px; border-radius:50%; background:#e6decf; cursor:pointer; border: none; }
.dot.active { background: var(--accent); }

@media (max-width:980px) {
  .slides { padding-top: 56%; }
}

@media (max-width:640px) {
  .slides { padding-top: 62%; }
}

/* Mobile menu toggle (hidden by default, shown on smaller screens) */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 44px;
  height: 44px;
  padding: 6px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 3px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }


.abacus-header {
  font-family: var(--font-display);
  font-weight: 700;
  color: #68330f;
  margin-bottom: 0.9rem;
}

.abacus-frame {
  background: #8c471f;
  border: 8px solid #6a3518;
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
  overflow: hidden;
}

.rail {
  height: 20px;
  background: linear-gradient(180deg, #d7ab7b, #bd8956);
  border-radius: 99px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 0.4rem;
}

.bead {
  width: 14px;
  height: 14px;
  margin-inline: auto;
  border-radius: 50%;
  background: #f8dfaf;
  border: 2px solid #c8914f;
  animation: beadPulse 3.6s ease-in-out infinite;
}

.bead.active {
  background: #ffb86a;
  border-color: #8f4e12;
  animation-duration: 2.2s;
}

/* When user toggles a bead manually, pause the automatic animation */
.bead.manual {
  animation: none !important;
}

.section {
  margin-top: 4.2rem;
}

.section-head {
  max-width: 700px;
  margin-bottom: 1.1rem;
}

.section-head h2 {
  margin: 0.3rem 0 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.card-grid,
.method-grid {
  display: grid;
  gap: 1rem;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.info-card,
.method-grid article,
.contact-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.info-card {
  padding: 1.1rem;
}

/* CTA row inside info cards: spaced buttons */
.info-card .cta-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  align-items: center;
}

.module-list {
  margin-left: 1rem;
  margin-top: 0.6rem;
}

.module-features ul {
  margin-left: 1rem;
  margin-top: 0.6rem;
}

.info-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.method-grid {
  grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.method-grid article {
  padding: 1rem;
}

.method-grid p,
blockquote {
  color: var(--muted);
}

blockquote {
  margin: 1rem 0 0;
  padding-left: 1rem;
  border-left: 3px solid #d8ad83;
  font-style: italic;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem;
  align-items: flex-start;
}

.contact-card h3 {
  margin-bottom: 0.35rem;
}

address,
.contact-card p {
  margin: 0;
  color: var(--muted);
  font-style: normal;
}

.contact-card a {
  color: #8c3f14;
  font-weight: 700;
}

/* Phones: keep each number on a single line and add small spacing */
.contact-card .phones .phone {
  margin: 0.18rem 0;
}

/* Prevent phone numbers from breaking mid-number */
.contact-card a[href^="tel:"] {
  white-space: nowrap;
  display: inline-block;
  text-decoration: underline;
}

.contact-actions {
  align-self: flex-end;
  margin-top: 0.4rem;
}

/* Grid for multiple center cards (e.g., Nellikuppam, Tindivanam) */
.centers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.6rem;
}

footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 4rem auto 2rem;
  color: #5e6473;
  border-top: 1px solid #e4cfb5;
  padding-top: 1rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes beadPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .menu-toggle {
    display: flex;
  }

  .top-nav {
    display: none;
  }

  .topbar.open .top-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.8rem;
  }

  .topbar.open .top-nav a {
    padding: 0.6rem 0.6rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
  }

  .topbar.open .cta-button {
    width: 100%;
    margin-top: 0.6rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    order: 2;
  }

  .hero-visual {
    order: 1;
  }

  .card-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .centers-grid {
    grid-template-columns: 1fr;
  }

  .contact-actions {
    align-self: flex-start;
    margin-top: 0.3rem;
  }
}

@media (max-width: 640px) {
  .top-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  .topbar {
    position: static;
    top: auto;
    margin-top: 0.6rem;
  }

  .brand-mark {
    width: 72px;
  }

  h1 {
    line-height: 1.2;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}
