/* ============================================
   INDIA BHIMRAYA — Digital Documentary Platform
   Design System & Styles
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Primary Palette - Vivid Blues */
  --primary-blue: #1e3a6e;
  --accent-blue: #2b6cb0;
  --royal-blue: #1a365d;
  
  /* Earthy Palette - Warm & Rich */
  --earthy-brown: #4a2e14;
  --light-brown: #c49a5c;
  --gold-accent: #d4a937;
  --warm-sand: #edddc0;
  
  /* Backgrounds - Warm Vintage Parchment (bright but textured) */
  --cream-bg: #ece2c6;
  --cream-light: #f4edda;
  --dark-bg: #1a1612;
  
  /* Text - High Contrast */
  --text-dark: #111111;
  --text-body: #2a2a2a;
  --text-muted: #555555;
  --text-light: #fdfbf7;
  
  /* Utility */
  --white: #ffffff;
  --border-ornate: #2952a3;
  --shadow-soft: 0 4px 20px rgba(0,35,102,0.10);
  --shadow-hover: 0 12px 40px rgba(0,35,102,0.22);
  --shadow-card: 0 8px 30px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: 1.25rem;
  background-color: var(--cream-bg);
  background-image: 
    /* Aged parchment vignette */
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(90, 60, 30, 0.20) 150%),
    /* Warm water-stain spots */
    radial-gradient(ellipse at 80% 20%, rgba(139, 90, 43, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 10% 80%, rgba(100, 70, 40, 0.06) 0%, transparent 50%),
    /* Crumpled paper texture */
    url('../assets/paper-texture.png');
  background-size: auto, auto, auto, 600px 600px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-blend-mode: normal, normal, normal, soft-light;
  color: #1f1510;
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-weight: 700;
  color: var(--primary-blue);
  line-height: 1.2;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---- Ornate Border Motif (inspired by the illustration) ---- */
.ornate-border {
  border: 3px solid var(--border-ornate);
  position: relative;
}

.ornate-border::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(26, 58, 138, 0.3);
  pointer-events: none;
  z-index: 1;
}

/* ---- Ashoka Chakra (CSS-only) ---- */
.ashoka-chakra {
  width: 80px;
  height: 80px;
  border: 3px solid var(--accent-blue);
  border-radius: 50%;
  position: relative;
  display: inline-block;
  animation: chakra-spin 20s linear infinite;
}

.ashoka-chakra::before {
  content: '☸';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 42px;
  color: var(--accent-blue);
}

@keyframes chakra-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- Navbar ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0.8rem 0;
  background-color: rgba(236, 226, 198, 0.93);
  background-image: url('../assets/paper-texture.png');
  background-size: 400px 400px;
  background-blend-mode: soft-light;
  backdrop-filter: blur(12px) sepia(0.15);
  -webkit-backdrop-filter: blur(12px) sepia(0.15);
  z-index: 1000;
  border-bottom: 2px solid var(--accent-blue);
  transition: all var(--transition);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-soft);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--primary-blue);
  letter-spacing: -0.5px;
}

.brand img {
  height: 55px;
  width: auto;
  mix-blend-mode: multiply;
  filter: contrast(1.15) brightness(0.98);
}

.brand span {
  display: none; /* The new logo has text built-in */
}

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

.nav-links a {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--royal-blue);
  position: relative;
  padding: 0.3rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--accent-blue);
}

/* Mobile Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--primary-blue);
  transition: var(--transition);
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: 70px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: multiply;
  opacity: 0.45;
  filter: grayscale(60%) sepia(60%) hue-rotate(5deg) contrast(1.1) brightness(1.0);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 95%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 95%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* Vintage vignette matching parchment edges */
  background: radial-gradient(
    circle at center,
    transparent 40%,
    rgba(236, 226, 198, 0.5) 78%,
    rgba(28, 24, 21, 0.3) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 900px;
  padding: 2rem;
}

.hero-logo-wrapper {
  margin-bottom: 2rem;
  position: relative;
}

.hero-logo {
  max-width: 550px;
  width: 85%;
  margin: 0 auto;
  transform: translateY(10px);
  mix-blend-mode: multiply;
  filter: contrast(1.1);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--white);
  text-shadow: 2px 4px 8px rgba(0,0,0,0.4);
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.hero-title .title-india {
  font-style: italic;
  font-weight: 400;
  opacity: 0.9;
}

.hero-title .title-bhimraya {
  font-weight: 800;
  display: block;
  font-size: 1.15em;
  background: linear-gradient(135deg, var(--white), #a8c8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  font-weight: 600;
  color: var(--primary-blue);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.hero-chakra {
  width: 60px;
  height: 60px;
  border: 2px solid var(--primary-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: chakra-spin 15s linear infinite;
}

.hero-chakra span {
  font-size: 32px;
  color: var(--primary-blue);
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: bounce 2s ease infinite;
}

.scroll-indicator span {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid rgba(255,255,255,0.6);
  border-bottom: 2px solid rgba(255,255,255,0.6);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ============================================
   PILLARS GRID SECTION
   ============================================ */
.pillars-section {
  padding: 6rem 0;
  background-color: var(--cream-bg);
  background-image: url('../assets/paper-texture.png');
  background-size: 600px 600px;
  background-blend-mode: soft-light;
  position: relative;
}

.pillars-section::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  height: 80px;
  background: var(--cream-light);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: capitalize;
  color: var(--gold-accent);
  margin-bottom: 0.75rem;
  display: block;
}

.section-title {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: clamp(3rem, 6vw, 4.5rem);
  color: var(--royal-blue);
  position: relative;
  display: inline-block;
  font-weight: 700;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--gold-accent));
  margin: 1rem auto 0;
  border-radius: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ---- Pillar Card ---- */
.pillar-card {
  background-color: var(--cream-light);
  background-image: url('../assets/paper-texture.png');
  background-size: 350px 350px;
  background-blend-mode: soft-light;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.pillar-card::before {
  content: '☸';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  font-size: 120px;
  color: var(--accent-blue);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.pillar-card:hover::before {
  opacity: 0.04;
  transform: translate(-50%, -50%) scale(1) rotate(45deg);
}

.pillar-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-img-wrapper {
  height: 220px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  mix-blend-mode: multiply;
  filter: sepia(0.2) contrast(1.1) brightness(1.05);
}

.pillar-card:hover .card-img-wrapper img {
  transform: scale(1.08);
}

.card-img-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, rgba(0,0,0,0.15));
  pointer-events: none;
}

.card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  border-top: 3px solid var(--gold-accent);
}

.card-content h3 {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: 2.4rem;
  color: var(--primary-blue);
  margin-bottom: 0.1rem;
  font-weight: 700;
}

.card-content .card-subtitle {
  font-size: 0.9rem;
  color: var(--light-brown);
  font-weight: 600;
  font-style: italic;
}

.card-content .card-devanagari {
  font-size: 1rem;
  color: var(--accent-blue);
  margin-top: 0.3rem;
  font-weight: 600;
}

/* ============================================
   STORY / PHOTO ESSAY LAYOUT (Pillar Pages)
   ============================================ */
.story-page {
  min-height: 100vh;
  padding-top: 70px;
  background-color: var(--cream-bg);
  background-image: 
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(90, 60, 30, 0.18) 150%),
    url('../assets/paper-texture.png');
  background-size: auto, 600px 600px;
  background-repeat: no-repeat, repeat;
  background-blend-mode: normal, soft-light;
}

.story-hero {
  position: relative;
  height: 70vh;
  min-height: 500px;
  overflow: hidden;
}

.story-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  filter: sepia(0.15) contrast(1.05) brightness(1.0);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
}

.story-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

.story-hero-title {
  position: absolute;
  bottom: 3rem;
  left: 3rem;
  z-index: 2;
  color: var(--white);
}

.story-hero-title h1 {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  color: var(--cream-light);
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.story-hero-title .title-devanagari {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  opacity: 0.85;
  font-style: italic;
}

.story-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
  position: relative;
}

.story-legend {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: 1.6rem;
  font-style: italic;
  color: var(--text-body);
  border-left: 4px solid var(--gold-accent);
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  margin-bottom: 2.5rem;
  background: rgba(212, 169, 55, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.6;
}

.story-legend strong {
  color: var(--primary-blue);
  font-style: normal;
  font-weight: 600;
}

.story-text {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: 1.5rem;
  line-height: 1.8;
  color: var(--text-dark);
  margin-bottom: 2rem;
}

.story-text p {
  margin-bottom: 1.5rem;
}

/* Ornate 17th Century Tailpiece divider */
.ornate-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 4rem 0;
  color: var(--gold-accent);
  opacity: 0.9;
}

.ornate-divider::before,
.ornate-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
}

.ornate-divider span {
  font-size: 2.5rem;
  padding: 0 1rem;
  font-family: 'Times New Roman', Times, serif;
}

/* Navigation between pillars */
.story-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid rgba(0,35,102,0.1);
  margin-top: 3rem;
}

.story-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--primary-blue);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--primary-blue);
  transition: all var(--transition);
}

.story-nav a:hover {
  background: var(--primary-blue);
  color: var(--white);
}

.story-nav .nav-all {
  background: var(--accent-blue);
  color: var(--white);
  border-color: var(--accent-blue);
}

.story-nav .nav-all:hover {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

/* ============================================
   R-STAMP & FOOTER
   ============================================ */
.r-stamp-section {
  text-align: center;
  padding: 2rem 0;
  opacity: 0.6;
}

.r-stamp-icon {
  font-size: 3rem;
  display: inline-flex;
  width: 70px;
  height: 70px;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--earthy-brown);
  border-radius: 50%;
  color: var(--earthy-brown);
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-weight: 700;
  position: relative;
}

.r-stamp-icon::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--earthy-brown);
  border-radius: 50%;
}

.site-footer {
  background-color: var(--dark-bg);
  background-image: url('../assets/paper-texture.png');
  background-size: 500px 500px;
  background-blend-mode: overlay;
  color: var(--text-light);
  text-align: center;
  padding: 4rem 0 2rem;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--gold-accent), var(--accent-blue));
}

.footer-brand {
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--white);
}

.footer-chakra {
  font-size: 2rem;
  color: rgba(255,255,255,0.2);
  margin: 1.5rem 0;
  animation: chakra-spin 20s linear infinite;
  display: inline-block;
}

.footer-text {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 1rem;
}

.footer-stamp {
  display: inline-flex;
  width: 60px;
  height: 60px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  color: rgba(255,255,255,0.5);
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-weight: 700;
  font-size: 2rem;
  margin: 1rem 0;
}

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: 'Lucida Handwriting', 'Mistral', 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.5rem;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-blue);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ============================================
   FADE-IN ANIMATION (Scroll-triggered via JS)
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 992px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--cream-light);
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right var(--transition);
  }

  .nav-links.open {
    right: 0;
  }

  .hamburger {
    display: flex;
  }

  .hero-logo {
    max-width: 280px;
    width: 70%;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .card-img-wrapper {
    height: 200px;
  }

  .story-hero {
    height: 50vh;
    min-height: 350px;
  }

  .story-hero-title {
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
  }

  .story-body {
    padding: 2.5rem 1.5rem;
  }

  .story-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .story-nav a {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1.25rem;
  }
  
  .pillars-section {
    padding: 4rem 0;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .card-content h3 {
    font-size: 1.2rem;
  }
}
