/* SWARANTARA: shared styles */
:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --surface-2: #f4ebdc;
  --text: #2b1a14;
  --muted: #6e5a4f;
  --line: #e6d8c3;
  --accent: #b5432a;      /* sindoor red */
  --accent-2: #e08a2c;    /* saffron */
  --accent-ink: #ffffff;
  --indigo: #2f2a5a;
  --good: #2f7d4f;
  --shadow: 0 1px 2px rgba(60, 30, 10, 0.06), 0 8px 24px rgba(60, 30, 10, 0.08);
  --radius: 18px;
  --font-head: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17110f;
    --surface: #221916;
    --surface-2: #2c211d;
    --text: #f5e9dc;
    --muted: #bba797;
    --line: #3d2f29;
    --accent: #e0694b;
    --accent-2: #f0a54a;
    --accent-ink: #1b100c;
    --indigo: #b9b2f0;
    --good: #6fcf97;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 0.4em; font-weight: 700; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.08em; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: 0.95rem; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 1rem;
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none;
  transition: transform 0.1s ease, background 0.2s ease, opacity 0.2s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.small { padding: 7px 14px; font-size: 0.9rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Hero */
.hero { padding: 64px 0 40px; text-align: center; position: relative; overflow: hidden; }
.hero .devanagari { font-size: 1.2rem; color: var(--accent-2); letter-spacing: 0.1em; margin-bottom: 6px; }
.hero h1 { font-size: clamp(2.8rem, 11vw, 5.5rem); letter-spacing: 0.08em; margin-bottom: 0.15em; }
.hero .topic { font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero .btn-row { justify-content: center; }
.waves { width: 100%; height: 60px; color: var(--accent-2); opacity: 0.5; margin-top: 40px; }

/* Sections and cards */
section.block { padding: 40px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.card .icon { font-size: 1.8rem; margin-bottom: 6px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: transform 0.15s ease; }
.tool-card:hover { transform: translateY(-3px); }
.tool-card .go { margin-top: auto; color: var(--accent); font-weight: 600; }
.team .card { text-align: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.role { color: var(--muted); font-size: 0.92rem; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.9rem; margin-top: 40px; }
.site-footer p { margin: 0 0 6px; }

/* ---------- Raga Relief ---------- */
.app { padding: 32px 0 24px; }
.step { animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.mood-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 20px; }
.mood {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 120px; padding: 16px 10px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow);
  font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: center;
  transition: transform 0.12s ease, border-color 0.2s;
}
.mood:hover { transform: translateY(-2px); border-color: var(--accent-2); }
.mood .emoji { font-size: 2.4rem; line-height: 1; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0 8px; }
.scale button {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  font: inherit; font-size: 0.78rem; color: var(--muted); cursor: pointer; min-width: 0;
}
.scale button .emoji { font-size: 1.8rem; line-height: 1; }
.scale button[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-2); color: var(--text); font-weight: 600; }

.raga-card { margin: 24px 0; background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
.raga-card .name { font-family: var(--font-head); font-size: 2rem; font-weight: 700; margin: 0; }
.raga-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 0.92rem; margin: 4px 0 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 0.95rem; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--bg); }
.field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 24px; }
.field > span { font-weight: 600; }
.notice { font-size: 0.88rem; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin: 12px 0 0; }

/* Listening screen */
.listen { text-align: center; padding: 8px 0; }
.breath { position: relative; width: min(260px, 70vw); aspect-ratio: 1; margin: 18px auto 18px; display: grid; place-items: center; }
.breath .ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, var(--accent-2), var(--accent)); opacity: 0.18; animation: breathe 8s ease-in-out infinite; }
.breath .ring:nth-child(2) { inset: 14%; opacity: 0.3; animation-delay: 0.25s; }
.breath .ring:nth-child(3) { inset: 28%; opacity: 0.55; animation-delay: 0.5s; }
.breath .label { position: relative; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.35); }
.paused .breath .ring { animation-play-state: paused; }
@keyframes breathe { 0%, 100% { transform: scale(0.82); } 50% { transform: scale(1.06); } }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 12px auto; max-width: 420px; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 0.3s linear; }
.time-left { font-variant-numeric: tabular-nums; color: var(--muted); margin-bottom: 18px; }
.listen .btn-row { justify-content: center; }

.result-big { font-family: var(--font-head); font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 700; margin: 6px 0; }
.result-big .delta.up { color: var(--good); }

.stats { margin-top: 32px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin: 10px 0 14px; }
.stat-num { font-family: var(--font-head); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 0.8rem; color: var(--muted); }

/* ---------- Sleep Mode ---------- */
.sleep-setup .card { margin-top: 20px; }
select {
  font: inherit; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); max-width: 100%;
}
.scene {
  position: fixed; inset: 0; z-index: 100; cursor: pointer;
  background: #000; color: #fff; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  transition: background 1.2s linear;
  -webkit-tap-highlight-color: transparent;
}
.scene .sun {
  position: absolute; left: 50%; width: 60vmin; height: 60vmin; border-radius: 50%;
  transform: translate(-50%, -50%); filter: blur(30px);
  transition: top 1.2s linear, background 1.2s linear, opacity 1.2s linear;
}
.scene .overlay {
  position: relative; z-index: 2; padding: 16px; max-width: 420px;
  transition: opacity 0.6s ease;
}
.scene .overlay.hide { opacity: 0; pointer-events: none; }
.scene .overlay .raga { font-family: var(--font-head); font-size: 2rem; font-weight: 700; margin: 0; }
.scene .overlay .remaining { font-variant-numeric: tabular-nums; opacity: 0.8; margin-bottom: 18px; }
.scene .btn { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); color: #fff; }
.scene .btn:hover { background: rgba(255,255,255,0.2); }
.scene .btn-row { justify-content: center; }
.scene .goodnight { font-family: var(--font-head); font-size: 2.6rem; opacity: 0; transition: opacity 3s ease; position: absolute; z-index: 1; color: #f6c99a; pointer-events: none; }
.scene .goodnight.show { opacity: 0.7; }
.scene .hint { position: absolute; bottom: 20px; left: 0; right: 0; font-size: 0.85rem; opacity: 0.5; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .site-header .wrap { justify-content: center; padding-top: 8px; padding-bottom: 8px; }
  .scale button { font-size: 0.68rem; padding: 10px 2px; }
  .scale button .emoji { font-size: 1.5rem; }
  .mood-grid { grid-template-columns: repeat(2, 1fr); }
}
