/* ============================================================
   Aao Kahani Suno — Stylesheet
   ------------------------------------------------------------
   This single file controls the entire look of the site.
   Sections:
     1. Design tokens (colors, fonts, spacing)
     2. Reset & base
     3. Buttons & shared components
     4. Header
     5. Hero + ticker
     6. About
     7. What we do (zig-zag)
     8. Gallery
     9. Divvya
    10. Why oral storytelling
     11. Join (form)
     12. Footer
     13. Animations (reveal, ticker, marker)
     14. Responsive (mobile)
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Backgrounds & text */
  --background: hsl(40 46% 96%);
  --foreground: hsl(24 30% 14%);
  --card: hsl(40 50% 98%);
  --muted-foreground: hsl(26 14% 40%);
  --border: hsl(32 26% 82%);

  /* Brand palette */
  --indigo: hsl(224 52% 26%);
  --marigold: hsl(38 92% 55%);
  --terracotta: hsl(14 72% 52%);
  --leaf: hsl(158 38% 32%);
  --cream: hsl(36 50% 92%);

  /* Derived */
  --primary-foreground: hsl(40 50% 97%);
  --indigo-light: hsl(224 52% 26% / 0.07);
  --indigo-border: hsl(224 52% 26% / 0.35);
  --marigold-soft: hsl(38 92% 55% / 0.16);
  --marigold-border: hsl(38 92% 55% / 0.6);

  /* Layout */
  --max-wide: 90rem;
  --max-narrow: 72rem;
  --radius: 1rem;
  --radius-lg: 1.75rem;
  --radius-xl: 2rem;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Karla", sans-serif;
  overflow-x: clip;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  /* Subtle paper-grain texture */
  background-image: radial-gradient(hsla(28 40% 40% / 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.font-display { font-family: "Fraunces", Georgia, serif; }
.font-deva { font-family: "Tiro Devanagari Hindi", serif; }

/* ---------- 3. Buttons & shared ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 9999px;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--terracotta);
  color: #fff;
}
.btn-primary-small {
  background: var(--indigo);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  min-height: auto;
  font-weight: 700;
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--indigo);
}
.btn-outline:hover { border-color: var(--terracotta); }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--leaf);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 42rem;
}

.section { padding: 5rem 1.25rem; }
@media (min-width: 1024px) { .section { padding: 7rem 1.25rem; } }

.container-narrow { max-width: var(--max-narrow); margin: 0 auto; padding: 0 1rem; }
.container-wide { max-width: var(--max-wide); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) {
  .container-narrow, .container-wide { padding: 0 2rem; }
}

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid hsl(var(--border) / 0.7);
  background: hsl(40 46% 96% / 0.88);
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
}
@media (min-width: 640px) { .header-inner { padding: 0.75rem 2rem; } }

.logo { display: flex; align-items: baseline; gap: 0.5rem; }
.logo-deva { font-family: "Tiro Devanagari Hindi", serif; font-size: 1.25rem; color: var(--indigo); }
.logo-text { font-family: "Fraunces", serif; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.02em; }

.nav-desktop {
  margin-left: auto;
  display: none;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
@media (min-width: 768px) { .nav-desktop { display: flex; } }
.nav-desktop a:hover { color: var(--terracotta); }

.site-header .btn-primary-small { margin-left: auto; }
@media (min-width: 768px) { .site-header .btn-primary-small { margin-left: 0; } }

/* ---------- 5. Hero + ticker ---------- */
.hero { position: relative; overflow: hidden; }
.hero-grid {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 1.25rem 4rem;
}
@media (min-width: 640px) { .hero-grid { padding: 3rem 2rem 4rem; } }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; padding: 5rem 2rem 6rem; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--marigold-border);
  background: var(--marigold-soft);
  padding: 0.375rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: hsl(24 60% 28%);
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}
.badge-icon { font-size: 0.875rem; }

.hero-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.hero-deva {
  display: block;
  font-family: "Tiro Devanagari Hindi", serif;
  font-size: 0.52em;
  font-weight: 400;
  color: var(--terracotta);
}
.hero-body {
  margin-top: 1.75rem;
  max-width: 36rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--muted-foreground);
}
.hero-buttons { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-image { position: relative; }
.hero-image-blob {
  position: absolute;
  left: -1.5rem;
  top: -1.5rem;
  width: 7rem;
  height: 7rem;
  border-radius: 9999px;
  background: hsl(38 92% 55% / 0.45);
  filter: blur(2px);
  display: none;
}
@media (min-width: 640px) { .hero-image-blob { display: block; } }
.hero-image-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 4px solid var(--indigo);
  box-shadow: 16px 18px 0 hsl(38 92% 55% / 0.65);
}
.hero-image-frame img { width: 100%; height: 100%; object-fit: cover; }

.marker-underline {
  background-image: linear-gradient(hsl(38 92% 55% / 0.55), hsl(38 92% 55% / 0.55));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 0% 0.42em;
  animation: marker-sweep 1s cubic-bezier(0.22,1,0.36,1) 0.5s forwards;
}
@keyframes marker-sweep { to { background-size: 100% 0.42em; } }

/* Ticker */
.ticker-bar {
  border-top: 2px solid var(--indigo);
  border-bottom: 2px solid var(--indigo);
  background: var(--indigo);
  color: var(--primary-foreground);
  padding: 0.75rem 0;
  overflow: hidden;
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 32s linear infinite;
}
.ticker-group { display: flex; flex-shrink: 0; align-items: center; }
.ticker-item { padding: 0 1.5rem; font-size: 1.125rem; }
.ticker-item.deva { font-family: "Tiro Devanagari Hindi", serif; }
.ticker-item.italic { font-family: "Fraunces", serif; font-style: italic; }
.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--marigold);
  flex-shrink: 0;
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- 6. About ---------- */
.about-grid { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .about-grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }

.section-quote {
  font-family: "Fraunces", serif;
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.quote-attribution { margin-top: 1rem; font-size: 0.875rem; color: var(--muted-foreground); }

.about-grid p { font-size: 1.125rem; line-height: 1.7; color: var(--muted-foreground); margin-bottom: 1.5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  margin-top: 0.5rem;
}
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-big { font-family: "Fraunces", serif; font-size: 1.875rem; font-weight: 900; color: var(--terracotta); }
.stat-small { margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- 7. What we do ---------- */
.work-section { background: var(--cream); }
.work-items { margin-top: 3.5rem; display: flex; flex-direction: column; gap: 4rem; }

.work-item { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 1024px) { .work-item { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .work-item-reverse .work-image { order: 2; } }

.work-image {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 2px solid hsl(224 52% 26% / 0.25);
}
.work-image img { width: 100%; height: 18rem; object-fit: cover; }
@media (min-width: 1024px) { .work-image img { height: 20rem; } }

.work-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: hsl(38 92% 55% / 0.4);
  font-size: 1.25rem;
}
.work-title { margin-top: 1.25rem; font-family: "Fraunces", serif; font-size: 1.875rem; font-weight: 900; letter-spacing: -0.02em; }
.work-text p { margin-top: 1rem; max-width: 32rem; font-size: 1.125rem; line-height: 1.7; color: var(--muted-foreground); }

.intergenerational-box {
  margin-top: 4rem;
  border: 2px dashed hsl(224 52% 26% / 0.4);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}
.inter-title { font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 900; }
.intergenerational-box p { margin: 0.75rem auto 0; max-width: 42rem; color: var(--muted-foreground); }

/* ---------- 8. Gallery ---------- */
.gallery-grid { margin-top: 2.5rem; display: grid; gap: 1rem; }
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }

.gallery-item { overflow: hidden; border-radius: var(--radius-lg); border: 2px solid hsl(224 52% 26% / 0.2); }
.gallery-item img { width: 100%; height: 16rem; object-fit: cover; }

/* ---------- 9. Divvya ---------- */
.divvya-section { background: var(--cream); }
.divvya-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1024px) { .divvya-grid { grid-template-columns: 0.85fr 1.15fr; } }

.divvya-image { position: relative; }
.divvya-image-border {
  position: absolute;
  right: -1.25rem;
  bottom: -1.25rem;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  border: 2px solid var(--terracotta);
}
.divvya-image img { position: relative; width: 100%; border-radius: var(--radius-lg); object-fit: cover; }

.divvya-subtitle { margin-top: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--terracotta); }
.divvya-quote {
  margin-top: 1.5rem;
  border-left: 4px solid var(--marigold);
  padding-left: 1.25rem;
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.4;
}
.divvya-text p { margin-top: 1.5rem; font-size: 1.125rem; line-height: 1.7; color: var(--muted-foreground); }

/* ---------- 10. Why oral storytelling ---------- */
.why-grid { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .why-grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; } }
.why-grid p { font-size: 1.125rem; line-height: 1.7; color: var(--muted-foreground); margin-bottom: 1.25rem; }

/* ---------- 11. Join (form) ---------- */
.join-section { background: var(--cream); }
.join-grid { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .join-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

.join-body { margin-top: 1.25rem; max-width: 32rem; font-size: 1.125rem; line-height: 1.7; color: var(--muted-foreground); }
.social-buttons { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 1rem; }

.contact-form {
  border-radius: var(--radius-lg);
  border: 2px solid var(--indigo);
  background: var(--card);
  padding: 1.75rem;
  box-shadow: 10px 12px 0 hsl(38 92% 55% / 0.55);
}
.form-row { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.form-field label { font-size: 0.875rem; font-weight: 700; }
.form-field input, .form-field textarea {
  min-height: 46px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--background);
  padding: 0 1rem;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--foreground);
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--terracotta); }
.form-field textarea { padding: 1rem; resize: vertical; }

.form-submit { width: 100%; margin-top: 1.75rem; }
.form-note { margin-top: 0.75rem; text-align: center; font-size: 0.75rem; color: var(--muted-foreground); }

.form-success { text-align: center; padding: 2.5rem 0; }
.success-icon { font-size: 2rem; color: var(--terracotta); }
.success-title { margin-top: 1rem; font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 900; }
.success-body { margin-top: 0.5rem; color: var(--muted-foreground); }

/* ---------- 11b. Comments / Feedback ---------- */
.feedback-section { background: var(--background); }
.feedback-intro {
  margin-top: 1.25rem;
  max-width: 40rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--muted-foreground);
}
.feedback-grid {
  margin-top: 3rem;
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .feedback-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

/* Checkbox row */
.form-check { flex-direction: row; align-items: flex-start; gap: 0.625rem; margin-bottom: 0; }
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
}
.check-label input[type="checkbox"] {
  margin-top: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--terracotta);
  cursor: pointer;
  flex-shrink: 0;
}
.check-label span { line-height: 1.5; }

/* Community notes panel */
.notes-panel {
  border-radius: var(--radius-lg);
  border: 2px solid hsl(224 52% 26% / 0.18);
  background: var(--card);
  padding: 1.75rem;
  box-shadow: 10px 12px 0 hsl(38 92% 55% / 0.4);
}
.notes-title {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.notes-sub {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.notes-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.note-card {
  border-left: 3px solid var(--marigold);
  padding: 0.25rem 0 0.25rem 1.25rem;
}
.note-quote {
  font-family: "Fraunces", serif;
  font-size: 1.0625rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--foreground);
}
.note-attribution {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--terracotta);
}
.notes-empty {
  margin-top: 1.5rem;
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
}

/* ---------- 12. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--cream);
  padding: 3rem 1.25rem;
}
.footer-inner {
  max-width: var(--max-narrow);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.footer-deva { font-family: "Tiro Devanagari Hindi", serif; font-size: 1.5rem; color: var(--indigo); }
.footer-name { margin-top: 0.25rem; font-family: "Fraunces", serif; font-size: 1.125rem; font-weight: 600; }
.footer-desc { margin-top: 0.5rem; max-width: 24rem; font-size: 0.875rem; color: var(--muted-foreground); }

.footer-links { font-size: 0.875rem; color: var(--muted-foreground); }
.footer-links a { display: block; }
.footer-links a:hover { color: var(--terracotta); }
.footer-copyright { margin-top: 1rem; }

/* ---------- 13. Animations ---------- */
/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.reveal.reveal-delay { transition-delay: 120ms; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Hero rise */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.8s cubic-bezier(0.22,1,0.36,1) both; }
.rise-delay { animation-delay: 160ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .rise, .marker-underline { animation: none !important; }
  .marker-underline { background-size: 100% 0.42em; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
