/* ==========================================================================
   Raag Explorer — palette borrowed from mysanthiya.com (navy + warm gold)
   ========================================================================== */
:root {
  --blue: #15376b;
  --blue-dark: #0d2447;
  --blue-soft: #eaf0fa;
  --orange: #e6ab1f;
  --orange-dark: #bd8814;
  --orange-soft: #fcf3da;

  --ink: #1a2030;
  --ink-soft: #5c6577;
  --ink-faint: #a3aab9;

  --page-bg: #fbfbfc;
  --header-bg: #f4f7fc;
  --surface: #ffffff;
  --line: #e7e9ef;
  --line-strong: #d4d8e2;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 14px 30px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);

  --radius: 14px;
  --radius-lg: 22px;
  --content-max: 1180px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Cormorant Garamond", "Iowan Old Style", "Baskerville", Georgia, serif;
  --font-gurmukhi: "Noto Sans Gurmukhi", "Inter", sans-serif;

  /* Thaat accent colours (distinct, but tuned to sit beside navy + gold) */
  --thaat-Bilawal:  #2f9e6f;
  --thaat-Khamaj:   #d97706;
  --thaat-Kafi:     #0ea5a4;
  --thaat-Bhairav:  #b4436c;
  --thaat-Bhairavi: #7c3aed;
  --thaat-Asavari:  #64748b;
  --thaat-Todi:     #c026d3;
  --thaat-Purvi:    #4f46e5;
  --thaat-Marwa:    #dc6803;
  --thaat-Kalyan:   #2563eb;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(230,171,31,0.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 0%, rgba(21,55,107,0.08), transparent 55%),
    var(--page-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

:lang(pa), .gurmukhi { font-family: var(--font-gurmukhi); }

a { color: var(--blue); }

.wrap { max-width: var(--content-max); margin: 0 auto; padding: 0 22px; }

/* ---------- Header / hero ---------- */
.hero {
  background:
    radial-gradient(900px 380px at 85% -40%, rgba(230,171,31,0.30), transparent 60%),
    linear-gradient(160deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  padding: 34px 0 30px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: auto 0 -1px 0; height: 5px;
  background: linear-gradient(90deg, var(--orange), var(--orange-dark));
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--orange), var(--orange-dark));
  color: var(--blue-dark); font-weight: 800; font-size: 24px;
  box-shadow: var(--shadow-md);
}
.brand h1 { margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: 0.2px; }
.brand .gur { font-family: var(--font-gurmukhi); font-size: 15px; color: var(--orange-soft); opacity: 0.95; }
.hero-tag { max-width: 560px; margin: 16px 0 0; font-size: 16px; color: #dbe4f4; }
.hero-tag b { color: #fff; }

.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px; padding: 7px 15px; font-size: 13.5px;
  display: inline-flex; gap: 7px; align-items: center;
}
.stat b { color: var(--orange); }

/* ---------- Controls / toolbar ---------- */
.toolbar { position: sticky; top: 0; z-index: 20; background: rgba(251,251,252,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 14px 0; }
.toolbar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.search {
  flex: 1 1 260px; min-width: 220px; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px;
  padding: 0 16px; height: 46px; box-shadow: var(--shadow-sm); transition: border-color var(--transition), box-shadow var(--transition);
}
.search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(230,171,31,0.18); }
.search svg { flex: none; color: var(--ink-faint); }
.search input { border: 0; outline: 0; background: transparent; font-size: 15.5px; width: 100%; color: var(--ink); font-family: inherit; }

.select-group { display: flex; gap: 10px; flex-wrap: wrap; }
.select {
  position: relative; display: inline-flex; align-items: center;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 999px;
  height: 46px; padding: 0 6px 0 15px; box-shadow: var(--shadow-sm);
}
.select label { font-size: 12px; color: var(--ink-soft); margin-right: 7px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.select select { border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--blue); padding: 0 26px 0 0; height: 100%; cursor: pointer; -webkit-appearance: none; appearance: none; }
.select::after { content: "▾"; position: absolute; right: 14px; color: var(--ink-faint); pointer-events: none; }

.btn {
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--blue);
  height: 46px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14.5px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: var(--transition); font-family: inherit;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--orange); color: var(--orange-dark); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(150deg, var(--orange), var(--orange-dark)); color: #fff; border-color: transparent; }
.btn.primary:hover { color: #fff; filter: brightness(1.05); }
.btn.ghost { background: transparent; box-shadow: none; }

.result-line { margin: 16px 0 4px; color: var(--ink-soft); font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-line b { color: var(--ink); }
.chip-clear { color: var(--orange-dark); cursor: pointer; font-weight: 700; }

/* ---------- Card grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 14px 0 60px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent, var(--orange)); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-name { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--blue-dark); line-height: 1.1; }
.card-gur { font-family: var(--font-gurmukhi); font-size: 17px; color: var(--orange-dark); margin-top: 3px; }
.card-num { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); white-space: nowrap;
}
.badge.thaat { background: color-mix(in srgb, var(--accent) 15%, white); color: var(--accent); }
.badge.time { background: var(--orange-soft); color: var(--orange-dark); }
.badge.sggs { background: #eafaf1; color: #1a8f5e; }
.badge.variant-badge { background: var(--blue-soft); color: var(--blue); }
.card.variant { border-style: dashed; }
.card.variant::before { opacity: 0.6; }
.modal-eyebrow { font-size: 12.5px; font-weight: 700; color: var(--orange-soft); letter-spacing: 0.3px; margin-bottom: 4px; text-transform: uppercase; }
.modal-eyebrow .link-parent { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.modal-eyebrow .link-parent:hover { color: var(--orange); }
.card-swar { font-size: 12.5px; color: var(--ink-soft); border-top: 1px dashed var(--line); padding-top: 10px; }
.card-swar .lbl { color: var(--ink-faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 10.5px; }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty .big { font-size: 42px; margin-bottom: 10px; }

/* ---------- Modal / detail ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(13,36,71,0.55); backdrop-filter: blur(3px); display: none; z-index: 60; padding: 24px; overflow-y: auto; }
.modal-back.open { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 720px; width: 100%;
  margin: auto; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 220ms cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes pop { from { transform: translateY(14px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-hd { background: linear-gradient(160deg, var(--blue), var(--blue-dark)); color: #fff; padding: 24px 26px; position: relative; }
.modal-hd::after { content:""; position:absolute; left:0; right:0; bottom:0; height:4px; background: var(--accent, var(--orange)); }
.modal-hd .close { position: absolute; top: 16px; right: 18px; background: rgba(255,255,255,0.14); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; cursor: pointer; transition: var(--transition); }
.modal-hd .close:hover { background: rgba(255,255,255,0.28); }
.modal-hd h2 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 600; }
.modal-hd .gur { font-family: var(--font-gurmukhi); font-size: 21px; color: var(--orange-soft); margin-top: 2px; }
.modal-hd .subline { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.modal-hd .subline .badge { background: rgba(255,255,255,0.15); color: #fff; }

.modal-body { padding: 22px 26px 26px; }
.note-box { background: var(--orange-soft); border-left: 4px solid var(--orange); border-radius: 8px; padding: 12px 15px; font-size: 14.5px; color: #6b4e0e; margin-bottom: 20px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.fact { background: var(--header-bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-faint); font-weight: 700; }
.fact .v { font-size: 15.5px; font-weight: 700; color: var(--blue-dark); margin-top: 3px; }
.fact .v small { font-family: var(--font-gurmukhi); color: var(--ink-soft); font-weight: 500; font-size: 13px; display: block; }

.swar-block { margin-bottom: 16px; }
.swar-block h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--ink-soft); }
.swar-line { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.swar-line .roman { font-size: 15.5px; font-weight: 600; color: var(--ink); letter-spacing: 0.3px; }
.swar-line .gur { font-family: var(--font-gurmukhi); font-size: 16px; color: var(--orange-dark); margin-top: 4px; }

.related h3 { font-family: var(--font-display); font-size: 19px; color: var(--blue-dark); margin: 22px 0 10px; }
.related-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1.5px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: var(--transition); color: var(--blue); display: inline-flex; gap: 7px; align-items: center; }
.pill:hover { border-color: var(--accent, var(--orange)); color: var(--accent, var(--orange-dark)); transform: translateY(-1px); }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; }
.pill small { color: var(--ink-faint); font-weight: 600; }
.related .none { color: var(--ink-faint); font-size: 13.5px; }

/* ---------- Clock ---------- */
.clock-back { position: fixed; inset: 0; background: rgba(13,36,71,0.55); backdrop-filter: blur(3px); display: none; z-index: 70; padding: 24px; overflow-y: auto; }
.clock-back.open { display: flex; align-items: flex-start; justify-content: center; }
.clock-modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 760px; width: 100%; margin: auto; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 220ms cubic-bezier(0.2,0.8,0.2,1); }
.clock-hd { background: linear-gradient(160deg, var(--blue), var(--blue-dark)); color: #fff; padding: 20px 24px; position: relative; }
.clock-hd::after { content:""; position:absolute; left:0; right:0; bottom:0; height:4px; background: linear-gradient(90deg,var(--orange),var(--orange-dark)); }
.clock-hd h2 { margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.clock-hd p { margin: 4px 0 0; color: #cfdcf1; font-size: 14px; }
.clock-hd .close { position: absolute; top: 16px; right: 18px; background: rgba(255,255,255,0.14); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.clock-hd .close:hover { background: rgba(255,255,255,0.28); }
.clock-body { padding: 18px 24px 26px; display: grid; grid-template-columns: 1fr; gap: 10px; }
.clock-wrap { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 22px; align-items: start; }
.clock-side { max-height: 420px; overflow-y: auto; padding-right: 4px; }
@media (max-width: 640px) { .clock-wrap { grid-template-columns: 1fr; } }
.now-banner { background: var(--orange-soft); border: 1px solid var(--orange); border-radius: 12px; padding: 12px 15px; margin-bottom: 4px; }
.now-banner .time { font-weight: 800; color: var(--orange-dark); font-size: 15px; }
.now-banner .list { margin-top: 4px; font-size: 14px; color: var(--ink); }
.now-banner .list b { color: var(--blue-dark); }
#clockSvg { width: 100%; height: auto; display: block; }
.clock-dot { cursor: pointer; transition: r 120ms ease; }
.clock-dot:hover { r: 8; }
.clock-side h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-soft); }
.clock-side .list-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; cursor: pointer; transition: background var(--transition); }
.clock-side .list-item:hover { background: var(--header-bg); }
.clock-side .list-item .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.clock-side .list-item .nm { font-weight: 700; color: var(--blue-dark); font-size: 14.5px; }
.clock-side .list-item .tm { color: var(--ink-faint); font-size: 12.5px; margin-left: auto; }
.clock-side .list-subhead { margin: 12px 0 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-soft); }
.clock-side .list-item.variant .nm { font-weight: 600; font-size: 13.5px; }
.clock-side .list-item.variant .vparent { font-weight: 400; color: var(--ink-faint); font-size: 12px; }
.now-banner .vcount { color: var(--ink-soft); font-weight: 600; }
.legend .notation-note { margin-left: auto; color: var(--ink-soft); font-size: 12.5px; }
.legend .notation-note b { color: var(--blue-dark); font-weight: 700; }

/* ---------- Legend ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 26px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.legend .li { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.legend .li .dot { width: 11px; height: 11px; border-radius: 50%; }

footer.site { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--ink-soft); font-size: 13px; text-align: center; }
footer.site b { color: var(--ink); }
footer.site a { color: var(--blue); }
