/* --- 1. Root Variables & Foundational Styles --- */
:root {
  /* Color Palette: Refined for a softer, more premium feel. */
  --text-color: #1a1a1c; /* Slightly softer than pure black */
  --accent-color: #007aff;
  --background-color: #fbfbfd; /* A subtle off-white, easier on the eyes */
  --secondary-text: #5a5a5f; /* Darker grey for better readability */
  --border-color: #d6d6db;
  --ui-background: #f5f5f7; /* For UI elements like toggles and inputs */

  /* Typography */
  --font-en:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hi: 'Noto Serif Devanagari', serif;

  /* Sizing & Spacing */
  --radius: 14px; /* Slightly larger radius for a modern look */
  --content-width: 840px; /* Increased width for a more expansive feel */
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-en);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6; /* Set a comfortable base line-height */
}

/* Set Hindi font for elements with lang="hi" */
[lang='hi'] {
  font-family: var(--font-hi);
}

.main-container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px; /* Increased vertical padding */
}

/* --- 2. Layout & Section Styling --- */
.section {
  padding: 48px 0; /* Increased spacing between sections */
  border-bottom: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s ease-out,
    transform 0.7s ease-out;
}
.section:last-of-type {
  border-bottom: none;
}
.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- 3. Header: Logo & Language Toggle --- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 32px;
}

.logo {
  font-weight: 700;
  font-size: 1.75rem; /* Slightly larger logo */
  letter-spacing: -1.2px;
}

.lang-toggle {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  position: relative;
  background-color: var(--ui-background);
}

.lang-toggle button {
  background: none;
  border: none;
  padding: 8px 18px; /* More padding */
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--secondary-text);
  transition: color 0.3s ease;
  z-index: 2;
}

.lang-toggle button.active {
  color: var(--text-color); /* Active text is primary, not white */
}

.lang-toggle .glider {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  background-color: var(--background-color); /* Glider is background color */
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 1;
}

/* --- 4. Typography --- */
.hero-title {
  font-size: 4.5rem; /* Larger hero title */
  font-weight: 700;
  text-align: center;
  letter-spacing: -2.5px;
  line-height: 1.05;
  color: var(--text-color);
}

/* KEY CHANGE: Larger, more readable story text */
.story-text p {
  font-size: 1.3rem; /* Significantly larger font size (approx 21px) */
  line-height: 1.8; /* More space between lines for readability */
  margin-bottom: 2em; /* More space between paragraphs */
  color: var(--secondary-text);
}
[lang='hi'] .story-text p {
  font-size: 1.4rem; /* Hindi text can be slightly larger for clarity */
  line-height: 1.9;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.drop-cap {
  font-size: 4.5em; /* Adjusted to match new paragraph size */
  font-weight: 700;
  float: left;
  line-height: 0.7em;
  margin-right: 0.1em;
  color: var(--text-color);
}

/* --- 5. Founder Identity --- */
.founder-identity {
  display: flex;
  align-items: center;
  gap: 24px; /* More space */
  background-color: var(--ui-background);
  padding: 24px;
  border-radius: var(--radius);
}

.founder-photo-wrapper {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.founder-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--background-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.founder-fallback {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: white;
  display: none; /* Initially hidden */
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
}

.founder-details h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
  font-weight: 600;
}

.founder-details p {
  color: var(--secondary-text);
  font-size: 1rem;
}

/* --- 6. Forms & Buttons --- */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
}

.action-link,
.btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.action-link:hover,
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.25);
}

.btn-primary {
  background-color: var(--accent-color);
  color: var(--background-color);
  border: none;
  cursor: pointer;
}

.btn-secondary {
  background-color: #e8e8ed;
  color: var(--text-color);
}

.form-instructions {
  font-size: 1rem;
  color: var(--secondary-text);
  margin-top: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
}

.map-link {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-input {
  width: 100%;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-family: var(--font-en);
  background-color: var(--ui-background);
  transition: all 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
  background-color: var(--background-color);
}

/* Custom Checkbox Styling */
.custom-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
}

.custom-checkbox-wrapper input[type='checkbox'] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 7px;
  cursor: pointer;
  position: relative;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  flex-shrink: 0;
}

.custom-checkbox-wrapper input[type='checkbox']:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.custom-checkbox-wrapper input[type='checkbox']:checked::after {
  content: '✔';
  color: white;
  font-size: 16px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
}

.custom-checkbox-wrapper label {
  cursor: pointer;
  color: var(--secondary-text);
  font-weight: 500;
  font-size: 1.05rem;
}

#donorInfo {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    height 0.3s ease;
  overflow: hidden;
}

/* --- 7. Footer --- */
.footer {
  padding-top: 48px;
  text-align: center;
  color: var(--secondary-text);
  font-size: 1rem;
}
.footer-links a {
  color: var(--secondary-text);
  text-decoration: none;
  margin: 0 10px;
}
.footer-links a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}
.whatsapp-contact {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #25d366;
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease;
}
.whatsapp-contact:hover {
  transform: scale(1.05);
}

/* --- 8. Accessibility & Responsiveness --- */
:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .main-container {
    padding: 24px 16px;
  }
  .hero-title {
    font-size: 3.5rem;
    letter-spacing: -2px;
  }
  .story-text p {
    font-size: 1.2rem; /* Slightly smaller on tablets */
  }
  [lang='hi'] .story-text p {
    font-size: 1.3rem;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2.8rem;
  }
  .story-text p {
    font-size: 1.15rem; /* Maintain readability on mobile */
  }
  [lang='hi'] .story-text p {
    font-size: 1.25rem;
  }
  .founder-identity {
    flex-direction: column;
    text-align: center;
  }
}
