:root {
  --night: #1B1E45;
  --violet: #3B2F63;
  --blush: #F6D6C2;
  --sky: #EEF1F8;
  --paper: #FFFFFF;
  --ink: #1F2244;
  --ink-soft: #4A4E72;
  --line: #D6DBEA;
  --marigold: #E2972B;
  --marigold-deep: #B8701A;
  --tulsi: #4F7A5A;
  --tulsi-bg: #E8F1EA;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Mukta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --deva: 'Tiro Devanagari Sanskrit', 'Mukta', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font-family: var(--sans); font-size: 18px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 4px; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--paper); padding: 8px 12px; }

.wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 920px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(2rem, 4vw, 2.6rem); }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1em; }

/* header */
.top {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; color: #F3EEF9;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.brand-mark { width: 34px; height: 34px; color: #F3EEF9; }
.top nav { display: flex; gap: 18px; font-size: .95rem; }
.top nav a { text-decoration: none; opacity: .85; }
.top nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.nav-pass { color: #FFD48A; }
@media (max-width: 560px) { .top nav a:not(.nav-pass) { display: none; } }

/* hero: brahma muhurta, the hour before dawn */
.hero {
  position: relative; overflow: hidden; color: #F3EEF9;
  min-height: min(92vh, 760px); display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(180deg, var(--night) 0%, #262556 38%, var(--violet) 66%, #8B5C7E 84%, var(--blush) 100%);
}
.hero-sky {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 32%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 26%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 14%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 36%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 54% 40%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 36% 52%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 54%, rgba(255,255,255,.6) 50%, transparent 51%);
  opacity: .8;
}
.hero-inner { position: relative; max-width: 760px; margin: 0 auto; padding: 120px 20px 170px; text-align: center; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 500; letter-spacing: -.01em; margin-bottom: .35em; }
.hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.25rem); max-width: 34em; margin: 0 auto 1.8em; color: #E3DDF0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; display: flex; justify-content: center; align-items: flex-end; }
.diya { width: 120px; height: 90px; margin-bottom: 10px; }
.diya-flame { transform-origin: 60px 38px; animation: flicker 3.2s ease-in-out infinite; }
.diya-glow { animation: breathe 3.2s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1, 1) } 30% { transform: scale(.96, 1.05) rotate(-1.5deg) } 60% { transform: scale(1.03, .97) rotate(1deg) } }
@keyframes breathe { 0%,100% { opacity: .85 } 50% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .diya-flame, .diya-glow { animation: none; } html { scroll-behavior: auto; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 1rem/1 var(--sans); padding: 15px 24px; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--marigold); color: #241405; }
.btn-primary:hover { background: #EDA642; }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { border-color: rgba(243,238,249,.55); color: #F3EEF9; background: transparent; }
.btn-ghost:hover { border-color: #F3EEF9; }
.btn-ghost-dark { border-color: var(--line); color: var(--ink); background: var(--paper); }
.btn-ghost-dark:hover { border-color: var(--ink-soft); }
.btn-wide { width: 100%; margin-top: 8px; }

/* today */
.today { background: var(--blush); padding: 56px 0 64px; }
.today h2 { font-size: 1.9rem; margin-bottom: .2em; }
.today-line { color: #5A3B44; font-size: 1.05rem; }
.quote-card { margin: 24px 0 0; padding: 0; }
.quote-card .shloka { font-family: var(--deva); font-size: 1.15rem; line-height: 1.9; color: #6B3E2E; margin: 0 0 .7em; }
.quote-card blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.3; font-style: italic; font-weight: 500; }
.quote-card figcaption { margin-top: .8em; font-size: .95rem; color: #6A4A52; }

/* form */
.begin { padding: 72px 0 80px; }
.lede { color: var(--ink-soft); }
.form { margin-top: 28px; }
.field { margin-bottom: 20px; position: relative; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; gap: 0; } }
label { display: block; font-weight: 500; margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--ink-soft); font-size: .9rem; }
input, select, textarea {
  width: 100%; font: 400 1rem/1.4 var(--sans); color: var(--ink);
  padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper);
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(59,47,99,.15); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .95rem; margin: 10px 0 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.hint { font-size: .9rem; color: var(--ink-soft); margin: 6px 0 0; }
.place-list {
  list-style: none; margin: 4px 0 0; padding: 6px; position: absolute; z-index: 10; left: 0; right: 0;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(27,30,69,.12);
  max-height: 260px; overflow: auto;
}
.place-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.place-list li[aria-selected="true"], .place-list li:hover { background: var(--sky); }
.form-error { color: #A12C2C; font-weight: 500; }
.privacy-note { text-align: center; font-size: .9rem; color: var(--ink-soft); margin-top: 12px; }

/* care */
.care { background: var(--tulsi-bg); border-top: 4px solid var(--tulsi); padding: 40px 0; }
.care h2 { font-size: 1.9rem; color: #2E4B36; }
.care-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.care-list a { display: block; background: var(--paper); border-radius: 12px; padding: 12px 16px; text-decoration: none; border: 1.5px solid #C9DCCD; }
.care-list a:hover { border-color: var(--tulsi); }
.care-list strong { display: block; }
.care-list span { color: var(--ink-soft); font-size: .95rem; }

/* result */
.result { padding: 64px 0 40px; background: linear-gradient(180deg, var(--sky), #F6F3FA); }
.chart-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 12px; }
@media (max-width: 780px) { .chart-layout { grid-template-columns: 1fr; } }
.rasi {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr);
  aspect-ratio: 1; border: 2px solid var(--night); background: var(--paper); font-size: .85rem;
}
.rasi .house { border: 1px solid #B9BFD6; padding: 4px 6px; position: relative; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.rasi .house .sname { font-size: .72rem; color: var(--ink-soft); }
.rasi .house .pl { font-weight: 600; color: var(--night); line-height: 1.25; }
.rasi .house .pl.retro::after { content: ' (R)'; font-weight: 400; font-size: .7rem; }
.rasi .house.lagna { background: #FFF6E6; }
.rasi .house.lagna::before { content: ''; position: absolute; top: 0; left: 0; width: 26px; height: 26px; background: linear-gradient(135deg, transparent 48%, var(--marigold) 49%, var(--marigold) 54%, transparent 55%); }
.rasi .house.lagna .sname::after { content: ' Lagna'; color: var(--marigold-deep); font-weight: 600; }
.rasi .center { grid-column: 2 / 4; grid-row: 2 / 4; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-family: var(--serif); background: var(--sky); border: 1px solid #B9BFD6; padding: 8px; }
.rasi .center strong { font-size: 1.4rem; }
@media (max-width: 420px) { .rasi { font-size: .72rem; } .rasi .house { padding: 2px 3px; } .rasi .house .sname { font-size: .62rem; } }

.facts { margin: 0; display: grid; gap: 14px; }
.facts div { border-left: 3px solid var(--marigold); padding: 2px 0 2px 14px; }
.facts dt { font-size: .9rem; color: var(--ink-soft); }
.facts dd { margin: 0; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.25; }
.facts dd small { display: block; font-family: var(--sans); font-size: .9rem; font-weight: 400; color: var(--ink-soft); }

.planets { margin: 24px 0 8px; }
.planets summary { cursor: pointer; font-weight: 500; color: var(--violet); }
.table-scroll { overflow-x: auto; }
.planets table { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: .95rem; background: var(--paper); }
.planets th, .planets td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.planets th { font-weight: 600; background: var(--sky); }

/* the reading, set as a letter */
.letter { background: var(--paper); border-radius: 4px; padding: clamp(24px, 5vw, 48px); margin-top: 40px; box-shadow: 0 1px 0 var(--line), 0 20px 40px -24px rgba(27,30,69,.25); min-height: 160px; }
.letter h3 { font-size: 1.65rem; margin-top: 1.4em; color: var(--night); }
.letter h3:first-child { margin-top: 0; }
.letter p, .letter li { font-size: 1.08rem; line-height: 1.75; }
.letter ul { padding-left: 1.2em; }
.letter li { margin-bottom: .5em; }
.letter li::marker { color: var(--marigold); }
.letter blockquote, .letter .wisdom { margin: 1.4em 0; padding: 0 0 0 18px; border-left: 3px solid var(--marigold); font-family: var(--serif); font-size: 1.45rem; line-height: 1.35; font-style: italic; }
.letter .wisdom .shloka { font-family: var(--deva); font-style: normal; font-size: 1.05rem; color: #6B3E2E; display: block; margin-bottom: .5em; }
.letter .wisdom cite { display: block; font-family: var(--sans); font-style: normal; font-size: .95rem; color: var(--ink-soft); margin-top: .4em; }
.waiting { color: var(--ink-soft); font-style: italic; }
.waiting::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: '' } 25% { content: '.' } 50% { content: '..' } 75% { content: '...' } }
.letter-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; }

.ask { margin: 48px 0 24px; }
.ask h3 { font-size: 1.9rem; margin-bottom: .1em; }
.ask-form { display: flex; gap: 10px; margin-top: 14px; align-items: flex-end; }
.ask-form textarea { flex: 1; }
@media (max-width: 520px) { .ask-form { flex-direction: column; align-items: stretch; } }
.answer { margin-top: 18px; }
.answer .qa { background: var(--paper); border-radius: 4px; padding: 18px 22px; margin-bottom: 12px; }
.answer .q { font-weight: 600; color: var(--violet); margin-bottom: .4em; }
.notice { background: #FFF6E6; border: 1.5px solid #F1D3A2; border-radius: 12px; padding: 12px 16px; }

/* pass */
.pass { background: var(--night); color: #F3EEF9; padding: 64px 0; text-align: center; }
.pass p { color: #D9D3EA; max-width: 34em; margin-left: auto; margin-right: auto; }
.price { font-family: var(--serif); font-size: 3rem; font-weight: 600; color: #FFD48A !important; margin: .2em 0 .4em !important; }
.pass .hint { color: #BDB6D6; }
.pass.has-pass .price, .pass.has-pass #pass-btn { display: none; }

.foot { padding: 40px 0 56px; font-size: .92rem; color: var(--ink-soft); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

@media print {
  .top, .hero, .today, .begin, .ask, .pass, .letter-actions, .foot nav, .care { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .result { padding: 0; background: none; }
  .letter { box-shadow: none; padding: 0; margin-top: 20px; }
  .planets[open] summary, .planets summary { display: none; }
}
