/* Anvesha — the sanctum. Page-only styles; uses the site's tokens from site.css. */
.sanctum {
  --glow: 198, 82, 39;
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh; background: var(--night); color: var(--ivory);
  padding: calc(var(--header-h) + 28px) 0 40px;
}
.sanctum-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% 22%, rgba(var(--glow), .20), transparent 70%),
    radial-gradient(90% 70% at 50% 120%, rgba(36, 52, 74, .9), transparent 70%),
    linear-gradient(180deg, #121a27 0%, #172235 55%, #141c29 100%);
}
.sanctum-sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sanctum-inner { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 var(--gutter); display: flex; flex-direction: column; min-height: calc(100svh - var(--header-h) - 68px); }
.sanctum .breadcrumbs { color: rgba(239, 231, 214, .5); margin-bottom: 0; }

/* ---------- The presence: orb + mandala ---------- */
.presence { position: relative; width: 200px; height: 200px; margin: 26px auto 8px; display: grid; place-items: center; transition: width .9s var(--ease), height .9s var(--ease), margin .9s var(--ease); }
.mandala { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: anv-turn 90s linear infinite; }
.mandala circle, .mandala path { fill: none; stroke: rgba(210, 174, 109, .38); stroke-width: .6; vector-effect: non-scaling-stroke; }
.mandala .r2 { stroke-dasharray: 2 5; }
.mandala .r3 { stroke: rgba(210, 174, 109, .18); }
.mandala .petals path { stroke: rgba(210, 174, 109, .3); }
.orb { position: relative; width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #ffd9a0 0%, #e7954f 26%, #c65227 58%, #7a2a12 100%);
  box-shadow: 0 0 40px 8px rgba(var(--glow), .45), 0 0 120px 30px rgba(var(--glow), .22), inset -8px -10px 24px rgba(60, 15, 5, .45);
  animation: anv-breathe 6s ease-in-out infinite;
}
.orb::after { content: ""; position: absolute; inset: -14%; border-radius: 50%; border: 1px solid rgba(255, 210, 150, .25); animation: anv-ripple 6s ease-out infinite; }
@keyframes anv-breathe { 0%, 100% { transform: scale(.94); filter: brightness(.95); } 50% { transform: scale(1.04); filter: brightness(1.1); } }
@keyframes anv-ripple { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes anv-turn { to { transform: rotate(360deg); } }
.sanctum[data-state="thinking"] .orb { animation-duration: 1.6s; }
.sanctum[data-state="thinking"] .orb::after { animation-duration: 1.6s; }
.sanctum[data-state="thinking"] .mandala { animation-duration: 9s; }
.sanctum[data-state="answering"] .orb { box-shadow: 0 0 60px 14px rgba(var(--glow), .6), 0 0 160px 50px rgba(var(--glow), .3), inset -8px -10px 24px rgba(60, 15, 5, .45); }

/* ---------- Opening words ---------- */
.sanctum-head { text-align: center; margin: 6px auto 34px; max-width: 34em; }
.sanctum-head .eyebrow { color: rgba(239, 231, 214, .55); justify-content: center; }
.sanctum-head .eyebrow::before { display: none; }
.sanctum-head h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(46px, 6vw, 84px); line-height: 1; margin: 14px 0 6px; letter-spacing: -.01em; }
.sanctum-head h1 span { display: block; font-family: var(--f-deva); font-size: .4em; color: var(--gold-2); margin-top: 12px; letter-spacing: 0; }
.sanctum-lede { font-size: 19px; line-height: 1.6; color: rgba(239, 231, 214, .76); margin: 18px auto 0; }

/* ---------- Paths (first questions) ---------- */
.paths { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.path { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 18px 18px 20px; background: rgba(239, 231, 214, .035);
  box-shadow: inset 0 0 0 1px var(--night-line); transition: background .4s, box-shadow .4s, transform .4s var(--ease); color: var(--ivory); }
.path:hover, .path:focus-visible { background: rgba(210, 174, 109, .09); box-shadow: inset 0 0 0 1px rgba(210, 174, 109, .55); transform: translateY(-3px); }
.path .deva { font-size: 22px; color: var(--gold-2); line-height: 1.3; }
.path b { font-family: var(--f-ui); font-weight: 400; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: rgba(239, 231, 214, .9); }
.path small { font-family: var(--f-text); font-size: 16px; line-height: 1.4; color: rgba(239, 231, 214, .66); }

/* ---------- Conversation ---------- */
.thread { display: flex; flex-direction: column; gap: 26px; }
.msg { animation: anv-in .6s var(--ease) both; }
@keyframes anv-in { from { opacity: 0; transform: translateY(10px); } }
.msg-user { align-self: flex-end; max-width: 82%; background: rgba(239, 231, 214, .08); box-shadow: inset 0 0 0 1px var(--night-line); padding: 14px 18px; border-radius: 18px 18px 4px 18px; }
.msg-user p { margin: 0; font-size: 18px; line-height: 1.5; color: var(--ivory); overflow-wrap: anywhere; }
.msg-anv { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; align-items: start; }
.orb-mini { width: 26px; height: 26px; margin-top: 6px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #ffd9a0, #c65227 60%, #7a2a12); box-shadow: 0 0 16px 3px rgba(198, 82, 39, .45); }
.msg-anv[aria-busy="true"] .orb-mini { animation: anv-breathe 1.6s ease-in-out infinite; }
.msg-body { min-width: 0; }
.msg-body > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.anv-para { font-size: 19px; line-height: 1.72; margin: 0 0 1em; color: rgba(239, 231, 214, .92); overflow-wrap: break-word; }
.anv-para .w { opacity: 0; animation: anv-word .5s ease forwards; }
@keyframes anv-word { to { opacity: 1; } }
.typing { display: inline-flex; gap: 6px; padding: 14px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); opacity: .3; animation: anv-dot 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes anv-dot { 50% { opacity: 1; transform: translateY(-3px); } }

.cite { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px; border-radius: 10px; vertical-align: 2px;
  font-family: var(--f-ui); font-size: 11.5px; line-height: 1; color: var(--night); background: var(--gold-2); transition: background .25s, transform .25s; }
.cite:hover, .cite:focus-visible { background: var(--ivory); transform: translateY(-1px); }

.reflection { position: relative; margin: 24px 0 26px; padding: 22px 24px 20px; background: linear-gradient(135deg, rgba(198, 82, 39, .14), rgba(210, 174, 109, .06)); box-shadow: inset 0 0 0 1px rgba(210, 174, 109, .3); }
.reflection .tag { font-family: var(--f-ui); font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-2); margin: 0 0 10px; }
.reflection p.text { margin: 0; font-size: 19px; line-height: 1.6; color: var(--ivory); }
.pause { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.pause button { font-family: var(--f-ui); font-size: 13.5px; color: var(--ivory); padding: 9px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(210, 174, 109, .5); transition: background .3s; }
.pause button:hover, .pause button:focus-visible { background: rgba(210, 174, 109, .16); }
.breath { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--gold-2); background: radial-gradient(circle, rgba(210, 174, 109, .55), transparent 70%); transform: scale(.5); opacity: .4; }
.pause.on .breath { animation: anv-breath 10s ease-in-out infinite; opacity: 1; }
@keyframes anv-breath { 0% { transform: scale(.5); } 40% { transform: scale(1.15); } 50% { transform: scale(1.15); } 100% { transform: scale(.5); } }
.pause .cue { font-family: var(--f-ui); font-size: 13.5px; color: rgba(239, 231, 214, .7); }

.sources { margin-top: 8px; }
.sources > p { font-family: var(--f-ui); font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: rgba(239, 231, 214, .55); margin: 0 0 12px; }
.src-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0; padding: 0; }
.src { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 14px 16px; background: rgba(239, 231, 214, .035); box-shadow: inset 0 0 0 1px var(--night-line); transition: box-shadow .3s, background .3s; scroll-margin-top: calc(var(--header-h) + 20px); }
.src.lit, .src:target { background: rgba(210, 174, 109, .1); box-shadow: inset 0 0 0 1px var(--gold-2); }
.src .n { font-family: var(--f-ui); font-size: 12px; color: var(--gold-2); padding-top: 3px; }
.src a.title { font-size: 17px; line-height: 1.35; color: var(--ivory); overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: rgba(210, 174, 109, .5); text-underline-offset: 3px; }
.src a.title:hover { color: var(--gold-2); }
.src .kind { display: block; font-family: var(--f-ui); font-size: 12px; color: rgba(239, 231, 214, .5); margin-top: 3px; }
.src details { margin-top: 8px; }
.src summary { cursor: pointer; font-family: var(--f-ui); font-size: 12.5px; color: rgba(239, 231, 214, .72); width: fit-content; }
.src summary:hover { color: var(--gold-2); }
.src details ul { margin: 6px 0 0; padding: 0 0 0 14px; }
.src details li { padding: 5px 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.src details a { color: rgba(239, 231, 214, .85); text-decoration: underline; text-decoration-color: rgba(239, 231, 214, .25); text-underline-offset: 3px; }
.src details a:hover { color: var(--gold-2); }
.src details .meta { display: block; font-family: var(--f-ui); font-size: 11.5px; color: rgba(239, 231, 214, .45); }

.followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.followups button { font-family: var(--f-ui); font-size: 13.5px; color: rgba(239, 231, 214, .85); padding: 9px 15px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--night-line); transition: box-shadow .3s, color .3s; }
.followups button:hover, .followups button:focus-visible { box-shadow: inset 0 0 0 1px var(--gold-2); color: var(--ivory); }
.msg-note { font-size: 18px; line-height: 1.6; color: rgba(239, 231, 214, .82); margin: 0 0 10px; }
.msg-note.error { color: #f0b49b; }
.related { margin: 0; padding: 0 0 0 18px; }
.related li { padding: 3px 0; font-size: 17px; }
.related a { color: var(--ivory); text-decoration: underline; text-decoration-color: var(--gold-2); text-underline-offset: 3px; }

/* ---------- Composer ---------- */
.composer { position: sticky; bottom: 16px; z-index: 5; margin-top: 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px;
  padding: 10px 10px 10px 22px; border-radius: 28px; background: rgba(27, 38, 56, .92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(210, 174, 109, .35), 0 20px 50px -20px rgba(0, 0, 0, .7); transition: box-shadow .3s; }
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--gold-2), 0 0 0 4px rgba(210, 174, 109, .14), 0 20px 50px -20px rgba(0, 0, 0, .7); }
.composer textarea { width: 100%; min-height: 28px; max-height: 180px; resize: none; border: 0; outline: none; background: transparent; color: var(--ivory);
  font-family: var(--f-text); font-size: 19px; line-height: 1.5; padding: 9px 0; }
.composer textarea::placeholder { color: rgba(239, 231, 214, .42); }
.composer button { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--night);
  background: radial-gradient(circle at 38% 34%, #ffd9a0, #e09a55 45%, #c65227); box-shadow: 0 0 18px rgba(198, 82, 39, .5); transition: transform .3s var(--ease), opacity .3s; }
.composer button:hover { transform: scale(1.06); }
.composer button:disabled { opacity: .45; cursor: progress; transform: none; }
.composer button svg { width: 20px; height: 20px; }
.sanctum-meta { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; padding: 0 8px; min-height: 22px; }
.state-text { margin: 0; font-family: var(--f-ui); font-size: 13px; color: var(--gold-2); }
.meta-right { display: flex; align-items: center; gap: 14px; font-family: var(--f-ui); font-size: 12.5px; color: rgba(239, 231, 214, .5); }
.count.over { color: #f0b49b; }
.diyas { display: inline-flex; gap: 6px; }
.diyas i { width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 8px rgba(198, 82, 39, .8); transition: background .5s, box-shadow .5s; }
.diyas i.out { background: rgba(239, 231, 214, .18); box-shadow: none; }
.fine { margin: 26px auto 0; max-width: 46em; text-align: center; font-size: 14px; line-height: 1.6; color: rgba(239, 231, 214, .45); }

/* ---------- Once the conversation begins ---------- */
.sanctum.has-thread .presence { width: 84px; height: 84px; margin-top: 6px; }
.sanctum.has-thread .sanctum-head { margin-bottom: 26px; }
.sanctum.has-thread .sanctum-head h1 { font-size: clamp(30px, 3vw, 40px); }
.sanctum.has-thread .sanctum-head h1 span, .sanctum.has-thread .sanctum-lede, .sanctum.has-thread .paths, .sanctum.has-thread .sanctum-head .eyebrow { display: none; }
.sanctum.has-thread .thread { flex: 1; }

/* The header stays dark on this page. */
.site-header.on-dark.is-solid { background: rgba(20, 28, 41, .86); color: var(--ivory); box-shadow: 0 1px 0 var(--night-line); }
.site-header.on-dark.is-solid .brand img { filter: brightness(0) invert(.9) sepia(.25); }

@media (max-width: 760px) {
  .paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .presence { width: 150px; height: 150px; margin-top: 18px; }
  .src-grid { grid-template-columns: minmax(0, 1fr); }
  .msg-anv { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .msg-user { max-width: 92%; }
  .anv-para { font-size: 18px; }
  .composer { bottom: 10px; padding-left: 18px; }
  .sanctum-meta { flex-direction: column-reverse; align-items: flex-start; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .orb::after, .mandala, .msg, .anv-para .w, .pause.on .breath, .typing i { animation: none !important; }
  .anv-para .w { opacity: 1; }
}

/* The mascot takes the place of the orb at the heart of the sanctum. */
.presence .mascot { position: relative; width: 66%; height: auto; filter: drop-shadow(0 0 26px rgba(198, 82, 39, .55)) drop-shadow(0 0 70px rgba(198, 82, 39, .25)); }
.sanctum[data-state="answering"] .presence .mascot { filter: drop-shadow(0 0 34px rgba(255, 170, 90, .75)) drop-shadow(0 0 90px rgba(198, 82, 39, .35)); }
.sanctum.has-thread .presence .mascot { width: 78%; }
.msg-anv .mascot-tiny { width: 34px; height: auto; margin-top: 2px; filter: drop-shadow(0 2px 8px rgba(198, 82, 39, .45)); }
.msg-anv .mascot-tiny .m-float { animation: none; }
@media (max-width: 760px) { .msg-anv .mascot-tiny { width: 30px; } }
