/* About in 3D -- see about3d.js. Scoped to body.ab3d (the script sets it). The site sets no
   global box-sizing, so every 3D part sets its own. Nothing is scroll-driven: parts settle once when
   they come into view, so CSS transitions are safe. */

body.ab3d #author, body.ab3d #website, body.ab3d #discovery, body.ab3d #next, body.ab3d #write { position: relative; }

/* the 3D nodes wait for the script; the page's own parts they are built from stay hidden */
.ab3-orbit, .ab3-prism, .ab3-lokas, .ab3-book { display: none; }
.ab3-src { display: none !important; }
.ab3-iast { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 19px; }

/* phone traps: nav-menus.js gives every div max-width:100% and .gp-fit to anything poking past the screen */
.ab3-orbit, .ab3-orbit *, .ab3-prism, .ab3-prism *, .ab3-lokas, .ab3-lokas *, .ab3-book, .ab3-book * { box-sizing: border-box; }
.ab3-orbit div, .ab3-lokas div, .ab3-book .gp-fit, .ab3-prism .gp-fit, .ab3-lokas .gp-fit { max-width: none !important; }

/* ---------- shared: the atom orbit ---------- */
body.ab3d .ab3-orbit { display: block; position: absolute; z-index: 0; pointer-events: none; perspective: 1000px; height: 0; }
.ab3-otilt { position: absolute; left: 0; right: 0; top: 0; height: 0; transform-style: preserve-3d; transform: rotateX(74deg) rotateZ(-16deg); }
.ab3-oring { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1; transform: translateY(-50%); border-radius: 50%;
  border: 1px solid rgba(236,196,95,.3); animation: ab3spin 30s linear infinite; }
.ab3-oring.two { left: 10%; right: 10%; border-color: rgba(127,183,196,.22); animation-duration: 43s; animation-direction: reverse; }
.ab3-oring.three { left: 22%; right: 22%; border-color: rgba(207,125,80,.22); animation-duration: 23s; }
.ab3-oring i { position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: #f5d67e; box-shadow: 0 0 12px 3px rgba(236,196,95,.75); }
.ab3-oring.two i { background: #9fd0dc; box-shadow: 0 0 10px 2px rgba(127,183,196,.7); }
.ab3-oring.three i { background: #e59a70; box-shadow: 0 0 10px 2px rgba(207,125,80,.7); }
@keyframes ab3spin { to { transform: translateY(-50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ab3-oring { animation: none; } }

/* ---------- 1 · header ---------- */
body.ab3d .ab3-hin { position: relative; }
body.ab3d .ab3-hin > :not(.ab3-orbit) { position: relative; z-index: 1; }
body.ab3d .ab3-orbit.hero { left: 50%; width: min(900px, 120vw); margin-left: calc(min(900px, 120vw) / -2); top: 44%; }
body.ab3d .ab3-orbit.hero .ab3-otilt { transform: rotateX(76deg) rotateZ(-12deg); }
body.ab3d .ab3-orbit.hero .ab3-oring { border-color: rgba(236,196,95,.2); }

/* ---------- 2 · the author: portrait plate, raised figures ---------- */
body.ab3d .ab3-pcol { perspective: 1200px; }
body.ab3d .ab3-portrait { transform: rotateY(calc(10deg + var(--ry, 0deg))) rotateX(var(--rx, 0deg));
  transition: transform .7s cubic-bezier(.22,.61,.36,1);
  box-shadow: 16px 16px 0 -1px #f6f0e2, 16px 16px 0 0 rgba(138,108,31,.45), 0 40px 60px -30px rgba(36,29,18,.55) !important; }
body.ab3d .ab3-figs { perspective: 900px; }
body.ab3d .ab3-figs > div { transform-origin: 50% 100%; transform: rotateX(50deg); opacity: .25;
  transition: transform 1.1s cubic-bezier(.2,.75,.2,1), opacity .9s ease, box-shadow .4s ease;
  box-shadow: 0 2px 0 rgba(138,108,31,.22), 0 22px 30px -22px rgba(36,29,18,.45); }
body.ab3d .ab3-figs > div:nth-child(2) { transition-delay: .08s; } body.ab3d .ab3-figs > div:nth-child(3) { transition-delay: .16s; }
body.ab3d .ab3-figs > div:nth-child(4) { transition-delay: .24s; }
body.ab3d .ab3-figs.ab3-in > div { transform: rotateX(10deg); opacity: 1; }
body.ab3d .ab3-figs.ab3-in > div:hover { transform: rotateX(0) translateY(-4px); transition-delay: 0s; }
body.ab3d .ab3-figs > div > :first-child { text-shadow: 1px 1px 0 rgba(36,29,18,.14), 2px 2px 0 rgba(36,29,18,.1), 3px 4px 6px rgba(36,29,18,.16); }
@media (max-width: 760px) { body.ab3d .ab3-portrait { transform: rotateY(6deg); } }

/* ---------- 2 · the record as a turning prism ---------- */
body.ab3d .ab3-prism { display: block; margin-top: 4px; }
.ab3-ptabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.ab3-ptabs button { font: 800 11px/1 'Manrope', sans-serif; letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
  border: 1px solid rgba(36,29,18,.16); background: transparent; color: rgba(36,29,18,.55); padding: 9px 14px; border-radius: 999px;
  transition: background .3s ease, color .3s ease, border-color .3s ease; }
.ab3-ptabs button:hover { color: #241d12; }
.ab3-ptabs button[aria-pressed="true"] { background: #241d12; color: #f6f0e2; border-color: #241d12; }
.ab3-pstage { position: relative; height: calc(var(--ph, 220px) + 10px); perspective: 1300px; perspective-origin: 50% 50%; touch-action: pan-y; }
.ab3-pdrum { position: absolute; left: 0; right: 0; top: 0; height: var(--ph, 220px); transform-style: preserve-3d; }
.ab3-face { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; gap: 9px; padding: 16px;
  background: linear-gradient(170deg, #efe5cc, #e8dcbd); border: 1px solid rgba(138,108,31,.28); border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 26px 40px -28px rgba(36,29,18,.5); }
.ab3-fh { font: 800 10.5px/1 'Manrope', sans-serif; letter-spacing: .24em; text-transform: uppercase; color: #8a6c1f; padding: 2px 2px 4px; }

/* ---------- 3 · the vision: three worlds as three plates ---------- */
body.ab3d .ab3-lokas { display: block; position: relative; width: 100%; max-width: 420px; height: 300px; }
.ab3-lstage { position: absolute; left: 0; top: 0; width: 200px; height: 300px; perspective: 900px; }
.ab3-lspin { position: absolute; left: 30px; top: 150px; width: 140px; height: 140px; margin-top: -70px; transform-style: preserve-3d;
  transform: rotateX(64deg) rotateZ(0deg); animation: ab3turn 36s linear infinite; }
@keyframes ab3turn { to { transform: rotateX(64deg) rotateZ(360deg); } }
@media (prefers-reduced-motion: reduce) { .ab3-lspin { animation: none; transform: rotateX(64deg) rotateZ(30deg); } }
.ab3-lplate { position: absolute; inset: 0; border-radius: 22px; border: 1.5px solid; }
.ab3-lplate.k0 { transform: translateZ(-56px); border-color: rgba(140,69,39,.85); background: rgba(207,125,80,.34); box-shadow: 0 0 30px rgba(207,125,80,.35); }
.ab3-lplate.k1 { transform: translateZ(0); border-color: rgba(49,98,108,.85); background: rgba(127,183,196,.34); box-shadow: 0 0 30px rgba(127,183,196,.35); }
.ab3-lplate.k2 { transform: translateZ(56px); border-color: rgba(138,108,31,.9); background: rgba(236,196,95,.38); box-shadow: 0 0 34px rgba(236,196,95,.45); }
.ab3-apex { position: absolute; left: 72px; top: 26px; width: 56px; height: 51px; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(48,64,84,.35), 0 0 30px rgba(236,196,95,.35); animation: ab3float 5s ease-in-out infinite; }
@keyframes ab3float { 50% { transform: translateY(-7px); } }
.ab3-llabels { position: absolute; left: 236px; top: 0; height: 300px; margin: 0; padding: 0; list-style: none; }
.ab3-llabels li { position: absolute; left: 0; white-space: nowrap; display: flex; flex-direction: column; gap: 2px; }
.ab3-llabels li::before { content: ''; position: absolute; left: -46px; top: 13px; width: 38px; border-top: 1px dashed rgba(138,108,31,.45); }
.ab3-llabels li.k2 { top: 82px; } .ab3-llabels li.k1 { top: 132px; } .ab3-llabels li.k0 { top: 182px; }
.ab3-llabels b { font: 500 20px/1.2 'Cormorant Garamond', serif; color: #241d12; }
.ab3-llabels b i { font-style: italic; }
.ab3-llabels b { font-family: 'Cormorant Garamond', 'Tiro Devanagari Sanskrit', serif; }
.ab3-llabels li > span { font: 600 12px/1.3 'Manrope', sans-serif; letter-spacing: .04em; color: rgba(36,29,18,.6); }
.ab3-llabels li.k0 b { color: #8c4527; } .ab3-llabels li.k1 b { color: #31626c; } .ab3-llabels li.k2 b { color: #775d13; }
body.ab3d .ab3-nums > div > :first-child { transform: translateY(14px); opacity: 0; display: inline-block;
  transition: transform .9s cubic-bezier(.2,.75,.2,1), opacity .7s ease;
  text-shadow: 1px 1px 0 rgba(36,29,18,.14), 2px 2px 0 rgba(36,29,18,.1), 3px 4px 6px rgba(36,29,18,.16); }
body.ab3d .ab3-nums.ab3-in > div > :first-child { transform: none; opacity: 1; }
body.ab3d .ab3-nums > div:nth-child(2) > :first-child { transition-delay: .12s; }
body.ab3d .ab3-nums > div:nth-child(3) > :first-child { transition-delay: .24s; }

/* ---------- 4 · the evidence: an open book ---------- */
body.ab3d .ab3-book { display: block; padding: 6px 6vw 0; }
.ab3-bstage { perspective: 1800px; perspective-origin: 50% 0%; }
.ab3-bset { position: relative; max-width: 1000px; height: var(--lh, 320px); margin: 0 auto; transform-style: preserve-3d; transform: rotateX(10deg); }
.ab3-leaf { position: absolute; top: 0; height: var(--lh, 320px); width: 50%; overflow: hidden; transform-style: flat;
  background: linear-gradient(155deg, #0e1222, #0a0d19); border: 1px solid color-mix(in srgb, var(--acc, #ecc45f) 28%, transparent); }
.ab3-leaf.l { left: 0; transform-origin: 100% 50%; transform: rotateY(7deg); border-radius: 18px 4px 4px 18px;
  background: linear-gradient(100deg, #0e1222 70%, #070912); }
.ab3-leaf.r, .ab3-leaf.t { left: 50%; transform-origin: 0 50%; transform: rotateY(-7deg); border-radius: 4px 18px 18px 4px;
  background: linear-gradient(260deg, #0e1222 70%, #070912); }
.ab3-leaf.t { visibility: hidden; z-index: 3; box-shadow: 0 0 40px rgba(0,0,0,.5); }
.ab3-leaf.t.back { background: linear-gradient(100deg, #0e1222 70%, #070912); }
.ab3-spine { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; transform: translateZ(1px);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--acc, #ecc45f) 60%, transparent), transparent); }
.ab3-pg { padding: 34px 40px 30px; display: flex; flex-direction: column; gap: 12px; }
.ab3-bn { font: 700 10.5px/1 'Manrope', sans-serif; letter-spacing: .22em; }
.ab3-who { font: 400 30px/1.15 'Marcellus', serif; color: #f2ecdd; margin-top: 6px; }
.ab3-dates { font: 600 11px/1.3 'Manrope', sans-serif; letter-spacing: .2em; text-transform: uppercase; color: rgba(242,236,221,.4); }
.ab3-q { font: italic 400 23px/1.45 'Cormorant Garamond', serif; color: rgba(242,236,221,.9); margin-top: 10px; }
.ab3-echo { font: 800 10.5px/1 'Manrope', sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.ab3-verse { font: 400 17px/1.6 'Tiro Devanagari Sanskrit', serif; margin-top: 4px; }
.ab3-tr { font: 400 14px/1.7 'Manrope', sans-serif; color: rgba(242,236,221,.66); }
.ab3-ref { font: 700 10.5px/1 'Manrope', sans-serif; letter-spacing: .18em; text-transform: uppercase; opacity: .7; margin-top: 2px; }
.ab3-bnav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 30px; }
.ab3-bnav button { font: 700 13px/1 'Manrope', sans-serif; cursor: pointer; border: 1px solid rgba(242,236,221,.18); color: rgba(242,236,221,.7);
  background: transparent; border-radius: 999px; height: 40px; padding: 0 18px; }
.ab3-bnav .prev, .ab3-bnav .next { width: 40px; padding: 0 0 3px; font: 400 22px/1 'Marcellus', serif; color: #ecc45f; border-color: rgba(236,196,95,.35); }
.ab3-bnav button:hover { background: rgba(236,196,95,.12); }
.ab3-bcount { font: 700 11px/1 'Manrope', sans-serif; letter-spacing: .16em; color: rgba(242,236,221,.45); min-width: 40px; text-align: center; }
/* phones: the book opens top and bottom, the lower page turns up */
.ab3-book.vert .ab3-bset { height: calc(var(--lh, 320px) * 2); transform: rotateX(4deg); }
.ab3-book.vert .ab3-leaf { width: 100%; left: 0; }
.ab3-book.vert .ab3-leaf.l { top: 0; transform-origin: 50% 100%; transform: rotateX(-7deg); border-radius: 18px 18px 4px 4px; background: linear-gradient(180deg, #0e1222 70%, #070912); }
.ab3-book.vert .ab3-leaf.r, .ab3-book.vert .ab3-leaf.t { top: var(--lh, 320px); transform-origin: 50% 0; transform: rotateX(7deg); border-radius: 4px 4px 18px 18px; background: linear-gradient(0deg, #0e1222 70%, #070912); }
.ab3-book.vert .ab3-leaf.t.back { background: linear-gradient(180deg, #0e1222 70%, #070912); }
.ab3-book.vert .ab3-spine { left: 0; right: 0; top: var(--lh, 320px); bottom: auto; width: auto; height: 2px; margin: -1px 0 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--acc, #ecc45f) 60%, transparent), transparent); }
.ab3-book.vert .ab3-pg { padding: 24px 22px 20px; gap: 9px; }
.ab3-book.vert .ab3-who { font-size: 24px; } .ab3-book.vert .ab3-q { font-size: 19px; margin-top: 4px; } .ab3-book.vert .ab3-verse { font-size: 15.5px; }

/* ---------- 5 · four doors ---------- */
body.ab3d .ab3-doors { perspective: 1600px; opacity: 1 !important; transform: none !important; }
body.ab3d .ab3-doors > a { position: relative; transform-origin: 0 50%; transform: rotateY(-58deg) !important; opacity: .3;
  transition: transform 1.3s cubic-bezier(.2,.75,.2,1) calc(var(--k) * .13s), opacity 1s ease calc(var(--k) * .13s), box-shadow .5s ease, border-color .3s ease !important;
  box-shadow: 0 2px 0 rgba(138,108,31,.2), 0 30px 46px -30px rgba(36,29,18,.5); }
body.ab3d .ab3-doors.ab3-in > a { transform: rotateY(0) !important; opacity: 1; }
body.ab3d .ab3-doors.ab3-in > a:hover, body.ab3d .ab3-doors.ab3-in > a:focus-visible {
  transform: rotateY(-18deg) !important; transition-delay: 0s !important; transition-duration: .6s !important;
  border-color: rgba(138,108,31,.5) !important;
  box-shadow: 0 2px 0 rgba(138,108,31,.25), 36px 10px 50px -18px rgba(236,196,95,.75), 0 40px 60px -30px rgba(36,29,18,.5); }
body.ab3d .ab3-doors > a::after { content: ''; position: absolute; right: 14px; top: 50%; width: 5px; height: 26px; margin-top: -13px;
  border-radius: 3px; background: linear-gradient(180deg, #d9b85a, #8a6c1f); box-shadow: 0 2px 4px rgba(36,29,18,.3); }
@media (max-width: 760px) {
  body.ab3d .ab3-doors > a, body.ab3d .ab3-doors.ab3-in > a { transform: rotateY(-50deg) !important; opacity: .3; }
  body.ab3d .ab3-doors > a.ab3-in, body.ab3d .ab3-doors.ab3-in > a.ab3-in { transform: rotateY(0) !important; opacity: 1; transition-delay: 0s !important; }
}

/* ---------- 6 · the letter on a desk; the atom at the close ---------- */
body.ab3d .ab3-deskrow { perspective: 1600px; perspective-origin: 70% 0; }
body.ab3d .ab3-desk { position: relative; transform-origin: 50% 100%; opacity: 1 !important;
  transform: rotateX(34deg) translateY(20px) !important; transition: transform 1.4s cubic-bezier(.2,.75,.2,1) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 0 rgba(236,196,95,.14), 0 6px 0 -1px rgba(236,196,95,.08), 0 40px 60px -30px rgba(0,0,0,.9); }
body.ab3d .ab3-desk.ab3-in { transform: rotateX(4deg) !important; }
body.ab3d .ab3-desk.ab3-in:focus-within { transform: none !important; transition-duration: .5s !important; }
@media (max-width: 760px) { body.ab3d .ab3-desk.ab3-in { transform: none !important; } }
body.ab3d .ab3-close { position: relative; }
body.ab3d .ab3-close > img { position: relative; z-index: 1; }
body.ab3d .ab3-orbit.small { left: 50%; width: 240px; margin-left: -120px; top: 38px; }
#ab3-orbit-hero, #ab3-orbit-close { max-width: none !important; }
