:root {
  --bg: #07020f;
  --ink: #f4eeff;
  --muted: rgba(228, 214, 255, 0.66);
  --line: rgba(206, 168, 255, 0.26);
  --glass: rgba(30, 12, 58, 0.45);
  --accent: #ffb366;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at 50% 30%, #1d0838 0%, var(--bg) 70%);
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

a { color: inherit; }

.top, .hero, .wrap, .foot { position: relative; z-index: 1; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(20px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0;
  animation: fade 1.2s 0.4s both;
}

.mark {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.btn:hover, .btn:focus-visible {
  border-color: rgba(255, 179, 102, 0.7);
  box-shadow: 0 0 24px rgba(255, 169, 77, 0.25);
  transform: translateY(-1px);
  outline: none;
}
.btn.ghost { background: transparent; }

/* Landing */

body.landing { height: 100svh; overflow: hidden; }

.hero {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(13svh, 88px);
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
}

.deva {
  margin: 0;
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  color: var(--accent);
  letter-spacing: 0.12em;
  animation: rise 1.6s 3.4s both;
}

h1 {
  margin: 0.1em 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 7.5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 0 40px rgba(156, 195, 255, 0.35);
}
.landing h1 { animation: rise 1.8s 3.6s both; }

.tag {
  margin: 0.8em 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  color: var(--muted);
}
.landing .tag { animation: rise 1.8s 4s both; }

.foot {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 24px 16px max(20px, env(safe-area-inset-bottom));
}
.landing .foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  animation: fade 2s 4.6s both;
}
.sep { opacity: 0.5; }

/* Family */

body.family { min-height: 100svh; display: flex; flex-direction: column; }

.wrap {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(40px, 10vh, 110px) clamp(16px, 4vw, 40px) 24px;
}
.wrap h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); animation: rise 1.2s 0.2s both; }
.wrap .tag { animation: rise 1.2s 0.4s both; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: clamp(32px, 6vh, 56px);
}

.card {
  display: block;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  animation: rise 1s both;
}
.card:nth-child(1) { animation-delay: 0.5s; }
.card:nth-child(2) { animation-delay: 0.6s; }
.card:nth-child(3) { animation-delay: 0.7s; }
.card:nth-child(4) { animation-delay: 0.8s; }
.card:hover, .card:focus-visible {
  border-color: rgba(255, 179, 102, 0.6);
  box-shadow: 0 0 36px rgba(255, 169, 77, 0.18);
  transform: translateY(-3px);
  outline: none;
}
.card svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card h2 {
  margin: 14px 0 6px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.6rem;
}
.card p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--muted); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01s !important; animation-delay: 0s !important; }
}
.still *, .still *::before, .still *::after { animation: none !important; }

/* Lotus interaction */

.landing #sky { touch-action: none; cursor: grab; }
.landing .foot { pointer-events: none; }

.hero { transition: opacity 0.6s; }
.showing .hero { opacity: 0; }

.hint {
  margin: 1.4em 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fade 2s 5s both, breathe 3s 7s ease-in-out infinite;
}
.touched .hint { visibility: hidden; }

.nak {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(13svh, 88px);
  z-index: 1;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(6px);
  transition: opacity 0.8s 0.9s, transform 0.8s 0.9s, filter 0.8s 0.9s;
}
.showing .nak { opacity: 1; transform: none; filter: none; }
.nak h2 {
  margin: 0.1em 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.03em;
  text-shadow: 0 0 40px rgba(206, 150, 255, 0.45);
}
.nak .note {
  margin: 0.7em auto 0;
  max-width: 34em;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  color: var(--muted);
}

.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--serif);
  font-size: 1.05rem;
  pointer-events: none;
  white-space: nowrap;
}
.tip[hidden] { display: none; }

@keyframes breathe { 50% { opacity: 0.45; } }
.nak .hint { animation: none; visibility: visible; margin-top: 1.1em; }

/* Title like the house board: big backlit Kannada, English and Hindi small beneath. */
.landing h1.kn,
.nak h2.kn {
  font-family: 'Noto Serif Kannada', serif;
  font-weight: 900;
  font-size: clamp(3.4rem, 12vw, 7rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: #fff7ea;
  text-shadow: 0 0 10px rgba(255, 226, 180, 0.55), 0 0 34px rgba(255, 196, 120, 0.35), 0 0 70px rgba(206, 150, 255, 0.3);
}
.names {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.7em;
  margin: 0.25em 0 0;
  animation: rise 1.8s 3.8s both;
}
.names .en {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  letter-spacing: 0.22em;
  color: #fff3e0;
  text-shadow: 0 0 16px rgba(255, 210, 150, 0.4);
}
.names .hi {
  font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  color: var(--accent);
}
.names .sep { font-size: 0.7rem; color: var(--muted); }
/* Constellation label: same layout as the title, slightly smaller so long names fit. */
.nak h2.kn { font-size: clamp(2.6rem, 10vw, 5.5rem); margin: 0; }
.nak .names { animation: none; }
.names .en { text-transform: uppercase; }
