/* Vedatom — Knowledge Base in 3D: the three halls as doorways (.k3h) and every writing on one spiral (.k3s).
   Mounted by kb3d.js into the empty #kbhalls3d and #kbspiral3d placeholders. */
.k3h, .k3s { --ink: #070a12; --paper: #f2ecdd; --muted: rgba(242,236,221,.66); --gold: #ecc45f;
  --bhu: #e2926a; --bhuvar: #7fb7c4; --svar: #ecc45f; color: var(--paper); font-family: 'Manrope', system-ui, sans-serif; }
.k3h *, .k3s * { box-sizing: border-box; }
.k3s .skt, .k3h .skt { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-weight: 600; text-transform: none; letter-spacing: .01em; }
/* the site caps every div at 100% on phones; 3D parts sit inside zero-size anchors and must be exempt */
.k3h div, .k3s div { max-width: none; }

/* ---------- the three doorways ---------- */
.k3h { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3vw; max-width: 1180px; margin: 64px auto 0; }
.k3h-hall { --W: min(250px, 24vw); --H: calc(var(--W) * 1.42); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 22px; outline: none; color: var(--paper); cursor: pointer; }
.k3h-view { width: var(--W); height: var(--H); perspective: 900px; perspective-origin: 50% 46%; }
.k3h-portal { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.7,.3,1); }
.k3h-arch { border-radius: calc(var(--W) / 2) calc(var(--W) / 2) 6px 6px; }
.k3h-corridor { position: absolute; inset: 0; transform-style: preserve-3d; }
.k3h-corridor i { position: absolute; inset: 0; border: 1.5px solid var(--c); border-bottom: none; opacity: calc(.55 - var(--k) * .07); transform: translateZ(calc(var(--k) * -70px)); }
.k3h-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 420px; transform-origin: bottom; transform: rotateX(90deg);
  background: linear-gradient(to top, color-mix(in srgb, var(--c) 26%, transparent), transparent 85%); }
.k3h-far { position: absolute; inset: 8% 10% 0; transform: translateZ(-430px); overflow: hidden; display: flex; align-items: center; justify-content: center; opacity: .55; transition: opacity .9s ease;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c) 70%, #fff) 0, var(--c) 10%, color-mix(in srgb, var(--c) 28%, transparent) 28%, transparent 47%); }
.k3h-far svg { width: 78%; height: auto; fill: none; stroke: color-mix(in srgb, var(--c) 60%, #fff); opacity: .7; }
.k3h-far svg .dot { fill: color-mix(in srgb, var(--c) 60%, #fff); stroke: none; }
.k3h-leaf { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, #0d111c), #0a0d16 70%); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: inset 0 0 40px rgba(0,0,0,.55); transition: transform 1.1s cubic-bezier(.2,.7,.25,1); }
.k3h-leaf.l { left: 0; transform-origin: left center; border-top-left-radius: calc(var(--W) / 2) calc(var(--W) / 2); border-right-color: transparent; }
.k3h-leaf.r { right: 0; transform-origin: right center; border-top-right-radius: calc(var(--W) / 2) calc(var(--W) / 2); border-left-color: transparent; }
.k3h-leaf::before { content: ''; position: absolute; left: 14%; right: 14%; top: 46%; bottom: 8%; border: 1px solid color-mix(in srgb, var(--c) 24%, transparent); border-radius: 4px; }
.k3h-g { position: absolute; top: 21%; left: 0; right: 0; text-align: center; padding-left: 8%; font-family: 'Tiro Devanagari Sanskrit', serif;
  font-size: calc(var(--W) * .14); line-height: 1; white-space: nowrap; color: color-mix(in srgb, var(--c) 62%, transparent); }
.k3h-ring { position: absolute; top: 66%; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); }
.k3h-leaf.l .k3h-ring { right: 10px; } .k3h-leaf.r .k3h-ring { left: 10px; }
.k3h-frame { position: absolute; inset: -7px -7px 0; border: 2px solid color-mix(in srgb, var(--c) 75%, transparent); border-bottom: none;
  border-radius: calc(var(--W) / 2 + 7px) calc(var(--W) / 2 + 7px) 0 0; transform: translateZ(1px); pointer-events: none; box-shadow: 0 0 30px color-mix(in srgb, var(--c) 20%, transparent); }
.k3h-sill { position: absolute; left: -16px; right: -16px; bottom: -4px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--c) 60%, transparent); transform: translateZ(2px); }
.k3h-hall.ajar .k3h-leaf.l { transform: rotateY(-22deg); } .k3h-hall.ajar .k3h-leaf.r { transform: rotateY(22deg); }
.k3h-hall:hover .k3h-leaf.l, .k3h-hall:focus-visible .k3h-leaf.l, .k3h-hall.open .k3h-leaf.l { transform: rotateY(-74deg); }
.k3h-hall:hover .k3h-leaf.r, .k3h-hall:focus-visible .k3h-leaf.r, .k3h-hall.open .k3h-leaf.r { transform: rotateY(74deg); }
.k3h-hall:hover .k3h-far, .k3h-hall:focus-visible .k3h-far, .k3h-hall.open .k3h-far { opacity: 1; }
.k3h-meta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.k3h-n { font-family: 'Cinzel', 'Cormorant Garamond', serif; font-size: 12px; letter-spacing: .34em; color: var(--c); }
.k3h-meta h3 { margin: 0; font-family: 'Marcellus', serif; font-weight: 400; font-size: 30px; line-height: 1.05; color: var(--paper); }
.k3h-meta p { margin: 0; font-size: 13.5px; line-height: 1.6; color: rgba(242,236,221,.62); max-width: 250px; min-height: 3.2em; text-wrap: balance; }
.k3h-go { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--c); }
.k3h-go span { display: inline-block; transition: transform .45s cubic-bezier(.2,.7,.3,1); }
.k3h-hall:hover .k3h-go span { transform: translateX(5px); }
.k3h-hall:focus-visible h3 { text-decoration: underline; text-underline-offset: 6px; }

/* ---------- every writing on one spiral ---------- */
.k3s { position: relative; padding: 90px 0 80px; overflow: hidden; background: radial-gradient(60% 50% at 50% 46%, rgba(48,64,84,.32), transparent 70%), #080b14; }
.k3s-head { text-align: center; padding: 0 6vw; position: relative; z-index: 3; }
.k3s-kick { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.k3s-head h2 { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: clamp(36px, 4.6vw, 58px); line-height: 1.06; margin: 12px 0; text-wrap: balance; color: var(--paper); }
.k3s-head h2 em { color: var(--gold); }
.k3s-head p { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 15.5px; line-height: 1.7; text-wrap: pretty; }
.k3s-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.k3s-chips button { font: inherit; font-size: 13px; font-weight: 700; color: rgba(242,236,221,.75); background: transparent; border: 1px solid rgba(242,236,221,.22); border-radius: 999px; padding: 8px 16px; cursor: pointer; transition: all .3s; }
.k3s-chips button .skt { font-size: 1.2em; }
.k3s-chips button[aria-pressed="true"] { background: var(--c, var(--gold)); color: #171106; border-color: var(--c, var(--gold)); }
.k3s-stage { position: relative; height: 620px; margin-top: 10px; perspective: 1300px; perspective-origin: 50% 30%; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.k3s-stage.dragging { cursor: grabbing; }
/* the sides fall away into the dark (a mask, so no edge shows against the section's glow) */
.k3s-stage { -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.18) 12%, #000 34%, #000 66%, rgba(0,0,0,.18) 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.18) 12%, #000 34%, #000 66%, rgba(0,0,0,.18) 88%, transparent 100%); }
.k3s-helix { position: absolute; left: 50%; top: 47%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.k3s-card { --cw: 128px; position: absolute; left: calc(var(--cw) / -2); top: calc(var(--cw) * -.31); width: var(--cw); height: calc(var(--cw) * .62);
  border-radius: 6px; overflow: hidden; background: #1a1f2c; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent), 0 10px 24px rgba(0,0,0,.45); cursor: pointer; }
.k3s-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.k3s-plate { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: 'Tiro Devanagari Sanskrit', serif; font-size: 26px;
  color: var(--c); background: radial-gradient(circle, color-mix(in srgb, var(--c) 22%, #121624), #0c0f18 75%); }
.k3s-edge { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); opacity: .9; }
.k3s-shade { position: absolute; inset: 0; background: #05070d; opacity: 0; pointer-events: none; transition: opacity .3s; }
.k3s-card.quiet .k3s-shade { opacity: .62; }
.k3s-card.sel { box-shadow: 0 0 0 2px var(--c), 0 0 28px color-mix(in srgb, var(--c) 60%, transparent); }
.k3s-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.k3s-axis { position: absolute; left: -1px; width: 2px; background: linear-gradient(transparent, rgba(236,196,95,.5) 15%, rgba(236,196,95,.5) 85%, transparent); box-shadow: 0 0 10px rgba(236,196,95,.4); }
.k3s-caption { position: relative; z-index: 3; max-width: 620px; margin: 6px auto 0; padding: 0 6vw; text-align: center; min-height: 170px; }
.k3s-tag { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; color: var(--c); }
.k3s-caption h3 { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; margin: 8px 0; text-wrap: balance; color: var(--paper); }
.k3s-caption p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; line-height: 1.65; text-wrap: pretty; }
.k3s-read { display: inline-block; font-size: 13.5px; font-weight: 800; color: #171106; background: var(--c); padding: 11px 20px; border-radius: 999px; text-decoration: none; }
.k3s-time { font-size: 12px; color: rgba(242,236,221,.5); margin-left: 10px; }
.k3s-hint { text-align: center; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(242,236,221,.4); margin-top: 16px; position: relative; z-index: 3; }

@media (max-width: 760px) {
  .k3h { grid-template-columns: 1fr; gap: 54px; margin-top: 48px; }
  .k3h-hall { --W: min(230px, 62vw); }
  .k3s-stage { height: 430px; } .k3s-helix { top: 42%; } .k3s-caption { margin-top: 18px; }
  .k3s-card { --cw: 92px; }
}
@media (prefers-reduced-motion: reduce) { .k3h-leaf, .k3h-portal, .k3h-far { transition-duration: .01s; } }

/* the page's own hall links stay in the page (search still shows and hides them, and the doors click them) but are not drawn */
.kbhalls-src { display: none !important; }

/* links from other pages land a section just below the fixed menu bar (the browser's own jump and kb3d.js agree) */
#index, #paths, #bhu, #bhuvar, #svar, #glossary, #weekly { scroll-margin-top: 96px; }
