:root {
  --bg: #f6f2e8;
  --surface: #fffdf8;
  --text: #24201a;
  --muted: #625949;
  --accent: #b14d00;
  --accent-soft: #ffe9d6;
  --border: #eadcc9;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
  --font-display: "Cinzel", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 18% -6%, #fffef9 0, #fff8ec 30%, transparent 58%),
    radial-gradient(circle at 88% 8%, var(--accent-soft) 0, transparent 36%),
    radial-gradient(circle at 12% 20%, #fffaf2 0, transparent 30%),
    linear-gradient(160deg, #fffaf3 0, #f9f2e7 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(177, 77, 0, 0.08) 0 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.35;
  z-index: -1;
}

.container {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.hero {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(140deg, #fffefb 0, #fff6ea 48%, #ffedd8 100%);
  padding: 20px;
  box-shadow: 0 10px 28px rgba(48, 40, 30, 0.12);
  margin-bottom: 14px;
  overflow: hidden;
}

.hero::before,
.hero::after {
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -55% auto auto -10%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 233, 214, 0.68) 0, transparent 70%);
}

.hero::after {
  content: "✦ ✦";
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--accent);
  opacity: 0.8;
  font-size: 1rem;
  letter-spacing: 0.24em;
}

.hero-head {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.hero-copy {
  flex: 1;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(234, 220, 201, 0.9);
  border-radius: 14px;
  padding: 10px 12px;
}

.hero-kicker {
  margin: 0;
  color: #0b3ea8;
  font-size: 0.98rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-shadow: none;
}

.divine-logo {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid #ffd84a;
  background: radial-gradient(circle at 35% 30%, #0f3272 0, #072057 45%, #031137 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 10px rgba(255, 207, 64, 0.9),
    0 0 24px rgba(255, 207, 64, 0.55),
    inset 0 0 8px rgba(255, 223, 107, 0.45);
  flex-shrink: 0;
  animation: divinePulse 4.8s ease-in-out infinite;
}

.divine-logo-mark {
  color: #ffd84a;
  font-size: 2.85rem;
  line-height: 1;
  font-weight: 900;
  text-shadow: 0 0 6px rgba(255, 219, 107, 0.85), 0 0 16px rgba(255, 191, 43, 0.7);
}

.hero h1 {
  margin: 6px 0 0;
  font-size: 2.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: #1f1a12;
  letter-spacing: 0.015em;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hero p {
  margin: 12px 0 0;
  color: #3f362a;
  font-size: 1.02rem;
  font-weight: 500;
  max-width: 800px;
}

.hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hero-chips span {
  border: 1px solid #d5b895;
  border-radius: 999px;
  padding: 7px 13px;
  background: #fff9f0;
  color: #8e3a00;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hero-chips span:hover {
  transform: translateY(-1px);
  background: #fff6ea;
}

.sacred-divider {
  text-align: center;
  margin: 10px 0 16px;
  color: var(--accent);
  letter-spacing: 0.32em;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  opacity: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
}

.welcome-banner {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  column-gap: 16px;
  row-gap: 10px;
  margin-bottom: 18px;
  background: linear-gradient(120deg, #fffefb 0, #fff5e8 56%, #ffe8cc 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 10px 26px rgba(48, 40, 30, 0.1);
  overflow: hidden;
}

.welcome-banner::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -54px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(177, 77, 0, 0.12) 0, transparent 68%);
  pointer-events: none;
}

.welcome-kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  grid-column: 1 / 2;
}

.welcome-banner h2 {
  margin: 2px 0 0;
  font-size: 1.68rem;
  font-family: var(--font-display);
  letter-spacing: 0.015em;
  line-height: 1.25;
  grid-column: 1 / 2;
}

.welcome-banner p {
  margin: 0;
  color: #5f5443;
  line-height: 1.6;
}

.welcome-banner > p:not(.welcome-kicker):not(.rotating-message) {
  grid-column: 1 / 2;
  font-size: 1rem;
}

.rotating-message {
  margin-top: 2px;
  color: var(--accent);
  font-weight: 700;
  min-height: 2.5em;
  border: 1px solid #efdac3;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.92);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  grid-column: 1 / 2;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.did-you-know {
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(160deg, #fffdf9 0, #fff4e4 100%);
  box-shadow: 0 4px 12px rgba(48, 40, 30, 0.08);
  grid-column: 2 / 3;
  grid-row: 1 / span 4;
  align-self: stretch;
}

.did-you-know-title {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.did-you-know-text {
  margin-top: 6px;
  color: var(--muted);
  min-height: 4.5em;
  line-height: 1.55;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.sankalpa-controls {
  display: grid;
  grid-template-columns: 1.2fr 180px auto auto;
  gap: 8px;
  align-items: center;
}

.reminder-controls {
  display: grid;
  grid-template-columns: 1fr 180px 160px 1.2fr auto;
  gap: 8px;
  align-items: center;
}

.reminder-toggle {
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reminder-toggle input {
  width: 18px;
  height: 18px;
}

#reminderStatus {
  margin-top: 10px;
}

#sankalpaSummary {
  margin-top: 10px;
}

#sankalpaStreak {
  margin-top: 6px;
}

.message-fade {
  opacity: 0.2;
  transform: translateY(2px);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 220px 240px 220px 260px;
  gap: 12px;
}

input,
select,
button {
  font: inherit;
  min-height: 44px;
}

input,
select {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.result-count {
  margin: 14px 2px;
  color: var(--muted);
}

.featured {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-top: 12px;
}

.featured img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: center top;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f0e5d4;
}

.featured-content h2 {
  margin: 4px 0 8px;
}

.featured-type {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
}

.featured-purpose {
  margin: 8px 0 0;
  font-weight: 600;
}

.featured-history {
  margin: 8px 0 0;
  color: var(--muted);
}

.grid {
  display: block;
  margin-top: 6px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(48, 40, 30, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(48, 40, 30, 0.08);
}

.grid .card {
  width: 100%;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.mantra {
  margin: 8px 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.section-title {
  margin: 12px 0 4px;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.devanagari {
  font-size: 1.03rem;
}

.tamil-text {
  font-size: 1.06rem;
}

.meaning {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 12px;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.98);
}

button:active {
  transform: translateY(1px);
}

@keyframes divinePulse {
  0%,
  100% {
    box-shadow: 0 2px 10px rgba(48, 40, 30, 0.08);
  }
  50% {
    box-shadow: 0 3px 14px rgba(177, 77, 0, 0.22);
  }
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: #232018;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  margin: 0 auto 24px;
  max-width: 1100px;
  padding: 0 16px;
}

.site-footer p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
}

.hidden {
  display: none;
}

.mantra-info {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.mantra-info h3 {
  margin: 0 0 8px;
}

.pill-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.pill-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.9rem;
}

#historyList {
  margin: 0;
  padding-left: 18px;
}

#historyList li {
  margin: 6px 0;
  color: var(--muted);
}

.script-mode {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

#knowList {
  margin: 0;
  padding-left: 18px;
}

#knowList li {
  margin: 6px 0;
  color: var(--muted);
}

.chant-text {
  font-size: 1.15rem;
  line-height: 1.7;
  margin: 8px 0;
}

.chant-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.chant-controls label {
  color: var(--muted);
  font-weight: 600;
}

.breath-cue {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
}

.breath-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(177, 77, 0, 0.28);
  animation: inhalePulse 4s ease-in-out infinite;
}

.breath-dot.exhale {
  animation-name: exhalePulse;
}

.mala-wrap {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.mala-ring {
  --mala-progress: 0%;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--mala-progress), var(--accent-soft) var(--mala-progress));
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
}

.mala-ring span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

#malaProgressText {
  margin: 0;
}

@keyframes inhalePulse {
  0%,
  100% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(177, 77, 0, 0.28);
  }
  50% {
    transform: scale(1.25);
    box-shadow: 0 0 0 10px rgba(177, 77, 0, 0);
  }
}

@keyframes exhalePulse {
  0%,
  100% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(177, 77, 0, 0);
  }
  50% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(177, 77, 0, 0.24);
  }
}

#templeList {
  margin: 0;
  padding-left: 18px;
}

#templeList li {
  margin: 6px 0;
}

#templeList a {
  color: var(--accent);
  text-decoration: none;
}

#templeList a:hover {
  text-decoration: underline;
}

#muruganAruDetails {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fffaf2;
}

#muruganAruDetails summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

#muruganAruList {
  margin: 8px 0 0;
  padding-left: 18px;
}

#muruganAruList li {
  margin: 6px 0;
}

@media (max-width: 760px) {
  .container {
    padding: 16px 12px 28px;
  }

  .hero-head {
    align-items: flex-start;
  }

  .hero {
    padding: 12px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .welcome-banner h2 {
    font-size: 1.28rem;
  }

  .welcome-banner {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .welcome-kicker,
  .welcome-banner h2,
  .welcome-banner > p:not(.welcome-kicker):not(.rotating-message),
  .rotating-message,
  .did-you-know {
    grid-column: 1 / 2;
  }

  .did-you-know {
    grid-row: auto;
  }

  .did-you-know-text {
    min-height: 0;
  }

  .divine-logo {
    width: 54px;
    height: 54px;
  }

  .divine-logo-mark {
    font-size: 1.9rem;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .sankalpa-controls {
    grid-template-columns: 1fr;
  }

  .reminder-controls {
    grid-template-columns: 1fr;
  }

  .featured {
    grid-template-columns: 1fr;
  }

  .featured img {
    height: auto;
    max-height: 280px;
  }

  .chant-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .mala-wrap {
    align-items: flex-start;
  }

}
