/* astromorphy — paper sheets pinned over a painted night */

:root {
  --paper: #f1e9d6;
  --paper-deep: #e6dbc1;
  --ink: #2c241d;
  --ink-soft: #5e5145;
  --rust: #9b4a2b;
  --indigo: #2c3768;
  --night: #141a33;
  --cream: #f3ecdc;
  --cream-dim: rgba(243, 236, 220, 0.78);
  --paper-tex: none;
  --serif: 'EB Garamond', 'Tiro Devanagari Hindi', Georgia, 'Times New Roman', serif;
  --display: 'Cormorant Garamond', 'Tiro Devanagari Hindi', 'EB Garamond', Georgia, serif;
  --hand: 'Caveat', 'Kalam', 'Segoe Print', 'Bradley Hand', cursive;
  --hand-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font: 400 1.125rem/1.6 var(--serif);
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; line-height: 1.08; }
p { margin: 0 0 0.9em; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left)); }
.hand { font-family: var(--hand); font-weight: 500; }
[hidden] { display: none !important; }

/* ---------- the painting behind everything ---------- */
.sky-stage {
  position: fixed; left: 0; top: 0; width: 100%;
  height: 115vh; height: 115lvh;
  z-index: -1; will-change: transform; pointer-events: none;
  background: var(--night);
}
.sky-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- header ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding-top: env(safe-area-inset-top);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 12px; }
.logo { font: italic 500 1.65rem var(--display); text-decoration: none; color: var(--cream); letter-spacing: 0.01em; text-shadow: 0 1px 10px rgba(8, 10, 24, 0.6); }
.nav { display: flex; align-items: center; gap: 22px; font-size: 1rem; }
.nav a { text-decoration: none; color: var(--cream-dim); text-shadow: 0 1px 8px rgba(8, 10, 24, 0.7); }
.nav a:hover { color: var(--cream); }
.streak { font: 600 1.1rem var(--hand); color: #ead7a4; }

/* ---------- hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; position: relative; padding-block: 110px 90px; }
.hero-inner { text-align: center; text-shadow: 0 1px 18px rgba(8, 10, 26, 0.75), 0 0 2px rgba(8, 10, 26, 0.4); }
.hero-date { font-size: 1.6rem; color: #ead7a4; margin-bottom: 10px; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin-bottom: 22px; letter-spacing: -0.01em; }
.hero h1 em { font-weight: 400; }
.lede { max-width: 580px; margin: 0 auto 22px; color: var(--cream-dim); font-size: 1.2rem; }
.moon-pill { display: inline-block; font-style: italic; color: var(--cream); border-top: 1px solid rgba(243, 236, 220, 0.3); border-bottom: 1px solid rgba(243, 236, 220, 0.3); padding: 4px 16px; margin-bottom: 30px; }
.actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.paint-note {
  position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; margin: 0;
  font-size: 1.2rem; color: rgba(243, 236, 220, 0.72); text-shadow: 0 1px 8px rgba(8, 10, 26, 0.8);
  padding-inline: 20px; transition: opacity 1.2s ease;
}

/* ---------- buttons: hand-drawn edges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 1.08rem var(--serif); text-decoration: none; cursor: pointer;
  padding: 12px 26px; border: 1.5px solid transparent; border-radius: var(--hand-radius);
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  text-shadow: none;
}
.btn:active { transform: scale(0.97); }
.btn-paper { background: var(--paper); color: var(--ink); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6); }
.btn-paper:hover { transform: translateY(-2px) rotate(-0.5deg); }
.btn-ghost { color: var(--cream); border-color: rgba(243, 236, 220, 0.55); background: rgba(16, 20, 40, 0.25); }
.btn-ghost:hover { background: rgba(243, 236, 220, 0.1); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #3d3229; transform: translateY(-1px) rotate(0.4deg); }
.btn-line { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn-line:hover { background: rgba(44, 36, 29, 0.06); }
.btn-text { background: none; color: var(--ink-soft); padding-inline: 10px; text-decoration: underline; text-underline-offset: 4px; }
.btn-sm { padding: 9px 18px; font-size: 1rem; }
.btn:disabled { opacity: 0.45; cursor: progress; }

/* ---------- paper sheets ---------- */
main > section { padding-block: 70px; }
.sheet {
  position: relative; color: var(--ink);
  background-color: var(--paper); background-image: var(--paper-tex); background-blend-mode: soft-light;
  padding: clamp(26px, 4vw, 52px);
  border-radius: 3px 5px 4px 6px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}
.sheet::before { /* a strip of masking tape */
  content: ''; position: absolute; top: -13px; left: 50%; width: 120px; height: 28px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(232, 222, 190, 0.78);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  clip-path: polygon(2% 0, 98% 6%, 100% 92%, 0 100%, 3% 50%);
}
.sheet-head { margin-bottom: 22px; }
.sheet-head .hand { font-size: 1.45rem; color: var(--rust); margin-bottom: 2px; }
.sheet h2 { font-size: clamp(2rem, 3.8vw, 2.8rem); }
.sheet h3 { font-size: 1.6rem; margin: 30px 0 10px; }
.sheet p { color: var(--ink); }
.fine { font-size: 0.92rem; color: var(--ink-soft) !important; font-style: italic; }

/* ---------- almanac ---------- */
.alm-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 36px; align-items: start; }
.study { margin: 0; }
.study canvas { width: 100%; height: auto; aspect-ratio: 1; box-shadow: 0 2px 6px rgba(60, 40, 20, 0.18); transform: rotate(1.2deg); }
.study figcaption { text-align: center; font-size: 1.3rem; color: var(--ink-soft); margin-top: 10px; }
.phase-name { font: 500 2rem var(--display); margin-bottom: 6px !important; color: var(--indigo) !important; }
.for-you { border-left: 3px solid var(--rust); padding: 4px 0 4px 16px; margin: 18px 0; }
.for-you p { margin-bottom: 0.4em; }
.for-you .hand { font-size: 1.35rem; color: var(--rust); }
.moon-dates { list-style: none; padding: 0; margin: 0; display: flex; gap: 26px; flex-wrap: wrap; font-style: italic; color: var(--ink-soft); }
.moon-dates b { font-style: normal; color: var(--ink); font-weight: 500; }
.table-wrap { overflow-x: auto; }
.planets { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.planets td { padding: 9px 10px 9px 0; border-bottom: 1px dashed rgba(44, 36, 29, 0.22); vertical-align: baseline; white-space: nowrap; }
.planets td:first-child { font-weight: 500; }
.planets .g { display: inline-block; width: 1.4em; color: var(--rust); }
.planets .vis { color: var(--ink-soft); font-style: italic; white-space: normal; }
.planets .rx { color: var(--rust); font-weight: 500; }
.stations { margin-top: 18px; font-size: 1.1rem; }
.stations b { color: var(--rust); font-weight: 500; }

/* ---------- panchang ---------- */
.panchang { margin: 16px 0; padding: 12px 16px; background: rgba(196, 154, 60, 0.1); border-left: 3px solid #c49a3c; }
.panchang .hand { font-size: 1.3rem; color: #8a6420; margin-bottom: 4px; }
.panchang dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.panchang dt { font-style: italic; color: var(--ink-soft); }
.panchang dd { margin: 0; }
.panchang .till { color: var(--ink-soft); font-size: 0.92em; }

/* ---------- tonight, for you ---------- */
.weather-line { font-style: italic; font-size: 1.15rem; color: var(--ink-soft) !important; }
.contacts { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; gap: 12px; }
.contacts li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px; align-items: baseline; }
.contacts .tag { font: 600 1.3rem var(--hand); color: var(--rust); }
.contacts .mood { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; margin-right: 6px; vertical-align: 0.05em; }
.in-sign { margin: 16px 0 0; padding: 10px 14px; background: rgba(44, 55, 104, 0.07); border-left: 3px solid var(--indigo); }
.in-sign p { margin: 0 0 0.3em; }
.prompt { margin: 22px 0 6px; padding-top: 16px; border-top: 1px dashed rgba(44, 36, 29, 0.25); }
.prompt .hand { font-size: 1.35rem; color: var(--rust); margin-bottom: 2px; }
.prompt p:last-child { font: italic 500 1.45rem/1.35 var(--display); color: var(--indigo); }
.shower { margin-top: 10px; padding: 10px 14px; background: rgba(155, 74, 43, 0.08); border-left: 3px solid var(--rust); }
.shower b { color: var(--rust); font-weight: 500; }

/* ---------- the reading table (hero) ---------- */
:root { --spring: cubic-bezier(.2, .9, .25, 1.15); --glide: cubic-bezier(.2, .8, .2, 1); --gold: #ead7a4; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.2rem); margin-bottom: 14px; }
.table { margin-top: 6px; display: grid; justify-items: center; gap: 16px; }
.reveal-btn {
  position: relative; isolation: isolate; cursor: pointer; border: 0;
  font: italic 500 clamp(1.45rem, 2.6vw, 1.95rem) var(--display); color: var(--ink);
  background: var(--paper); border-radius: var(--hand-radius); padding: 20px 48px;
  box-shadow: 0 12px 40px -12px rgba(255, 214, 150, 0.6);
  transition: transform 0.5s var(--spring), opacity 0.5s ease;
  animation: breathe 3.4s ease-in-out infinite;
}
.reveal-btn:hover { transform: translateY(-3px) scale(1.04); }
.reveal-btn:active { transform: scale(0.96); }
.reveal-glow { position: absolute; inset: -18px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 214, 150, 0.5), transparent 75%); filter: blur(8px); animation: glow 3.4s ease-in-out infinite; }
.reveal-btn.gone { opacity: 0; transform: scale(0.8) translateY(14px); pointer-events: none; }
@keyframes breathe { 50% { box-shadow: 0 16px 60px -6px rgba(255, 214, 150, 0.85); } }
@keyframes glow { 50% { opacity: 0.55; transform: scale(1.08); } }
.reveal-sub { color: var(--cream-dim); font-style: italic; margin: 0; }

/* cards */
.spread { display: flex; gap: clamp(12px, 3vw, 36px); justify-content: center; margin-top: 4px; }
.slot { display: grid; justify-items: center; gap: 8px; width: clamp(98px, 15vw, 170px); animation: drift 8s ease-in-out infinite; }
.slot:nth-child(2) { animation-delay: -2.7s; }
.slot:nth-child(3) { animation-delay: -5.3s; }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.slot-label { font-size: 1.3rem; color: var(--cream-dim); margin: 0; transition: color 0.4s, transform 0.4s var(--spring); }
.slot.on .slot-label { color: var(--gold); transform: scale(1.12); }
.tcard {
  --dx: 0px; --dy: 0px; --rot: 0deg; --rx: 0deg; --ry: 0deg; --lift: 0px; --sc: 1; --mx: 50%; --my: 30%;
  position: relative; width: 100%; aspect-ratio: 12 / 17; border: 0; padding: 0; background: none; cursor: pointer;
  transform: translateY(var(--lift)) scale(var(--sc)) perspective(700px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.6s var(--spring), opacity 0.6s ease, filter 0.4s ease;
}
.tcard.tilting { transition: transform 0.12s linear, filter 0.4s ease; }
.tcard.dealing { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.5); opacity: 0; transition: none; }
.tcard.dealt { transition: transform 0.9s var(--spring), opacity 0.6s ease; }
.tcard .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.1s var(--spring); }
.tcard.flipped .inner { transform: rotateY(180deg); }
.tcard .face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 8px; overflow: hidden; background: var(--paper) center / cover;
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 34px -14px rgba(0,0,0,.85);
}
.tcard .front { transform: rotateY(180deg); display: grid; grid-template-rows: 1fr auto; padding: 7px 7px 3px; background-color: var(--paper); }
.tcard .front canvas { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.tcard .front span { font: 600 clamp(0.85rem, 1.4vw, 1.15rem)/1.2 var(--hand); color: var(--ink); text-align: center; padding-top: 3px; }
.tcard .front::after { /* glare that follows the pointer */
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.75), transparent 45%);
}
.tcard:hover .front::after, .tcard.active .front::after { opacity: 1; }
.tcard.active { --lift: -14px; --sc: 1.06; filter: drop-shadow(0 0 22px rgba(255, 214, 150, 0.55)); }
.tcard.target { --sc: 1.12; filter: drop-shadow(0 0 28px rgba(255, 130, 90, 0.95)); }
.tcard.shatter { animation: shatter 0.65s cubic-bezier(.5,0,.8,.6) forwards; pointer-events: none; }
@keyframes shatter {
  0% { transform: translateY(-14px) scale(1.06); }
  25% { transform: translateY(-22px) scale(1.16) rotate(-5deg); filter: brightness(1.9); }
  100% { transform: translateY(50px) scale(0.25) rotate(28deg); opacity: 0; filter: blur(10px) brightness(2.4); }
}

/* crafts: round, glowing, draggable */
.tools { display: grid; justify-items: center; gap: 6px; animation: rise 0.9s var(--glide) both; }
.crafts { display: flex; gap: 18px; }
.craft {
  position: relative; width: 58px; height: 58px; border-radius: 50%; cursor: grab; touch-action: none;
  display: grid; place-items: center; color: var(--gold);
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.18), rgba(20,22,44,.75) 70%);
  border: 1.5px solid rgba(234, 215, 164, 0.5);
  box-shadow: 0 0 0 0 rgba(234, 215, 164, 0.4), 0 10px 24px -10px rgba(0,0,0,.8);
  transition: transform 0.35s var(--spring), box-shadow 0.35s ease, opacity 0.3s;
  animation: orbit 5s ease-in-out infinite;
}
.craft:nth-child(2) { animation-delay: -1.6s; }
.craft:nth-child(3) { animation-delay: -3.2s; }
@keyframes orbit { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.craft svg { width: 28px; height: 28px; }
.craft:hover { transform: scale(1.14) rotate(-8deg); box-shadow: 0 0 0 8px rgba(234, 215, 164, 0.12), 0 12px 28px -10px rgba(0,0,0,.8); }
.craft:active { cursor: grabbing; transform: scale(0.94); }
.craft::after { content: attr(data-label); position: absolute; top: calc(100% + 6px); left: 50%; translate: -50% 0; white-space: nowrap; font: 600 0.95rem var(--hand); color: var(--cream-dim); opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.craft:hover::after, .craft:focus-visible::after { opacity: 1; }
.tools.spent .craft { opacity: 0.35; animation: none; }
.drag-ghost { position: fixed; z-index: 60; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none; color: var(--gold); display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(255,214,150,.35), transparent 70%); filter: drop-shadow(0 0 12px rgba(255,214,150,.9)); }
.drag-ghost svg { width: 40px; height: 40px; }
.quip { color: var(--gold); font-size: 1.3rem; min-height: 1.3em; margin: 4px 0 0 !important; text-align: center; }
.quip.wiggle { animation: wiggle 0.5s ease; }
@keyframes wiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-1.4deg); } 75% { transform: rotate(1.4deg); } }

/* the reading, one card at a time */
.story { width: min(680px, 100%); text-align: center; text-shadow: 0 1px 14px rgba(8, 10, 26, 0.9); animation: rise 0.9s var(--glide) both; }
.story-bars { display: flex; gap: 6px; justify-content: center; margin: 0 auto 14px; width: min(320px, 80%); }
.story-bars button { flex: 1; height: 3px; padding: 0; border: 0; border-radius: 3px; background: rgba(243, 236, 220, 0.22); overflow: hidden; cursor: pointer; }
.story-bars i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 3px; }
.story-bars .done i { width: 100%; }
.story-bars .now i { animation: fill var(--story-ms, 7000ms) linear forwards; }
.story-bars .now.held i { animation: none; width: 100%; }
@keyframes fill { to { width: 100%; } }
.story-who { font-size: 1.35rem; color: var(--gold); margin: 0 0 6px !important; }
.story-line { font: italic 500 clamp(1.45rem, 2.8vw, 2.05rem)/1.3 var(--display); color: var(--cream); margin: 0 0 10px !important; min-height: 2.6em; }
.story-aside { color: var(--cream-dim); font-style: italic; margin: 0 !important; transition: opacity 0.6s ease 0.4s; }
.story-aside.hide { opacity: 0; transition-delay: 0s; }
.w { display: inline-block; white-space: pre-wrap; opacity: 0; filter: blur(8px); transform: translateY(8px); animation: wordIn 0.7s var(--glide) forwards; }
@keyframes wordIn { to { opacity: 1; filter: blur(0); transform: none; } }
.ai-line { margin: 14px auto 0; max-width: 560px; color: var(--cream); font-style: italic; animation: rise 1s var(--glide) both; }
.ai-line::before { content: 'written for you tonight · '; font: 600 1.05rem var(--hand); color: var(--gold); font-style: normal; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }

.focus { display: grid; justify-items: center; gap: 10px; animation: rise 1s var(--glide) 0.2s both; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { font: 500 0.98rem var(--serif); color: var(--cream-dim); background: rgba(16, 20, 40, 0.35); border: 1px solid rgba(243, 236, 220, 0.25); border-radius: 999px; padding: 6px 16px; cursor: pointer; transition: background 0.3s, color 0.3s, transform 0.35s var(--spring); }
.chip:hover { transform: translateY(-2px) scale(1.04); color: var(--cream); }
.chip[aria-selected="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.focus-line { max-width: 600px; margin: 0 !important; min-height: 1.6em; color: var(--cream); text-align: center; text-shadow: 0 1px 12px rgba(8,10,26,.9); }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; animation: rise 1s var(--glide) 0.35s both; }
.pill-btn { font: 500 0.95rem var(--serif); color: var(--cream); text-decoration: none; background: rgba(16, 20, 40, 0.35); border: 1px solid rgba(243, 236, 220, 0.35); border-radius: 999px; padding: 7px 18px; cursor: pointer; transition: transform 0.35s var(--spring), background 0.3s; }
.pill-btn:hover { transform: translateY(-2px); background: rgba(243, 236, 220, 0.12); }
.extras { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.extras span { background: rgba(44, 55, 104, 0.08); border-radius: 999px; padding: 4px 13px; font-size: 0.98rem; }
.extras b { font-weight: 500; color: var(--indigo); }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 45; }
.mote {
  position: fixed; left: 0; top: 0; z-index: 30; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,246,214,1) 0%, rgba(255,214,140,.6) 35%, rgba(255,214,140,0) 70%);
}

/* ---------- lighter sections: drawers, quick forms, chip forecasts ---------- */
.drawer { margin-top: 18px; border-top: 1px dashed rgba(44, 36, 29, 0.25); }
.drawer > summary { list-style: none; cursor: pointer; padding: 12px 0 4px; font: 600 1.3rem var(--hand); color: var(--rust); display: flex; align-items: center; gap: 8px; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary::after { content: '+'; font: 400 1.4rem var(--serif); transition: transform 0.4s var(--spring); }
.drawer[open] > summary::after { transform: rotate(45deg); }
.drawer[open] .drawer-body { animation: rise 0.6s var(--glide) both; }
.drawer.small { border-top: 0; margin-top: 4px; }
.drawer.small > summary { font-size: 1.15rem; color: var(--ink-soft); padding-top: 4px; }
.quick-form { display: grid; gap: 6px; margin-top: 6px; }
.quick-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 1.4rem; }
.quick-row .hand { font-size: 1.6rem; color: var(--ink-soft); }
.quick-row input, .quick-extra input {
  font: 500 1.5rem var(--hand); color: var(--ink); background: transparent; border: 0; border-bottom: 1.5px solid rgba(44, 36, 29, 0.35);
  padding: 2px 4px; color-scheme: light; flex: 1; min-width: 160px; transition: border-color 0.3s;
}
.quick-row input:focus, .quick-extra input:focus { outline: none; border-bottom-color: var(--rust); }
.quick-extra { display: grid; gap: 10px; padding-bottom: 6px; }
.go-btn {
  font: italic 500 1.25rem var(--display); color: var(--paper); background: var(--ink); border: 0; cursor: pointer;
  border-radius: var(--hand-radius); padding: 9px 22px; transition: transform 0.35s var(--spring), box-shadow 0.35s;
  box-shadow: 0 8px 20px -10px rgba(44, 36, 29, 0.8);
}
.go-btn:hover { transform: translateY(-2px) rotate(-1deg) scale(1.04); }
.lede-s { font-style: italic; color: var(--ink-soft) !important; }
.contacts.chips-list { display: flex; flex-wrap: wrap; gap: 8px; }
.contact { flex: 1 1 100%; border: 1px solid rgba(44, 36, 29, 0.14); border-radius: 12px; background: rgba(255,255,255,0.25); transition: background 0.3s, transform 0.35s var(--spring); }
.contact:hover { transform: translateX(3px); background: rgba(255,255,255,0.45); }
.contact > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.contact > summary::-webkit-details-marker { display: none; }
.contact .tag { font: 600 1.25rem var(--hand); color: var(--rust); min-width: 5.5rem; }
.contact .mood { width: 0.7em; height: 0.7em; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.5); }
.contact .feel { font-style: italic; color: var(--ink-soft); flex: 1; }
.contact > summary::after { content: '+'; color: var(--ink-soft); transition: transform 0.4s var(--spring); }
.contact[open] > summary::after { transform: rotate(45deg); }
.contact p { margin: 0 !important; padding: 0 14px 12px; animation: rise 0.5s var(--glide) both; }

/* sections ink in as they scroll into view */
.ink { opacity: 0; transform: translateY(36px) scale(0.985); filter: blur(6px); transition: opacity 1.1s var(--glide), transform 1.1s var(--glide), filter 1.1s var(--glide); }
.ink.in { opacity: 1; transform: none; filter: none; }

@media (max-width: 560px) {
  .reveal-btn { padding: 18px 30px; }
  .slot-label { font-size: 1.1rem; }
  .craft { width: 52px; height: 52px; }
  .quick-row { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-btn, .reveal-glow, .slot, .craft { animation: none !important; }
  .tcard, .tcard .inner { transition-duration: 0.01s !important; }
  .w { animation-duration: 0.01s; animation-delay: 0s !important; }
  .ink { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ---------- portrait & bond ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 48px; align-items: center; }
.two-col.reverse { grid-template-columns: minmax(0, 470px) minmax(0, 1fr); }
.two-col.reverse .frame { order: -1; }
.frame { margin: 0; }
.frame canvas {
  width: 100%; height: auto; aspect-ratio: 4 / 5;
  background: var(--paper);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25), 0 28px 60px -20px rgba(0, 0, 0, 0.8);
  transform: rotate(0.6deg);
}
.frame figcaption { text-align: center; font-size: 1.35rem; color: var(--cream-dim); margin-top: 16px; text-shadow: 0 1px 8px rgba(8, 10, 26, 0.8); }

.lined-form { display: grid; gap: 18px; margin-top: 8px; }
.lined-form label { display: grid; gap: 2px; font-style: italic; color: var(--ink-soft); font-size: 1rem; }
.lined-form .opt { font-size: 0.9rem; }
.lined-form input {
  font: 500 1.6rem var(--hand); color: var(--ink); background: transparent;
  border: 0; border-bottom: 1.5px solid rgba(44, 36, 29, 0.35); border-radius: 0;
  padding: 4px 2px; width: 100%; color-scheme: light;
}
.lined-form input::placeholder { color: rgba(94, 81, 69, 0.45); }
.lined-form input:focus { outline: none; border-bottom-color: var(--rust); }
.lined-form .btn { justify-self: start; margin-top: 4px; }

.natal { margin-top: 6px; }
.sky-id { font-style: italic; color: var(--ink-soft) !important; }
.sky-id code { font: 600 1.25rem/1 ui-monospace, 'SF Mono', Menlo, monospace; color: var(--indigo); letter-spacing: 0.06em; margin-left: 6px; font-style: normal; }
.natal-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 18px; }
.natal-list li { border-bottom: 1px dashed rgba(44, 36, 29, 0.2); padding: 4px 0; }
.natal-list .g { color: var(--rust); display: inline-block; width: 1.4em; }
.natal-phase { font-style: italic; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.shared-note { background: rgba(155, 74, 43, 0.08); border-left: 3px solid var(--rust); padding: 10px 14px; }

.reading { margin-top: 26px; }
.reading h3 { margin-top: 0; color: var(--indigo); }
.zundro-note { margin-top: 26px !important; padding-top: 16px; border-top: 1px dashed rgba(44, 36, 29, 0.25); font-size: 0.98rem; color: var(--ink-soft) !important; font-style: italic; }
.zundro-note b { font-style: normal; color: var(--rust); }

/* ---------- making ---------- */
.steps { padding-left: 1.2em; margin: 0 0 20px; display: grid; gap: 12px; }
.steps b { font-weight: 500; color: var(--indigo); }
.numbers { font: italic 500 1.5rem/1.3 var(--display); color: var(--rust) !important; margin: 26px 0 !important; }
.prints { border-top: 1px dashed rgba(44, 36, 29, 0.25); padding-top: 18px; }
.contact { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-style: italic; }

/* ---------- footer ---------- */
.foot { padding-block: 60px calc(40px + env(safe-area-inset-bottom)); color: var(--cream-dim); text-shadow: 0 1px 8px rgba(8, 10, 26, 0.9); }
.foot-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot .hand { font-size: 1.4rem; }

/* ---------- share sheet & sign-in ---------- */
.signin { font: 500 0.95rem var(--serif); color: var(--cream); background: rgba(16, 20, 40, 0.3); border: 1px solid rgba(243, 236, 220, 0.4); border-radius: var(--hand-radius); padding: 5px 14px; cursor: pointer; }
.signin:hover { background: rgba(243, 236, 220, 0.12); }
.share-sheet { border: 0; padding: 0; background: transparent; max-width: min(460px, calc(100vw - 32px)); width: 100%; }
.share-sheet::backdrop { background: rgba(8, 10, 24, 0.6); }
.share-inner { transform: none; }
.share-inner h3 { margin: 0 0 16px; }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.share-grid button { font: 500 1.02rem var(--serif); padding: 11px 14px; border: 1.5px solid var(--ink); border-radius: var(--hand-radius); background: transparent; color: var(--ink); cursor: pointer; }
.share-grid button:hover { background: var(--ink); color: var(--paper); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 20; max-width: calc(100vw - 32px);
  background: var(--paper); color: var(--ink); padding: 10px 22px; border-radius: var(--hand-radius);
  font: 500 1.35rem var(--hand); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

/* ---------- embed mode (for Zundro and other sites) ---------- */
body.embed header, body.embed main, body.embed footer { display: none; }
body.embed .sky-stage { height: 100vh; }
.embed-caption {
  position: fixed; left: 0; right: 0; bottom: 18px; text-align: center; margin: 0;
  font-size: 1.6rem; color: var(--cream); text-shadow: 0 1px 10px rgba(8, 10, 26, 0.9);
}

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .two-col, .two-col.reverse { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .two-col.reverse .frame { order: 0; }
  .frame { max-width: 470px; margin-inline: auto; width: 100%; }
  .alm-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .study { max-width: 260px; margin-inline: auto; }
}
@media (max-width: 560px) {
  body { font-size: 1.06rem; }
  .nav { gap: 14px; font-size: 0.95rem; }
  .nav a[href="#bond"], .nav a[href="#portrait"] { display: none; }
  .logo { font-size: 1.4rem; }
  .actions .btn { width: 100%; }
  main > section { padding-block: 44px; }
  .row-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- static reference pages ---------- */
.page main > section:first-child { padding-top: 110px; }
.prose h1 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); margin-bottom: 18px; }
.prose h2 { font-size: 1.7rem; margin: 34px 0 12px; }
.prose .kicker { font-size: 1.45rem; color: var(--rust); margin-bottom: 2px; }
.prose .lede-p { font-size: 1.22rem; }
.prose a { color: var(--indigo); text-underline-offset: 3px; }
.crumbs { font-size: 0.95rem; font-style: italic; color: var(--ink-soft); margin-bottom: 14px; }
.crumbs a { color: var(--ink-soft); }
table.data { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 1.04rem; }
table.data th { text-align: left; font-weight: 500; font-style: italic; color: var(--ink-soft); padding: 6px 12px 6px 0; border-bottom: 1.5px solid rgba(44, 36, 29, 0.3); }
table.data td { padding: 8px 12px 8px 0; border-bottom: 1px dashed rgba(44, 36, 29, 0.22); vertical-align: top; }
table.data .rx { color: var(--rust); font-weight: 500; }
.link-grid { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 18px; }
.faq dt { font-weight: 500; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--ink-soft); }
.cta { margin-top: 34px; padding-top: 20px; border-top: 1px dashed rgba(44, 36, 29, 0.25); }
.cta .btn { margin: 6px 8px 0 0; }
.cta .btn-ink { color: var(--paper); }
.pager { display: flex; justify-content: space-between; gap: 12px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.98rem; }
.foot-links a { color: var(--cream-dim); }

/* =========================================================================
   Scroll scenes: night sections instead of paper forms, scrubbed by scroll
   ========================================================================= */

/* progress line and chapter dots */
.scroll-bar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 70; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(234,215,164,0), var(--gold) 30%, #fff6d8); box-shadow: 0 0 12px rgba(234,215,164,.8); }
.chapters { position: fixed; right: max(14px, env(safe-area-inset-right)); top: 50%; translate: 0 -50%; z-index: 40; display: grid; gap: 14px; }
.chapters a { position: relative; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(243,236,220,.55); background: transparent; transition: transform .45s var(--spring), background .3s; }
.chapters a.on { background: var(--gold); border-color: var(--gold); transform: scale(1.5); box-shadow: 0 0 10px rgba(234,215,164,.8); }
.chapters a::after { content: attr(data-label); position: absolute; right: 18px; top: 50%; translate: 0 -50%; white-space: nowrap; font: 600 1.05rem var(--hand); color: var(--cream); opacity: 0; transition: opacity .3s, translate .3s; text-shadow: 0 1px 8px rgba(8,10,26,.9); pointer-events: none; }
.chapters a:hover::after, .chapters a.on::after { opacity: .9; }
.chapters a.on::after { opacity: 0; }
.chapters a:hover::after { opacity: 1; }
@media (max-width: 860px) { .chapters { display: none; } }

/* the hero drifts away as you leave it; the cards fan apart */
.hero { --x: 0; }
.hero-inner { transform: translate3d(0, calc(var(--x) * -140px), 0) scale(calc(1 - var(--x) * .1)); opacity: calc(1 - var(--x) * 1.5); }
.hero .slot:nth-child(1) { translate: calc(var(--x) * -90px) calc(var(--x) * 40px); rotate: calc(var(--x) * -14deg); }
.hero .slot:nth-child(3) { translate: calc(var(--x) * 90px) calc(var(--x) * 40px); rotate: calc(var(--x) * 14deg); }
.hero .slot:nth-child(2) { translate: 0 calc(var(--x) * -30px); }
.paint-note { opacity: calc(1 - var(--x) * 3); }

/* night scenes: the same content, cream on the painted sky */
main > section.scene { padding-block: 16vh; min-height: 100vh; display: flex; align-items: center; }
main > section.scene > .wrap { width: 100%; }
.scene .sheet {
  --ink: #f3ecdc; --ink-soft: rgba(243, 236, 220, 0.72); --rust: #ead7a4; --indigo: #c9d2ff;
  color: var(--ink); background: radial-gradient(120% 120% at 30% 0%, rgba(26, 30, 58, 0.62), rgba(10, 12, 28, 0.38));
  border: 1px solid rgba(243, 236, 220, 0.12); border-radius: 22px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  background-image: none;
}
.scene .sheet::before { display: none; }
.scene .sheet p, .scene .sheet li, .scene .sheet dd, .scene .sheet td { color: var(--ink); }
.scene .sheet h2 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -0.01em; }
.scene .sheet-head .hand { font-size: 1.5rem; }
.scene .drawer, .scene .prompt, .scene .zundro-note, .scene .prints, .scene .planets td, .scene .natal-list li, .scene .moon-dates { border-color: rgba(243, 236, 220, 0.18); }
.scene .panchang { background: rgba(234, 215, 164, 0.08); }
.scene .panchang .hand { color: var(--gold); }
.scene .in-sign { background: rgba(201, 210, 255, 0.08); }
.scene .shower { background: rgba(234, 215, 164, 0.1); }
.scene .extras span { background: rgba(243, 236, 220, 0.08); }
.scene .btn-ink, .scene .go-btn { background: var(--cream); color: #1b1d33; }
.scene .btn-line { color: var(--cream); border-color: rgba(243, 236, 220, 0.6); }
.scene .btn-text { color: var(--cream-dim); }
.scene .quick-row input, .scene .quick-extra input { color: var(--cream); border-bottom-color: rgba(243, 236, 220, 0.35); color-scheme: dark; }
.scene .quick-row input::placeholder, .scene .quick-extra input::placeholder { color: rgba(243, 236, 220, 0.4); }
.scene .contact { background: rgba(243, 236, 220, 0.05); border-color: rgba(243, 236, 220, 0.14); }
.scene .contact:hover { background: rgba(243, 236, 220, 0.1); }
.scene .contact .mood { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 0 12px currentColor; }
.scene .sky-id code { color: #c9d2ff; }
.scene .numbers { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.25; color: var(--gold) !important; }
.scene .phase-name { font-size: clamp(2.2rem, 4vw, 3.2rem); }
.scene .shared-note { background: rgba(234, 215, 164, 0.1); }

/* ---------- scroll-scrubbed effects (driven by --e / --p from motion.js) ---------- */
[data-fx] { --e: 0; --p: 0.5; }
[data-fx~="rise"] { opacity: clamp(0, calc(var(--e) * 1.4), 1); transform: translate3d(0, calc((1 - var(--e)) * 90px), 0) scale(calc(0.94 + var(--e) * 0.06)); }
[data-fx~="tilt"] { transform-origin: 50% 100%; opacity: clamp(0, calc(var(--e) * 1.5), 1); transform: perspective(1400px) rotateX(calc((1 - var(--e)) * 32deg)) translate3d(0, calc((1 - var(--e)) * 110px), 0) scale(calc(0.9 + var(--e) * 0.1)); }
[data-fx~="swing"] { transform-origin: 0 50%; opacity: clamp(0, calc(var(--e) * 1.5), 1); transform: perspective(1600px) rotateY(calc((1 - var(--e)) * 38deg)) translate3d(calc((1 - var(--e)) * -60px), 0, 0); }
[data-fx~="zoom"] { opacity: clamp(0, calc(var(--e) * 1.6), 1); transform: scale(calc(1.3 - var(--e) * 0.3)) rotate(calc((1 - var(--e)) * -14deg)); }
[data-fx~="from-left"] { opacity: clamp(0, calc(var(--e) * 1.5), 1); transform: translate3d(calc((1 - var(--e)) * -180px), calc((1 - var(--e)) * 40px), 0) rotate(calc((1 - var(--e)) * -7deg)); }
[data-fx~="from-right"] { opacity: clamp(0, calc(var(--e) * 1.5), 1); transform: translate3d(calc((1 - var(--e)) * 180px), calc((1 - var(--e)) * 40px), 0) rotate(calc((1 - var(--e)) * 7deg)); }
[data-fx~="stagger"] > * { --k: clamp(0, calc(var(--e) * 2.4 - var(--i, 0) * 0.22), 1); opacity: var(--k); transform: translate3d(calc((1 - var(--k)) * var(--dir, 1) * 120px), 0, 0) rotate(calc((1 - var(--k)) * var(--dir, 1) * 4deg)); }
[data-fx~="stagger"] > :nth-child(even) { --dir: -1; }
.sw { opacity: 0.15; filter: blur(3px); transition: opacity 0.6s var(--glide), filter 0.6s var(--glide); }
.sw.lit { opacity: 1; filter: none; }
.frame figcaption { opacity: clamp(0, calc(var(--e, 1) * 2 - 1), 1); }
/* the painted sky leans in as you go deeper */
.sky-stage { transform-origin: 50% 100%; }

@media (prefers-reduced-motion: reduce) {
  .hero-inner, .hero .slot { transform: none !important; translate: none !important; rotate: none !important; opacity: 1 !important; }
  [data-fx], [data-fx~="stagger"] > * { transform: none !important; opacity: 1 !important; }
  .sw { opacity: 1; filter: none; }
}

/* language switch */
.lang-btn { font: 600 0.95rem var(--serif); color: var(--cream); background: rgba(16, 20, 40, 0.3); border: 1px solid rgba(243, 236, 220, 0.4); border-radius: 999px; padding: 4px 12px; cursor: pointer; transition: transform .35s var(--spring), background .3s; }
.lang-btn:hover { transform: translateY(-1px) scale(1.06); background: rgba(243, 236, 220, 0.12); }
/* Devanagari sits a little taller: give it room */
:lang(hi) body { line-height: 1.75; }
:lang(hi) .hero h1 { line-height: 1.25; }
:lang(hi) .story-line { line-height: 1.5; }

/* =========================================================================
   The page is a night: dawn arrives as you scroll to the bottom
   ========================================================================= */
:root { --page: 0; }
.dawn { position: fixed; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: screen;
  opacity: clamp(0, calc((var(--page) - 0.35) * 1.6), 1);
  background:
    radial-gradient(120% 60% at 50% 115%, rgba(255, 170, 110, 0.55), rgba(214, 96, 146, 0.18) 45%, transparent 70%),
    linear-gradient(to top, rgba(255, 196, 140, 0.22), transparent 55%); }
.dawn .sun { position: absolute; left: 50%; bottom: 0; width: 34vmin; height: 34vmin; margin-left: -17vmin; border-radius: 50%;
  translate: 0 calc((1 - var(--page)) * 60vmin + 8vmin);
  background: radial-gradient(circle, rgba(255, 236, 200, 0.95) 0%, rgba(255, 190, 120, 0.55) 30%, rgba(255, 150, 90, 0) 70%);
  filter: blur(2px); }
/* chapter dots become a little constellation */
.chapters a:nth-child(odd) { translate: -9px 0; }
.chapters a:nth-child(3n) { translate: 7px 0; }
.chapter-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.chapter-lines polyline { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0.75; filter: drop-shadow(0 0 3px rgba(234, 215, 164, 0.8)); }
/* ink bloom edges stay soft */
[data-ink] { will-change: clip-path; }
@media (prefers-reduced-motion: reduce) { .dawn { opacity: 0; } [data-ink] { clip-path: none !important; } }

/* ---------- the circle ---------- */
.circle-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: 10px; }
.circle-label { font-size: 1.3rem; color: var(--gold); margin-bottom: 8px !important; }
.circle-offer { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--paper); color: var(--ink-dark, #1b1d33); border-color: var(--paper); }
#circleText, #circleKeywords { width: 100%; font: 400 1.05rem/1.6 var(--serif); color: var(--cream); background: rgba(243,236,220,.05); border: 1px solid rgba(243,236,220,.2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; resize: vertical; }
#circleText:focus, #circleKeywords:focus { outline: none; border-color: var(--gold); }
.circle-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.circle-count { font-style: italic; color: var(--cream-dim); }
.circle-count.over { color: #ff9a8a; }
.vote-card { min-height: 150px; padding: 20px; border-radius: 16px; background: rgba(243,236,220,.06); border: 1px dashed rgba(234,215,164,.4); margin-bottom: 12px; transition: transform .45s var(--spring), opacity .4s; }
.vote-card.lift { transform: translateY(-40px) rotate(-3deg) scale(1.03); opacity: 0; }
.vote-card.pass { transform: translateX(-60px) rotate(-6deg); opacity: 0; }
.vote-text { font: italic 500 1.3rem/1.45 var(--display); color: var(--cream); }
.vote-kw { color: var(--gold); font-size: .95rem; margin: 6px 0 0 !important; }
.pill-btn.dark:disabled, .go-btn:disabled { opacity: .4; cursor: default; }
.reveal-list { margin: 14px 0 0; padding-left: 1.4em; display: grid; gap: 10px; }
.reveal-list li { animation: rise .7s var(--glide) both; }
.reveal-list li p { margin: 0 !important; font-style: italic; }
.reveal-list li span { font-size: .9rem; color: var(--gold); }
.reveal-list .empty { list-style: none; color: var(--cream-dim); }
.story-circle { margin: 10px auto 0 !important; color: var(--gold); font-style: italic; max-width: 560px; }
@media (max-width: 860px) { .circle-grid { grid-template-columns: 1fr; } }
