/* The Jyotish Project Resources. Built on the 16 city looks from jyotish.labs (looks/tokens.css). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--font-sans); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sa { font-family: var(--font-serif), "Noto Serif Devanagari", serif; }
.ia { font-style: italic; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* top bar shared by both pages */
.bar { display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: var(--accent-ink); }
.bar .home { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.bar .home b { font: 400 22px/1 var(--font-display); }
.bar .home span { font-size: 14px; opacity: .8; }
.bar .sp { flex: 1; }
.look { appearance: none; background: transparent; border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, transparent); color: var(--accent-ink); border-radius: 999px; padding: 6px 30px 6px 12px; font-size: 14px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.look option { color: #222; }

/* ---------------- landing ---------------- */
.hero { padding: 56px 0 40px; color: var(--accent-ink); }
.hero .kick { font-size: 15px; letter-spacing: .02em; opacity: .85; margin: 0 0 14px; }
.hero h1 { font: 400 clamp(40px, 6.4vw, 76px)/1.02 var(--font-display); margin: 0; max-width: 15ch; text-wrap: balance; }
.hero p.lede { font-size: clamp(18px, 2vw, 21px); max-width: 52ch; margin: 22px 0 0; opacity: .92; }
.feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; background: var(--surface); color: var(--ink); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); margin: 10px 0 56px; }
.feature .txt { padding: 34px 34px 32px; }
.feature .tag { display: inline-block; font-size: 13px; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px; }
.feature h2 { font: 400 clamp(30px, 3.6vw, 42px)/1.08 var(--font-display); margin: 14px 0 12px; }
.feature p { color: var(--ink-2); margin: 0 0 12px; }
.feature .nums { display: flex; flex-wrap: wrap; gap: 22px; margin: 20px 0 24px; }
.feature .nums div b { display: block; font: 400 30px/1 var(--font-display); color: var(--ink); }
.feature .nums div span { font-size: 14px; color: var(--ink-3); }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.feature .art { background: var(--surface-2); border-left: 1px solid var(--line); min-height: 320px; display: grid; place-items: center; }
.feature .art svg { width: 100%; height: 100%; max-height: 420px; }
.sec { color: var(--accent-ink); margin: 0 0 18px; }
.sec h2 { font: 400 30px/1.1 var(--font-display); margin: 0 0 6px; }
.sec p { margin: 0; opacity: .85; max-width: 60ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 56px; }
.tile { background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); border-radius: 14px; padding: 20px; border: 1px solid var(--line); }
.tile h3 { font: 400 22px/1.15 var(--font-display); margin: 0 0 6px; }
.tile p { font-size: 15px; color: var(--ink-2); margin: 0 0 12px; }
.tile .soon { font-size: 13px; color: var(--ink-3); }
.unity { background: var(--surface); color: var(--ink); border-radius: 18px; padding: 34px; margin-bottom: 56px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.unity h2 { font: 400 30px/1.1 var(--font-display); margin: 0 0 10px; }
.unity p { color: var(--ink-2); margin: 0 0 10px; max-width: 62ch; }
.four { display: grid; grid-template-columns: repeat(2, 64px); gap: 6px; }
.four span { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; font: 400 13px var(--font-display); color: var(--accent-ink); background: var(--accent); text-align: center; line-height: 1.05; }
.four span:nth-child(2) { background: var(--gold); } .four span:nth-child(3) { background: var(--good, var(--accent)); } .four span:nth-child(4) { background: var(--info, var(--accent)); }
footer.foot { color: var(--accent-ink); opacity: .85; font-size: 14px; padding: 10px 0 40px; }
footer.foot a { text-decoration: underline; text-underline-offset: 3px; }
.sources { background: var(--surface); color: var(--ink); border-radius: 18px; padding: 28px 30px; margin-bottom: 40px; font-size: 15px; }
.sources h2 { font: 400 26px var(--font-display); margin: 0 0 10px; }
.sources p, .sources li { color: var(--ink-2); }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature .art { border-left: 0; border-top: 1px solid var(--line); min-height: 240px; }
  .unity { grid-template-columns: 1fr; padding: 26px 22px; }
  .feature .txt { padding: 26px 22px; }
}

/* ---------------- map ---------------- */
body.map { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px 1fr 420px; gap: 0; }
.side, .panel { background: var(--surface); color: var(--ink); min-height: 0; overflow: auto; }
.side { border-radius: 0 16px 0 0; padding: 16px; }
.panel { border-radius: 16px 0 0 0; padding: 18px 20px 40px; }
.stage { position: relative; min-width: 0; min-height: 0; }
.stage svg { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.search { position: relative; }
.search input { width: 100%; border: 1px solid var(--line-2, var(--line)); background: var(--surface-2); color: var(--ink); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; }
.results { margin-top: 6px; }
.results button, .list button { display: flex; width: 100%; text-align: left; gap: 8px; align-items: baseline; background: none; border: 0; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.results button:hover, .list button:hover, .list button.on { background: var(--surface-2); }
.results small, .list small { color: var(--ink-3); margin-left: auto; font-size: 12px; white-space: nowrap; }
.side h4 { font: 600 13px var(--font-sans); color: var(--ink-3); margin: 18px 0 6px; letter-spacing: .02em; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; transform: translateY(-1px); background: var(--k, var(--accent)); }
.modes { display: flex; gap: 6px; position: absolute; top: 12px; left: 12px; z-index: 2; }
.modes button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.modes button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: min(560px, calc(100% - 24px)); font-size: 12px; color: var(--accent-ink); }
.legend span { display: inline-flex; align-items: center; gap: 5px; opacity: .9; }
.hint { position: absolute; right: 12px; top: 14px; z-index: 2; font-size: 13px; color: var(--accent-ink); opacity: .75; }

/* graph */
.g-edge { fill: none; stroke: var(--accent-ink); stroke-opacity: .28; }
.g-edge.doc { stroke-opacity: .55; stroke-dasharray: none; }
.g-edge.co { stroke-dasharray: 3 4; }
.g-edge.path { stroke: var(--gold); stroke-opacity: 1; stroke-width: 3.2 !important; stroke-dasharray: none; }
.g-node { cursor: pointer; transition: transform .7s cubic-bezier(.3,.7,.2,1), opacity .4s; }
.g-node circle { fill: var(--k); stroke: var(--bg); stroke-width: 2.5; transition: r .5s; }
.g-node.text circle { fill: var(--surface); stroke: var(--k); stroke-width: 3; }
.g-node text { font: 500 13px var(--font-sans); fill: var(--accent-ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.g-node.focus text { font: 400 22px var(--font-display); }
.g-node.focus circle { stroke: var(--accent-ink); stroke-width: 3; }
.g-node:hover text { fill: var(--gold); }
.g-node.dim { opacity: .25; }
.g-cat { font: 400 16px var(--font-display); fill: var(--accent-ink); opacity: .9; text-anchor: middle; }
.g-ring { fill: none; stroke: var(--accent-ink); stroke-opacity: .12; }
@media (prefers-reduced-motion: reduce) { .g-node { transition: none; } }

/* panel */
.crumb { font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2, var(--line)); background: var(--surface-2); cursor: pointer; color: var(--ink); }
.chip .dot { width: 7px; height: 7px; }
.panel h2 { font: 400 32px/1.08 var(--font-display); margin: 10px 0 4px; }
.panel .ia-title { font-style: italic; color: var(--ink-2); margin: 0 0 12px; }
.panel .desc { color: var(--ink-2); margin: 0 0 16px; }
.bars { display: grid; gap: 6px; margin: 8px 0 18px; }
.bars button { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left; font-size: 14px; }
.bars i { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 3px; }
.bars button.on b, .bars button:hover b { color: var(--accent); }
.bars em { font-style: normal; color: var(--ink-3); text-align: right; font-size: 13px; }
.panel h3 { font: 600 14px var(--font-sans); color: var(--ink-3); margin: 22px 0 8px; letter-spacing: .02em; }
.verse { border-top: 1px solid var(--line); padding: 12px 0; }
.verse .ref { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-3); }
.verse .ref a { color: var(--accent); cursor: pointer; text-decoration: none; }
.verse .s { font-size: 18px; line-height: 1.6; margin: 6px 0 4px; white-space: pre-line; }
.verse .t { font-size: 14.5px; color: var(--ink-2); font-style: italic; white-space: pre-line; }
.verse mark { background: color-mix(in srgb, var(--gold) 26%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.verse .cs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.verse .cs .chip { font-size: 12px; padding: 1px 8px; }
.more { margin-top: 12px; }
.scripts { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.scripts button { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; }
.scripts button.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chapters button { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 9px 2px; cursor: pointer; }
.chapters button:hover { background: var(--surface-2); }
.chapters b { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.chapters small { color: var(--ink-3); font-size: 12px; }
.pathbox { display: grid; gap: 6px; margin-top: 4px; }
.pathbox input { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; }
.steps { counter-reset: s; display: grid; gap: 8px; margin: 10px 0; }
.steps div { border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; font-size: 14.5px; color: var(--ink-2); }
.steps div b { color: var(--ink); font-weight: 600; cursor: pointer; }
.tour { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 3; width: min(560px, calc(100% - 24px)); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 14px 16px; box-shadow: 0 20px 40px -18px rgba(0,0,0,.5); display: none; }
.tour.on { display: block; }
.tour .tt { font-size: 13px; color: var(--ink-3); display: flex; justify-content: space-between; }
.tour p { margin: 6px 0 10px; font-size: 15px; color: var(--ink-2); }
.tour .nav { display: flex; gap: 8px; justify-content: flex-end; }
.tour .nav button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.tour .nav button.go { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sheet-handle { display: none; }
.empty { color: var(--ink-3); font-size: 14px; }

@media (max-width: 1100px) { .app { grid-template-columns: 240px 1fr 360px; } }
@media (max-width: 860px) {
  body.map { overflow: hidden; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; position: relative; }
  .side { border-radius: 0; padding: 10px 14px; max-height: none; overflow: visible; position: relative; z-index: 4; }
  .side .deep { display: none; }
  .side.open .deep { display: block; max-height: 55dvh; overflow: auto; }
  .stage { min-height: 0; padding-bottom: 44dvh; }
  .g-node text { font-size: 30px; stroke-width: 7px; }
  .g-node.focus text { font-size: 44px; }
  .modes { top: 8px; }
  .panel { position: absolute; left: 0; right: 0; bottom: 0; height: 44dvh; z-index: 5; border-radius: 18px 18px 0 0; box-shadow: 0 -16px 40px -20px rgba(0,0,0,.5); transition: height .35s; padding-top: 6px; }
  .panel.big { height: 86dvh; }
  .panel.min { height: 64px; overflow: hidden; }
  .sheet-handle { display: block; width: 100%; background: none; border: 0; padding: 6px 0 8px; cursor: pointer; }
  .sheet-handle i { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2, var(--line)); margin: 0 auto; }
  .legend { display: none; }
  .hint { display: none; }
  .tour { bottom: calc(44dvh + 10px); }
}
