/* ==========================================================================
   CASE STUDY template (work/aurum, work/pulse, work/atlas)
   Requires work.css (cover art + .sc-label). Centrepieces: .cfg (Aurum),
   .pl- (Pulse phone), .at- (Atlas live map).
   ========================================================================== */
.case { --case-accent: var(--accent); }

/* Reading progress */
.cs-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 130; pointer-events: none; }
.cs-progress span {
    display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
    background: linear-gradient(90deg, var(--accent), var(--case-accent, var(--accent)));
    box-shadow: 0 0 12px rgba(200, 255, 46, .6);
}

/* ==========================================================================
   HERO
   ========================================================================== */
.cs-hero { position: relative; padding-top: calc(var(--nav-h) + clamp(1.5rem, 4vw, 3rem)); }
.cs-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--font-mono); font-size: .72rem; color: var(--dim); }
.cs-crumbs li + li::before { content: '/'; margin-right: .5rem; color: var(--dim); }
.cs-crumbs a { color: var(--muted); transition: color .2s; }
.cs-crumbs a:hover { color: var(--accent); }
.cs-crumbs [aria-current] { color: var(--text); }
.cs-hero-label { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: clamp(2rem, 5vw, 3.5rem) 0 1rem; }
.cs-hero-note { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
.cs-title { font-size: clamp(4rem, 19vw, 19rem); line-height: .82; letter-spacing: -0.065em; margin-left: -.05em; }
.cs-title--long { font-size: clamp(3.2rem, 12.5vw, 12.5rem); }
.cs-title-in { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; }
.cs-title-in > .ch { display: inline-block; animation: csRise 1.2s var(--ease-out) both; animation-delay: calc(var(--i) * 50ms + 100ms); }
.cs-title-2 { color: var(--case-accent); }
@keyframes csRise { from { transform: translateY(105%) rotate(4deg); } }
.cs-tagline {
    font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 2.2rem); letter-spacing: -0.025em; line-height: 1.15;
    color: var(--text); max-width: 28ch; margin-top: clamp(1rem, 2vw, 1.75rem);
    animation: fadeUp 1s var(--ease-out) .5s both;
}
.cs-tagline em { font-family: var(--font-serif); font-style: italic; color: var(--case-accent); font-weight: 400; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } }

.cs-hero-media {
    position: relative; margin-top: clamp(2.5rem, 5vw, 4rem);
    border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
    aspect-ratio: 16 / 8; animation: mediaIn 1.6s var(--ease-out) .25s both;
}
@keyframes mediaIn { from { clip-path: inset(18% 10% 18% 10% round 14px); opacity: .2; } to { clip-path: inset(0 round 14px); opacity: 1; } }
.cs-cover { position: absolute; inset: -6% 0; will-change: transform; }

.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); margin-top: clamp(2rem, 4vw, 3rem); }
.cs-meta > div { padding: 1.25rem 1.25rem 1.5rem 0; border-top: 1px solid var(--border-strong); }
.cs-meta > div + div { padding-left: 1.25rem; border-left: 1px solid var(--border); }
.cs-meta dt { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--case-accent); margin-bottom: .5rem; }
.cs-meta dd { color: var(--text); font-size: .98rem; line-height: 1.45; }

/* ==========================================================================
   BRIEF / CHALLENGE / APPROACH
   ========================================================================== */
.cs-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(2rem, 6vw, 6rem); }
.cs-prose { display: grid; gap: 1.25rem; }
.cs-big { font-size: clamp(1.2rem, 1.9vw, 1.6rem); line-height: 1.45; color: var(--text); }
.cs-glance { display: grid; align-content: start; border-top: 1px solid var(--border-strong); }
.cs-glance > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cs-glance dt { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding-top: .2rem; }
.cs-glance dd { color: var(--text); font-size: .95rem; }

.cs-challenge { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .015) 30%, transparent); }
.cs-statement {
    font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 3.2rem); line-height: 1.15; letter-spacing: -0.03em;
    color: var(--muted); max-width: 30ch; margin-bottom: clamp(3rem, 6vw, 5rem);
}
.cs-statement mark {
    background: linear-gradient(transparent 62%, color-mix(in srgb, var(--case-accent) 28%, transparent) 62%);
    color: var(--text); padding: 0 .05em;
}
.cs-constraints { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.cs-constraints li { background: var(--bg); padding: clamp(1.5rem, 3vw, 2.25rem); display: grid; gap: .75rem; align-content: start; transition: background .4s; }
.cs-constraints li:hover { background: var(--surface); }
.cs-n { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; color: var(--case-accent); }
.cs-constraints p { font-size: .95rem; }

.cs-approach-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.cs-sticky { position: sticky; top: calc(var(--nav-h) + 2rem); display: grid; gap: 1.25rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.cs-steps { list-style: none; counter-reset: none; }
.cs-steps li {
    display: grid; grid-template-columns: clamp(4rem, 8vw, 7rem) 1fr; gap: 1rem; padding: 2rem 0;
    border-top: 1px solid var(--border);
}
.cs-steps li:last-child { border-bottom: 1px solid var(--border); }
.cs-step-n {
    font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: .9; letter-spacing: -0.05em;
    color: transparent; -webkit-text-stroke: 1px var(--border-strong); transition: color .5s, -webkit-text-stroke-color .5s;
}
.cs-steps li:hover .cs-step-n, .cs-steps li.is-in .cs-step-n { -webkit-text-stroke-color: var(--case-accent); }
.cs-steps li.is-in:hover .cs-step-n { color: var(--case-accent); }
.cs-step-wk { font-family: var(--font-mono); font-size: .7rem; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.cs-steps h3 { margin: .35rem 0 .6rem; }
.cs-steps p { font-size: .97rem; }

/* ==========================================================================
   ENGINEERING SNIPPETS
   ========================================================================== */
.cs-snips { display: grid; gap: clamp(3rem, 6vw, 5rem); }
.cs-snip { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.cs-snip:nth-child(even) .cs-snip-copy { order: 2; }
.cs-snip-copy { display: grid; gap: .9rem; }
.cs-snip-copy p { font-size: .98rem; }
.cs-code { min-width: 0; }
.cs-code .term-body { margin: 0; font-size: .8rem; line-height: 1.75; tab-size: 4; max-height: 440px; overflow: auto; }
.cs-code code { font-family: var(--font-mono); white-space: pre; display: block; counter-reset: ln; }
.cs-code .term-title { margin-right: 0; text-align: left; }
.cs-code .term-copy { position: static; }
.cs-code .ln { display: block; }
.cs-code .ln::before {
    counter-increment: ln; content: counter(ln); display: inline-block; width: 2.2em; margin-right: 1em;
    text-align: right; color: #3a3944; user-select: none;
}
.tk-c { color: #5f6b5a; font-style: italic; }
.tk-s { color: #c8ff2e; }
.tk-k { color: #b3a1ff; }
.tk-t { color: #2ee6ff; }
.tk-n { color: #febc2e; }
.tk-f { color: #f4f3ee; font-weight: 500; }
.tk-a { color: #ff8a8a; }

/* ==========================================================================
   METRICS / STACK
   ========================================================================== */
.cs-metrics { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.cs-metrics li {
    position: relative; background: var(--bg); padding: clamp(1.5rem, 3vw, 2.25rem); min-height: 15rem;
    display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; overflow: hidden;
}
.cs-metrics li::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--case-accent);
    transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease-out) .3s;
}
.cs-metrics li.is-in::after { transform: scaleX(1); }
.cs-tag { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.cs-num { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.6rem, 5vw, 4.6rem); letter-spacing: -0.05em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.cs-mlabel { color: var(--muted); font-size: .92rem; }

.cs-stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); }
.cs-stack-grid h3 { font-family: var(--font-mono); font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.cs-stack-grid ul { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; }

/* ==========================================================================
   NEXT PROJECT
   ========================================================================== */
.cs-next-wrap { border-top: 1px solid var(--border); }
.cs-next { position: relative; display: block; overflow: hidden; padding: clamp(4rem, 10vw, 9rem) 0; isolation: isolate; }
.cs-next-inner { position: relative; z-index: 2; display: grid; gap: 1rem; }
.cs-next-title {
    display: flex; align-items: center; gap: .3em; flex-wrap: wrap;
    font-family: var(--font-display); font-weight: 500; font-size: clamp(3.2rem, 12vw, 11rem); line-height: .9; letter-spacing: -0.06em;
    transition: transform .8s var(--ease-out), color .4s;
}
.cs-next-arrow { display: inline-block; font-size: .6em; color: var(--accent); transition: transform .8s var(--ease-out); }
.cs-next-sub { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); letter-spacing: .06em; }
.cs-next-cover {
    position: absolute; inset: 0; z-index: 0; opacity: .18; transform: scale(1.08);
    transition: opacity .8s var(--ease-out), transform 1.4s var(--ease-out);
}
.cs-next-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 15%, rgba(5, 5, 7, .55) 60%, rgba(5, 5, 7, .2)); }
.cs-next:hover .cs-next-cover, .cs-next:focus-visible .cs-next-cover { opacity: .75; transform: scale(1); }
.cs-next:hover .cs-next-title { transform: translateX(clamp(.5rem, 2vw, 2rem)); }
.cs-next:hover .cs-next-arrow { transform: translateX(.3em) rotate(-45deg); }
.cs-next:focus-visible { outline-offset: -4px; }

/* ==========================================================================
   AURUM — configurator
   ========================================================================== */
.cfg {
    display: grid; grid-template-columns: 1.3fr 1fr; border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; background: var(--surface);
}
.cfg-stage {
    position: relative; min-height: 640px; overflow: hidden; perspective: 1200px; touch-action: pan-y; cursor: grab;
    background: radial-gradient(60% 60% at 50% 48%, rgba(230, 187, 92, .22), transparent 70%), radial-gradient(circle at 50% 50%, #1b140a, #060504 75%);
}
.cfg-stage:active { cursor: grabbing; }
.cfg-ring { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; border: 1px dashed rgba(230, 187, 92, .18); animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cfg-watch { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s var(--ease-out); }
.cfg-watch svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cfg-watch.is-swap { animation: cfgPulse .7s var(--ease-out); }
@keyframes cfgPulse { 40% { scale: .97; } }
.cfg-ref { position: absolute; left: 1.25rem; bottom: 1.1rem; font-size: .72rem; color: rgba(230, 187, 92, .85); letter-spacing: .1em; }
.cfg-ref span { color: var(--dim); }
.cfg-hint { position: absolute; right: 1.25rem; bottom: 1.1rem; font-size: .66rem; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; }
.cfg-panel { padding: clamp(1.5rem, 3vw, 2.5rem); display: grid; gap: 1.6rem; align-content: start; border-left: 1px solid var(--border); }
.cfg-group { border: 0; display: grid; gap: .8rem; }
.cfg-group legend {
    display: flex; justify-content: space-between; width: 100%; gap: 1rem; padding: 0 0 .7rem; margin-bottom: .8rem;
    font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim);
    border-bottom: 1px solid var(--border);
}
.cfg-val { color: var(--text); letter-spacing: .04em; text-transform: none; font-size: .78rem; text-align: right; }
.cfg-swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.cfg-sw { position: relative; display: grid; justify-items: center; gap: .45rem; cursor: pointer; }
.cfg-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cfg-dot {
    width: 54px; height: 54px; border-radius: 50%; background: var(--sw); position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 6px 16px rgba(0, 0, 0, .4);
    transition: transform .45s var(--ease-out);
}
.cfg-dot::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid transparent; transition: border-color .3s, inset .45s var(--ease-out); }
.cfg-sw:hover .cfg-dot { transform: translateY(-3px); }
.cfg-sw input:checked + .cfg-dot::after { border-color: #e6bb5c; inset: -5px; }
.cfg-sw input:focus-visible + .cfg-dot { outline: 2px solid var(--accent); outline-offset: 6px; }
.cfg-name { font-family: var(--font-mono); font-size: .66rem; color: var(--muted); letter-spacing: .04em; }
.cfg-sw input:checked ~ .cfg-name { color: var(--text); }
.cfg-total { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding-top: 1.4rem; border-top: 1px solid var(--border-strong); flex-wrap: wrap; }
.cfg-total-l { display: block; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: .3rem; }
.cfg-price { font-family: var(--font-display); font-size: clamp(2rem, 3.5vw, 2.8rem); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; color: #f3d48a; }
.cfg-note { font-size: .7rem; color: var(--dim); transition: color .3s; }
.cfg-note.is-flash { color: var(--accent); }

/* ==========================================================================
   PULSE — phone mini-flow
   ========================================================================== */
.pl-demo {
    display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 3rem); border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: radial-gradient(50% 60% at 50% 50%, rgba(124, 92, 255, .22), transparent 70%), var(--surface);
    overflow: hidden;
}
.pl-steps { list-style: none; display: grid; gap: .25rem; justify-self: end; }
.pl-steps li {
    display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem; border-radius: 10px;
    font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.02em; color: var(--dim);
    transition: color .4s, background .4s;
}
.pl-steps li span { font-family: var(--font-mono); font-size: .7rem; color: var(--dim); }
.pl-steps li.is-done { color: var(--muted); }
.pl-steps li.is-done span { color: #9b82ff; }
.pl-steps li.is-on { color: var(--text); background: rgba(124, 92, 255, .14); }
.pl-steps li.is-on span { color: #c8ff2e; }

.pl-phone {
    position: relative; width: 300px; height: 620px; border-radius: 52px; padding: 11px;
    background: linear-gradient(145deg, #3a3848, #15141c 40%, #2a2936);
    box-shadow: 0 0 0 1px #4a4860, 0 50px 100px rgba(0, 0, 0, .6), 0 0 80px rgba(124, 92, 255, .25), inset 0 0 0 2px #0a0a0e;
}
.pl-btn { position: absolute; width: 4px; background: #2a2936; border-radius: 2px; }
.pl-btn--a { left: -3px; top: 120px; height: 30px; }
.pl-btn--b { left: -3px; top: 170px; height: 54px; }
.pl-btn--c { right: -3px; top: 180px; height: 80px; }
.pl-screen {
    position: relative; width: 100%; height: 100%; border-radius: 42px; overflow: hidden;
    background: linear-gradient(180deg, #17132c, #09080f); color: var(--text); font-family: var(--font-body);
}
.pl-island {
    position: absolute; top: 10px; left: 50%; width: 96px; height: 28px; margin-left: -48px; z-index: 20;
    background: #000; border-radius: 20px; transition: width .6s var(--ease-out), margin .6s var(--ease-out), height .6s var(--ease-out);
}
.pl-island-dot { position: absolute; right: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #1a1a2a; transition: background .3s; }
.pl-screen.is-scanning .pl-island { width: 124px; margin-left: -62px; }
.pl-screen.is-scanning .pl-island-dot { background: #28c840; box-shadow: 0 0 8px #28c840; }
.pl-status { position: absolute; top: 15px; left: 28px; right: 24px; z-index: 19; display: flex; justify-content: space-between; font-size: .78rem; font-weight: 600; }
.pl-status-r { display: flex; align-items: end; gap: 2px; }
.pl-status-r i { width: 3px; background: #fff; border-radius: 1px; }
.pl-status-r i:nth-child(1) { height: 5px; } .pl-status-r i:nth-child(2) { height: 7px; } .pl-status-r i:nth-child(3) { height: 9px; }
.pl-status-r b { width: 20px; height: 10px; border: 1.5px solid rgba(255,255,255,.7); border-radius: 3px; margin-left: 5px; position: relative; }
.pl-status-r b::after { content: ''; position: absolute; inset: 1px 4px 1px 1px; background: #fff; border-radius: 1px; }

.pl-view { position: absolute; inset: 0; padding: 60px 20px 30px; opacity: 0; visibility: hidden; transition: opacity .5s var(--ease-out), transform .6s var(--ease-out), visibility .5s, filter .5s; }
.pl-view.is-on { opacity: 1; visibility: visible; transform: none; }
.pl-lock { display: grid; justify-items: center; align-content: start; text-align: center; transform: scale(1.06); background: radial-gradient(80% 50% at 50% 30%, rgba(124,92,255,.35), transparent); }
.pl-lock.is-on { transform: none; }
.pl-lock-time { font-family: var(--font-display); font-size: 4.6rem; font-weight: 500; letter-spacing: -0.04em; line-height: 1; margin-top: 2.2rem; }
.pl-lock-date { font-size: .85rem; color: rgba(255,255,255,.7); margin-top: .4rem; }
.pl-faceid {
    position: relative; width: 92px; height: 92px; margin-top: 5.5rem; border-radius: 26px; display: grid; place-items: center;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); overflow: hidden;
    transition: transform .4s var(--ease-out), background .4s;
}
.pl-faceid:hover { transform: scale(1.05); background: rgba(124,92,255,.18); }
.pl-faceid svg { width: 56px; height: 56px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pl-fid-frame { transition: stroke .3s; }
.pl-fid-check { stroke: #28c840; stroke-dasharray: 40; stroke-dashoffset: 40; }
.pl-scan { position: absolute; left: 10%; right: 10%; height: 2px; top: 20%; background: #c8ff2e; box-shadow: 0 0 12px #c8ff2e; opacity: 0; }
.pl-faceid.is-scanning .pl-scan { animation: plScan .55s ease-in-out 2 alternate; }
.pl-faceid.is-scanning svg { animation: plWobble .9s ease-in-out; }
.pl-faceid.is-ok .pl-fid-face { opacity: 0; transition: opacity .2s; }
.pl-faceid.is-ok .pl-fid-frame { stroke: #28c840; }
.pl-faceid.is-ok .pl-fid-check { stroke-dashoffset: 0; transition: stroke-dashoffset .4s var(--ease-out) .1s; }
@keyframes plScan { 0% { top: 18%; opacity: 1; } 100% { top: 80%; opacity: 1; } }
@keyframes plWobble { 25% { transform: rotateY(18deg); } 60% { transform: rotateY(-18deg); } }
.pl-lock-hint { margin-top: 1rem; font-size: .78rem; color: rgba(255,255,255,.6); }

.pl-home { transform: translateY(24px) scale(.97); }
.pl-head { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.pl-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 600; background: linear-gradient(135deg, #7c5cff, #2ee6ff); color: #fff; }
.pl-label { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); letter-spacing: .06em; }
.pl-balance { font-family: var(--font-display); font-size: 2.35rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; transition: color .4s; }
.pl-balance.is-down { color: #b3a1ff; }
.pl-delta { font-family: var(--font-mono); font-size: .7rem; color: #c8ff2e; }
.pl-chart { width: 100%; height: 72px; margin: .8rem 0 1rem; overflow: visible; }
.pl-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.pl-home.is-on .pl-line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease-out) .2s; }
.pl-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.1rem; }
.pl-act { display: grid; justify-items: center; gap: .35rem; font-size: .7rem; color: var(--muted); }
.pl-act-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; color: #fff; background: #1f1b33; border: 1px solid rgba(124,92,255,.4); transition: transform .35s var(--ease-out), background .3s; }
.pl-act--send .pl-act-ic { background: #7c5cff; box-shadow: 0 0 0 0 rgba(124,92,255,.6); animation: plPing 2s infinite; }
.pl-act--send:hover .pl-act-ic { transform: scale(1.08); }
@keyframes plPing { 70% { box-shadow: 0 0 0 12px rgba(124,92,255,0); } 100% { box-shadow: 0 0 0 0 rgba(124,92,255,0); } }
.pl-recent { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.pl-see { font-family: var(--font-body); font-weight: 400; font-size: .72rem; color: #b3a1ff; }
.pl-tx { list-style: none; display: grid; gap: .55rem; }
.pl-tx li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: .6rem; font-size: .78rem; }
.pl-tx li.is-new { animation: plTxIn .8s var(--ease-out); }
@keyframes plTxIn { from { opacity: 0; transform: translateX(-20px); background: rgba(124,92,255,.3); } }
.pl-tx b { font-family: var(--font-mono); font-weight: 400; font-size: .74rem; }
.pl-tx .pl-pos { color: #c8ff2e; }
.pl-tx-n { display: grid; line-height: 1.25; }
.pl-tx-n small { font-size: .66rem; color: var(--muted); }
.pl-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--av); color: #0b0b10; font-weight: 700; font-size: .78rem; }

.pl-sheet {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 20px 34px;
    background: #15122a; border-radius: 28px 28px 0 0; border-top: 1px solid rgba(124,92,255,.35);
    box-shadow: 0 -30px 60px rgba(0,0,0,.5); transform: translateY(105%); visibility: hidden;
    transition: transform .7s cubic-bezier(.2, 1.15, .35, 1), visibility .7s;
}
.pl-sheet.is-on { transform: none; visibility: visible; }
.pl-screen.has-sheet .pl-home { filter: brightness(.45) blur(2px); transform: scale(.96); }
.pl-grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 0 auto 1rem; }
.pl-sheet-h { font-size: 1.2rem; margin-bottom: .9rem; }
.pl-sub { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.pl-who, .pl-amt { border: 0; display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pl-who legend, .pl-amt legend { width: 100%; }
.pl-who label { display: grid; justify-items: center; gap: .3rem; font-size: .72rem; color: var(--muted); cursor: pointer; flex: 1; padding: .5rem 0; border-radius: 14px; border: 1px solid transparent; transition: border-color .3s, background .3s, color .3s; }
.pl-who label:has(input:checked) { border-color: rgba(124,92,255,.6); background: rgba(124,92,255,.14); color: #fff; }
.pl-amt label { flex: 1; cursor: pointer; }
.pl-amt span { display: block; text-align: center; padding: .55rem 0; border-radius: 12px; font-family: var(--font-mono); font-size: .85rem; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); transition: background .3s, color .3s, border-color .3s; }
.pl-amt input:checked + span { background: #c8ff2e; color: #0b0f00; border-color: #c8ff2e; }
.pl-who input, .pl-amt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pl-who label:has(input:focus-visible), .pl-amt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-cta {
    width: 100%; height: 50px; border-radius: 16px; background: #7c5cff; color: #fff; font-weight: 600; font-size: .9rem;
    transition: transform .25s var(--ease-out), background .3s;
}
.pl-cta:hover { background: #8d71ff; }
.pl-cta:active { transform: scale(.97); }
.pl-cta--ghost { background: rgba(255,255,255,.08); }
.pl-cancel { width: 100%; margin-top: .4rem; height: 36px; font-size: .78rem; color: var(--muted); }

.pl-done { position: absolute; inset: 0; z-index: 15; display: grid; justify-items: center; align-content: center; text-align: center; padding: 0 24px; background: radial-gradient(70% 45% at 50% 42%, rgba(200,255,46,.16), #0b0a14 70%); opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
.pl-done.is-on { opacity: 1; visibility: visible; }
.pl-check { width: 112px; height: 112px; border-radius: 50%; background: #c8ff2e; display: grid; place-items: center; transform: scale(0); box-shadow: 0 0 60px rgba(200,255,46,.45); }
.pl-check svg { width: 64px; height: 64px; fill: none; stroke: #0b0f00; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pl-check path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.pl-done.is-on .pl-check path { stroke-dashoffset: 0; transition: stroke-dashoffset .5s var(--ease-out) .35s; }
.pl-burst { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.pl-burst i { position: absolute; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #c8ff2e; opacity: 0; }
.pl-burst i:nth-child(even) { background: #9b82ff; width: 6px; height: 6px; }
.pl-done.is-on .pl-burst i { animation: plBurst .9s var(--ease-out) .15s both; }
@keyframes plBurst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-110px); } }
.pl-done-h { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: #fff; margin-top: 1.4rem; letter-spacing: -0.03em; }
.pl-done-amt { color: var(--text); font-size: .95rem; }
.pl-done-meta { font-family: var(--font-mono); font-size: .66rem; color: var(--muted); margin: .4rem 0 2rem; }
.pl-done .pl-cta { width: 70%; }
.pl-home-ind { position: absolute; bottom: 8px; left: 50%; width: 110px; height: 4px; margin-left: -55px; border-radius: 2px; background: rgba(255,255,255,.55); z-index: 30; }

.pl-notes { display: grid; gap: 1rem; justify-items: start; max-width: 34ch; }
.pl-notes-k { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #9b82ff; }
.pl-note { color: var(--text); font-size: 1rem; line-height: 1.55; transition: opacity .3s; }
.pl-note.is-fade { opacity: 0; }
.pl-api { font-size: .72rem; color: var(--cyan); background: #08080c; border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; word-break: break-word; }

/* ==========================================================================
   ATLAS — live map
   ========================================================================== */
.at-demo { border-radius: var(--radius-lg); }
.at-body { display: grid; grid-template-columns: 1fr 340px; min-height: 560px; }
.at-map { position: relative; min-height: 560px; background: #03060c; }
#at-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.at-hud { position: absolute; top: 1rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.at-live { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem; border-radius: 100px; background: rgba(5, 5, 7, .7); border: 1px solid rgba(200,255,46,.35); color: var(--accent); font-size: .7rem; letter-spacing: .14em; }
.at-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s steps(1) infinite; }
.at-demo.is-paused .at-live { color: var(--amber); border-color: rgba(254,188,46,.4); }
.at-demo.is-paused .at-live i { background: var(--amber); animation: none; }
.at-ctrls { display: flex; gap: .4rem; pointer-events: auto; }
.at-btn { font-family: var(--font-mono); font-size: .72rem; color: var(--text); padding: .4rem .75rem; border-radius: 6px; background: rgba(12, 12, 17, .85); border: 1px solid var(--border-strong); transition: border-color .2s, color .2s; min-width: 3rem; }
.at-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.at-legend { position: absolute; left: 1rem; bottom: .9rem; display: flex; gap: 1rem; font-size: .66rem; color: var(--muted); flex-wrap: wrap; }
.at-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.at-legend i { width: 8px; height: 8px; border-radius: 50%; }
.lg-a { background: var(--cyan); } .lg-b { background: var(--accent); } .lg-c { background: var(--red); }
.at-side { border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; background: #07070b; }
.at-k { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.at-dim { color: var(--dim); }
.at-rate { padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--border); display: grid; gap: .2rem; }
.at-rate b { font-family: var(--font-display); font-weight: 500; font-size: 2.6rem; letter-spacing: -0.04em; line-height: 1.05; color: var(--text); font-variant-numeric: tabular-nums; }
#at-spark { width: 100%; height: 44px; margin-top: .4rem; }
.at-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--border); }
.at-stats div { padding: .8rem 1rem; display: grid; gap: .15rem; }
.at-stats div + div { border-left: 1px solid var(--border); }
.at-stats dt { font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.at-stats dd { font-size: .95rem; color: var(--text); font-variant-numeric: tabular-nums; }
.at-log-h { display: flex; justify-content: space-between; padding: .8rem 1.2rem .4rem; }
.at-log {
    list-style: none; flex: 1; min-height: 0; height: 250px; overflow: hidden; padding: 0 1.2rem 1rem;
    font-size: .7rem; line-height: 1.55; position: relative;
    mask-image: linear-gradient(transparent, #000 18%); -webkit-mask-image: linear-gradient(transparent, #000 18%);
    display: flex; flex-direction: column; justify-content: flex-end;
}
.at-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #b9b8c2; animation: logIn .35s var(--ease-out); flex: none; }
.at-log .lt { color: var(--dim); }
.at-log .lv { color: var(--cyan); }
.at-log .ok { color: var(--green); } .at-log .wn { color: var(--amber); } .at-log .er { color: var(--red); } .at-log .ac { color: var(--accent); }
@keyframes logIn { from { opacity: 0; transform: translateY(8px); } }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
    .pl-demo { grid-template-columns: 1fr auto; }
    .pl-steps { grid-column: 1 / -1; justify-self: stretch; grid-template-columns: repeat(4, 1fr); display: grid; }
    .pl-steps li { font-size: 1rem; justify-content: center; }
}
@media (max-width: 1024px) {
    .cs-meta { grid-template-columns: 1fr 1fr; }
    .cs-meta > div:nth-child(3) { padding-left: 0; border-left: 0; }
    .cfg { grid-template-columns: 1fr; }
    .cfg-panel { border-left: 0; border-top: 1px solid var(--border); }
    .cfg-stage { min-height: 520px; }
    .at-body { grid-template-columns: 1fr; }
    .at-side { border-left: 0; border-top: 1px solid var(--border); }
    .at-map { min-height: 440px; }
    .at-log { height: 200px; flex: none; }
    .cs-metrics { grid-template-columns: 1fr 1fr; }
    .cs-stack-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .cs-hero-media { aspect-ratio: 4 / 5; }
    .cs-cols, .cs-approach-grid { grid-template-columns: 1fr; }
    .cs-sticky { position: static; }
    .cs-constraints { grid-template-columns: 1fr; }
    .cs-snip { grid-template-columns: 1fr; }
    .cs-snip:nth-child(even) .cs-snip-copy { order: 0; }
    .cs-code .term-body { font-size: .72rem; padding: 1rem .8rem 1.2rem; }
    .pl-demo { grid-template-columns: 1fr; justify-items: center; }
    .pl-steps { grid-template-columns: repeat(2, 1fr); width: 100%; }
    .pl-notes { max-width: none; justify-items: stretch; }
    .pl-reset { justify-self: start; }
    .cfg-stage { min-height: 420px; }
    .cfg-ring { width: 360px; height: 360px; margin: -180px 0 0 -180px; }
    .at-map { min-height: 360px; }
}
@media (max-width: 480px) {
    .cs-meta { grid-template-columns: 1fr; }
    .cs-meta > div + div { padding-left: 0; border-left: 0; }
    .cs-glance > div { grid-template-columns: 1fr; gap: .25rem; }
    .cs-metrics { grid-template-columns: 1fr; }
    .cs-metrics li { min-height: 11rem; }
    .cs-stack-grid { grid-template-columns: 1fr; }
    .cs-steps li { grid-template-columns: 3.2rem 1fr; }
    .cfg-dot { width: 46px; height: 46px; }
    .cfg-stage { min-height: 360px; }
    .pl-phone { width: 280px; height: 580px; }
    .pl-steps li { padding: .5rem .6rem; font-size: .9rem; }
    .at-stats dd { font-size: .85rem; }
    .at-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cs-title-in > .ch, .cs-hero-media, .cs-tagline { animation: none; }
    .cfg-ring { animation: none; }
}
