:root {
  --ink: #131a2e;
  --panel: #1b2440;
  --panel-2: #212b4b;
  --line: #2c3758;
  --marigold: #f0a32e;
  --marigold-deep: #d9771a;
  --leaf: #5d8a45;
  --rose: #e89aa2;
  --paper: #f6f2e9;
  --muted: #9fa9c2;
  --serif: Fraunces, Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 40rem at 50% -10rem, rgba(240, 163, 46, 0.14), transparent 70%),
    var(--ink);
  background-repeat: no-repeat;
  color: var(--paper);
  font-family: Karla, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100svh;
}

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

a { color: var(--marigold); }

/* Toran: a strand of marigolds and mango leaves across the top ---------- */

.toran {
  height: 34px;
  background:
    radial-gradient(circle at 14px 9px, var(--marigold-deep) 2.5px, transparent 3px),
    radial-gradient(circle at 14px 9px, var(--marigold) 8px, transparent 8.5px),
    radial-gradient(ellipse 4.5px 10px at 28px 20px, var(--leaf) 95%, transparent),
    linear-gradient(var(--marigold-deep), var(--marigold-deep)) 0 8px / 100% 2px no-repeat;
  background-size: 28px 34px, 28px 34px, 28px 34px, 100% 2px;
  background-repeat: repeat-x, repeat-x, repeat-x, no-repeat;
  background-position: 0 0, 0 0, 0 0, 0 8px;
  opacity: 0.9;
}

/* Ornament ---------------------------------------------------------------- */

.ornament {
  display: block;
  width: 12rem;
  max-width: 70%;
  height: auto;
  margin: 1.5rem auto;
  color: var(--marigold);
}

.invocation {
  font-family: "Tiro Devanagari Sanskrit", serif;
  color: var(--marigold);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin: 0 0 1.75rem;
}

/* Names ------------------------------------------------------------------- */

h1 .name { display: block; }

h1 .amp {
  display: block;
  font-style: italic;
  font-weight: 300;
  color: var(--marigold);
  font-size: 0.55em;
  line-height: 1.2;
  margin: 0.1em 0;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 1.5rem 0 3rem;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 15vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero .when {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--rose);
}

.hero .where {
  margin: 0.2rem 0 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
}

/* Chapters (Vadodara, Goa) ------------------------------------------------ */

.chapter + .chapter { margin-top: 4rem; }

.chapter-head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.chapter-head h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 2.25rem;
  line-height: 1.1;
  margin: 0;
  color: var(--marigold);
}

.chapter-when {
  margin: 0.35rem 0 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

/* Event cards ------------------------------------------------------------- */

.event {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 0 0 1rem;
  overflow: hidden;
}

.event::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--marigold), var(--rose));
}

.event .date {
  margin: 0 0 0.2rem;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.event h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}

.event p { margin: 0 0 0.75rem; color: #dcd8cf; }

.event strong { color: var(--rose); font-weight: 700; }

.event ul {
  list-style: none;
  margin: 0.25rem 0 0.75rem;
  padding: 0.75rem 0 0;
  border-top: 1px dashed var(--line);
}

.event li {
  display: grid;
  grid-template-columns: 5.75rem 1fr;
  gap: 0.75rem;
  padding: 0.2rem 0;
}

.event li .t {
  color: var(--marigold);
  font-weight: 700;
  font-size: 0.9rem;
  padding-top: 0.08rem;
  white-space: nowrap;
}

.event li .t:empty::before {
  content: "✦";
  font-size: 0.7rem;
  opacity: 0.7;
}

/* Chat -------------------------------------------------------------------- */

.ask {
  margin-top: 3.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
}

.ask h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 0.25rem;
}

.ask .note { margin: 0 0 1rem; color: var(--muted); font-size: 0.9rem; }

#log { display: flex; flex-direction: column; gap: 0.75rem; }

#log:empty { display: none; }

.msg {
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  max-width: 90%;
  white-space: pre-wrap;
}

.msg.you {
  align-self: flex-end;
  background: var(--line);
  border-bottom-right-radius: 3px;
}

.msg.bot {
  align-self: flex-start;
  background: #223058;
  border-bottom-left-radius: 3px;
}

.msg.problem { align-self: stretch; background: #43283a; color: var(--rose); }

form.ask-form { display: flex; gap: 0.5rem; margin-top: 1rem; }

input[type="text"], input[type="password"] {
  flex: 1;
  min-width: 0;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  color: var(--paper);
  font: inherit;
  font-size: 16px; /* stops iOS zooming on focus */
}

input::placeholder { color: var(--muted); }

input:focus-visible, button:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 2px;
}

button {
  background: linear-gradient(180deg, var(--marigold), var(--marigold-deep));
  color: #20160a;
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { filter: brightness(1.06); }

button[disabled] { opacity: 0.5; cursor: default; }

/* Login ------------------------------------------------------------------- */

.gate {
  min-height: calc(100svh - 34px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 25rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
}

.gate-card {
  border: 1px solid var(--line);
  outline: 1px solid rgba(240, 163, 46, 0.35);
  outline-offset: -8px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 2.25rem 1.5rem 1.75rem;
}

.gate h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  line-height: 0.95;
  margin: 0;
}

.gate .ornament { margin: 1.25rem auto; }

.gate-when {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.gate form { display: flex; flex-direction: column; gap: 0.75rem; }

.gate input { text-align: center; }

.problem-text { color: var(--rose); margin: 1rem 0 0; }

/* Footer ------------------------------------------------------------------ */

footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  text-wrap: balance;
}

footer p { margin: 0; }

footer .ornament { width: 8rem; margin-bottom: 1rem; opacity: 0.7; }

@media (prefers-reduced-motion: no-preference) {
  .event { transition: border-color 0.2s; }
  .event:hover { border-color: #3a4870; }
}

/* Lists with no times at all don't need the time column. */
.event ul:not(:has(.t:not(:empty))) li { grid-template-columns: 1rem 1fr; }

.nowrap { white-space: nowrap; }

/* ======================================================================== */
/* Chapter themes. Each chapter is a full-bleed band with its own world.    */
/* ======================================================================== */

html, body { overflow-x: clip; }

.chapter[class*="theme-"] {
  position: relative;
  margin-inline: calc(50% - 50vw);
  padding: 3.5rem max(1rem, calc(50vw - 18rem)) 2.5rem;
}

.chapter[class*="theme-"] + .chapter[class*="theme-"] { margin-top: 5rem; }

/* Vadodara: traditional, rooted ---------------------------------------- */

.theme-traditional {
  --kumkum: #6e1220;
  --kumkum-deep: #4a0b16;
  --zari: #e2b45c;
  --cream: #f7e9cc;
  background:
    radial-gradient(circle, rgba(247, 233, 204, 0.13) 1.4px, transparent 1.9px) 0 0 / 18px 18px,
    radial-gradient(circle, rgba(226, 180, 92, 0.12) 1.4px, transparent 1.9px) 9px 9px / 18px 18px,
    radial-gradient(ellipse 70% 50% at 50% 0, rgba(226, 180, 92, 0.18), transparent 70%),
    linear-gradient(180deg, var(--kumkum), var(--kumkum-deep));
  color: var(--cream);
}

/* Zari border: a gold sawtooth edge top and bottom, like a saree border. */
.theme-traditional::before,
.theme-traditional::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  background:
    conic-gradient(from -45deg at 50% 100%, var(--zari) 90deg, transparent 0) 0 0 / 14px 7px repeat-x,
    linear-gradient(var(--zari), var(--zari)) 0 9px / 100% 2px no-repeat,
    radial-gradient(circle, var(--zari) 1.6px, transparent 2px) 3px 12px / 14px 4px repeat-x;
}

.theme-traditional::before { top: 0; }
.theme-traditional::after { bottom: 0; transform: scaleY(-1); }

.theme-traditional .chapter-head h2 {
  font-style: normal;
  font-weight: 400;
  font-size: 2.6rem;
  letter-spacing: 0.02em;
  color: var(--zari);
}

/* A small kalash-and-lotus mark above the heading. */
.theme-traditional .chapter-head h2::before {
  content: "❁";
  display: block;
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 0.6rem;
  color: var(--zari);
}

.theme-traditional .chapter-when { color: rgba(247, 233, 204, 0.75); }

/* Jharokha-arch cards with a double gold frame. */
.theme-traditional .event {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0, rgba(226, 180, 92, 0.12), transparent 70%),
    rgba(40, 6, 12, 0.55);
  border: 1px solid rgba(226, 180, 92, 0.55);
  outline: 1px solid rgba(226, 180, 92, 0.3);
  outline-offset: -7px;
  border-radius: 46% 46% 10px 10px / 3.25rem 3.25rem 10px 10px;
  padding: 2.75rem 1.5rem 0.75rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.theme-traditional .event::before { content: none; }

.theme-traditional .event .date { color: var(--zari); }

.theme-traditional .event h3 { color: var(--cream); }

.theme-traditional .event p { color: rgba(247, 233, 204, 0.85); }

.theme-traditional .event ul {
  text-align: left;
  border-top: 1px solid rgba(226, 180, 92, 0.3);
}

.theme-traditional .event li .t { color: var(--zari); }

.theme-traditional .event:hover { border-color: var(--zari); }

/* Goa: beach, flowy ----------------------------------------------------- */

.theme-beach {
  --sea: #0e4a5c;
  --sea-deep: #082f3d;
  --aqua: #8fe3da;
  --sand: #f6e6c8;
  --coral: #ff9a7a;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 30' preserveAspectRatio='none'%3E%3Cpath d='M0 14 C40 28 80 28 120 14 S200 0 240 14 V30 H0Z' fill='%23131a2e'/%3E%3C/svg%3E") left bottom / 240px 30px repeat-x,
    radial-gradient(circle at 50% 2.5rem, rgba(255, 170, 120, 0.55), rgba(255, 140, 110, 0.15) 9rem, transparent 18rem),
    linear-gradient(180deg, #1d4e66 0%, var(--sea) 25%, var(--sea-deep) 100%);
  color: var(--sand);
}

/* Rolling wave along the top edge. */
.theme-beach::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -38px;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 40' preserveAspectRatio='none'%3E%3Cpath d='M0 22 C40 4 80 4 120 22 S200 40 240 22 V40 H0Z' fill='%231d4e66'/%3E%3C/svg%3E") 0 0 / 240px 40px repeat-x;
}

.theme-beach::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -26px;
  height: 30px;
  opacity: 0.45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 30' preserveAspectRatio='none'%3E%3Cpath d='M0 16 C30 2 60 2 90 16 S150 30 180 16' fill='none' stroke='%238fe3da' stroke-width='1.5'/%3E%3C/svg%3E") 0 0 / 180px 30px repeat-x;
}

@media (prefers-reduced-motion: no-preference) {
  .theme-beach::before { animation: drift 14s linear infinite; }
  .theme-beach::after { animation: drift-back 10s linear infinite; }
}

@keyframes drift { to { background-position: 240px 0; } }
@keyframes drift-back { to { background-position: -180px 0; } }

.theme-beach .chapter-head h2 {
  font-size: 2.75rem;
  font-weight: 300;
  color: var(--sand);
}

.theme-beach .chapter-when { color: var(--aqua); }

/* A soft wave under the heading. */
.theme-beach .chapter-head::after {
  content: "";
  display: block;
  width: 7rem;
  height: 12px;
  margin: 0.9rem auto 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 12'%3E%3Cpath d='M2 6 C11 0 19 0 28 6 S45 12 56 6 S73 0 84 6 S101 12 110 6' fill='none' stroke='%23ff9a7a' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Frosted-glass cards with organic, uneven corners. */
.theme-beach .event {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 32px 32px 32px 10px;
  padding: 1.4rem 1.4rem 0.75rem;
  margin-bottom: 1.25rem;
}

.theme-beach .event:nth-of-type(even) { border-radius: 32px 32px 10px 32px; }

.theme-beach .event::before { content: none; }

.theme-beach .event .date { color: var(--aqua); }

.theme-beach .event h3 {
  font-style: italic;
  font-weight: 300;
  font-size: 1.6rem;
  color: var(--sand);
}

.theme-beach .event p { color: rgba(246, 230, 200, 0.85); }

.theme-beach .event strong { color: var(--coral); }

.theme-beach .event ul { border-top: 1px solid rgba(143, 227, 218, 0.22); }

.theme-beach .event li .t { color: var(--coral); }

.theme-beach .event:hover { border-color: rgba(143, 227, 218, 0.45); }


/* ======================================================================== */
/* Motion. The .js class is set before paint, so nothing is hidden when     */
/* scripts don't run. All of it stops under prefers-reduced-motion.         */
/* ======================================================================== */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  0% { opacity: 0; transform: scale(0.4) rotate(-20deg); }
  70% { opacity: 1; transform: scale(1.15) rotate(4deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes draw { from { stroke-dashoffset: 92; } to { stroke-dashoffset: 0; } }

@keyframes bloom {
  from { opacity: 0; transform: translate(120px, 12px) rotate(-90deg) scale(0); }
  to { opacity: 1; transform: translate(120px, 12px); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(26px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes open-out {
  to { opacity: 0; transform: scale(1.06); filter: blur(4px); }
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

@keyframes fall {
  0% { opacity: 0; transform: translate3d(0, -5vh, 0) rotate(0); }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 105vh, 0) rotate(var(--spin)); }
}

@keyframes sway {
  from { transform: translateY(0); }
  to { transform: translateY(1.5px); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Toran: a slow breathing sway. */
  .toran { animation: sway 3.5s ease-in-out infinite alternate; }

  /* Hero and login card: staggered entrance. */
  .js .hero > *,
  .js .gate-card > * {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .js .hero .invocation, .js .gate-card .invocation { animation-delay: 0.05s; }
  .js .hero h1, .js .gate-card h1 { animation: none; }
  .js h1 .name { animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .js h1 .name:first-child { animation-delay: 0.2s; }
  .js h1 .name:last-child { animation-delay: 0.55s; }
  .js h1 .amp { animation: pop 0.8s cubic-bezier(0.3, 0.7, 0.3, 1) 0.4s both; }
  .js .hero .ornament, .js .gate-card .ornament { animation: none; }
  .js .ornament .o-line {
    stroke-dasharray: 92;
    animation: draw 1.1s ease-out 0.75s both;
  }
  .js .ornament .o-dia { animation: rise 0.6s ease-out 1.1s both; }
  .js .ornament .o-bloom { animation: bloom 0.9s cubic-bezier(0.3, 0.7, 0.3, 1) 0.95s both; }
  .js .hero .when { animation-delay: 1.05s; }
  .js .hero .where { animation-delay: 1.2s; }
  .js .gate-card .gate-when { animation-delay: 1s; }
  .js .gate-card form { animation-delay: 1.15s; }
  .js .gate-card .problem-text { animation-delay: 0s; }
  .js .gate-card { animation: card-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .js .gate > footer { animation: rise 0.8s ease-out 1.3s both; }

  /* Hero drifts up and fades as you scroll past it. */
  .hero {
    transform: translateY(var(--hero-y, 0));
    opacity: var(--hero-fade, 1);
    will-change: transform, opacity;
  }

  /* Login transitions. */
  .js .gate-card.shake { animation: shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
  .js .gate-card.shake > *, .js .gate-card.shake h1 .name, .js .gate-card.shake h1 .amp,
  .js .gate-card.shake .ornament * { animation: none; }
  .opening .gate-card { animation: open-out 0.42s ease-in forwards !important; }
  .opening .gate > footer, .opening .toran { transition: opacity 0.3s; opacity: 0; }

  /* Scroll reveals --------------------------------------------------------- */

  .js .event {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity 0.8s ease,
      transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
      border-color 0.2s,
      outline-offset 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s;
  }
  .js .event.in { opacity: 1; transform: none; }

  .js .event li {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    transition-delay: calc(0.3s + var(--i, 0) * 0.07s);
  }
  .js .event.in li { opacity: 1; transform: none; }

  /* Vadodara: arches rise and their gold frame settles inward. */
  .js .theme-traditional .event { transform: translateY(40px) scale(0.96); outline-offset: -1px; }
  .js .theme-traditional .event.in { transform: none; outline-offset: -7px; }

  /* Goa: cards float in from alternating sides, like driftwood. */
  .js .theme-beach .event {
    transform: translate(-36px, 18px) rotate(-2deg);
    transition:
      opacity 1s ease,
      transform 1.3s cubic-bezier(0.34, 1.35, 0.5, 1),
      border-color 0.2s;
  }
  .js .theme-beach .event:nth-of-type(even) { transform: translate(36px, 18px) rotate(2deg); }
  .js .theme-beach .event.in { transform: none; }

  /* Chapter headings. */
  .js .chapter-head {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js .chapter-head.in { opacity: 1; transform: none; }

  .js .theme-traditional .chapter-head h2::before {
    transform: rotate(-120deg) scale(0.3);
    transition: transform 1.2s cubic-bezier(0.3, 0.7, 0.3, 1) 0.2s;
  }
  .js .theme-traditional .chapter-head.in h2::before { transform: none; }

  .js .theme-beach .chapter-head::after {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.4s ease-in-out 0.4s;
  }
  .js .theme-beach .chapter-head.in::after { clip-path: inset(0 0 0 0); }
}

/* Chapter switcher ------------------------------------------------------- */

.chapter-nav {
  position: fixed;
  z-index: 10;
  top: max(0.75rem, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(19, 26, 46, 0.72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -150%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s;
}

.chapter-nav.show { transform: translate(-50%, 0); opacity: 1; }

.chapter-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  transition: background 0.35s, color 0.35s;
  white-space: nowrap;
}

.chapter-nav a.active[data-theme="theme-traditional"] { background: #6e1220; color: #e2b45c; }
.chapter-nav a.active[data-theme="theme-beach"] { background: #0e4a5c; color: #8fe3da; }
.chapter-nav a.active[data-theme=""] { background: var(--line); color: var(--paper); }

.chapter[id] { scroll-margin-top: 3.5rem; }

/* Petals ----------------------------------------------------------------- */

.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.petals span {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 0.75);
  border-radius: 60% 0 60% 0;
  background: radial-gradient(circle at 30% 30%, #ffc45a, var(--marigold-deep));
  opacity: 0;
  animation: fall var(--dur) cubic-bezier(0.4, 0.1, 0.6, 1) var(--delay) forwards;
}

.petals span.rose { background: radial-gradient(circle at 30% 30%, #ffc2c8, #d9707d); }

@media (prefers-reduced-motion: reduce) {
  .petals { display: none; }
}

/* Chat: suggested questions and WhatsApp hand-off ------------------------ */

.suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.suggest:empty { display: none; }

.chip {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 400;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.chip:hover { border-color: var(--marigold); background: rgba(240, 163, 46, 0.08); filter: none; }

.handoff {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #1f8a4c;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
}

.handoff::before { content: "💬"; }

.handoff:hover { filter: brightness(1.08); }
