/* ============================================
   Echoes of Tamilakam — heritage theme
   ============================================ */
:root {
  --bg: #14100c;            /* dark gallery wall */
  --bg-alt: #1a1510;
  --surface: #221b14;
  --surface-hover: #2a2119;
  --text: #efe7da;          /* aged parchment */
  --text-muted: #b3a48f;
  --gold: #c9a24b;          /* temple bronze/gold */
  --gold-light: #e3c47b;
  --terracotta: #b5542d;    /* fired clay */
  --stone: #8a7d6a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.35, 1);
  --font-head: "Cormorant Garamond", "Noto Serif Tamil", serif;
  --font-body: "Inter", "Noto Sans Tamil", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ============================================
   Bilingual switching
   body[data-lang="en"] shows .en, hides .ta
   ============================================ */
body[data-lang="en"] .ta { display: none; }
body[data-lang="ta"] .en { display: none; }

body[data-lang="ta"] {
  font-family: "Noto Sans Tamil", var(--font-body);
}

body[data-lang="ta"] h1,
body[data-lang="ta"] h2,
body[data-lang="ta"] h3 {
  font-family: "Noto Serif Tamil", var(--font-head);
  line-height: 1.35;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(20, 16, 12, 0.88);
  backdrop-filter: blur(12px);
  padding: 0.55rem 0;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(201, 162, 75, 0.15);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.logo-mark {
  color: var(--gold);
  font-size: 1.6rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--gold-light);
}

.lang-toggle {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-toggle:hover {
  background: var(--gold);
  color: var(--bg);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: 0.85rem 1.9rem;
  border: none;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  will-change: transform;
}

.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--terracotta));
  color: #1a1006;
  box-shadow: 0 6px 24px rgba(201, 162, 75, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 10px 32px rgba(201, 162, 75, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(201, 162, 75, 0.45);
}

.btn-ghost:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 115%, rgba(181, 84, 45, 0.28), transparent 65%),
    radial-gradient(ellipse 55% 45% at 85% -10%, rgba(201, 162, 75, 0.14), transparent 60%),
    radial-gradient(ellipse 45% 40% at 8% 20%, rgba(138, 125, 106, 0.12), transparent 60%);
  animation: heroGlow 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroGlow {
  from { opacity: 0.85; transform: scale(1); }
  to   { opacity: 1; transform: scale(1.06); }
}

/* subtle kolam-style dot lattice */
.hero-kolam {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(201, 162, 75, 0.14) 1px, transparent 1.5px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 4rem;
}

.hero-eyebrow {
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

body[data-lang="ta"] .hero-eyebrow {
  letter-spacing: 0.08em;
  text-transform: none;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.hero-title em {
  font-style: italic;
  background: linear-gradient(90deg, var(--gold-light), var(--terracotta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 620px;
  margin: 1.5rem auto 2.4rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(201, 162, 75, 0.35);
  border-radius: 999px;
}

.scroll-hint-dot {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--gold);
  animation: scrollHint 1.8s ease-in-out infinite;
}

@keyframes scrollHint {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: clamp(4rem, 10vw, 7rem) 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid rgba(201, 162, 75, 0.08);
}

.section-tag {
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
}

body[data-lang="ta"] .section-tag {
  text-transform: none;
  letter-spacing: 0.06em;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.section-note {
  color: var(--stone);
  font-size: 0.9rem;
  font-style: italic;
}

/* ============================================
   Timeline
   ============================================ */
.timeline {
  position: relative;
  margin-top: 3rem;
  padding-left: 2.2rem;
}

.timeline-line {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(201, 162, 75, 0.15);
  overflow: hidden;
}

.timeline-line span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--gold), var(--terracotta));
  transform-origin: top;
  transform: scaleY(0);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.2rem;
}

.timeline-dot {
  position: absolute;
  left: -2.2rem;
  top: 1.6rem;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 162, 75, 0.12);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid rgba(201, 162, 75, 0.12);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  transform-style: preserve-3d;
}

.timeline-card:hover {
  background: var(--surface-hover);
  border-color: rgba(201, 162, 75, 0.35);
  box-shadow: var(--shadow);
}

.timeline-era {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  background: rgba(181, 84, 45, 0.12);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  margin-bottom: 0.7rem;
}

.timeline-card h3 {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  transform: translateZ(24px);
}

.timeline-card p {
  color: var(--text-muted);
  font-size: 0.97rem;
  transform: translateZ(12px);
}

/* ============================================
   Script cards
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(201, 162, 75, 0.12);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  transform-style: preserve-3d;
}

.card:hover {
  background: var(--surface-hover);
  border-color: rgba(201, 162, 75, 0.4);
  box-shadow: var(--shadow);
}

.card-glyph {
  font-size: 2.6rem;
  line-height: 1;
  color: var(--gold-light);
  margin-bottom: 1.1rem;
  transform: translateZ(32px);
}

.card h3 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transform: translateZ(20px);
}

.card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  transform: translateZ(10px);
}

/* ============================================
   Gallery + placeholders
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.gallery-item {
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(201, 162, 75, 0.12);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.gallery-item:hover {
  transform: translateY(-6px);
  border-color: rgba(201, 162, 75, 0.4);
  box-shadow: var(--shadow);
}

.gallery-item figcaption {
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* placeholder tiles — replace with <img> */
.ph {
  aspect-ratio: 4 / 3;
  display: grid;
  place-content: center;
  gap: 0.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(201, 162, 75, 0.12);
}

.ph-icon { font-size: 3rem; opacity: 0.85; }

.ph-label {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: rgba(239, 231, 218, 0.55);
  font-family: monospace;
}

.ph-bronze  { background: radial-gradient(ellipse at 30% 25%, #5c4322, #2b2012 70%); }
.ph-bronze2 { background: radial-gradient(ellipse at 70% 30%, #6b4a1f, #241a0e 70%); }
.ph-stone   { background: radial-gradient(ellipse at 40% 20%, #59503f, #241f17 70%); }
.ph-stone2  { background: radial-gradient(ellipse at 65% 70%, #4e463a, #201b14 70%); }
.ph-clay    { background: radial-gradient(ellipse at 35% 30%, #7a4426, #2a1a10 70%); }
.ph-clay2   { background: radial-gradient(ellipse at 60% 25%, #8a4a24, #261509 70%); }

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 8, 5, 0.92);
  backdrop-filter: blur(6px);
  display: grid;
  place-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.lightbox[hidden] { display: none; }

.lightbox-content {
  max-width: min(860px, 90vw);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lightbox-content .ph {
  aspect-ratio: 4 / 3;
  width: min(860px, 90vw);
  border-bottom: none;
}

.lightbox-caption {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.6rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
}

.lightbox-close:hover {
  color: var(--gold-light);
  transform: rotate(90deg);
}

/* ============================================
   3D artifact (CSS urn, drag to rotate)
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.artifact-stage {
  display: grid;
  justify-items: center;
  gap: 1rem;
}

.pedestal-scene {
  width: 260px;
  padding: 2.5rem 1.5rem 1.5rem;
  background:
    radial-gradient(ellipse 80% 30% at 50% 100%, rgba(201, 162, 75, 0.12), transparent 70%),
    var(--surface);
  border: 1px solid rgba(201, 162, 75, 0.15);
  border-radius: var(--radius);
  text-align: center;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.pedestal-scene:active { cursor: grabbing; }

.artifact-3d {
  height: 220px;
  display: grid;
  place-items: center;
}

.urn {
  position: relative;
}

.urn-body {
  position: relative;
  width: 130px;
  height: 140px;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  overflow: hidden;
  background: linear-gradient(160deg, #a45a2e, #6e3c1c 55%, #45230e);
  box-shadow:
    inset -18px -10px 30px rgba(0, 0, 0, 0.45),
    inset 14px 8px 24px rgba(255, 220, 170, 0.15);
}

/* the moving band pattern = "spinning pot" illusion (JS scrolls it) */
.urn-pattern {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(20, 12, 6, 0.28) 0 7px,
      transparent 7px 24px,
      rgba(255, 220, 170, 0.08) 24px 30px,
      transparent 30px 52px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(20, 12, 6, 0.22) 30px 33px);
  will-change: background-position;
}

/* fixed lighting stays put while the pattern moves underneath */
.urn-body::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(255, 235, 190, 0.3) 6%, transparent 32%),
    linear-gradient(-100deg, rgba(0, 0, 0, 0.4) 4%, transparent 30%);
  pointer-events: none;
}

.urn-neck {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 62px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(160deg, #b06334, #572d13);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.5);
}

.urn-shadow {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
}

.artifact-hint {
  font-size: 0.8rem;
  color: var(--stone);
  font-style: italic;
}

/* ============================================
   Sites
   ============================================ */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 2.5rem;
}

.site-chip {
  display: grid;
  gap: 0.15rem;
  padding: 1.3rem 1.4rem;
  background: var(--surface);
  border: 1px solid rgba(201, 162, 75, 0.12);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.site-chip strong {
  font-family: "Noto Serif Tamil", var(--font-head);
  font-size: 1.25rem;
  color: var(--gold-light);
  font-weight: 700;
}

.site-chip:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 162, 75, 0.4);
  box-shadow: var(--shadow);
}

/* ============================================
   Contact
   ============================================ */
.contact-box {
  max-width: 640px;
  text-align: center;
}

.contact-box > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid rgba(201, 162, 75, 0.15);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.2);
}

.contact-form .btn {
  justify-self: center;
  margin-top: 0.5rem;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid rgba(201, 162, 75, 0.1);
  text-align: center;
  color: var(--stone);
  font-size: 0.88rem;
}

/* ============================================
   Reveal
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.no-js .reveal,
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(300px, 80vw);
    flex-direction: column;
    justify-content: center;
    background: rgba(26, 21, 16, 0.97);
    backdrop-filter: blur(14px);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.35, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  }

  .nav-links.open { transform: translateX(0); }

  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .form-row { grid-template-columns: 1fr; }

  .timeline { padding-left: 1.8rem; }
  .timeline-dot { left: -1.8rem; }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
