/* Home page (keerthivibisan.com/): a bold poster. One strong colour (electric blue) on near-black and off-white.
   Standalone: the blog has its own stylesheet (/site/blog.css). The theme follows the device; light keeps the plain #f4f5f7 look. */

:root {
  --ink: #0d0f12; --paper: #f4f5f7;
  --blue: #2b44ff; --blue-deep: #0a1785; --blue-ink: #050b45;
  --bg: var(--ink); --fg: var(--paper); --bg-alt: #121419; --surface: #171a20;
  --line: rgb(255 255 255 / .1); --line-strong: rgb(255 255 255 / .2);
  --muted: #a1a6b0; --faint: #6c717b; --accent: #7d8cff; /* blue text on the page: lifted for contrast on dark */
  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gut: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --r-card: 24px; --r-inner: 14px; --r-ctl: 999px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: var(--paper); --fg: var(--ink); --bg-alt: #eaebef; --surface: #fff;
  --line: rgb(13 15 18 / .12); --line-strong: rgb(13 15 18 / .22);
  --muted: #50555e; --faint: #80858e; --accent: var(--blue);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--body); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--blue); color: #fff; }
.wrap { width: min(100% - var(--gut) * 2, var(--max)); margin-inline: auto; }
.skip { position: fixed; left: 12px; top: 12px; z-index: 100; padding: 8px 14px; border-radius: var(--r-ctl); background: var(--fg); color: var(--bg); transform: translateY(-200%); }
.skip:focus { transform: none; }
.arr { flex: none; vertical-align: -.15em; transition: transform 300ms var(--ease); }
a:hover > .arr, a:hover .arr { transform: translate(2px, -2px); }

/* While GSAP drives an element, CSS transitions on it wait. */
.gs { transition: none !important; }
/* Before the entrances run, hide what they will bring in. If the scripts never arrive, show it anyway. */
html.motion-pending [data-reveal], html.motion-pending [data-stagger] > *, html.motion-pending .hero-title .w > span,
html.motion-pending .hero-kicker, html.motion-pending .hero-side { opacity: 0; animation: failsafe .4s 2.5s forwards; }
@keyframes failsafe { to { opacity: 1; } }

/* ── Buttons, labels, chips ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: var(--r-ctl); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform 300ms var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn.solid { background: #fff; color: var(--blue-ink); }
.btn.ghost { border: 1px solid rgb(255 255 255 / .45); color: #fff; }
.btn.ghost-ink { border: 1px solid var(--line-strong); }
.eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.h2 { font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: clamp(40px, 7vw, 104px); line-height: .9; letter-spacing: -.01em; text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 4px 10px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 12px; }

/* ── Hero: dark with blue light, the copy on the left, a stack of sign-in screens on the right, giant headline ── */
.hero { position: relative; isolation: isolate; overflow: clip; color: #fff;
  background: radial-gradient(48% 60% at 74% 44%, rgb(43 68 255 / .36), transparent 70%), radial-gradient(40% 40% at 8% 100%, rgb(43 68 255 / .2), transparent 70%), #06070a; }
.hero-grain { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .09; 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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* Name first: kicker, the name, the one-line message, the intro and buttons on the left; the cards on the right. */
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 40px; min-height: 100svh; padding-block: 104px 56px; }
.hero-copy { display: grid; gap: 24px; }
.hero-kicker { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
/* A green "online" light: a soft ring pings out of it (transform and opacity only; paused with the hero off screen). */
.hero-kicker .dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2fd67b; box-shadow: 0 0 0 4px rgb(47 214 123 / .22), 0 0 14px rgb(47 214 123 / .7); }
.hero-kicker .dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #2fd67b; opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .hero-kicker .dot::after { animation: online 2.4s cubic-bezier(.2, .7, .1, 1) infinite; } }
@keyframes online { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
.hero-side { display: grid; gap: 18px; max-width: 520px; }
.hero-tag { font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(34px, 3.6vw, 56px); line-height: .9; letter-spacing: -.01em; }
.hero-tag em { font-style: normal; color: transparent; -webkit-text-stroke: 1.5px rgb(244 245 247 / .9); }
.hero-lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: rgb(255 255 255 / .85); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn.solid { background: var(--blue); color: #fff; box-shadow: 0 10px 40px -10px var(--blue); }
.hero-title { font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(64px, 11vw, 200px); line-height: .84; letter-spacing: -.015em; }
.hero-title .w { display: block; width: fit-content; overflow: clip; overflow-clip-margin: .1em; vertical-align: top; padding-top: .04em; }
.hero-title .w > span { display: inline-block; }
.hero-title .w.outline > span { color: transparent; -webkit-text-stroke: 2px rgb(244 245 247 / .85); }

/* The sign-in cards: white mock-up screens in a 3D stack. Only transform and opacity change as they move. */
.sc-stage { justify-self: center; width: 360px; height: 480px; perspective: 1400px; pointer-events: none; }
.sc-stack { position: relative; width: 100%; height: 100%; transform: rotateY(-16deg) rotateX(6deg); transform-style: preserve-3d; }
.sc { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 14px; height: 390px; padding: 26px; border-radius: 22px; background: #fff; color: #0d0f12; text-align: left;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / .75); transform-origin: 50% 100%; transition: transform 800ms var(--ease), opacity 500ms, translate 450ms var(--ease), rotate 450ms var(--ease);
  transform: translate3d(calc(var(--k) * 34px), calc(var(--k) * -26px), calc(var(--k) * -90px)); opacity: max(0, calc(1 - var(--k) * .3)); z-index: calc(10 - var(--k)); }
.sc::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: #0b0e1a; opacity: .4; transition: opacity 500ms; pointer-events: none; }
.sc.front::after { opacity: 0; }
.sc.leave { transform: translate3d(-130%, 30px, 80px) rotate(-10deg) !important; opacity: 0 !important; }
.sc.leave-r { transform: translate3d(130%, 30px, 80px) rotate(10deg) !important; opacity: 0 !important; }
/* Only the front card takes the pointer: drag it sideways (vertical drags still scroll on touch), or tap it. */
.sc.front { pointer-events: auto; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.sc.dragging { cursor: grabbing; transition: none; }
.sc-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: #50555e; }
.sc-brand i { width: 20px; height: 20px; border-radius: 6px; background: conic-gradient(from 200deg, var(--blue), #8b99ff, var(--blue)); }
.sc-title { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.sc-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #eef1ff; color: var(--blue); }
.sc-face { position: relative; display: grid; place-items: center; width: 88px; height: 88px; overflow: hidden; border-radius: 20px; background: #eef1ff; color: var(--blue); }
/* A scan line sweeps the face icon (only while the card is in front). */
.sc-scan { position: absolute; left: 10%; right: 10%; top: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--blue), transparent); box-shadow: 0 0 10px var(--blue); opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .sc.front .sc-scan { opacity: 1; animation: sc-scan 1.6s ease-in-out infinite alternate; } }
@keyframes sc-scan { from { transform: translateY(12px); } to { transform: translateY(74px); } }
.sc-hint { font-size: 14px; line-height: 1.45; color: #6a6f78; }
.sc-otp { display: flex; gap: 8px; }
.sc-otp i { display: grid; place-items: center; width: 40px; height: 48px; border: 1.5px solid #d6d9e0; border-radius: 10px; font: 600 22px var(--mono); font-style: normal; }
.sc-field { display: grid; gap: 2px; padding: 10px 14px; border: 1.5px solid #d6d9e0; border-radius: 12px; font-size: 15px; }
.sc-field span { font-size: 11px; color: #80858e; }
.sc-num { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; color: var(--blue); }
.sc-btn { display: grid; overflow: hidden; margin-top: auto; padding: 14px; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 600; font-size: 15px; text-align: center; transition: background 300ms; }
.sc-btn > span { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 350ms var(--ease), opacity 300ms; }
.sc-btn .busy, .sc-btn .done { opacity: 0; transform: translateY(100%); }
.sc.busy .sc-btn .idle, .sc.done .sc-btn .idle { opacity: 0; transform: translateY(-100%); }
.sc.busy .sc-btn .busy { opacity: 1; transform: none; }
.sc.done .sc-btn .busy { opacity: 0; transform: translateY(-100%); }
.sc.done .sc-btn .done { opacity: 1; transform: none; }
.sc.done .sc-btn { background: #14975a; }
.spin { width: 14px; height: 14px; border: 2px solid rgb(255 255 255 / .4); border-top-color: #fff; border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── In numbers: LED-style figures under the hero. Lit digits are dot-matrix (a mask of round dots); the unlit "88"
      sits faintly behind, like a real display. home.js counts them up once. ── */
.stats { border-block: 1px solid var(--line); background: var(--bg); }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-block: 0; padding-block: 0; list-style: none; }
.stats-row li { display: grid; gap: 10px; align-content: start; padding: clamp(28px, 4vw, 48px) clamp(16px, 2vw, 28px); border-left: 1px solid var(--line); }
.stats-row li:first-child { border-left: 0; padding-left: 0; }
.led { position: relative; display: inline-flex; align-items: flex-start; width: max-content; font-family: var(--mono); font-weight: 500; font-size: clamp(64px, 8vw, 120px); line-height: .9; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.led-on, .led-off, .led-plus { -webkit-mask: radial-gradient(circle, #000 52%, transparent 58%) 0 0 / .075em .075em; mask: radial-gradient(circle, #000 52%, transparent 58%) 0 0 / .075em .075em; }
.led-off { position: absolute; left: 0; top: 0; color: var(--line); }
.led-on { position: relative; color: var(--accent); text-shadow: 0 0 .18em color-mix(in srgb, var(--blue) 70%, transparent); }
.led-plus { font-size: .5em; color: var(--accent); }
.stat-label { max-width: 22ch; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Sections ──────────────────────────────────────────────────────────── */
.sec { padding-block: clamp(80px, 11vw, 160px); }
.sec.alt { background: var(--bg-alt); }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-head.row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }

/* ── Work and projects: cards on a turning 3D ring. home.js adds .is-3d and turns it (drag, arrows, keys, a slow
      step when idle). Without the script, a row you swipe. The section keeps its normal height: nothing takes over the scroll. ── */
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ix-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.ix-f { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: none; color: var(--muted); font: 500 14px var(--body); cursor: pointer; }
.ix-f span { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ix-f:hover { color: var(--fg); }
.ix-f[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.ix-f[aria-pressed="true"] span { color: rgb(255 255 255 / .75); }
.ix-more { display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: none; color: inherit; font: 600 14px var(--body); text-decoration: none; cursor: pointer; }
.ix-more:hover { background: color-mix(in srgb, currentColor 8%, transparent); }

.orbit-sec { --cw: 320px; --ch: 420px; padding-block: clamp(80px, 11vw, 150px); overflow: clip; }
.gal-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px 40px; margin-bottom: 20px; }
.gal-title { display: grid; gap: 16px; }
.gal-title .h2 { font-size: clamp(40px, 5.6vw, 84px); }
.gal-filters { display: grid; gap: 12px; margin-bottom: 8px; }
.tab-note { max-width: 60ch; color: var(--muted); font-size: 15px; }
.gal-nav { display: flex; align-items: center; gap: 8px; }
.gal-count { margin-right: 8px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.gal-count b { font-weight: 500; color: var(--fg); }
.gal-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.gal-btn:hover { background: var(--fg); color: var(--bg); }

/* Without the script: a row with scroll snap. */
.orbit { position: relative; outline: none; }
.orbit-ring { display: flex; gap: 16px; overflow-x: auto; margin: 0; padding: 28px max(var(--gut), (100% - var(--max)) / 2); list-style: none; scroll-snap-type: x mandatory; scrollbar-width: none; }
.orbit-ring::-webkit-scrollbar { display: none; }
.orbit-floor { display: none; }

/* The cards (both layouts). */
.gc { position: relative; flex: none; display: flex; flex-direction: column; gap: 16px; width: var(--cw); height: var(--ch); padding: 28px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); scroll-snap-align: center; }
.gc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gc-num { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 92px; line-height: .8; color: transparent; -webkit-text-stroke: 1.5px var(--line-strong); }
.gc .kicker { text-align: right; }
.gc h3 { margin-top: auto; font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: 36px; line-height: .92; letter-spacing: -.01em; }
.gc h3 button { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; }
/* The title's button covers the whole card. */
.gc h3 button::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.gc h3 button:focus-visible { outline: none; }
.gc:has(h3 button:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.gc-line { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 15px; }
.gc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.gc-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.gc.feat { border-color: transparent; color: #fff; background: radial-gradient(90% 100% at 100% 0%, #5468ff 0%, transparent 60%), var(--blue); }
.gc.feat .gc-num { -webkit-text-stroke-color: rgb(255 255 255 / .55); }
.gc.feat .kicker, .gc.feat .gc-line { color: rgb(255 255 255 / .85); }
.gc.feat .chips li { border-color: rgb(255 255 255 / .4); }
/* Handcrafted (before the AI era): a dashed edge, like a draft. */
.gc.hand { border-style: dashed; border-color: var(--line-strong); }

/* The arc's own box sits far toward the viewer, so it projects much larger than it looks: it must not take clicks
   (it would cover the tabs above). Only the cards do. */
/* 3D: a concave arc seen from its centre, like a curved display (home.js sets the perspective to the arc's radius,
   turns .orbit-ring, and fades and shades each card by its angle). */
.orbit.is-3d { height: calc(var(--ch) + 200px); perspective: 1900px; perspective-origin: 50% 45%; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.orbit.is-3d.dragging { cursor: grabbing; }
.orbit.is-3d .orbit-ring { pointer-events: none; position: absolute; left: 50%; top: 116px; display: block; width: var(--cw); height: var(--ch); margin-left: calc(var(--cw) / -2); padding: 0; overflow: visible; transform-style: preserve-3d; will-change: transform; }
.orbit.is-3d .gc { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; will-change: transform, opacity; }
/* The front card: a soft blue halo; others dim slightly (opacity only). */
.orbit.is-3d .gc::before { content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; box-shadow: 0 24px 48px -20px color-mix(in srgb, var(--blue) 80%, transparent), 0 0 0 1px color-mix(in srgb, var(--blue) 60%, transparent); opacity: 0; transition: opacity 400ms; }
.orbit.is-3d .gc.is-front::before { opacity: 1; }
/* Cards toward the edges of the curve sit in shade. The shade is its own layer, so changing it each frame doesn't repaint the card. */
.orbit.is-3d .gc::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: #04050a; opacity: var(--shade, 0); pointer-events: none; will-change: opacity; }
/* When the tab's cards all fit, nothing to turn: no arrows or counter. */
.orbit-sec.fits .gal-nav { visibility: hidden; }
.orbit.is-3d .gc { cursor: pointer; }
.orbit.is-3d .orbit-floor { display: block; position: absolute; left: 50%; bottom: 0; width: min(900px, 90%); height: 140px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 40%, transparent), transparent); opacity: .55; pointer-events: none; }
.orbit:focus-visible .gc.is-front { outline: 2px solid var(--accent); outline-offset: 4px; }

/* The drag bubble: follows the mouse over the arc (home.js). "Drag" gets small arrows either side. */
.drag-dot { position: fixed; left: 0; top: 0; z-index: 30; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 12px 40px -10px var(--blue);
  font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.3); transition: transform 350ms var(--ease), opacity 200ms; }
.drag-dot.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.drag-dot.on.down { transform: translate(-50%, -50%) scale(.85); }
.drag-dot.drag::before, .drag-dot.drag::after { content: ''; position: absolute; top: 50%; width: 6px; height: 6px; border: solid #fff; border-width: 0 0 2px 2px; }
.drag-dot.drag::before { left: 10px; transform: translateY(-50%) rotate(45deg); }
.drag-dot.drag::after { right: 10px; transform: translateY(-50%) rotate(-135deg); }
@media (hover: hover) and (pointer: fine) { .orbit.is-3d.has-dot, .orbit.is-3d.has-dot * { cursor: none !important; } }
@media (hover: none), (pointer: coarse) { .drag-dot { display: none; } }
.orbit-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.orbit-hint { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.hint-3d, .hint-fit, .is-3d-on .hint-row, .fits .hint-3d { display: none; }
.is-3d-on .hint-3d, .is-3d-on.fits .hint-fit { display: inline; }


/* Side panel with one item's detail. */
html:has(dialog.panel[open]) { overflow: hidden; }
dialog.panel { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--fg); overflow-y: auto; overscroll-behavior: contain; }
dialog.panel::backdrop { background: rgb(5 6 10 / .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) {
  dialog.panel[open] { animation: panel-in 450ms var(--ease); }
  dialog.panel[open]::backdrop { animation: fade-in 300ms; }
}
@keyframes panel-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.panel-x { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: inherit; cursor: pointer; }
.panel-x:hover { background: color-mix(in srgb, currentColor 10%, var(--surface)); }
.panel-body { display: grid; align-content: start; gap: 18px; min-height: 100%; padding: 72px clamp(24px, 5vw, 48px) clamp(32px, 5vw, 48px); }
.panel-title { font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: clamp(36px, 5vw, 60px); line-height: .92; letter-spacing: -.01em; }
.panel-line { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; }
.panel-text { color: var(--muted); }
.panel-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; margin: 0; overflow: hidden; border-radius: var(--r-inner); border: 1px solid var(--line); background: var(--line); }
.panel-facts div { display: grid; gap: 4px; padding: 12px 14px; background: var(--surface); }
.panel-facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.panel-facts dd { margin: 0; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.panel-sec { display: grid; gap: 10px; }
.panel-points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.panel-points li { position: relative; padding-left: 22px; line-height: 1.5; }
.panel-points li::before { content: ''; position: absolute; left: 2px; top: .6em; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.panel-metric { font-family: var(--mono); font-size: 14px; }
.panel-metric::before { content: '→ '; color: var(--accent); }
.panel-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn.blue { background: var(--blue); color: #fff; }

/* ── Experience: a short list, the full story is the timeline ──────────── */
.xs { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.xs a { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, .8fr) auto; gap: 6px 24px; align-items: baseline; padding: 22px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.when { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.xs-role { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2vw, 26px); line-height: 1.15; letter-spacing: -.02em; transition: transform 400ms var(--ease); }
.xs a:hover .xs-role { transform: translateX(8px); }
.xs-org { color: var(--accent); font-weight: 500; }
.lane { padding: 3px 10px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.xs-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 32px; padding: clamp(24px, 3vw, 36px); border-radius: var(--r-card); color: #fff; text-decoration: none; transition: transform 400ms var(--ease);
  background: radial-gradient(80% 140% at 100% 0%, #5468ff 0%, transparent 60%), var(--blue); }
.xs-cta:hover { transform: translateY(-3px); }
.xs-cta-text { display: grid; gap: 8px; }
.xs-cta b { font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: clamp(28px, 3.6vw, 52px); line-height: .95; letter-spacing: -.01em; }
.xs-cta-text span { color: rgb(255 255 255 / .85); }
.xs-cta-go { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--blue); }
.xs-cta-go .arr { width: 22px; height: 22px; }

/* ── Skills: a bento of tiles, one per skill, coloured by group. Hover, focus or tap turns a tile over: since when, and
      where it was used. The legend above highlights one group. Only transform and opacity move. ── */
.sec-lede { max-width: 56ch; color: var(--muted); font-size: clamp(16px, 1.4vw, 18px); }
[data-tone="identity"] { --tone: #5b6dff; }
[data-tone="backend"] { --tone: #22c3a0; }
[data-tone="data"] { --tone: #f5b83d; }
[data-tone="apps"] { --tone: #38c8ff; }
[data-tone="ai"] { --tone: #c06bff; }
[data-tone="tools"] { --tone: #9aa0aa; }
[data-theme="light"] [data-tone="identity"] { --tone: #2b44ff; }
[data-theme="light"] [data-tone="backend"] { --tone: #0f8f74; }
[data-theme="light"] [data-tone="data"] { --tone: #b8791a; }
[data-theme="light"] [data-tone="apps"] { --tone: #0b84b8; }
[data-theme="light"] [data-tone="ai"] { --tone: #8a3fd1; }
[data-theme="light"] [data-tone="tools"] { --tone: #5d636c; }

.tk-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tk-key { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: none; color: var(--muted); font: 500 14px var(--body); cursor: pointer; }
.tk-key i { width: 10px; height: 10px; border-radius: 3px; background: var(--tone); }
.tk-key span { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.tk-key:hover, .tk-key[aria-pressed="true"] { color: var(--fg); border-color: var(--tone); }

.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); grid-auto-rows: 132px; grid-auto-flow: dense; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tk { perspective: 900px; transition: opacity 300ms; }
.tk.wide { grid-column: span 2; }
.tk.big { grid-column: span 2; grid-row: span 2; }
.tk-grid.hl .tk:not(.lit) { opacity: .22; }
.tk-inner { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transform-style: preserve-3d; transition: transform 650ms var(--ease); }
.tk.on .tk-inner, .tk-inner:focus-visible { transform: rotateY(180deg); }
@media (hover: hover) { .tk:hover .tk-inner { transform: rotateY(180deg); } }
.tk-inner:focus-visible { outline: none; }
.tk-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 16px; border-radius: var(--r-inner); border: 1px solid var(--line); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.tk-front { background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 60%), var(--surface); }
.tk-back { transform: rotateY(180deg); justify-content: flex-start; background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--tone) 35%, transparent), transparent 70%), var(--surface); border-color: color-mix(in srgb, var(--tone) 55%, var(--line)); }
.tk-inner:focus-visible .tk-back { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-ico { display: grid; place-items: start; width: 34px; height: 34px; color: var(--tone); }
.tk-ico svg { width: 100%; height: 100%; }
.tk-ico.brand svg { fill: currentColor; }
.tk-ico.line svg { stroke-width: 1.6; }
.tk-name { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.15; letter-spacing: -.01em; }
.tk-since { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; hyphens: auto; overflow-wrap: anywhere; font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.15; }
.tk-since em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--tone); white-space: nowrap; }
.tk-uses { color: var(--muted); font-size: 13px; line-height: 1.4; overflow: hidden; }
/* Big and wide tiles: a larger logo and name. */
.tk.big .tk-ico { width: 72px; height: 72px; }
.tk.big .tk-name { font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: clamp(28px, 2.6vw, 40px); line-height: .95; }
.tk.big .tk-face { padding: 22px; }
.tk.big .tk-uses { font-size: 15px; }
.tk.big .tk-since { font-size: 22px; }
.tk.wide .tk-face { flex-direction: row; align-items: flex-end; }
.tk.wide .tk-back { flex-direction: column; align-items: stretch; }
.tk.wide .tk-ico { width: 44px; height: 44px; align-self: flex-start; }
.tk.wide .tk-name { font-size: 20px; text-align: right; }
@media (prefers-reduced-motion: reduce) { .tk-inner { transition: none; } }

/* ── Writing ───────────────────────────────────────────────────────────── */
.posts { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.posts a { display: grid; grid-template-columns: 130px 140px minmax(0, 1fr) auto; gap: 6px 28px; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.posts time, .p-min { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.p-cat { font-family: var(--mono); font-size: 13px; color: var(--accent); text-transform: capitalize; }
.p-title { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.15; letter-spacing: -.02em; transition: transform 400ms var(--ease); }
.posts a:hover .p-title { transform: translateX(8px); }
.p-min { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Hovering the list: the other posts step back, and a card with the post's cover and description follows the cursor
   (home.js: springy follow and a tilt from the pointer's speed). Mouse only; on touch the rows are plain links. */
@media (hover: hover) and (pointer: fine) {
  .posts a { transition: opacity 300ms; }
  .posts:has(a:hover) a:not(:hover) { opacity: .32; }
}
.tip { position: fixed; left: 0; top: 0; z-index: 45; width: 340px; pointer-events: none; }
.tip-inner { overflow: hidden; border-radius: 20px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / .75), 0 0 0 1px color-mix(in srgb, var(--blue) 25%, transparent);
  opacity: 0; transform: translateY(14px) scale(.9); transform-origin: 30% 50%; transition: opacity 220ms, transform 500ms var(--ease); }
.tip.on .tip-inner { opacity: 1; transform: none; }
.tip-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(90% 120% at 100% 0%, #5468ff, transparent 60%), var(--blue); }
.tip-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); transition: transform 1.4s var(--ease); }
.tip.on .tip-media img { transform: scale(1); }
.tip-media::after { content: ''; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, color-mix(in srgb, var(--surface) 70%, transparent)); }
.tip-ph { position: absolute; left: 18px; bottom: 12px; font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: 44px; line-height: .9; color: #fff; }
.tip-body { display: grid; gap: 10px; padding: 16px 18px 18px; }
.tip-title { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.15; letter-spacing: -.02em; }
.tip-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tip .chips li { padding: 3px 8px; font-size: 11px; }
.tip-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--accent); }
/* Moving to another post: its details rise in, one after another. */
.tip-inner.swap .tip-body > * { animation: tip-in 420ms var(--ease) both; }
.tip-inner.swap .tip-body > :nth-child(2) { animation-delay: 40ms; }
.tip-inner.swap .tip-body > :nth-child(3) { animation-delay: 80ms; }
.tip-inner.swap .tip-body > :nth-child(4) { animation-delay: 120ms; }
.tip-inner.swap .tip-body > :nth-child(5) { animation-delay: 160ms; }
.tip-inner.swap .tip-media img { animation: tip-img 700ms var(--ease) both; }
@keyframes tip-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes tip-img { from { opacity: 0; transform: scale(1.12); } }
@media (hover: none), (pointer: coarse), (max-width: 860px) { .tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .tip-inner, .tip-media img { transition: none; } .tip-inner.swap * { animation: none !important; } }

/* ── About ─────────────────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.about-photo { margin: 0; overflow: hidden; border-radius: var(--r-card); aspect-ratio: 4 / 5; background: var(--blue); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
/* With the 3D badge (badge.js) the photo moves onto the card; the figure becomes its stage. */
.about-photo { position: relative; }
.about-photo.has-badge { overflow: visible; background: none; aspect-ratio: 3 / 4; }
.about-photo.has-badge img { visibility: hidden; }
.badge-gl { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.badge-gl.can-grab { cursor: grab; }
.badge-gl.grabbing { cursor: grabbing; }
.about-copy { display: grid; gap: 28px; }
.about-text { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.7vw, 40px); line-height: 1.25; letter-spacing: -.02em; text-wrap: pretty; }
.ico { display: inline-grid; place-items: center; width: 1.45em; height: 1em; margin-inline: .06em; border-radius: var(--r-ctl); background: var(--blue); color: #fff; vertical-align: -.12em; }
.ico svg { width: .62em; height: .62em; }
@media (prefers-reduced-motion: no-preference) {
  .ico svg { animation: bob 3.2s var(--ease) infinite; }
  .ico-key svg { animation-name: turn; }
  .ico-spark svg { animation-name: spin; animation-duration: 6s; animation-timing-function: linear; }
  .ico-pen svg { animation-name: write; }
}
@keyframes bob { 50% { transform: translateY(-14%); } }
@keyframes turn { 0%, 60%, 100% { transform: none; } 75% { transform: rotate(-35deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes write { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(10%, -8%); } 50% { transform: translate(-6%, 4%); } 75% { transform: translate(8%, 6%); } }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding-top: 24px; border-top: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 4px 0 0; font-size: 15px; }

/* ── Contact ───────────────────────────────────────────────────────────── */
.contact { position: relative; overflow: clip; padding-top: clamp(80px, 11vw, 150px); color: #fff;
  background: radial-gradient(70% 90% at 100% 0%, #4d62ff 0%, transparent 60%), var(--blue); }
.contact .eyebrow { color: rgb(255 255 255 / .8); }
.contact .eyebrow::before { background: #fff; }
.contact-title { margin: 20px 0 clamp(32px, 4vw, 56px); font-family: var(--display); font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(84px, 19vw, 340px); line-height: .8; letter-spacing: -.02em; }
.contact-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; padding-bottom: 32px; border-bottom: 1px solid rgb(255 255 255 / .3); }
.contact-lede { max-width: 30ch; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mail-link { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3vw, 40px); letter-spacing: -.02em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; overflow-wrap: anywhere; }
.copy { padding: 9px 16px; border: 1px solid rgb(255 255 255 / .5); border-radius: var(--r-ctl); background: none; color: #fff; font: 500 14px var(--body); cursor: pointer; }
.copy:hover { background: #fff; color: var(--blue); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0; padding: 28px 0 clamp(56px, 7vw, 96px); list-style: none; }
.contact-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 18px; text-decoration: none; }
.contact-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 22px 0 max(22px, env(safe-area-inset-bottom)); border-top: 1px solid rgb(255 255 255 / .3); font-family: var(--mono); font-size: 12px; color: rgb(255 255 255 / .8); }
.foot a { text-decoration: none; }

/* ── Smaller screens ───────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .posts a { grid-template-columns: 130px minmax(0, 1fr) auto; }
  .p-cat { display: none; }
}
@media (max-width: 860px) {
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-row li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stats-row li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .hero-inner { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 32px; padding-block: 96px 40px; }
  /* Phones: the card stack follows the buttons, at 62% (the negative margin takes back the space scaling leaves). */
  .sc-stage { transform: scale(.62); transform-origin: top center; margin-bottom: calc(480px * -.38); }
  .hero-title { font-size: clamp(64px, 24vw, 200px); }
  .orbit-sec { --cw: min(270px, 74vw); --ch: 390px; }
  .gc { padding: 22px; }
  .gc-num { font-size: 72px; }
  .gc h3 { font-size: 30px; }
  .xs a { grid-template-columns: minmax(0, 1fr) auto; }
  .when { grid-column: 1; }
  .lane { grid-column: 2; grid-row: 1; }
  .xs-role, .xs-org { grid-column: 1 / -1; }
  .xs-cta { align-items: flex-end; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-photo { width: min(100%, 420px); aspect-ratio: 4 / 5; margin-inline: auto; }
  .contact-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .tk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 104px; gap: 8px; }
  .tk-face { padding: 12px; }
  .tk-ico { width: 28px; height: 28px; }
  .tk-name, .tk-since { font-size: 14px; }
  .tk.big .tk-ico { width: 52px; height: 52px; }
  .tk.wide .tk-name { font-size: 16px; }
  .tk-uses { font-size: 12px; }
  .sec-head.row { grid-template-columns: minmax(0, 1fr); }
  .sec-head.row .btn { justify-self: start; }
  .posts a { grid-template-columns: minmax(0, 1fr) auto; padding: 20px 0; }
  .posts time { grid-column: 1; }
  .p-min { grid-column: 2; grid-row: 1; }
  .p-title { grid-column: 1 / -1; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .contact-title { font-size: 30vw; }
  .btn { padding: 13px 18px; }
}

/* ── Now reading: a pill in the corner naming the section in view (home.js). Four bars pulse like a level meter. ── */
.np { position: fixed; right: var(--gut); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; display: inline-flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); color: var(--fg); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 20px 50px -24px rgb(0 0 0 / .6);
  opacity: 0; transform: translateY(24px); pointer-events: none; transition: opacity 300ms, transform 500ms var(--ease); }
.np.on { opacity: 1; transform: none; pointer-events: auto; }
.np-bars { display: flex; align-items: flex-end; gap: 3px; width: 34px; height: 34px; padding: 9px 8px; border-radius: 50%; background: var(--blue); }
.np-bars i { flex: 1; height: 100%; border-radius: 2px; background: #fff; transform-origin: bottom; transform: scaleY(.4); }
@media (prefers-reduced-motion: no-preference) {
  .np-bars i { animation: np-bar 900ms ease-in-out infinite alternate; }
  .np-bars i:nth-child(2) { animation-delay: -300ms; animation-duration: 700ms; }
  .np-bars i:nth-child(3) { animation-delay: -600ms; animation-duration: 1100ms; }
  .np-bars i:nth-child(4) { animation-delay: -150ms; animation-duration: 800ms; }
}
@keyframes np-bar { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
/* The bars play for a moment when the section changes, then hold still (a loop that never stops keeps the screen redrawing). */
.np-bars i { animation-play-state: paused; }
.np.playing .np-bars i { animation-play-state: running; }
/* Sections with looping CSS animations (data-loops) pause them while off screen; home.js sets .paused. */
[data-loops].paused, [data-loops].paused * { animation-play-state: paused !important; }
.np-text { display: grid; line-height: 1.15; }
.np-text small { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.np-text b { font-weight: 600; font-size: 14px; white-space: nowrap; }
.np-text b.swap { animation: tip-in 380ms var(--ease) both; }
.np-up { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); transition: transform 300ms var(--ease); }
.np:hover .np-up { transform: translateY(-2px); }
