/* ajayksingh.dev v3. Patterns combined from the research (see RESEARCH.md):
   sticky split layout + scroll-spy + cursor glow (Brittany Chiang), Ctrl K palette + numbered
   colour-topped cards + illustrated journey (swyx), modern CSS: @property, scroll-driven
   animation, view transitions, color-mix (Josh Comeau, Paco), serif + sans pairing (Paco, Phil Schmid). */

@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --bg: #0a0a14;
  --bg-2: #10101e;
  --surface: rgba(255,255,255,.04);
  --surface-2: rgba(255,255,255,.075);
  --line: rgba(255,255,255,.09);
  --text: #f2f1fb;
  --muted: #9d9abb;
  --violet: #8b5cf6; --blue: #3b82f6; --cyan: #22d3ee; --green: #34d399; --amber: #fbbf24; --pink: #f472b6;
  --grad: linear-gradient(100deg, var(--violet), var(--blue) 45%, var(--cyan));
  --grad-2: linear-gradient(100deg, var(--green), var(--cyan));
  --glow: rgba(139, 92, 246, .14);
  --aurora-op: .5;
  --code-bg: #0d0b1d;
  --shadow: 0 30px 60px -30px rgba(0,0,0,.75);
  --r: 18px;
  --sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f7f6fd; --bg-2: #eeecfa; --surface: rgba(255,255,255,.72); --surface-2: #fff;
  --line: rgba(30,20,80,.10); --text: #16142c; --muted: #5d5a79;
  --violet: #7c3aed; --blue: #2563eb; --cyan: #0891b2; --green: #059669; --amber: #d97706; --pink: #db2777;
  --glow: rgba(124, 58, 237, .10); --aurora-op: .32; --shadow: 0 30px 60px -30px rgba(40,20,120,.25);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f7f6fd; --bg-2: #eeecfa; --surface: rgba(255,255,255,.72); --surface-2: #fff;
    --line: rgba(30,20,80,.10); --text: #16142c; --muted: #5d5a79;
    --violet: #7c3aed; --blue: #2563eb; --cyan: #0891b2; --green: #059669; --amber: #d97706; --pink: #db2777;
    --glow: rgba(124,58,237,.10); --aurora-op: .32; --shadow: 0 30px 60px -30px rgba(40,20,120,.25);
    color-scheme: light;
  }
}
/* Easter egg: IBM i 5250 green-screen mode */
:root[data-theme="term"] {
  --bg: #020a04; --bg-2: #031006; --surface: rgba(51,255,102,.04); --surface-2: rgba(51,255,102,.08);
  --line: rgba(51,255,102,.25); --text: #4dff7c; --muted: #2fbf5a;
  --violet: #4dff7c; --blue: #4dff7c; --cyan: #b6ffc8; --green: #4dff7c; --amber: #ffd84d; --pink: #ff6b6b;
  --grad: linear-gradient(90deg, #4dff7c, #b6ffc8); --grad-2: var(--grad);
  --glow: rgba(77,255,124,.08); --aurora-op: 0; --code-bg: #000;
  --sans: "JetBrains Mono", ui-monospace, monospace; --serif: "JetBrains Mono", monospace;
  color-scheme: dark;
}
:root[data-theme="term"] .scanlines { opacity: 1; }
:root[data-theme="term"] body { text-shadow: 0 0 6px rgba(77,255,124,.45); }
:root[data-theme="term"] .serif { font-style: normal; }
:root[data-theme="term"] .btn-glow, :root[data-theme="term"] .chip[aria-pressed="true"] { color: #000; text-shadow: none; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
svg, img { display: block; }
h1, h2, h3 { line-height: 1.08; margin: 0 0 .5em; letter-spacing: -0.03em; font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); max-width: 22ch; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1.3; font-weight: 600; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); }
.dim { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
kbd { font: 500 .72rem var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); color: var(--muted); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 80; background: var(--violet); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-2 { background-image: var(--grad-2); }

/* Ambient layers */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
.glow { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(600px circle at var(--gx, 30%) var(--gy, 20%), var(--glow), transparent 70%); }
.aurora { position: fixed; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; opacity: var(--aurora-op); transition: opacity .4s; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(100px); animation: drift 28s ease-in-out infinite alternate; }
.aurora .b1 { width: 44vmax; height: 44vmax; background: var(--violet); top: -20vmax; left: -14vmax; }
.aurora .b2 { width: 40vmax; height: 40vmax; background: var(--blue); bottom: -22vmax; right: -12vmax; animation-delay: -9s; }
.aurora .b3 { width: 26vmax; height: 26vmax; background: var(--cyan); top: 35vh; left: 38vw; opacity: .45; animation-delay: -16s; }
@keyframes drift { 50% { transform: translate(5vw, 4vh) scale(1.1); } 100% { transform: translate(-3vw, 7vh) scale(.95); } }
.noise { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.scanlines { position: fixed; inset: 0; z-index: 75; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); }

/* Split layout */
.layout { width: min(1240px, 100% - 40px); margin-inline: auto; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 72px; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 40px 0 28px; overflow-y: auto; scrollbar-width: none; }
.content { padding: 48px 0 40px; min-width: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 .98rem var(--mono); text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; font-size: .75rem; font-weight: 700; box-shadow: 0 0 28px -4px var(--violet); }
.id { margin-top: 36px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 5px 13px 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: .82rem; color: var(--muted); backdrop-filter: blur(8px); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 70%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.name { font-size: clamp(2.4rem, 4vw, 3.4rem); font-weight: 800; letter-spacing: -0.04em; margin: 20px 0 10px; line-height: 1; }
.role { font-size: 1.25rem; font-weight: 600; margin-bottom: 14px; }
.role em { font-family: var(--serif); font-weight: 400; font-size: 1.15em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .1em; }
.amp { color: var(--muted); font-weight: 400; }
.tag { color: var(--muted); max-width: 32ch; }
.rotator { color: var(--text); font-weight: 600; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--cyan) 35%, transparent) 62%); }
.rotator [data-rot] { display: inline-block; transition: opacity .3s, transform .3s; }
.rotator .out { opacity: 0; transform: translateY(-8px); }

.spy { display: flex; flex-direction: column; gap: 0; margin-top: 26px; }
.spy a { display: flex; align-items: center; gap: 14px; padding: 5px 0; text-decoration: none; font: 600 .74rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: color .2s; width: fit-content; }
.spy .bar { width: 28px; height: 1px; background: currentColor; transition: width .25s, background .25s; }
.spy a:hover, .spy a.active { color: var(--text); }
.spy a:hover .bar, .spy a.active .bar { width: 64px; background: var(--grad); height: 2px; }

.side-actions { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; font: 700 .72rem var(--mono); transition: border-color .2s, transform .15s; }
.icon-btn:hover { border-color: color-mix(in srgb, var(--cyan) 60%, transparent); transform: translateY(-2px); }
.term-btn[aria-pressed="true"] { background: #4dff7c; color: #000; }
.theme .sun { display: none; }
:root[data-theme="light"] .theme .sun { display: block; } :root[data-theme="light"] .theme .moon { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .theme .sun { display: block; } :root:not([data-theme]) .theme .moon { display: none; } }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--green); text-decoration: underline; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; font: 600 .98rem var(--sans); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9rem; border-radius: 10px; }
.btn-glow { color: #fff; background: var(--grad); box-shadow: 0 10px 30px -10px var(--violet), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-glow:hover { box-shadow: 0 16px 40px -10px var(--blue), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-light { background: #fff; color: #16142c; }
.btn-ghost-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,.2); }

/* Intro */
.headline { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; max-width: none; margin-bottom: 22px; }
.headline .line { display: block; animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
.headline .line:nth-child(2) { animation-delay: .08s; } .headline .line:nth-child(3) { animation-delay: .16s; }
.headline .serif { font-size: 1.12em; background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 62ch; }

.code-card { position: relative; margin: 34px 0 0; border-radius: var(--r); background: var(--code-bg); color: #e6e4ff; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transform-style: preserve-3d; animation: rise 1s .25s both; }
.code-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: conic-gradient(from var(--angle), transparent 55%, var(--violet), var(--cyan), transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite; }
@keyframes spin { to { --angle: 360deg; } }
.code-top { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.lights { display: flex; gap: 6px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; } .lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tabs button { font: 500 .78rem var(--mono); color: #9b97c4; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.arrow { margin-left: auto; font: 500 .72rem var(--mono); color: #7fdbca; white-space: nowrap; }
.code { margin: 0; padding: 20px 22px; font: 400 .88rem/1.75 var(--mono); overflow-x: auto; min-height: 268px; }
.code .k { color: #c792ea; } .code .f { color: #82aaff; } .code .t { color: #7fdbca; } .code .n { color: #f78c6c; } .code .s { color: #c3e88d; } .code .c { color: #6f6a99; font-style: italic; }
.code-card figcaption { padding: 12px 22px 16px; font-size: .82rem; color: #9b97c4; border-top: 1px solid rgba(255,255,255,.08); }
.code-card figcaption a { color: #7fdbca; }
:root[data-theme="term"] .code-card, :root[data-theme="term"] .code .k, :root[data-theme="term"] .code .f, :root[data-theme="term"] .code .t, :root[data-theme="term"] .code .n, :root[data-theme="term"] .code .s, :root[data-theme="term"] .code .c, :root[data-theme="term"] .code-card figcaption a { color: #4dff7c; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 36px; border-radius: var(--r); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.stat { padding: 20px 18px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.stat b { display: block; font: 800 clamp(2rem, 3.4vw, 2.8rem)/1 var(--sans); letter-spacing: -0.05em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 6px; }
.stat:nth-child(2) b, .stat:nth-child(4) b { background-image: var(--grad-2); }
.stat span { color: var(--muted); font-size: .86rem; }

.marquee { margin-top: 28px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: scroll 40s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
.marquee ul { display: flex; gap: 44px; list-style: none; margin: 0; padding: 0 22px; }
.marquee li { font: 600 1.05rem var(--sans); white-space: nowrap; color: var(--muted); }
.marquee li::before { content: "◆"; color: var(--violet); font-size: .6em; margin-right: 12px; vertical-align: 2px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Sections */
.block { padding-top: 120px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 500 .76rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 16px; }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad); }
h2 .serif { font-size: 1.1em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.sub { color: var(--muted); max-width: 60ch; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.mode { font-size: .74rem; color: var(--muted); border: 1px dashed var(--line); padding: 4px 12px; border-radius: 99px; margin-bottom: 1.4em; }

/* Hover-dim: focus the card under the pointer, fade its siblings (Brittany Chiang) */
@media (hover: hover) {
  .dim-group:hover > * { opacity: .45; }
  .dim-group:hover > *:hover { opacity: 1; }
  .dim-group > * { transition: opacity .25s, transform .3s, border-color .25s, background .25s; }
}

/* Journey */
.journey { position: relative; margin-top: 40px; padding: 26px 22px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.journey .path { position: absolute; left: 0; right: 0; top: 18px; width: 100%; height: 120px; }
.journey .path path { stroke-dashoffset: 1000; transition: stroke-dashoffset 2.4s cubic-bezier(.4,.1,.2,1); }
.journey.in .path path { stroke-dashoffset: 0; }
.stops { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; list-style: none; margin: 110px 0 0; padding: 0; }
.stops li { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); opacity: 0; transform: translateY(12px); transition: opacity .5s, transform .5s; }
.journey.in .stops li { opacity: 1; transform: none; }
.journey.in .stops li:nth-child(2) { transition-delay: .25s; } .journey.in .stops li:nth-child(3) { transition-delay: .5s; }
.journey.in .stops li:nth-child(4) { transition-delay: .75s; } .journey.in .stops li:nth-child(5) { transition-delay: 1s; } .journey.in .stops li:nth-child(6) { transition-delay: 1.25s; }
.stops .yr { font-size: .72rem; color: var(--cyan); }
.stops b { font-size: .98rem; letter-spacing: -0.01em; }
.stops span:last-child { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.stops .now { border-color: color-mix(in srgb, var(--violet) 60%, transparent); box-shadow: 0 0 30px -10px var(--violet); }
.stops .now .yr { color: var(--green); }

/* Services: numbered cards with a colour top line (swyx) */
.svc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 36px; }
.svc-card { position: relative; padding: 26px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(10px); overflow: hidden; transform-style: preserve-3d; }
.svc-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); box-shadow: 0 0 24px var(--c); }
.svc-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -90px; top: -120px; border-radius: 50%; background: var(--c); filter: blur(70px); opacity: .22; pointer-events: none; }
.svc-card:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.svc-card .num { display: block; font-size: .78rem; color: var(--c); margin-bottom: 16px; }
.svc-card p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 7px; list-style: none; padding: 0; margin: 14px 0 0; }
.tags li { font: 500 .74rem var(--mono); padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--cyan) 12%, transparent); color: color-mix(in srgb, var(--cyan) 85%, var(--text)); border: 1px solid color-mix(in srgb, var(--cyan) 22%, transparent); }

/* Apps: 3D tilt cards with real screenshots */
.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 8px; }
.app { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(10px); overflow: hidden; transform-style: preserve-3d; }
.app:hover { border-color: color-mix(in srgb, var(--c, var(--violet)) 55%, transparent); }
.app:nth-child(4n+1) { --c: var(--violet); } .app:nth-child(4n+2) { --c: var(--pink); } .app:nth-child(4n+3) { --c: var(--green); } .app:nth-child(4n+4) { --c: var(--amber); }
.shot { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.app:hover .shot img { transform: scale(1.05); }
.shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--bg) 85%, transparent)); }
.shot.art { display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 35%, transparent), transparent 60%), radial-gradient(circle at 75% 70%, color-mix(in srgb, var(--cyan) 25%, transparent), transparent 55%), var(--bg-2); }
.flow { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 16px; font: 600 .72rem var(--mono); }
.flow span { padding: 6px 10px; border-radius: 99px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line); animation: hop 3.2s ease-in-out infinite; }
.flow i { color: var(--muted); font-style: normal; }
.flow span:nth-of-type(2) { animation-delay: .4s; } .flow span:nth-of-type(3) { animation-delay: .8s; } .flow span:nth-of-type(4) { animation-delay: 1.2s; } .flow span:nth-of-type(5) { animation-delay: 1.6s; }
@keyframes hop { 0%, 70%, 100% { transform: none; border-color: var(--line); } 15% { transform: translateY(-4px); border-color: var(--c); color: var(--text); } }
.app-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.app-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.kind { font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--c); margin: 0; }
.status { font: 500 .72rem var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.is-online .status { color: var(--green); } .is-online .status::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.is-offline .status { color: var(--pink); } .is-offline .status::before { background: var(--pink); }
.app h3 { font-size: 1.4rem; margin-bottom: 8px; }
.app-body > p { color: var(--muted); flex: 1; font-size: .95rem; }
.app-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.app-actions .link { font-weight: 500; font-size: .92rem; text-underline-offset: 4px; }
.is-offline .btn { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.note { font-size: .88rem; color: var(--muted); }

/* Lab */
.lab-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 26px 0 20px; }
.search { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; max-width: 380px; height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.search:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 20%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 1rem var(--sans); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font: 500 .82rem var(--sans); padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { color: #fff; background: var(--grad); border-color: transparent; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.tools a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 15px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; overflow: hidden; }
.tools a::after { content: "↗"; position: absolute; right: 14px; top: 12px; color: var(--muted); transition: transform .2s, color .2s; }
.tools a:hover { border-color: color-mix(in srgb, var(--cyan) 55%, transparent); background: var(--surface-2); }
.tools a:hover::after { transform: translate(2px, -2px); color: var(--cyan); }
.tools .area { font: 500 .68rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--cyan); }
.tools .tname { font-weight: 600; line-height: 1.35; padding-right: 18px; }
.empty { color: var(--muted); }

/* Experience (Brittany-style rows) */
.xp { list-style: none; padding: 0; margin: 36px 0 18px; display: flex; flex-direction: column; gap: 6px; }
.xp-item { display: grid; grid-template-columns: 130px 1fr; gap: 22px; padding: 20px 22px; border-radius: 16px; border: 1px solid transparent; }
.xp-item:hover { background: var(--surface); border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.when { margin: 3px 0 0; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.xp-item h3 .co { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.xp-item p { color: var(--muted); margin: 0; font-size: .95rem; }
.also { color: var(--muted); font-size: .9rem; padding-left: 22px; }

/* Steps, stack, now */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; list-style: none; padding: 0; margin: 34px 0 0; }
.step { position: relative; padding: 22px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.step .num { display: block; font-size: 1.6rem; font-weight: 700; background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .9rem; margin: 0; }
.stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; margin-top: 26px; padding: 24px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.stack h3 { font: 500 .74rem var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0; }
.stack .tags { margin-top: 10px; }
.now { margin-top: 26px; padding: 22px 24px; border-radius: var(--r); border: 1px dashed color-mix(in srgb, var(--green) 50%, transparent); background: color-mix(in srgb, var(--green) 6%, transparent); }
.now ul { margin: 0; padding-left: 20px; color: var(--muted); }
.now li { margin: 4px 0; } .now li::marker { color: var(--green); }

/* CTA + footer */
.cta-panel { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 72px) clamp(22px, 5vw, 60px); border-radius: 26px; color: #fff;
  background: radial-gradient(circle at 12% 18%, #a855f7 0, transparent 45%), radial-gradient(circle at 88% 26%, #06b6d4 0, transparent 45%), radial-gradient(circle at 50% 115%, #ec4899 0, transparent 52%), #1e1b4b; }
.cta-panel h2 { color: #fff; max-width: 18ch; font-size: clamp(2rem, 4vw, 3.2rem); }
.cta-panel h2 .serif { background: linear-gradient(100deg, #fde68a, #fbcfe8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cta-panel p { color: rgba(255,255,255,.86); max-width: 54ch; font-size: 1.05rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
:root[data-theme="term"] .cta-panel { background: #000; border: 1px solid var(--line); color: var(--text); }
:root[data-theme="term"] .cta-panel h2, :root[data-theme="term"] .cta-panel p { color: var(--text); }
.foot { display: flex; flex-direction: column; gap: 6px; margin-top: 48px; font-size: .86rem; color: var(--muted); }

/* Palette + toast */
.palette { border: 0; padding: 0; background: transparent; width: min(620px, 100% - 24px); margin-top: 12vh; color: var(--text); }
.palette::backdrop { background: rgba(5,4,15,.55); backdrop-filter: blur(6px); }
.pal-box { border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); overflow: hidden; }
#pal-input { width: 100%; height: 58px; padding: 0 20px; border: 0; outline: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: 400 1.05rem var(--sans); }
#pal-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
#pal-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
#pal-list li span:last-child { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
#pal-list li[aria-selected="true"] { background: var(--surface-2); outline: 1px solid color-mix(in srgb, var(--violet) 50%, transparent); }
.pal-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .92rem; transition: all .3s; pointer-events: none; z-index: 90; text-shadow: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Tablet: single column, side panel becomes a header block */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; gap: 0; width: min(780px, 100% - 32px); }
  .side { position: relative; height: auto; padding: 32px 0 0; }
  .id { margin-top: 32px; }
  .spy { display: none; }
  .side-actions { margin-top: 24px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .content { padding-top: 56px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .stops { grid-template-columns: repeat(3, 1fr); }
}
/* Phone */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .block { padding-top: 88px; }
  .svc, .apps, .stack { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .xp-item { grid-template-columns: 1fr; gap: 6px; padding: 16px; }
  .also { padding-left: 16px; }
  .journey .path { display: none; }
  .stops { grid-template-columns: 1fr 1fr; margin-top: 0; }
  .code { font-size: .76rem; min-height: 0; padding: 16px; }
  .arrow { display: none; }
  .side-actions .btn { flex: 1 1 100%; }
  .cta-row .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .stops li { opacity: 1; transform: none; }
  .journey .path path { stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}

/* Hero CTAs */
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--line); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--cyan) 60%, transparent); }
.lede strong { color: var(--text); font-weight: 600; }

/* Range: hats */
.hats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; list-style: none; padding: 0; margin: 30px 0 0; }
.hat { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; transform-style: preserve-3d; }
.hat::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); box-shadow: 0 0 18px var(--c); }
.hat::after { content: ""; position: absolute; width: 140px; height: 140px; right: -60px; bottom: -70px; border-radius: 50%; background: var(--c); filter: blur(50px); opacity: .25; pointer-events: none; }
.hat-n { font-size: .72rem; color: var(--c); }
.hat b { font-size: 1.12rem; letter-spacing: -0.01em; }
.hat span:last-child { font-size: .86rem; color: var(--muted); line-height: 1.45; }
.hat:hover { border-color: color-mix(in srgb, var(--c) 55%, transparent); }

/* Range: built on -> building with */
.eras { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; margin-top: 18px; }
.era { padding: 20px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.era-h { margin: 0 0 4px; font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.era .tags li { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.now-era { border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 14%, transparent), color-mix(in srgb, var(--cyan) 8%, transparent)); }
.now-era .era-h { color: var(--cyan); }
.now-era .tags li { background: color-mix(in srgb, var(--cyan) 12%, transparent); color: color-mix(in srgb, var(--cyan) 85%, var(--text)); border-color: color-mix(in srgb, var(--cyan) 25%, transparent); }
.era-arrow { display: grid; place-items: center; font-size: 1.6rem; color: var(--cyan); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }

/* FAQ */
.faq { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.faq details { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); padding: 0 20px; transition: border-color .2s, background .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: var(--surface-2); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); color: var(--cyan); font: 500 1.1rem var(--mono); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 18px; }

@media (max-width: 1080px) { .hats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .hats { grid-template-columns: 1fr 1fr; }
  .eras { grid-template-columns: 1fr; }
  .era-arrow { transform: rotate(90deg); animation: none; }
  .hero-cta .btn { flex: 1 1 auto; }
}

/* Copy v4 helpers */
.lede-hook { font-size: 1.22rem; color: var(--text); max-width: 54ch; }
.xp-item .win { color: var(--text); font-weight: 600; margin: 2px 0 8px; font-size: 1rem; }
.xp-item .win + p { margin: 0; }

/* Hero: animated agent run card (replaces the code window) */
.run-card { position: relative; margin: 34px 0 0; border-radius: var(--r); border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); box-shadow: var(--shadow); overflow: hidden; transform-style: preserve-3d; animation: rise 1s .25s both; }
.run-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: conic-gradient(from var(--angle), transparent 55%, var(--violet), var(--cyan), transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 6s linear infinite; }
.run-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.run-live { display: inline-flex; align-items: center; gap: 8px; font: 600 .78rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--green); }
.run-title { font-size: .8rem; color: var(--muted); }
.run-clock { margin-left: auto; font-size: .8rem; color: var(--cyan); min-width: 4ch; text-align: right; }
.run-steps { list-style: none; margin: 0; padding: 14px 20px 10px; position: relative; }
.run-steps::before { content: ""; position: absolute; left: 39px; top: 34px; bottom: 34px; width: 2px; background: var(--line); }
.run-steps li { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 9px 0; opacity: .38; transition: opacity .35s, transform .35s; }
.run-steps .ico { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 1.05rem; background: var(--bg-2); border: 1px solid var(--line); transition: all .35s; }
.run-steps b { display: block; font-size: .98rem; letter-spacing: -0.01em; }
.run-steps div span { display: block; font-size: .84rem; color: var(--muted); line-height: 1.4; }
.run-steps .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); transition: all .3s; }
.run-steps li.active, .run-steps li.done { opacity: 1; }
.run-steps li.active { transform: translateX(4px); }
.run-steps li.active .ico { border-color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 18%, transparent), 0 0 24px -4px var(--cyan); }
.run-steps li.active .st { border-color: var(--cyan) transparent var(--cyan) var(--cyan); animation: spinr .8s linear infinite; }
@keyframes spinr { to { transform: rotate(360deg); } }
.run-steps li.done .ico { background: color-mix(in srgb, var(--green) 14%, var(--bg-2)); border-color: color-mix(in srgb, var(--green) 50%, transparent); }
.run-steps li.done .st { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%23062b1b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.run-steps li.gate.active .ico { border-color: var(--amber); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 18%, transparent), 0 0 24px -4px var(--amber); }
.run-steps li.gate.active .st { border-color: var(--amber) transparent var(--amber) var(--amber); }
.run-steps li.final.done .ico, .run-steps li.final.active .ico { background: var(--grad-2); color: #062b1b; border-color: transparent; }
.run-card figcaption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px 16px; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); }
.run-card figcaption a { color: var(--cyan); font-weight: 500; }
@media (max-width: 640px) {
  .run-title { display: none; }
  .run-steps { padding: 10px 14px 6px; }
  .run-steps::before { left: 31px; }
  .run-steps li { grid-template-columns: 34px 1fr auto; gap: 10px; }
  .run-steps .ico { width: 34px; height: 34px; border-radius: 10px; }
}
