/* ══ V3: home layout, Antigravity-style effects, story player ══
   Effects only switch on when JavaScript adds html.fx (and never with
   "reduce motion"), so without them every element is simply visible. */

/* ── hero: floating particle field + cursor glow ── */
.hero, .cs-hero { overflow: hidden; overflow: clip; isolation: isolate; }   /* clip: never scrollable, even by focus */
.fx-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
/* z-index -1: the glow stays behind panels and text, only lighting the page background */
.glow-cursor { position: fixed; left: 0; top: 0; width: 460px; height: 460px; margin: -230px 0 0 -230px; border-radius: 50%; pointer-events: none; z-index: -1;
               background: radial-gradient(circle, rgba(255,194,61,.075), transparent 62%); opacity: 0; transition: opacity .4s; }
.glow-cursor.on { opacity: 1; }
.hero h1 em { background: linear-gradient(90deg, var(--gold), var(--coral), var(--gold)); background-size: 200% 100%;
              -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* split text: words rise into place (replays when you scroll back) */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.split .w > span { display: inline-block; translate: 0 110%; transition: translate .8s cubic-bezier(.2,.8,.2,1); transition-delay: var(--wd, 0s); }
.split.go .w > span { translate: 0 0; }

/* generic reveal: replays each time a section comes back into view */
html.fx .rv { opacity: 0; translate: 0 34px; transition: opacity .7s ease var(--d, 0s), translate .8s cubic-bezier(.2,.8,.2,1) var(--d, 0s),
              scale .8s cubic-bezier(.2,.8,.2,1) var(--d, 0s), transform .2s, box-shadow .2s, background .2s; }
html.fx .rv.l { translate: -46px 0; } html.fx .rv.r { translate: 46px 0; } html.fx .rv.s { translate: 0 0; scale: .92; }
html.fx .rv.on { opacity: 1; translate: 0 0; scale: 1; }
@media (max-width: 760px) { html.fx .rv.l, html.fx .rv.r { translate: 0 34px; } }

/* magnetic buttons */
.mag { transition: translate .25s cubic-bezier(.2,.8,.2,1), transform .15s, background .15s; }

/* ── home hero ── */
.hero .kicker .sep { opacity: .5; margin: 0 .35em; }
.creds { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cred { display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 9px 14px; font-size: 14.5px; color: var(--mut); }
.cred b { color: var(--text); font-size: 17px; }
.cred .ic { font-size: 20px; }
.hero .wrap.full { display: block; }
.stats.s3 { grid-template-columns: repeat(3, 1fr); margin-top: 40px; }
@media (max-width: 760px) { .stats.s3 { grid-template-columns: 1fr; } }
.hero-art .me { translate: var(--px, 0) var(--py, 0); }

/* ── marquee of skills ── */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 14px 0; margin-top: 46px;
           -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee .track { display: flex; width: max-content; animation: marq 46s linear infinite; }
.marquee .track span { font-weight: 800; color: var(--dim); font-size: 18px; white-space: nowrap; padding-right: 34px; }
.marquee .track span::after { content: "✦"; color: var(--gold); margin-left: 34px; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ── case studies: three clean cards in one row ── */
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .cards.c3 { grid-template-columns: 1fr; } }
.card.v3 { min-height: 440px; padding: 24px; }
.card.v3 h3 { font-size: 27px; margin: 6px 0 6px; }
.card.v3 p { font-size: 16px; margin: 0 0 16px; }
.card.v3 .go { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; background: rgba(255,255,255,.18); padding: 8px 14px; border-radius: 99px; align-self: flex-start; transition: background .2s; }
.card.v3 .go::before { content: ""; border-left: 9px solid currentColor; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; }
.card.v3:hover .go { background: rgba(255,255,255,.3); }
.card.v3::after { content: ""; position: absolute; inset: 0; pointer-events: none;
                  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.16) 48%, transparent 66%); transform: translateX(-120%); transition: transform .9s ease; }
.card.v3:hover::after { transform: translateX(120%); }
.card.v3 .art img { width: 44%; height: 215px; object-fit: cover; object-position: top; top: 22px; right: 14px; }
.card.v3 .art img.wide { width: 80%; height: auto; top: 30px; right: -12px; }
/* ── growth.design-style project cards ──
   At rest: a flat, shiny tile (icon + name). On hover it unfolds to twice its height as three layers:
     1. .gd-back  the card's face (colour, spotlight, gloss, glare): tilts toward the pointer
     2. .gd-me    the Bitmoji: stays completely still, it is not part of the tilting card
     3. .gd-fg    icon + words: tilt with the card and glide further with the pointer, over the Bitmoji
   --rx/--ry (tilt), --px/--py (pointer) and --mx/--my (glare) are set by site.js. */
.gd-grid { gap: 14px; margin: 40px 0 0; }
/* room for a card to unfold over (it grows by half its height above and below) */
@media (hover: hover) { .gd-grid { margin-top: 74px; } #work.block { padding-bottom: 96px; } }
.card.gd { --c1: #6d28d9; --c2: #2e1065; height: 180px; min-height: 0; padding: 0; display: block; overflow: visible; background: none;
           box-shadow: none; border-radius: 12px; z-index: 1; transform: none !important; transform-style: flat; }
.card.gd:hover, .card.gd:focus-visible { z-index: 10; text-decoration: none; }
.card.gd:focus-visible { outline: none; }
.card.gd .gd-front, .card.gd .gd-back, .card.gd .gd-fg { position: absolute; left: 0; right: 0; border-radius: 12px; color: #fff; text-align: center; }
.card.gd .gd-front { top: 0; bottom: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
                     padding: 30px 18px 22px; background: linear-gradient(180deg, var(--c1) 42%, var(--c2)); transition: opacity .2s ease .12s; }
.card.gd:hover .gd-front, .card.gd:focus-visible .gd-front { opacity: 0; transition-delay: 0s; }

/* the two moving layers share one box and one tilt, so the face and the words move as one card */
.card.gd .gd-back, .card.gd .gd-fg { top: -50%; height: 200%; scale: 1 .5;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: scale .38s cubic-bezier(.3,1.35,.5,1), transform .22s ease-out, box-shadow .3s, opacity .2s; }
.card.gd:hover .gd-back, .card.gd:focus-visible .gd-back, .card.gd:hover .gd-fg, .card.gd:focus-visible .gd-fg { scale: 1.04; }
.card.gd .gd-back { z-index: 1;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.26), rgba(255,255,255,0) 36%), linear-gradient(180deg, var(--c1) 42%, var(--c2)); }
.card.gd:hover .gd-back, .card.gd:focus-visible .gd-back { box-shadow: 0 0 0 1.5px rgba(255,255,255,.9), inset 0 1px 0 rgba(255,255,255,.45), 0 34px 70px rgba(0,0,0,.6); }
.card.gd .gd-fg { z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 22px 20px 20px;
                  opacity: 0; transform-style: preserve-3d; pointer-events: none; }
.card.gd:hover .gd-fg, .card.gd:focus-visible .gd-fg { opacity: 1; transition-delay: 0s, 0s, 0s, .06s; }

/* the Bitmoji: outside the tilting card, so it never moves while the pointer does */
.card.gd .gd-me { position: absolute; z-index: 2; left: 50%; top: -16%; height: 110%; width: auto; max-width: 92%; translate: -50% 0; margin: 0;
                  object-fit: contain; pointer-events: none; opacity: 0; scale: .8; filter: drop-shadow(0 14px 18px rgba(0,0,0,.35));
                  transition: opacity .2s, scale .38s cubic-bezier(.3,1.35,.5,1); }
.card.gd:hover .gd-me, .card.gd:focus-visible .gd-me { opacity: 1; scale: 1.04; transition-delay: .06s, 0s; }
.card.gd .gd-me.pic { top: -20%; height: 100%; max-width: 86%; border-radius: 10px; object-fit: cover; }
.card.gd .gd-me.emo { top: -10%; height: auto; font-size: 120px; line-height: 1; }

/* the words and icon float at different heights; as the card tilts they slide across the still Bitmoji.
   The extra glide goes the same way as the tilt's own shift (away from the pointer), so the two add up. */
.card.gd .gd-fg > * { transition: transform .22s ease-out; }
.card.gd:hover .gd-fg .gd-ic.sm { transform: translateZ(120px) translate(calc(var(--px, 0) * -26px), calc(var(--py, 0) * -18px)); }
.card.gd:hover .gd-fg p { transform: translateZ(95px) translate(calc(var(--px, 0) * -20px), calc(var(--py, 0) * -14px)); }
.card.gd:hover .gd-fg .kind { transform: translateZ(80px) translate(calc(var(--px, 0) * -16px), calc(var(--py, 0) * -11px)); }
.card.gd:hover .gd-fg .go { transform: translateZ(65px) translate(calc(var(--px, 0) * -12px), calc(var(--py, 0) * -8px)); }
.card.gd .gd-fg .kind, .card.gd .gd-fg p, .card.gd .gd-fg .go { position: relative; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.card.gd .gd-fg .gd-ic.sm { top: 38px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }   /* lower: floating high pushes it outward */

/* shiny, solid tiles: a bevel, a thick slab edge underneath, a gloss across the top,
   a light that sweeps across every few seconds, and on hover a glare that follows the pointer */
.card.gd .gd-front { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -16px 26px -14px rgba(0,0,0,.45),
                                 0 6px 0 -1px color-mix(in srgb, var(--c2) 65%, #000), 0 8px 0 -1px rgba(0,0,0,.35), 0 20px 34px -8px rgba(0,0,0,.65); }
.card.gd .gd-front::before, .card.gd .gd-back::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(165deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.1) 26%, rgba(255,255,255,0) 48%); }
.card.gd .gd-back::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,.5), rgba(255,255,255,0) 45%); mix-blend-mode: soft-light; }
.card.gd:hover .gd-back::after { opacity: 1; }
.card.gd::after { content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none; z-index: 5;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.32) 49%, rgba(255,255,255,.08) 54%, transparent 62%);
  background-size: 260% 100%; background-position: 160% 0; animation: gdShine 7s ease-in-out var(--sd, 0s) infinite; transition: opacity .2s; }
.card.gd:hover::after { opacity: 0; }
.gd-grid .card.gd:nth-child(3n+2) { --sd: 1.4s; } .gd-grid .card.gd:nth-child(3n) { --sd: 2.8s; }
@keyframes gdShine { 0%, 62% { background-position: 160% 0; } 82%, 100% { background-position: -60% 0; } }

.gd-ic { display: block; width: 64px; height: 64px; }
.gd-ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gd-ic.sm { position: absolute; top: 16px; left: 50%; width: 38px; height: 38px; margin-left: -19px; opacity: .95; }
.gd-ic.emoji { font-size: 54px; line-height: 64px; text-align: center; }
.gd-ic.emoji.sm { font-size: 32px; line-height: 38px; }
.card.gd h3 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.01em; opacity: .95; }
.card.gd .kind { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: rgba(0,0,0,.38); padding: 3px 10px; border-radius: 6px; margin-bottom: 8px; opacity: 1; }
.card.gd p { font-size: 17.5px; font-weight: 700; line-height: 1.3; margin: 0 0 8px; max-width: 24ch; opacity: 1; }
.card.gd .go { font-size: 13px; font-weight: 600; opacity: .9; background: none; padding: 0; }
.card.gd .go::before { content: "▶  "; font-size: 10px; }
.card.gd.extra .go::before { content: "↗  "; }
.card.gd.g-sarvodaya { --c1: #c2410c; --c2: #5c1414; }
.card.gd.g-split { --c1: #6d28d9; --c2: #2e1065; }
.card.gd.g-kbs { --c1: #1d4ed8; --c2: #0b1437; }
.card.gd.g-x-sunset { --c1: #c2410c; --c2: #5c1414; } .card.gd.g-x-violet { --c1: #6d28d9; --c2: #2e1065; }
.card.gd.g-x-ocean { --c1: #0e7490; --c2: #0b1437; } .card.gd.g-x-forest { --c1: #0f766e; --c2: #052e2b; }
.card.gd.g-x-rose { --c1: #be185d; --c2: #4c0519; } .card.gd.g-x-night { --c1: #4b5563; --c2: #111827; }
/* phones and tablets have no hover: like growth.design, just the flat tiles (tap to play) */
@media (hover: none) {
  .card.gd { height: 150px; }
  .card.gd .gd-back, .card.gd .gd-fg, .card.gd .gd-me { display: none; }
  .card.gd .gd-front { padding: 24px 16px 18px; }
}

/* project cards added in /admin */
.g-x-sunset { background: linear-gradient(135deg, #5c1414, #a2361a 55%, #d97706); }
.g-x-violet { background: linear-gradient(135deg, #2e1065, #5b21b6 55%, #8b5cf6); }
.g-x-ocean  { background: linear-gradient(135deg, #0b1437, #1e3a8a 55%, #0e7490); }
.g-x-forest { background: linear-gradient(135deg, #052e2b, #0f766e 55%, #65a30d); }
.g-x-rose   { background: linear-gradient(135deg, #4c0519, #9f1239 55%, #f472b6); }
.g-x-night  { background: linear-gradient(135deg, #111827, #374151 55%, #6b7280); }
.card.extra .art .emo { position: absolute; right: 26px; top: 26px; font-size: 92px; line-height: 1; transform: rotate(8deg);
                        filter: drop-shadow(0 14px 22px rgba(0,0,0,.35)); transition: transform .35s ease; }
.card.extra:hover .art .emo { transform: rotate(0) translateY(-6px) scale(1.05); }
.card.extra .go::before { content: "↗"; border: 0; font-size: 13px; }
.kbs-art { position: absolute; right: 18px; top: 24px; width: 54%; display: grid; gap: 6px; transform: rotate(4deg); }
.kbs-art span { background: rgba(255,255,255,.12); border-radius: 9px; padding: 6px 10px; font-size: 13.5px; font-weight: 700; }
.kbs-art span.g { background: rgba(255,194,61,.4); }
.kbs-art span.d { text-align: center; opacity: .6; }

/* ── experience: one wide window with skills ── */
.xp-wide { display: grid; grid-template-columns: 1.2fr .8fr; background: var(--card); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
@media (max-width: 900px) { .xp-wide { grid-template-columns: 1fr; } }
.xp-wide .role { padding: 30px; }
.xp-wide .role h3 { font-size: 25px; font-weight: 800; }
.xp-wide .role .meta { color: var(--mut); margin: 4px 0 16px; }
.xp-wide .role ul { margin: 0; padding-left: 18px; color: #e9e1d5; }
.xp-wide .role li { margin-bottom: 9px; }
.xp-wide .lorbox { background: linear-gradient(160deg, #3a2a10, #241f1a 75%); padding: 30px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
@media (max-width: 900px) { .xp-wide .lorbox { border-left: 0; border-top: 1px solid var(--line); } }
.xp-wide .skillwrap { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 26px 30px 30px; }
.xp-wide .skillwrap > h3 { font-size: 20px; margin-bottom: 4px; }
.xp-wide .skillwrap > p { margin: 0 0 18px; color: var(--mut); font-size: 15px; }
.skillgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 26px; }
@media (max-width: 900px) { .skillgrid { grid-template-columns: 1fr; } }
.skillgrid h4 { margin: 0 0 9px; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.skillgrid .skills span { transition: translate .2s, border-color .2s, color .2s; }
.skillgrid .skills span:hover { translate: 0 -2px; border-color: var(--gold); color: var(--gold); }

/* ── education timeline with a line that draws itself ── */
.edu { position: relative; padding-left: 36px; max-width: 860px; }
.edu::before, .edu .line { content: ""; position: absolute; left: 10px; top: 8px; width: 2px; border-radius: 2px; }
.edu::before { bottom: 8px; background: var(--line); }
.edu .line { height: 0; background: linear-gradient(var(--gold), var(--coral)); }
html:not(.fx) .edu .line { display: none; }
.edu-item { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; margin-bottom: 14px; }
.edu-item::before { content: ""; position: absolute; left: -33px; top: 21px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--gold); }
.edu-item .y { font-size: 13px; font-weight: 800; color: var(--gold); letter-spacing: .06em; text-transform: uppercase; }
.edu-item h3 { font-size: 19px; margin: 4px 0 3px; }
.edu-item p { margin: 0; color: var(--mut); font-size: 15px; }
.edu-item .subj { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.edu-item .subj span { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); }
.edu-item.cert { border-color: rgba(255,194,61,.45); background: linear-gradient(160deg, rgba(255,194,61,.09), var(--card) 70%); }
.edu-item.cert .badge { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 800; color: var(--gold-ink); background: var(--gold); border-radius: 99px; padding: 4px 12px; }

/* ── about me as a story ── */
.chapters { display: grid; gap: 16px; }
.chapter { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
@media (max-width: 700px) { .chapter { grid-template-columns: 1fr; gap: 6px; } }
.chapter .when { font-weight: 800; color: var(--gold); font-size: 15px; }
.chapter .when small { display: block; color: var(--dim); font-weight: 800; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
.chapter h3 { font-size: 22px; margin: 0 0 8px; }
.chapter p { margin: 0 0 8px; color: #e6ddd0; }
.chapter p:last-child { margin-bottom: 0; }
.chapter.now { border-color: rgba(255,194,61,.5); background: linear-gradient(160deg, rgba(255,194,61,.08), var(--card) 70%); }
.about-grid { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
@media (max-width: 960px) { .about-grid { grid-template-columns: 1fr; } }
.about-grid .panel { position: sticky; top: 90px; }
@media (max-width: 960px) { .about-grid .panel { position: static; } }

/* case-study endings: the documents, then the resume */
.end .grid.more { margin-top: 14px; }
.doc.resume { border-color: rgba(255,194,61,.5); background: linear-gradient(160deg, rgba(255,194,61,.1), var(--card) 70%); }

/* ═══ story player (growth.design-style slideshow) ═══ */
.play-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 24px; }
.play-bar[hidden] { display: none; }
.btn.play { font-size: 17px; padding: 14px 22px; border-radius: 14px; box-shadow: 0 10px 30px rgba(255,194,61,.25); }
.btn.play::before { content: ""; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.play-bar .dur { color: var(--mut); font-size: 14.5px; }
.play-bar .dur b { color: var(--text); }

body.pl-open { overflow: hidden; }
.player { position: fixed; inset: 0; z-index: 100; display: none; color: var(--text); overflow: hidden; overflow: clip; background: #0d0b09; font-family: var(--sans); }
.player.open { display: block; animation: plIn .35s ease; }
@keyframes plIn { from { opacity: 0; } to { opacity: 1; } }
.pl-bg { position: absolute; inset: -60px; background: var(--pl-grad, #241f1a) center / cover no-repeat; filter: blur(28px) saturate(1.25); opacity: .5; }
.pl-tint { position: absolute; inset: 0; background: radial-gradient(1100px 700px at 50% 45%, var(--pl-tint, rgba(162,54,26,.45)), rgba(10,8,6,.88) 75%); transition: background .8s; }
.pl-top { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; z-index: 6; }
.pl-ttl { font-weight: 800; font-size: 15px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-top .acts { display: flex; gap: 8px; flex: none; }
.pl-top button { height: 40px; border-radius: 99px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.35); color: #fff; font: inherit; font-size: 14px; font-weight: 700; padding: 0 14px; cursor: pointer; }
.pl-top button:hover { background: rgba(255,255,255,.12); }
.pl-top .pl-x { width: 40px; padding: 0; font-size: 17px; }

.pl-stage { position: absolute; inset: 64px 84px 70px 160px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 30px; z-index: 3; }
.pl-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; max-height: 100%; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding: 8px 8px; }
.pl-col::-webkit-scrollbar { display: none; }
/* centred while it fits, top-aligned (and scrollable) when it doesn't */
.pl-col > :first-child { margin-top: auto; } .pl-col > :last-child { margin-bottom: auto; }
.pl-left { align-items: flex-end; }
.pl-right { align-items: flex-start; }
.pl-dev { position: relative; display: flex; justify-content: center; align-items: center; max-height: 100%; }
.pl-dev.swap { animation: plSwap .5s cubic-bezier(.2,.8,.2,1); }
@keyframes plSwap { from { opacity: 0; transform: translateY(24px) scale(.95) rotate(-1deg); } to { opacity: 1; transform: none; } }
.pl-dev .device.phone { width: min(290px, 31vh); }
.pl-dev .device.phone img { max-height: calc(100vh - 190px); }
.pl-dev .device.browser { width: min(620px, 40vw); }
.pl-dev .device.art { width: min(440px, 34vw); }
.pl-dev .art-card { max-height: calc(100vh - 160px); overflow: auto; }
.pl-dev .demo { width: min(560px, 42vw); margin: 0; max-height: calc(100vh - 150px); overflow: auto; }
.pl-dev .demo::before { position: static; display: inline-block; margin-bottom: 6px; }
.player .beat { opacity: 1 !important; transform: none !important; }
.pl-point { position: absolute; left: 100%; top: 42%; margin-left: 10px; font-size: 44px; animation: plPoint 1.1s ease-in-out infinite; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); pointer-events: none; }
@keyframes plPoint { 0%,100% { transform: translateX(0) } 50% { transform: translateX(-12px) } }

/* comic lettering */
.pl-chap, .pl-cap, .pl-bub { font-family: "Kalam", var(--hi); }
.pl-chap { background: #1d1712; color: #fff; border: 2px solid #fff; box-shadow: 5px 5px 0 rgba(0,0,0,.45); padding: 12px 16px 14px; max-width: 380px; transform: rotate(-1deg); }
.pl-chap .sc { font-family: var(--sans); font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #cfc4b4; }
.pl-chap .k { font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-top: 6px; display: inline-block; }
.pl-chap.twist .k { color: var(--coral); animation: shake .6s ease .3s; }
.pl-chap h3 { font-size: 27px; line-height: 1.15; margin-top: 4px; letter-spacing: 0; font-weight: 700; }
.pl-cap { background: #fff1a8; color: #1d1712; border: 2px solid #1d1712; box-shadow: 4px 4px 0 #1d1712; padding: 11px 15px; max-width: 360px; font-size: 19px; line-height: 1.35; transform: rotate(-.5deg); }
.pl-cap.long { font-size: 16.5px; max-width: 390px; }
.pl-cap ul { margin: 0; padding-left: 18px; } .pl-cap li { margin-bottom: 5px; }
.pl-cap .mut { color: #6b5e52; }
.pl-talk { display: flex; align-items: flex-end; gap: 10px; max-width: 420px; }
.pl-talk .pl-av { width: 46px; height: 46px; border-radius: 50%; flex: none; background: #fff; border: 2px solid #1d1712; }
.pl-left .pl-talk { flex-direction: row-reverse; }
.pl-bub { position: relative; background: #fff; color: #1d1712; border: 2.5px solid #1d1712; border-radius: 22px; padding: 11px 16px 12px; font-size: 19px; line-height: 1.35; box-shadow: 4px 4px 0 rgba(0,0,0,.35); min-width: 0; }
.pl-bub .who { display: block; font-family: var(--sans); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a7a66; margin-bottom: 2px; }
.pl-bub .tr { display: block; font-family: var(--sans); font-size: 13.5px; color: #5f5244; margin-top: 6px; line-height: 1.4; }
.pl-bub .mut { color: #7a6c5c; font-family: var(--sans); font-size: 13px; }
.pl-bub q { font-weight: 700; }
.pl-bub.long { font-size: 16.5px; }
.pl-talk.think .pl-bub { border-style: dashed; background: #f4efe6; font-style: italic; }
.pl-talk.think .pl-bub .who::after { content: " · thinks"; text-transform: none; letter-spacing: 0; font-style: normal; }
.pl-talk.ai .pl-bub { background: #e5efff; }
.pl-talk.me .pl-bub { background: #fff6d6; }
.pl-bub::after { content: ""; position: absolute; bottom: 10px; left: -13px; border: 7px solid transparent; border-right: 12px solid #1d1712; border-left: 0; }
.pl-left .pl-bub::after { left: auto; right: -13px; border-right: 0; border-left: 12px solid #1d1712; }
.pl-ins { background: #fff; color: #1d1712; border-radius: 16px; padding: 14px 16px; max-width: 360px; box-shadow: 0 16px 36px rgba(0,0,0,.45); border-top: 5px solid #c2255c; }
.pl-ins .k { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #c2255c; }
.pl-ins.tip { border-top-color: #1d4ed8; } .pl-ins.tip .k { color: #1d4ed8; }
.pl-ins h5 { margin: 5px 0 5px; font-size: 18px; line-height: 1.25; }
.pl-ins p { margin: 0; font-size: 14.5px; color: #3b3027; line-height: 1.5; }
.pl-stats { display: flex; flex-wrap: wrap; gap: 10px; max-width: 420px; }
.pl-stat { background: rgba(20,17,14,.9); border: 1px solid rgba(255,194,61,.55); border-radius: 14px; padding: 10px 14px; flex: 1 1 150px; }
.pl-stat b { display: block; font-size: 30px; color: var(--gold); line-height: 1.1; }
.pl-stat span { font-size: 13.5px; color: #e6ddd0; line-height: 1.35; display: block; }
.pl-in { animation: plBeat .5s cubic-bezier(.3,1.45,.5,1) both; }
@keyframes plBeat { from { opacity: 0; transform: translateY(16px) scale(.88); } to { opacity: 1; transform: none; } }
.pl-chap.pl-in { animation-name: plChap; }
@keyframes plChap { from { opacity: 0; transform: translateY(16px) scale(.9) rotate(-4deg); } to { opacity: 1; transform: rotate(-1deg); } }
.pl-cap.pl-in { animation-name: plCap; }
@keyframes plCap { from { opacity: 0; transform: translateY(16px) scale(.9) rotate(2deg); } to { opacity: 1; transform: rotate(-.5deg); } }

/* narrator, goal tracker, frustration meter */
/* narrator: a sticker of Sanyam whose expression follows the story */
.pl-narr { position: absolute; left: 10px; bottom: 10px; width: 150px; height: 175px; display: flex; align-items: flex-end; justify-content: center; z-index: 4; pointer-events: none; }
/* no white outline (Sanyam's choice): a soft warm glow instead, so dark hair doesn't vanish into the dark background */
.pl-narr img { max-width: 100%; max-height: 100%; width: auto; height: auto; transform-origin: 50% 100%;
               filter: drop-shadow(0 0 16px rgba(255, 226, 190, .32)) drop-shadow(0 12px 18px rgba(0,0,0,.5)); }
.pl-narr img.bump { animation: plBump .55s ease; }
.pl-narr img.pop { animation: plPop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes plBump { 35% { transform: translateY(-12px) rotate(-7deg); } 70% { transform: translateY(0) rotate(3deg); } }
@keyframes plPop { from { transform: scale(.6) translateY(18px); opacity: .2; } to { transform: none; opacity: 1; } }
.pl-ttl { flex: 1 1 auto; min-width: 0; }
.pl-goals { flex: none; display: flex; align-items: center; gap: 10px; background: rgba(13,11,9,.72); border: 1px solid rgba(255,255,255,.16); border-radius: 99px; padding: 6px 8px 6px 14px; backdrop-filter: blur(6px); }
.pl-goals .lab { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; white-space: nowrap; }
.pl-goals .now { font-weight: 800; font-size: 14px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-gdots { display: flex; gap: 5px; }
.pl-gdots i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(0,0,0,.3); display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; transition: background .4s, border-color .4s; }
.pl-gdots i.done { background: #2fbf71; border-color: #2fbf71; }
.pl-gdots i.cur { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,194,61,.3); }
.pl-meter { position: absolute; left: 57px; bottom: 200px; top: 128px; width: 18px; border-radius: 99px; background: rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.3); overflow: hidden; z-index: 4; }
.pl-meter i { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; border-radius: 99px; transition: height .7s cubic-bezier(.2,.8,.2,1), background .7s; }
.pl-meter-lab { position: absolute; left: 16px; top: 70px; width: 100px; text-align: center; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; line-height: 1.25; color: #cfc4b4; z-index: 4; }
.pl-meter-lab span { display: block; font-size: 20px; transition: transform .3s; }

/* controls */
.pl-nav { position: absolute; right: 18px; bottom: 16px; display: flex; gap: 10px; z-index: 6; }
.pl-nav button { width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.45); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: background .15s, transform .15s; }
.pl-nav button:hover { background: rgba(255,194,61,.28); transform: translateY(-2px); }
.pl-nav button.next { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.pl-nav button.next:hover { background: #ffd166; }
.pl-nav button:disabled { opacity: .3; cursor: default; transform: none; }
.pl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.12); z-index: 6; }
.pl-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--coral)); transition: width .35s; }
.pl-count { position: absolute; right: 150px; bottom: 32px; font-size: 13px; font-weight: 700; color: #cfc4b4; z-index: 6; }
.pl-hint { position: absolute; right: 18px; bottom: 84px; z-index: 6; font-family: "Kalam", var(--hi); background: #fff1a8; color: #1d1712; border: 2px solid #1d1712; box-shadow: 3px 3px 0 #1d1712;
           padding: 7px 12px; font-size: 16px; transform: rotate(-2deg); transition: opacity .4s; max-width: 330px; }
.pl-hint.gone { opacity: 0; pointer-events: none; }
.pl-hint kbd { font-family: var(--sans); font-weight: 800; background: #fff; border: 1.5px solid #1d1712; border-radius: 6px; padding: 0 6px; font-size: 13px; }

.pl-end { background: #fff; color: #1d1712; border-radius: 22px; padding: 28px; width: min(560px, 92vw); text-align: center; box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.pl-end .big { font-size: 46px; line-height: 1; }
.pl-end h3 { font-size: 27px; margin: 10px 0 6px; }
.pl-end p { color: #5f5244; margin: 0 0 18px; }
.pl-end .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.pl-end a, .pl-end button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d8cfc0; background: #faf6ef; color: #1d1712; border-radius: 11px; padding: 9px 14px;
                            font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; text-decoration: none; }
.pl-end a:hover, .pl-end button:hover { background: #f0e8da; text-decoration: none; }
.pl-end .pri { background: #1d1712; color: #fff; border-color: #1d1712; }
.pl-end .pri:hover { background: #3a2a10; }
.pl-end .pl-share { border-top: 1px dashed #d8cfc0; padding-top: 14px; margin-top: 6px; }
.pl-end .pl-share small { display: block; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8a7a66; margin-bottom: 8px; }

@media (max-width: 1100px) { .pl-stage { inset: 64px 20px 76px 160px; gap: 20px; } }
@media (max-width: 900px) {
  .pl-stage { inset: 58px 0 80px; padding: 0 14px 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
  .pl-col { max-height: none; overflow: visible; padding: 0; align-items: center; width: 100%; }
  .pl-col > :first-child, .pl-col > :last-child { margin-block: 0; }
  .pl-right { display: none; }
  .pl-dev { order: -1; max-height: none; }
  .pl-dev .device.phone { width: min(190px, 46vw); } .pl-dev .device.phone img { max-height: 36vh; }
  .pl-dev .device.browser, .pl-dev .device.art, .pl-dev .demo { width: calc(100vw - 32px); }
  .pl-dev .art-card { max-height: 44vh; padding: 14px; }
  .pl-dev .demo { max-height: none; }
  .pl-chap, .pl-cap, .pl-ins, .pl-talk, .pl-stats { max-width: calc(100vw - 40px); }
  .pl-chap h3 { font-size: 22px; }
  .pl-cap, .pl-bub { font-size: 16.5px; }
  .pl-left .pl-talk { flex-direction: row; }
  .pl-left .pl-bub::after { right: auto; left: -13px; border-left: 0; border-right: 12px solid #1d1712; }
  .pl-meter, .pl-meter-lab, .pl-goals, .pl-point, .pl-count, .pl-top .art { display: none; }
  .pl-narr { left: 6px; bottom: 6px; width: 70px; height: 84px; }
  .pl-hint { right: 12px; left: 76px; bottom: 82px; font-size: 14.5px; text-align: center; max-width: none; }
  .pl-nav { right: 12px; bottom: 12px; } .pl-nav button { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  html.fx .rv { opacity: 1 !important; translate: none !important; scale: none !important; }
  .split .w > span { translate: none !important; }
  .marquee .track, .hero h1 em, .card.gd::after { animation: none; }
  .pl-in, .pl-dev.swap, .player.open, .pl-narr img.bump, .pl-narr img.pop, .pl-point { animation: none; }
}
