* { box-sizing:border-box; }
html { scroll-behavior:smooth; scroll-padding-top:86px; }
body { margin:0; background:var(--bg); color:var(--fg); }
:root { --reading-accent:var(--tint); }
[data-theme="yellow-light"] { --reading-accent:#956400; }
[hidden],html[data-lang="en"] [lang="hi"],html[data-lang="hi"] [lang="en"] { display:none !important; }
html[data-lang="hi"] { --font-heading:'Noto Sans Devanagari',sans-serif; }
button,input { font:inherit; }
button,a,input,summary { -webkit-tap-highlight-color:transparent; }
button,a { touch-action:manipulation; }
a { color:inherit; text-underline-offset:5px; }
button { color:inherit; cursor:pointer; }
:focus-visible { outline:3px solid var(--tint); outline-offset:5px; }
::selection { background:var(--accent-soft); color:var(--fg); }
.skip-link { position:fixed; left:20px; top:-80px; padding:16px; background:var(--card); z-index:20; }
.skip-link:focus { top:10px; }
.story-header { max-width:1440px; margin:auto; padding:24px 5%; display:flex; align-items:center; justify-content:space-between; gap:20px; min-height:94px; }
.header-controls { display:flex; align-items:center; gap:20px; }
.language { display:flex; gap:4px; }
.language button { background:none; border:0; border-radius:50%; min-width:40px; min-height:40px; font-size:13px; }
.language button[aria-pressed="true"] { background:var(--accent-soft); }
.motion-button { background:none; border:0; border-bottom:1px solid var(--line); padding:10px 0; font-size:12px; }
.chapter-nav { position:sticky; top:0; z-index:10; display:flex; justify-content:center; gap:54px; background:var(--bg); border-block:1px solid var(--line); min-height:55px; padding:18px 24px; }
.chapter-nav a { font-size:12px; text-decoration:none; color:var(--fg2); }
.chapter-nav a[aria-current="true"] { color:var(--fg); font-weight:700; }
.nav-progress { position:absolute; left:0; bottom:-1px; height:2px; width:100%; transform:scaleX(0); transform-origin:left; background:var(--tint); }
.story-hero { display:grid; grid-template-columns:1fr 1fr; gap:32px; align-items:center; max-width:1440px; min-height:min(830px,calc(100svh - 149px)); margin:auto; padding:72px 5% 100px; }
.eyebrow { font-size:11px; line-height:1.7; font-weight:600; letter-spacing:.16em; margin:0 0 22px; color:var(--fg2); text-transform:uppercase; }
html[data-lang="hi"] .eyebrow { letter-spacing:.03em; font-size:13px; }
body h1 { font-family:var(--font-heading); font-size:clamp(64px,7vw,108px); line-height:1.08; letter-spacing:-.055em; margin:0 0 30px; font-weight:500; background:none !important; color:var(--fg) !important; -webkit-text-fill-color:currentColor !important; }
h1 em,h2 em { font-style:normal; color:var(--reading-accent); }
.lead { font-size:clamp(20px,1.65vw,25px); line-height:1.65; color:var(--fg2); margin:24px 0; max-width:570px; }
.hero-copy .lead { font-size:20px; max-width:440px; }
.story-button { display:inline-flex; align-items:center; gap:32px; padding:17px 25px; background:var(--fg); color:var(--bg); border-radius:100px; text-decoration:none; font-size:14px; font-weight:500; margin-top:16px; }
.hero-note { font-size:12px; color:var(--fg2); margin-top:20px; }
.hero-art { position:relative; width:100%; }
.guide-note { font-family:var(--font-heading); font-size:17px; font-style:italic; text-align:center; color:var(--fg2); }
.story-body { position:relative; max-width:1440px; margin:auto; }
.story-thread { position:absolute; top:0; left:5%; bottom:0; width:1px; background:var(--line); }
.story-thread span { display:block; width:100%; height:0; background:var(--tint); position:relative; }
.story-thread span:after { content:''; position:absolute; bottom:0; left:-4px; width:9px; height:9px; background:var(--tint); border-radius:50%; box-shadow:0 0 0 7px var(--accent-soft); }
.chapter { position:relative; padding:100px 5% 120px 10%; min-height:760px; border-bottom:1px solid var(--line); scroll-margin-top:30px; }
.chapter-pin { position:absolute; left:calc(5% - 18px); top:108px; }
.chapter-number { display:grid; place-items:center; width:37px; height:37px; background:var(--bg); border:1px solid var(--line); border-radius:50%; font-size:11px; font-weight:500; color:var(--fg2); }
.chapter-grid { display:grid; grid-template-columns:1fr 1.08fr; align-items:center; gap:6%; }
.chapter-copy { min-width:0; }
h2 { font-size:clamp(38px,4.1vw,63px); line-height:1.18; letter-spacing:-.04em; font-weight:500; margin:0; }
html[data-lang="hi"] h1,html[data-lang="hi"] h2 { letter-spacing:-.03em; line-height:1.35; }
.art-panel { min-width:0; position:relative; }
.illustration { display:block; width:100%; height:auto; overflow:visible; }
.illustration text { text-anchor:middle; dominant-baseline:middle; fill:var(--fg); stroke:none; font-family:var(--font-body); }
.fine { stroke:var(--line); fill:none; stroke-width:1.4; }
.ink-line { stroke:var(--fg2); stroke-width:2; fill:none; stroke-linecap:round; stroke-linejoin:round; }
.accent-line,.sun-rays { stroke:var(--tint); fill:none; stroke-width:1.5; stroke-linecap:round; }
.faint-line { stroke:var(--fg2); opacity:.4; stroke-width:1.5; fill:none; }
.leaf-line { stroke:var(--fg2); opacity:.45; stroke-width:1.5; fill:var(--soft); }
.sun-fill,.star-fill { fill:var(--tint); stroke:none; }
.moon-fill { fill:var(--accent-soft); stroke:var(--tint); stroke-width:1.5; }
.cloth { fill:var(--accent-soft); }
.skin,.paper-fill { fill:var(--bg); }
.hair { fill:var(--fg2); }
.soft-fill { fill:var(--soft); }
.halo { fill:var(--accent-soft); opacity:.5; stroke:var(--tint); stroke-width:1; }
.nakshatra-ring { stroke:var(--fg2); fill:none; stroke-width:.8; opacity:.7; }
.rashi-ring { stroke:var(--tint); fill:var(--soft); stroke-width:1; }
.rashi-ring path { fill:none; }
.illustration .zodiac { font-size:30px; fill:var(--fg2); }
.illustration .zodiac-mark { fill:none; stroke:var(--fg2); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
.lineage { margin:0 24px; padding:20px; border-block:1px solid var(--line); text-align:center; }
.lineage-row { display:flex; flex-direction:column; gap:8px; align-items:center; font:500 17px/1.5 var(--font-heading); }
.lineage-row > [aria-hidden] { color:var(--tint); font:400 16px var(--font-body); }
.nodes-lesson { display:grid; grid-template-columns:1fr 1fr; align-items:center; gap:50px; border-top:1px solid var(--line); padding-top:35px; margin-top:20px; }
.nodes-lesson h3 { font:500 27px/1.4 var(--font-heading); margin:0 0 20px; }
.nodes-lesson p { color:var(--fg2); font-size:17px; line-height:1.8; }
.graha-card .graha-sub { color:var(--fg); font-size:12px; margin-bottom:9px; }
.illustration .sector-num { font-size:11px; font-variant-numeric:tabular-nums; }
.illustration .diagram-caption { font-size:11px; letter-spacing:2px; fill:var(--fg2); }
.illustration .diagram-large { font-family:var(--font-heading); font-size:31px; }
.illustration .diagram-name { font-size:15px; font-weight:500; }
.illustration .diagram-small { font-size:12px; fill:var(--fg2); }
.kp-bar { fill:var(--accent-soft); stroke:var(--bg); stroke-width:3; }
.kp-piece.is-active .kp-bar { fill:var(--tint); }
.question { border-left:2px solid var(--tint); padding:4px 0 4px 18px; font:italic 18px/1.6 var(--font-heading); color:var(--fg2); margin-top:32px; }
.source-link { display:inline-block; font-size:12px; line-height:1.7; color:var(--fg2); margin-top:22px; text-decoration-thickness:1px; }
.story-beats { list-style:none; counter-reset:beats; padding:0; margin:28px 0 0; }
.story-beats li { counter-increment:beats; display:flex; align-items:flex-start; gap:12px; padding:12px 0; font-size:15px; line-height:1.65; border-top:1px solid var(--line); }
.story-beats li:before { content:'0' counter(beats); flex:none; color:var(--fg2); font-size:11px; line-height:2.3; }
.lesson-control,.kp-controls { margin-top:26px; padding:22px; background:var(--soft); border:1px solid var(--line); border-radius:16px; }
label { display:block; font-size:14px; line-height:1.5; }
input[type="range"] { width:100%; height:40px; margin:10px 0; accent-color:var(--tint); cursor:ew-resize; }
.address-readout { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:10px; }
.address-readout strong { font:500 24px/1.4 var(--font-heading); }
.address-readout span,#kp-readout { font-size:14px; color:var(--fg2); }
.diagram-note { font-size:12px; line-height:1.8; color:var(--fg2); max-width:510px; }
details { border-top:1px solid var(--line); margin-top:25px; font-size:15px; line-height:1.8; }
summary { cursor:pointer; padding:17px 0; color:var(--fg); font-weight:500; }
details p { margin:0 0 18px; color:var(--fg2); }
.branch-list,.timeline-list { padding:0; list-style:none; margin:30px 0 0; }
.branch-list li,.timeline-list li { border-top:1px solid var(--line); padding:20px 0; }
.branch-list h3,.timeline-list h3 { font-size:19px; margin:0 0 8px; font-weight:500; }
.branch-list p,.timeline-list p { font-size:15px; line-height:1.7; color:var(--fg2); margin:0; }
.timeline-date { font-size:11px; letter-spacing:.08em; display:block; margin-bottom:8px; color:var(--fg2); }
.chapter-wide .chapter-grid { grid-template-columns:1fr; gap:0; }
.chapter-wide .chapter-copy { max-width:800px; }
.chapter-wide .lead { max-width:730px; }
.chapter-wide .art-panel { margin-top:50px; }
.graha-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:0 40px; }
.graha-card { border-top:1px solid var(--line); padding:27px 0; display:grid; grid-template-columns:66px 1fr; gap:18px; align-items:start; }
.graha-card svg { width:64px; }
.graha-card h3 { font:500 23px/1.4 var(--font-heading); margin:0 0 6px; }
.graha-card p { margin:0; color:var(--fg2); font-size:14px; line-height:1.8; }
.graha-card .planet-type { font-size:10px; letter-spacing:.1em; text-transform:uppercase; display:block; margin-top:12px; }
.house-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--line); border:1px solid var(--line); }
.house { background:var(--bg); padding:24px; min-height:160px; }
.house-num { font:500 34px/1 var(--font-heading); color:var(--reading-accent); }
.house h3 { font-size:16px; line-height:1.6; font-weight:500; margin:16px 0 5px; }
.house p { font-size:13px; line-height:1.8; color:var(--fg2); margin:0; }
.house-icon { float:right; width:36px; height:36px; color:var(--fg2); }
.sign-selector { display:flex; gap:8px; flex-wrap:wrap; margin:25px 0; }
.sign-selector button,.quiz-options button { padding:12px 18px; border:1px solid var(--line); border-radius:100px; font-size:13px; background:var(--bg); }
.sign-selector button[aria-pressed="true"] { background:var(--fg); color:var(--bg); border-color:var(--fg); }
.sign-explainer { border-left:2px solid var(--tint); padding-left:18px; font-size:16px; line-height:1.75; color:var(--fg2); }
.reading-stack { display:grid; gap:14px; }
.reading-tile { display:grid; grid-template-columns:54px 1fr; gap:12px; align-items:center; padding:22px 25px; border:1px solid var(--line); border-radius:14px; background:var(--card); }
.reading-tile > b { font:400 31px var(--font-heading); color:var(--tint); }
.reading-tile small { display:block; font-size:10px; letter-spacing:.12em; color:var(--fg2); text-transform:uppercase; }
.reading-tile strong { display:block; font:500 24px/1.6 var(--font-heading); }
.reading-tile p { font-size:14px; line-height:1.6; color:var(--fg2); margin:3px 0 0; }
.reading-result { margin:20px 0 0; padding:24px; font:500 23px/1.6 var(--font-heading); background:var(--soft); border-radius:14px; }
.quiz { margin-top:34px; border-top:1px solid var(--line); padding-top:24px; }
.quiz p { font-size:17px; line-height:1.65; }
.quiz-options { display:flex; flex-wrap:wrap; gap:10px; }
.quiz-options button[aria-pressed="true"] { border-color:var(--tint); background:var(--accent-soft); }
.quiz-feedback { min-height:52px; color:var(--fg2); font-size:14px !important; }
.source-index { display:grid; grid-template-columns:1fr 1fr; gap:10px 30px; padding:0; list-style:none; }
.source-index li { padding:16px 0; border-top:1px solid var(--line); font-size:14px; line-height:1.7; }
.source-index small { display:block; font-size:12px; color:var(--fg2); margin-top:6px; }
.sources-intro { font-size:16px; line-height:1.8; color:var(--fg2); max-width:730px; }
.story-footer { max-width:1440px; margin:auto; padding:65px 5%; text-align:center; }
.story-footer > p { font:400 27px/1.6 var(--font-heading); }
.story-footer nav { display:flex; justify-content:center; flex-wrap:wrap; gap:25px; margin:30px 0; font-size:13px; }
.story-footer small { color:var(--fg2); font-size:11px; }
[data-motion-off="true"] { scroll-behavior:auto; }
@media(min-width:1050px) { .chapter:not(.chapter-wide) .art-panel { position:sticky; top:100px; align-self:start; } }
@media(max-width:900px) {
  .story-header { padding:18px 5%; }
  .header-controls { gap:12px; }
  .story-hero { padding-block:60px 75px; gap:8px; }
  body h1 { font-size:65px; }
  .chapter { min-height:0; padding:80px 5% 90px 11%; }
  .chapter-grid { gap:4%; }
  h2 { font-size:40px; }
  .lead { font-size:20px; }
  .graha-grid { gap:0 20px; }
  .graha-card { grid-template-columns:46px 1fr; gap:12px; }
  .graha-card svg { width:44px; }
  .house-grid { grid-template-columns:repeat(3,1fr); }
}
@media(max-width:620px) {
  html { scroll-padding-top:78px; }
  .story-header { flex-wrap:wrap; gap:14px; padding:18px 6%; }
  .story-header .site-brand { font-size:16px; }
  .header-controls { width:100%; justify-content:space-between; }
  .motion-button { font-size:11px; }
  .chapter-nav { gap:0; padding:17px 10px; justify-content:space-around; min-height:52px; }
  .chapter-nav a { font-size:10px; }
  .story-hero { display:flex; flex-direction:column; align-items:stretch; padding:52px 7% 65px; }
  body h1 { font-size:clamp(57px,13vw,76px); line-height:1.09; }
  .hero-copy .lead { font-size:18px; }
  .hero-art { margin:25px auto 0; max-width:400px; }
  .eyebrow { font-size:9px; letter-spacing:.14em; }
  .guide-note { font-size:15px; }
  .chapter { padding:64px 6% 72px 12%; scroll-margin-top:18px; }
  .chapter-pin { left:calc(5% - 12px); top:65px; }
  .chapter-number { width:25px; height:25px; font-size:9px; }
  .chapter-grid { display:flex; flex-direction:column; align-items:stretch; gap:24px; }
  h2 { font-size:clamp(35px,9vw,46px); }
  .lead { font-size:20px; line-height:1.7; }
  .art-panel { width:100%; max-width:520px; margin:auto; }
  .lesson-control,.kp-controls { padding:17px; }
  .question { font-size:17px; }
  .chapter-wide .art-panel { margin-top:15px; }
  .graha-grid { grid-template-columns:1fr; }
  .graha-card { grid-template-columns:60px 1fr; gap:20px; padding:24px 0; }
  .graha-card svg { width:58px; }
  .graha-card p { font-size:15px; }
  .house-grid { grid-template-columns:repeat(2,1fr); }
  .house { padding:19px 14px; min-height:180px; }
  .house h3 { font-size:15px; }
  .house-num { font-size:30px; }
  .house-icon { width:27px; height:27px; }
  .source-index { grid-template-columns:1fr; }
  .nodes-lesson { grid-template-columns:1fr; gap:10px; }
  .reading-tile { padding:20px; grid-template-columns:38px 1fr; }
  .reading-tile strong { font-size:22px; }
  .story-footer > p { font-size:24px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *,*:before,*:after { animation:none !important; transition:none !important; } }
@media(max-width:380px) {
  .header-controls { display:grid; grid-template-columns:auto auto; gap:6px; }
  .motion-button { grid-column:1 / -1; justify-self:end; }
}
