/* =========================================================
   Ahmad Reza Shamim — Portfolio
   Mobile-first · light/dark tokens · no framework
   ========================================================= */

:root {
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --gutter: 16px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* dark (default) */
  --bg: #05070d;
  --bg-2: #0a0e18;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #e8edf6;
  --muted: #95a1b8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-3: #34d399;
  --on-accent: #041016;
  --glow: rgba(34, 211, 238, .22);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  --grid-line: rgba(255, 255, 255, .045);
}

:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #eceff7;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: #ffffff;
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .18);
  --text: #0b1220;
  --muted: #4b5568;
  --accent: #0e7490;
  --accent-2: #6d28d9;
  --accent-3: #047857;
  --on-accent: #ffffff;
  --glow: rgba(14, 116, 144, .16);
  --shadow: 0 20px 50px -24px rgba(15, 23, 42, .25);
  --grid-line: rgba(15, 23, 42, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--on-accent); border-radius: 10px; }
.skip:focus { left: 8px; }

/* ---------- progress ---------- */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 .95rem/1 var(--font-body); letter-spacing: .01em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, border-color .25s;
  -webkit-tap-highlight-color: transparent;
}
.btn .ic { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn:active { transform: scale(.97); }
.btn--primary {
  color: var(--on-accent);
  background: linear-gradient(110deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn--primary:hover { box-shadow: 0 14px 40px -8px var(--glow), inset 0 1px 0 rgba(255,255,255,.25); transform: translateY(-1px); }
.btn--ghost { border: 1px solid var(--border-strong); background: var(--surface); backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--accent); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .875rem; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; gap: 6px; grid-auto-flow: column;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
kbd { font: 500 .72rem var(--font-mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); }

/* theme + sound icon swap */
.ic-moon, .ic-on { display: none; }
[data-theme="light"] .ic-sun { display: none; }
[data-theme="light"] .ic-moon { display: block; }
[aria-pressed="true"] .ic-off { display: none; }
[aria-pressed="true"] .ic-on { display: block; color: var(--accent); }

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .4s;
}
.header.is-scrolled { border-bottom-color: var(--border); }
.header__in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.1rem var(--font-display); }
.brand__mark {
  position: relative; width: 40px; height: 40px; padding: 2px; border-radius: 50%; flex: none;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 6px 20px -6px var(--glow);
}
.brand__mark img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); }
.brand__mark::after { /* availability dot */
  content: ""; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-3); border: 2px solid var(--bg);
}
.brand__dot { color: var(--accent); }
.nav { display: none; }
.controls { display: flex; align-items: center; gap: 8px; }
.kbd-btn, .kbd-btn kbd, .header__cta { display: none; }

/* mobile sheet */
.sheet {
  position: fixed; inset: var(--header-h) 0 0; z-index: 45;
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: sheet-in .35s var(--ease);
}
.sheet[hidden] { display: none; }
.sheet__nav a {
  display: flex; align-items: baseline; gap: 14px; padding: 14px 0;
  font: 600 1.75rem var(--font-display); border-bottom: 1px solid var(--border);
}
.sheet__nav span { font: 500 .8rem var(--font-mono); color: var(--accent); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 48px 0 64px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -2;
  background:
    radial-gradient(40% 40% at 80% 20%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 70%),
    radial-gradient(35% 35% at 15% 35%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(10px);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .7; }
.hero__grid {
  position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%);
}
.hero__in { display: grid; gap: 48px; align-items: center; }
.hero { --px: 0; --py: 0; }
.hero__grid { transform: translate3d(calc(var(--px) * -14px), calc(var(--py) * -14px), 0); transition: transform .6s var(--ease); }
.hero::before { transform: translate3d(calc(var(--px) * 30px), calc(var(--py) * 30px), 0); transition: transform .8s var(--ease); }


.hero__title { font-size: clamp(2.1rem, 8.4vw, 4.3rem); font-weight: 700; letter-spacing: -.035em; margin-bottom: 20px; }
.rotator { display: block; min-height: 1.15em; white-space: nowrap; } /* phrases ≤ 20 chars: one line, no layout shift */
.rotator__word { display: inline-block; transition: opacity .35s var(--ease), transform .35s var(--ease), filter .35s; }
.rotator__word.is-out { opacity: 0; transform: translateY(.3em); filter: blur(6px); }
.hero__lead { font-size: 1.05rem; color: var(--muted); max-width: 56ch; }
.hero__lead strong { color: var(--text); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.hero__cta .btn { flex: 1 1 200px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.stat { padding: 14px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.stat dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; line-height: 1.3; }
.stat dd { margin: 6px 0 0; font: 700 1.7rem/1 var(--font-display); }
.stat small { font-size: .6em; }

/* orbit */
.orbit { --size: min(84vw, 420px); position: relative; width: var(--size); aspect-ratio: 1; margin-inline: auto; }
.orbit__ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--border-strong); }
.orbit__ring--2 { inset: 17%; border-style: solid; border-color: var(--border); background: radial-gradient(circle, var(--glow), transparent 70%); }
.orbit__core {
  position: absolute; inset: 26%; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 80px -10px var(--glow), 0 0 0 10px color-mix(in srgb, var(--accent) 6%, transparent);
  animation: breathe 5s ease-in-out infinite;
}
.orbit__core picture, .orbit__core img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.orbit__core img { border: 3px solid var(--bg); filter: contrast(1.05); }
.orbit__badge {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
  font: 600 .72rem var(--font-mono); color: var(--on-accent);
  background: linear-gradient(110deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px -8px var(--glow);
}
.orbit__badge .ic { width: 14px; height: 14px; }
@keyframes breathe { 50% { box-shadow: 0 0 100px -6px var(--glow), 0 0 0 16px color-mix(in srgb, var(--accent) 4%, transparent); } }
.orbit__track { position: absolute; inset: 0; animation: spin 60s linear infinite; }
.orbit__node {
  --r: calc(var(--size) / 2);
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px;
  display: grid; place-items: center; border-radius: 14px;
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--accent);
  box-shadow: var(--shadow);
  transform: rotate(calc(var(--i) * 45deg)) translate(var(--r)) rotate(calc(var(--i) * -45deg));
  transition: border-color .2s, box-shadow .2s;
}
.orbit__node > .ic { animation: spin 60s linear infinite reverse; }
.orbit__node::after {
  content: attr(data-label); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  white-space: nowrap; padding: 4px 10px; border-radius: 8px; font-size: .75rem; font-weight: 600;
  background: var(--text); color: var(--bg); opacity: 0; pointer-events: none; transition: .2s var(--ease);
}
.orbit__node:hover, .orbit__node:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.orbit__node:hover::after, .orbit__node:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.orbit:hover .orbit__track, .orbit:hover .orbit__node > .ic { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--border); background: var(--bg-2); padding: 14px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track { display: flex; width: max-content; gap: 36px; animation: marquee 50s linear infinite; }
.marquee span { font: 500 .9rem var(--font-mono); color: var(--muted); white-space: nowrap; }
.marquee span::before { content: "◆"; margin-right: 36px; color: var(--accent); font-size: .6em; vertical-align: middle; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: 72px 0; position: relative; overflow-x: clip; }
.section--alt { background: var(--bg-2); }
.section__head { max-width: 720px; margin-bottom: 36px; }
.section__lead { color: var(--muted); font-size: 1.05rem; margin-top: 14px; }
.eyebrow { font: 500 .8rem var(--font-mono); color: var(--accent); letter-spacing: .04em; margin-bottom: 12px; }
.h2 { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 700; }

.card {
  position: relative; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); padding: 22px;
  transition: border-color .3s, transform .3s var(--ease), box-shadow .3s, background-color .4s;
}
/* pointer spotlight */
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--border-strong); }

/* about */
.about { display: grid; gap: 36px; }
.about__media { position: relative; margin: 0 8px; isolation: isolate; }
.about__media picture, .about__media img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.about__media img { aspect-ratio: 880 / 875; object-fit: cover; border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.about__vector { position: absolute; z-index: -1; width: 70%; right: -14%; top: -12%; opacity: .8; animation: spin 80s linear infinite; }
.hud { /* corner brackets */
  position: absolute; inset: -8px; z-index: 2; pointer-events: none; border-radius: calc(var(--radius) + 6px);
  --c: var(--accent); --l: 26px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) 2px, linear-gradient(var(--c), var(--c)) top left / 2px var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) 2px, linear-gradient(var(--c), var(--c)) bottom right / 2px var(--l);
  background-repeat: no-repeat;
}
.float {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0;
  border-radius: 14px; border: 1px solid var(--border-strong); font-size: .8rem; line-height: 1.3;
  background: color-mix(in srgb, var(--bg-2) 80%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.float strong { display: block; font: 600 .9rem var(--font-display); }
.float span span, .float > span { color: var(--muted); }
.float strong { color: var(--text); }
.float .ic { color: var(--accent); width: 22px; height: 22px; }
.float--a { left: -8px; bottom: 18%; }
.float--b { right: -8px; top: 10%; animation-delay: -3s; }
.float--b .ic { color: var(--accent-3); }
@keyframes float { 50% { transform: translateY(-8px); } }
.about__copy p { color: var(--muted); }
.about__copy strong { color: var(--text); }
.about__copy .h2 { margin-bottom: 20px; }
.roles { display: grid; gap: 10px; }
.roles li {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); transition: border-color .2s, transform .25s var(--ease);
}
.roles li:hover { border-color: var(--accent); transform: translateX(4px); }
.roles .ic { color: var(--accent); width: 22px; height: 22px; }
.roles strong { display: block; font: 600 1rem var(--font-display); }
.roles span { font-size: .87rem; color: var(--muted); }

/* filters */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 calc(var(--gutter) * -1) 24px; padding-inline: var(--gutter); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: .88rem; font-weight: 500; color: var(--muted); transition: .2s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-active { color: var(--on-accent); background: var(--text); border-color: var(--text); }
[data-theme="dark"] .chip.is-active { background: var(--accent); border-color: var(--accent); }

/* products */
.products { display: grid; gap: 14px; }
.product { display: flex; flex-direction: column; gap: 12px; }
.product.is-hidden { display: none; }
.product__top { display: flex; align-items: center; justify-content: space-between; }
.product__icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent-2) 20%, transparent));
  border: 1px solid var(--border); color: var(--accent);
}
.product__icon .ic { width: 22px; height: 22px; }
.tag { font: 500 .72rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.product h3 { font-size: 1.25rem; }
.product > p { color: var(--muted); margin: 0; font-size: .95rem; }
.mini { display: flex; flex-wrap: wrap; gap: 6px; }
.mini li { font-size: .76rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.ai-badge {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font: 600 .75rem var(--font-mono);
  padding: 4px 10px; border-radius: 999px; color: var(--accent-3);
  background: color-mix(in srgb, var(--accent-3) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent-3) 30%, transparent);
}
.ai-badge .ic { width: 14px; height: 14px; }
.product__more {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; align-self: flex-start;
  font-weight: 600; color: var(--accent);
}
.product__more .ic { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.product__more:hover .ic { transform: translateX(4px); }
.product__more::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* whole card clickable */
.product:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
/* line-art illustration in the empty bottom-right corner */
.product { isolation: isolate; }
.product__art {
  position: absolute; z-index: -1; right: 14px; bottom: 12px; width: min(52%, 200px); height: auto;
  pointer-events: none; opacity: .7; transition: opacity .3s, transform .4s var(--ease);
}
.product:hover .product__art { opacity: 1; transform: translateY(-3px); }
.product__art :is(.a-l, .a-d, .a-g, .a-p) { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.product__art .a-l { stroke: url(#g-accent); stroke-width: 1.4; }
.product__art .a-fill { fill: var(--bg-2); }
.product__art .a-d { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 3 5; animation: dash-flow 2.4s linear infinite; }
.product__art .a-soft { stroke: var(--accent-2); opacity: .45; }
.product__art .a-g { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 4; }
.product__art .a-n { fill: var(--accent); }
.product__art .a-n2 { fill: var(--accent-2); }
.product__art .a-p { stroke: var(--accent); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: ping 2.8s var(--ease) infinite; }
@keyframes dash-flow { to { stroke-dashoffset: -32; } }
@keyframes ping { from { transform: scale(.7); opacity: .7; } to { transform: scale(1.3); opacity: 0; } }

/* modal */
.modal {
  width: min(100% - 24px, 720px); max-height: min(88dvh, 880px); padding: 0; border: 1px solid var(--border-strong);
  border-radius: 22px; background: var(--bg-2); color: var(--text); box-shadow: 0 40px 120px -20px rgba(0,0,0,.6);
  margin: auto auto 12px; overflow: auto; overscroll-behavior: contain;
}
.modal::backdrop, .palette::backdrop { background: rgba(2, 4, 10, .6); backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in .4s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(30px) scale(.98); } }
.modal__in { padding: 22px; display: grid; gap: 18px; }
.modal__close { position: sticky; top: 0; justify-self: end; margin-bottom: -50px; z-index: 2; background: var(--bg-2); }
.modal__head { display: flex; align-items: center; gap: 14px; padding-right: 56px; }
.modal__head h3 { font-size: 1.4rem; margin-top: 4px; }
.modal__body h4 { font: 500 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 22px 0 10px; }
.modal__body h4:first-child { margin-top: 0; }
.modal__body p { color: var(--muted); }
.stackline { font-family: var(--font-mono); font-size: .88rem; }
.ticks { display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 26px; font-size: .93rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.ticks li::after {
  content: ""; position: absolute; left: 2px; top: calc(.35em + 2px); width: 12px; height: 12px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.ticks--ai li::before { background: color-mix(in srgb, var(--accent-3) 18%, transparent); }
.ticks--ai li::after { background: var(--accent-3); }

/* ai console */
.ai { display: grid; gap: 16px; margin-bottom: 28px; }
.ai__tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.ai__tabs::-webkit-scrollbar { display: none; }
.ai__tab {
  flex: none; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 500; color: var(--muted); transition: .2s;
}
.ai__tab[aria-selected="true"] { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 24px -8px var(--glow); }
.console { border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg-2); overflow: hidden; box-shadow: var(--shadow); }
.section--alt .console { background: var(--bg); }
.console__bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.console__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.console__bar span:first-child { background: #ff5f57; } .console__bar span:nth-child(2) { background: #febc2e; } .console__bar span:nth-child(3) { background: #28c840; }
.console__bar em { margin-left: auto; font: normal 500 .72rem var(--font-mono); color: var(--muted); }
.console__body { padding: 20px 18px 24px; display: grid; gap: 18px; min-height: 220px; font-size: .95rem; }
.console__body p { display: flex; gap: 12px; margin: 0; }
.console .who {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  font: 600 .65rem var(--font-mono); text-transform: uppercase; border: 1px solid var(--border); background: var(--surface);
}
.console__a .who { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); border: 0; }
.console__a .who .ic { width: 16px; height: 16px; }
.console__q .txt { font-weight: 600; padding-top: 3px; }
.console__a .txt { color: var(--muted); padding-top: 3px; }
.console .txt.is-typing::after { content: "▍"; color: var(--accent); animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

.caps { display: grid; gap: 12px; }
.cap .ic { width: 26px; height: 26px; color: var(--accent); margin-bottom: 14px; }
.cap h3 { font-size: 1.1rem; margin-bottom: 6px; }
.cap p { color: var(--muted); margin: 0; font-size: .93rem; }

/* services */
.services { display: grid; gap: 14px; }
.service { padding: 26px 22px; overflow: hidden; }
.service__no { position: absolute; top: 14px; right: 18px; font: 700 2.6rem var(--font-display); color: var(--border-strong); opacity: .6; }
.service__ic { width: 30px; height: 30px; color: var(--accent); margin-bottom: 18px; }
.service h3 { font-size: 1.2rem; margin-bottom: 10px; padding-right: 40px; }
.service p { color: var(--muted); font-size: .94rem; }
.service--hl { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent), color-mix(in srgb, var(--accent-2) 8%, transparent)); }
.service--hl::after { content: "Most requested"; position: absolute; bottom: 16px; right: 16px; font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }

.engage { display: grid; gap: 1px; margin-top: 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--border); }
.engage__item { padding: 20px 22px; background: var(--bg-2); }
.engage__item h3 { font-size: 1.05rem; margin-bottom: 4px; }
.engage__item p { margin: 0; color: var(--muted); font-size: .92rem; }

/* process */
.process { display: grid; gap: 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: s; }
.steps button {
  width: 100%; min-height: 60px; display: grid; gap: 2px; padding: 10px 12px; text-align: left; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); font: 600 .95rem var(--font-display); transition: .25s var(--ease);
}
.steps button span { font: 500 .72rem var(--font-mono); color: var(--muted); }
.steps button[aria-selected="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.steps button[aria-selected="true"] span { color: var(--accent); }
/* autoplay progress bar on the active step */
.steps button, .ai__tab { position: relative; overflow: hidden; }
.process.is-playing .steps button[aria-selected="true"]::after,
.ai.is-playing .ai__tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: step-fill var(--step-ms, 5000ms) linear forwards;
}
@keyframes step-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.step-panel { min-height: 170px; padding: 26px; }
.step h3 { font-size: 1.5rem; margin-bottom: 10px; }
.step p { color: var(--muted); margin: 0; max-width: 64ch; }
.step:not([hidden]) { animation: fade-up .45s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }

/* stack */
.stack { display: grid; gap: 14px; }
.stack__group { padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.stack__group h3 { font: 500 .78rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 14px; }
.stack__group ul { display: flex; flex-wrap: wrap; gap: 8px; }
.stack__group li { font-size: .86rem; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); transition: .2s; }
.stack__group li:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* contact */
.contact-sec::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 60% at 80% 60%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%);
}
.contact { display: grid; gap: 32px; }
.contact__copy > p { color: var(--muted); margin-top: 16px; }
.links { display: grid; gap: 4px; margin-top: 24px; }
.links li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.links a, .links span { display: flex; align-items: center; gap: 12px; min-height: 52px; font-weight: 500; word-break: break-word; }
.links span { color: var(--muted); }
.links a:hover { color: var(--accent); }
.links .ic { color: var(--accent); }
.copy { font: 500 .75rem var(--font-mono); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); }
.copy:hover { color: var(--accent); border-color: var(--accent); }

.form { display: grid; gap: 12px; padding: 20px; container-type: inline-size; }
/* corner line-art on the form */
.contact .form { position: relative; overflow: visible; }
.form__corner {
  position: absolute; top: -34px; right: -34px; width: 150px; height: 150px; pointer-events: none; z-index: 1;
}
.form__corner .a-d { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 3 6; animation: dash-flow 2.4s linear infinite; }
.form__corner .a-l { fill: none; stroke: url(#g-accent); stroke-width: 1.4; stroke-linecap: round; }
.form__corner .a-n { fill: var(--accent); }
.form__corner .a-n2 { fill: var(--accent-2); }
@media (max-width: 639px) { .form__corner { top: -26px; right: -10px; width: 110px; height: 110px; } }
.form__row { display: grid; gap: 12px; }
@container (min-width: 420px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: .82rem; font-weight: 600; padding: 0; margin-bottom: 0; }
.field legend { margin-bottom: 6px; }
.field input:not([type="radio"]), .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: 400 .95rem var(--font-body); transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 88px; }
.field ::placeholder { color: var(--muted); opacity: .75; }
.field select {
  appearance: none; cursor: pointer; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.field select:invalid, .field select:has(option[value=""]:checked) { color: var(--muted); }
.field select option { background: var(--bg-2); color: var(--text); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.field .is-invalid { border-color: #f43f5e !important; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills span {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); font-size: .82rem; transition: .2s;
}
.pills input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pills input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form .hp { display: none; }
.form__note { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }
.form__note[data-state] {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  font-size: .92rem; font-weight: 600; text-align: left; animation: fade-up .35s var(--ease);
}
.form__note[data-state="success"] {
  color: var(--accent-3); background: color-mix(in srgb, var(--accent-3) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-3) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-3) 10%, transparent);
}
.form__note[data-state="error"] {
  color: #f43f5e; background: color-mix(in srgb, #f43f5e 10%, transparent); border: 1px solid color-mix(in srgb, #f43f5e 40%, transparent);
}
.form__note[data-state] .ic { flex: none; width: 22px; height: 22px; }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); font-size: .86rem; color: var(--muted); }
.footer__in { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.footer p { margin: 0; }
.to-top:hover { color: var(--accent); }

/* palette */
.palette {
  width: min(100% - 24px, 560px); padding: 0; margin: 12vh auto auto; border-radius: 18px;
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text); box-shadow: 0 40px 120px -20px rgba(0,0,0,.6);
}
.palette[open] { animation: modal-in .3s var(--ease); }
.palette__search { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette__search .ic { color: var(--muted); }
.palette__search input { flex: 1; height: 56px; border: 0; background: none; color: var(--text); font: 400 1rem var(--font-body); outline: none; }
.palette__list { max-height: 50vh; overflow: auto; padding: 8px; }
.palette__list li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; cursor: pointer; font-size: .95rem; }
.palette__list li small { margin-left: auto; color: var(--muted); font: 500 .72rem var(--font-mono); }
.palette__list li[aria-selected="true"] { background: var(--surface-2); color: var(--accent); }
.palette__list .ic { width: 18px; height: 18px; color: var(--muted); }
.palette__hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: .88rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- pointer effects (fine pointers only, added by JS) ---------- */
.cursor-dot, .cursor-ring, .cursor-glow { position: fixed; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity .3s; will-change: transform; }
.has-cursor .cursor-dot, .has-cursor .cursor-ring, .has-cursor .cursor-glow { opacity: 1; }
.cursor-dot { z-index: 92; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent); }
.cursor-ring {
  z-index: 91; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 65%, transparent);
  transition: opacity .3s, width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background-color .3s, border-color .3s;
}
.cursor-ring.is-hover { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: var(--accent); }
.cursor-ring.is-down { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
.cursor-glow {
  z-index: 1; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 9%, transparent), color-mix(in srgb, var(--accent-2) 5%, transparent) 40%, transparent 68%);
}
[data-tilt] { transform-style: preserve-3d; transition: transform .5s var(--ease); will-change: transform; }
.is-magnetic { transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, border-color .25s; }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* =========================================================
   ≥ 640px
   ========================================================= */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .products, .caps, .services, .stack { grid-template-columns: repeat(2, 1fr); }
  .product--wide { grid-column: 1 / -1; }
  .roles { grid-template-columns: repeat(2, 1fr); }
  .engage { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(6, 1fr); }
  .modal { margin: auto; }
  .modal__in { padding: 30px; }
  .hero__cta .btn { flex: 0 0 auto; }
  .filters { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .kbd-btn { display: inline-grid; }
}

/* =========================================================
   ≥ 960px
   ========================================================= */
@media (min-width: 960px) {
  :root { --header-h: 72px; }
  .nav { display: flex; gap: 4px; }
  .nav a { position: relative; padding: 8px 12px; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--muted); transition: color .2s, background-color .2s; }
  .nav a:hover { color: var(--text); background: var(--surface); }
  .nav a.is-active { color: var(--text); }
  .nav a.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
  .menu-btn { display: none; }
  .kbd-btn kbd, .header__cta { display: inline-flex; }
  .sheet { display: none !important; }

  .hero { padding: 72px 0 96px; min-height: calc(100svh - var(--header-h)); display: flex; align-items: center; }
  .hero__in { grid-template-columns: 1.15fr .85fr; }
  .hero__title { font-size: clamp(3rem, 4.6vw, 4.3rem); }
  .orbit { --size: 420px; }
  .section { padding: 112px 0; }
  .section__head { margin-bottom: 52px; }
  .about { grid-template-columns: .95fr 1.05fr; gap: 72px; align-items: center; }
  .about .roles { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .about__media { margin: 0; }
  .float--a { left: -28px; }
  .float--b { right: -28px; }
  .products { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .product--wide { grid-column: auto; } /* 9 cards fill 3×3 */
  .caps, .services, .stack { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .card { padding: 26px; }
  .card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .ai { grid-template-columns: 220px 1fr; gap: 20px; }
  .ai__tabs { flex-direction: column; overflow: visible; margin: 0; padding: 0; }
  .ai__tab { text-align: left; }
  .console__body { padding: 28px; min-height: 260px; font-size: 1.02rem; }
  .contact { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
  .form { padding: 26px; }
}

@media (min-width: 1200px) {
  .orbit { --size: 460px; }
}

/* hover-capable only */
@media (hover: none) {
  .card:hover { transform: none; }
  .card::before { display: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .hero__canvas { display: none; }
}

/* print */
@media print {
  .header, .hero__canvas, .marquee, .controls, .form, .toast, .progress { display: none !important; }
  body { background: #fff; color: #000; }
  .product__detail { display: block !important; }
}

/* lock page scroll behind open dialogs */
html:has(dialog[open]) { overflow: hidden; }
