/* ==========================================================================
   TBSI Developer Hub — Front-end styles
   ========================================================================== */
:root {
  --bg: #05060f;
  --bg-2: #0a0c1b;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --border: rgba(255, 255, 255, .08);
  --border-2: rgba(255, 255, 255, .16);
  --text: #e8eaf6;
  --muted: #8f96b8;
  --c1: #22d3ee;
  --c2: #8b5cf6;
  --c3: #f472b6;
  --accent: var(--c1);
  --grad: linear-gradient(115deg, var(--c1), var(--c2) 52%, var(--c3));
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  --radius: 22px;
  --f-head: "Space Grotesk", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 72px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f7ff;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, .7);
  --surface-2: rgba(255, 255, 255, .9);
  --border: rgba(20, 24, 60, .09);
  --border-2: rgba(20, 24, 60, .18);
  --text: #12152e;
  --muted: #5b6185;
  --c1: #0891b2;
  --c2: #7c3aed;
  --c3: #db2777;
  --shadow: 0 30px 70px -35px rgba(40, 50, 120, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.65 var(--f-body); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .4s, color .4s;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
::selection { background: var(--c2); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--c1), var(--c2)); border-radius: 10px; border: 2px solid var(--bg); }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 8px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 999; background: var(--c2); color: #fff; padding: 10px 16px; border-radius: 10px; transition: top .2s; }
.skip:focus { top: 12px; }
.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% auto; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.glass {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}
.pad { padding: 28px; }
.sticky { position: sticky; top: calc(var(--nav-h) + 24px); }

/* ---------- Background FX ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
#net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .75; }
.aurora i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .32; animation: float 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: var(--c2); top: -18vmax; left: -10vmax; }
.aurora i:nth-child(2) { background: var(--c1); bottom: -22vmax; right: -12vmax; animation-delay: -7s; opacity: .22; }
.aurora i:nth-child(3) { background: var(--c3); top: 30%; left: 45%; width: 28vmax; height: 28vmax; animation-delay: -12s; opacity: .14; }
[data-theme="light"] .aurora i { opacity: .16; }
@keyframes float { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, 4vmax) scale(1.12); } 100% { transform: translate(-4vmax, 7vmax) scale(.95); } }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  opacity: .55;
}
.noise { position: absolute; inset: -50%; opacity: .05; 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 baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.cursor-glow { position: fixed; left: 0; top: 0; width: 520px; height: 520px; border-radius: 50%; pointer-events: none; z-index: -1; background: radial-gradient(circle, rgba(139, 92, 246, .16), transparent 60%); transform: translate(-50%, -50%); opacity: 0; transition: opacity .4s; }
body.has-pointer .cursor-glow { opacity: 1; }
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; }
.scroll-progress span { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px var(--c2); }

/* ---------- Nav ---------- */
.nav { position: fixed; top: 14px; left: 0; right: 0; z-index: 100; transition: top .3s var(--ease); }
.nav-inner {
  width: min(1200px, 100% - 28px); margin-inline: auto; height: 60px; padding: 0 10px 0 18px;
  display: flex; align-items: center; gap: 18px; border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled .nav-inner { background: color-mix(in srgb, var(--bg) 82%, transparent); box-shadow: 0 20px 50px -25px rgba(0, 0, 0, .7); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; }
.brand-mark svg { width: 34px; height: 34px; animation: spin 18s linear infinite; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text small { font: 500 .62rem/1.4 var(--f-mono); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { position: relative; padding: 8px 14px; border-radius: 10px; font-size: .92rem; font-weight: 500; color: var(--muted); transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-links a.active::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 16px; height: 2px; margin-left: -8px; border-radius: 2px; background: var(--grad); }
.nav-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 1.15rem; transition: border-color .2s, transform .2s; }
.icon-btn:hover { border-color: var(--border-2); transform: translateY(-1px); }
.t-light { display: none; } [data-theme="light"] .t-light { display: block; } [data-theme="light"] .t-dark { display: none; }
.kbd-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .88rem; }
.kbd-btn:hover { color: var(--text); border-color: var(--border-2); }
kbd { font: 500 .7rem var(--f-mono); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.burger { display: none; }

/* ---------- Buttons, chips, badges ---------- */
.btn { --h: 50px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: var(--h); padding: 0 24px; border-radius: 14px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; transition: transform .25s var(--ease), box-shadow .3s, border-color .2s, background .2s; white-space: nowrap; }
.btn i { font-size: 1.15em; }
.btn-sm { --h: 40px; padding: 0 16px; font-size: .86rem; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-primary { color: #fff; background: var(--grad); background-size: 180% auto; box-shadow: 0 10px 40px -10px color-mix(in srgb, var(--c2) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { background-position: right center; box-shadow: 0 16px 50px -10px color-mix(in srgb, var(--c2) 90%, transparent); }
.btn-ghost { background: var(--surface); border-color: var(--border-2); backdrop-filter: blur(10px); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.btn-store { --h: 58px; background: #000; color: #fff; border-color: rgba(255, 255, 255, .2); padding: 0 22px 0 18px; }
.btn-store i { font-size: 1.8rem; }
.btn-store span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; font-size: 1.05rem; }
.btn-store small { font-size: .62rem; letter-spacing: .08em; opacity: .8; font-weight: 500; }
.btn-store:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .88rem; font-weight: 500; transition: all .25s var(--ease); }
.chip em { font-style: normal; font: 600 .72rem var(--f-mono); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); }
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 8px 26px -10px var(--c2); }
.chip.active em { background: rgba(255, 255, 255, .2); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: color-mix(in srgb, var(--accent) 14%, transparent); color: color-mix(in srgb, var(--accent) 75%, var(--text)); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.badge.hot { --accent: #fbbf24; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); font-size: .85rem; color: var(--muted); margin-bottom: 26px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; padding: calc(var(--nav-h) + 60px) 0 80px; }
.h-title { font-size: clamp(2.6rem, 6.4vw, 5.2rem); font-weight: 700; margin-bottom: 24px; }
.h-title > span { display: block; }
.h-hi { font-size: .42em; font-weight: 500; color: var(--muted); font-family: var(--f-mono); letter-spacing: 0; margin-bottom: .2em; }
.h-build { font-size: .5em; margin-top: .25em; font-weight: 600; }
.typing { color: var(--accent); border-right: 3px solid var(--c3); padding-right: 4px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { border-color: transparent; } }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.15rem); color: var(--muted); max-width: 58ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0; }
.stats { display: flex; flex-wrap: wrap; gap: 14px; }
.stat { padding: 14px 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(10px); min-width: 120px; }
.stat b { display: block; font: 700 1.9rem/1 var(--f-head); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: .8rem; color: var(--muted); }
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0; }
.glitch:hover::before { animation: g1 .4s steps(2) 2; opacity: .8; }
.glitch:hover::after { animation: g2 .4s steps(2) 2; opacity: .8; }
@keyframes g1 { 0% { clip-path: inset(10% 0 60% 0); transform: translate(-4px, -2px); } 100% { clip-path: inset(60% 0 5% 0); transform: translate(4px, 2px); } }
@keyframes g2 { 0% { clip-path: inset(70% 0 10% 0); transform: translate(4px, 1px); } 100% { clip-path: inset(5% 0 70% 0); transform: translate(-4px, -1px); } }

.hero-visual { display: grid; place-items: center; perspective: 1000px; }
.orb { position: relative; width: min(440px, 80vw); aspect-ratio: 1; display: grid; place-items: center; transform-style: preserve-3d; }
.ring { position: absolute; inset: 0; border-radius: 50%; }
.r1 { background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c3), var(--c1)); padding: 2px; animation: spin 8s linear infinite; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); filter: drop-shadow(0 0 18px var(--c2)); }
.r2 { inset: 12%; border: 1px dashed var(--border-2); animation: spin 40s linear infinite reverse; }
.r3 { inset: 26%; background: radial-gradient(circle, color-mix(in srgb, var(--c2) 35%, transparent), transparent 70%); filter: blur(20px); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.15); opacity: .7; } }
.avatar { position: relative; width: 48%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--grad); box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--border-2), 0 30px 80px -20px var(--c2); transform: translateZ(60px); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font: 700 clamp(4rem, 9vw, 6rem) var(--f-head); color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .35); }
.orbit { position: absolute; inset: 0; animation: spin 30s linear infinite; }
.orbit span { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--border-2); font-size: 1.3rem; color: var(--c1); backdrop-filter: blur(8px); transform: rotate(var(--a)) translateX(min(220px, 40vw)) rotate(calc(-1 * var(--a))); }
.orbit span i { display: block; animation: spin 30s linear infinite reverse; }
.orbit span:nth-child(3n+2) { color: var(--c2); } .orbit span:nth-child(3n) { color: var(--c3); }
.code-card { position: absolute; right: -6%; bottom: 2%; width: 240px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--bg-2) 80%, transparent); border: 1px solid var(--border-2); backdrop-filter: blur(14px); box-shadow: var(--shadow); transform: translateZ(90px); animation: bob 6s ease-in-out infinite; }
.code-card pre { margin: 8px 0 0; font: 500 .74rem/1.6 var(--f-mono); color: var(--text); white-space: pre; overflow: hidden; }
.code-card .k { color: var(--c2); } .code-card .s { color: #34d399; } .code-card .n { color: var(--c3); }
.cc-dots { display: flex; gap: 6px; align-items: center; }
.cc-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; } .cc-dots i:nth-child(2) { background: #f59e0b; } .cc-dots i:nth-child(3) { background: #22c55e; }
.cc-dots em { margin-left: auto; font: .68rem var(--f-mono); color: var(--muted); font-style: normal; }
@keyframes bob { 50% { transform: translateZ(90px) translateY(-12px); } }
.scroll-hint { position: absolute; left: 50%; bottom: 26px; width: 26px; height: 42px; border: 2px solid var(--border-2); border-radius: 14px; transform: translateX(-50%); }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--grad); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--border); background: var(--surface); padding: 18px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 46px; width: max-content; animation: marquee 40s linear infinite; }
.marquee-track span { display: inline-flex; align-items: center; gap: 10px; font: 600 1.05rem var(--f-head); color: var(--muted); white-space: nowrap; }
.marquee-track i { color: var(--c1); font-size: 1.3rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.s-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.eyebrow { display: inline-block; font: 500 .82rem var(--f-mono); color: var(--c1); letter-spacing: .06em; margin-bottom: 14px; }
.s-title { font-size: clamp(2rem, 4.4vw, 3.3rem); font-weight: 700; }
.h-sm { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.h-sm i { color: var(--accent); }

/* ---------- Products ---------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 30px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.search { position: relative; display: flex; align-items: center; }
.search i { position: absolute; left: 14px; color: var(--muted); }
.search input { width: 260px; height: 44px; padding: 0 16px 0 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; transition: border-color .2s, box-shadow .2s, width .3s; }
.search input:focus { outline: none; border-color: var(--c2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c2) 18%, transparent); width: 300px; }
.grid.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; padding: 26px; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: border-color .3s, box-shadow .4s, transform .5s var(--ease); transform-style: preserve-3d; will-change: transform;
}
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: radial-gradient(400px circle at var(--mx) var(--my), var(--accent), transparent 45%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; pointer-events: none; }
.card-glow { position: absolute; inset: 0; background: radial-gradient(500px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 13%, transparent), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.card:hover { box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.card:hover::before, .card:hover .card-glow { opacity: 1; }
.card.featured { grid-column: span 2; }
.card[hidden] { display: none; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.icon-wrap { position: relative; transform: translateZ(40px); }
.icon-wrap::after { content: ""; position: absolute; inset: 10%; background: var(--accent); filter: blur(22px); opacity: .45; z-index: -1; border-radius: 20px; }
.p-icon { width: 68px; height: 68px; border-radius: 20px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border-2); }
.p-icon-fallback { display: grid; place-items: center; font: 700 1.9rem var(--f-head); color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #1e1b4b)); }
.card h3 { font-size: 1.35rem; margin-bottom: 6px; transform: translateZ(25px); }
.card p { color: var(--muted); font-size: .95rem; flex: 1; transform: translateZ(15px); }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tags span { font: 500 .74rem var(--f-mono); color: var(--muted); padding: 3px 8px; border-radius: 7px; background: var(--surface-2); }
.card-links { position: relative; z-index: 2; display: flex; gap: 6px; padding-top: 16px; border-top: 1px solid var(--border); }
.lk { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; border-radius: 10px; font-size: .85rem; font-weight: 600; color: var(--muted); border: 1px solid transparent; transition: all .2s; }
.lk:first-child { margin-right: auto; color: var(--accent); }
.lk:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.lk i { font-size: 1.05rem; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.empty i { font-size: 3rem; color: var(--c2); }

/* ---------- About & services ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 50px; align-items: center; }
.facts { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.facts li { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.facts i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--c1); font-size: 1.15rem; }
.facts a:hover { color: var(--c1); }
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.service { padding: 26px; transition: transform .5s var(--ease), border-color .3s; }
.service:hover { border-color: var(--border-2); }
.s-ic { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--grad); color: #fff; font-size: 1.5rem; margin-bottom: 18px; box-shadow: 0 12px 30px -10px var(--c2); }
.service h3 { font-size: 1.12rem; }
.service p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.skill-group { padding: 26px; }
.skill-group h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.skill-group h3 i { color: var(--c1); }
.skill { margin-bottom: 16px; }
.skill-row { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; margin-bottom: 7px; }
.skill-row i { color: var(--c2); margin-right: 4px; }
.skill-row b { font-size: .78rem; color: var(--muted); }
.bar { height: 7px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: calc(var(--lvl) * 1%); border-radius: inherit; background: var(--grad); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.4s var(--ease); box-shadow: 0 0 12px var(--c2); position: relative; }
.bar span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); animation: sweep 2.4s infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.in .bar span { transform: scaleX(1); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 820px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 110px; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--c1), var(--c2), transparent); }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 34px; margin-bottom: 22px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 104px; top: 22px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--c1); box-shadow: 0 0 16px var(--c1); }
.t-when { text-align: right; padding-top: 16px; padding-right: 14px; color: var(--c1); font-size: .85rem; }
.t-body { padding: 20px 24px; }
.t-body h3 { font-size: 1.08rem; margin-bottom: 4px; }
.t-body p { color: var(--muted); margin: 0; font-size: .93rem; }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: clamp(28px, 5vw, 60px); position: relative; overflow: hidden; }
.contact-wrap::after { content: ""; position: absolute; width: 400px; height: 400px; right: -150px; top: -150px; background: radial-gradient(circle, color-mix(in srgb, var(--c2) 30%, transparent), transparent 70%); pointer-events: none; }
.mail-big { display: inline-flex; align-items: center; gap: 10px; font: 600 1.15rem var(--f-head); margin: 10px 0 24px; border-bottom: 2px solid var(--c2); padding-bottom: 4px; word-break: break-all; }
.mail-big:hover { color: var(--c1); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 1.15rem; color: var(--muted); transition: all .25s var(--ease); }
.socials a:hover { color: #fff; background: var(--grad); border-color: transparent; transform: translateY(-3px); }
.socials.big a { width: 48px; height: 48px; font-size: 1.3rem; }
.contact-form { display: grid; gap: 16px; position: relative; z-index: 1; }
.field { position: relative; }
.field input, .field textarea, .field select { width: 100%; padding: 22px 16px 8px; border-radius: 14px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; resize: vertical; transition: border-color .2s, box-shadow .2s; }
.field select { appearance: none; cursor: pointer; }
.field select option { background: var(--bg-2); color: var(--text); }
.field label { position: absolute; left: 16px; top: 15px; color: var(--muted); font-size: .95rem; pointer-events: none; transition: all .2s var(--ease); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--c2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c2) 16%, transparent); }
.field input:focus + label, .field input:not(:placeholder-shown) + label, .field textarea:focus + label, .field textarea:not(:placeholder-shown) + label, .field label.up { top: 6px; font-size: .72rem; color: var(--c1); font-family: var(--f-mono); }
.field.err input, .field.err textarea { border-color: #ef4444; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 60px 0 24px; margin-top: 40px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer h4 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-family: var(--f-mono); margin-bottom: 14px; }
.footer-grid > div > a:not(.brand) { display: block; padding: 4px 0; color: var(--text); opacity: .8; font-size: .93rem; transition: opacity .2s, color .2s, transform .2s; }
.footer-grid > div > a:not(.brand):hover { opacity: 1; color: var(--c1); transform: translateX(3px); }
.footer p { margin-top: 12px; max-width: 40ch; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }
.to-top { position: fixed; right: 22px; bottom: 22px; width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--grad); color: #fff; font-size: 1.3rem; z-index: 90; box-shadow: 0 12px 30px -10px var(--c2); opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: all .35s var(--ease); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 300; display: grid; place-items: start center; padding-top: 12vh; }
.cmdk[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 12, .6); backdrop-filter: blur(6px); animation: fade .2s; }
.cmdk-box { position: relative; width: min(620px, 92vw); border-radius: 20px; background: color-mix(in srgb, var(--bg-2) 92%, transparent); border: 1px solid var(--border-2); box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(139, 92, 246, .15); overflow: hidden; animation: pop .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cmdk-input i { color: var(--c1); font-size: 1.2rem; }
.cmdk-input input { flex: 1; background: none; border: 0; color: var(--text); font: inherit; font-size: 1.05rem; outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.cmdk-list .grp { font: 600 .7rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px 6px; }
.cmdk-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.cmdk-list a .ci { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--c1); overflow: hidden; }
.cmdk-list a .ci img { width: 100%; height: 100%; object-fit: cover; }
.cmdk-list a b { display: block; font-weight: 600; font-size: .95rem; }
.cmdk-list a small { color: var(--muted); font-size: .8rem; }
.cmdk-list a.on { background: color-mix(in srgb, var(--c2) 18%, transparent); }
.cmdk-list .none { padding: 30px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
.cmdk-foot kbd { margin-right: 3px; }

/* ---------- Toasts & lightbox ---------- */
.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 400; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: .92rem; animation: pop .3s var(--ease); }
.toast i { font-size: 1.2rem; color: #22c55e; }
.toast.bad i { color: #ef4444; }
.lightbox { position: fixed; inset: 0; z-index: 350; display: grid; place-items: center; background: rgba(3, 4, 12, .88); backdrop-filter: blur(8px); padding: 30px; animation: fade .2s; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 88vh; max-width: 92vw; border-radius: 18px; box-shadow: var(--shadow); }
.lightbox .icon-btn { position: absolute; top: 20px; right: 20px; }

/* ---------- Product page ---------- */
.p-hero { padding: calc(var(--nav-h) + 50px) 0 40px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); margin-bottom: 34px; }
.crumbs a:hover { color: var(--c1); }
.p-hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center; }
.p-icon-big { position: relative; transform-style: preserve-3d; }
.p-icon-big .p-icon { width: clamp(130px, 18vw, 190px); height: clamp(130px, 18vw, 190px); border-radius: 26%; position: relative; z-index: 1; box-shadow: 0 30px 70px -20px color-mix(in srgb, var(--accent) 70%, transparent); transform: translateZ(40px); }
.p-icon-big .p-icon-fallback { font-size: 4.5rem; }
.p-halo { position: absolute; inset: -18%; border-radius: 50%; background: conic-gradient(from 0deg, var(--accent), transparent 30%, var(--c2), transparent 70%, var(--accent)); filter: blur(30px); opacity: .55; animation: spin 10s linear infinite; }
.p-title { font-size: clamp(2.3rem, 5.4vw, 4rem); margin: 14px 0 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.p-title i { color: var(--accent); }
.p-hero-copy .card-badges { justify-content: flex-start; }
.p-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; padding-bottom: 40px; }
.p-main { display: grid; gap: 24px; min-width: 0; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px; border-radius: 18px; }
.feature i { color: var(--accent); font-size: 1.3rem; flex: none; margin-top: 1px; }
.shots { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 16px; }
.shot { flex: none; width: 220px; padding: 0; border: 1px solid var(--border-2); border-radius: 22px; overflow: hidden; background: var(--surface); scroll-snap-align: start; transition: transform .3s var(--ease), box-shadow .3s; }
.shot:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -20px var(--accent); }
.shot img { width: 100%; aspect-ratio: 9/18; object-fit: cover; }
.info { margin: 0 0 18px; display: grid; }
.info div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.info dt { color: var(--muted); } .info dd { margin: 0; font-weight: 600; text-align: right; }
.legal-links { display: grid; gap: 8px; margin-top: 6px; }
.legal-links a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: .9rem; font-weight: 500; transition: all .2s; }
.legal-links a i:first-child { color: var(--accent); font-size: 1.1rem; }
.legal-links a i:last-child { margin-left: auto; color: var(--muted); }
.legal-links a:hover { border-color: var(--accent); transform: translateX(3px); }

/* ---------- Prose (markdown) ---------- */
.prose { font-size: 1.02rem; line-height: 1.8; }
.prose h1 { font-size: 1.9rem; margin: 0 0 18px; }
.prose h2 { font-size: 1.4rem; margin: 2em 0 .7em; padding-top: .4em; display: flex; align-items: center; gap: 10px; }
.prose h2::before { content: ""; width: 6px; height: 1.1em; border-radius: 4px; background: var(--grad); flex: none; }
.prose h3 { font-size: 1.15rem; margin: 1.6em 0 .5em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.prose a:hover { border-color: var(--accent); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose ul li::marker { color: var(--accent); }
.prose code { font: .88em var(--f-mono); padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 14px 14px 0; }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; height: 1px; background: var(--border-2); margin: 2em 0; }

/* ---------- Legal page ---------- */
.legal-hero { padding: calc(var(--nav-h) + 50px) 0 30px; }
.legal-head { max-width: 860px; }
.legal-app { display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 18px; border: 1px solid var(--border-2); background: var(--surface); }
.legal-app .p-icon { width: 46px; height: 46px; border-radius: 13px; }
.legal-app .p-icon-fallback { font-size: 1.3rem; }
.legal-app b { display: block; font-family: var(--f-head); }
.legal-app small { color: var(--muted); font-size: .78rem; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: .82rem; }
.legal-meta i { color: var(--accent); margin-right: 4px; }
.legal-head .cta { margin: 22px 0 0; }
.legal-layout { display: grid; grid-template-columns: 270px 1fr; gap: 26px; align-items: start; padding-bottom: 60px; }
.legal-layout:has(> .doc:only-child) { grid-template-columns: 1fr; max-width: 900px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: t; display: grid; gap: 2px; }
.toc li { counter-increment: t; }
.toc a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: .88rem; color: var(--muted); transition: all .2s; }
.toc a::before { content: counter(t, decimal-leading-zero); font: 500 .72rem/1.9 var(--f-mono); color: var(--border-2); }
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc a.active { color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.toc a.active::before { color: var(--accent); }
.doc { padding: clamp(24px, 5vw, 56px); min-width: 0; }
.doc-foot { display: flex; gap: 16px; align-items: flex-start; margin-top: 40px; padding: 22px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.doc-foot > i { font-size: 1.8rem; color: var(--accent); }
.doc-foot p { margin: 4px 0 0; color: var(--muted); }
.doc-foot a { color: var(--accent); }

/* ---------- 404 ---------- */
.nf { min-height: 100vh; display: grid; place-content: center; text-align: center; padding: 120px 0 60px; }
.nf-code { font: 700 clamp(7rem, 22vw, 14rem)/1 var(--f-head); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 10px; }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.card.reveal.in, .service.reveal.in { transition: opacity .9s var(--ease) var(--d, 0ms), transform .5s var(--ease), border-color .3s, box-shadow .4s; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: calc(var(--nav-h) + 50px); }
  .hero-copy { order: 2; } .hero-visual { order: 1; }
  .lead { margin-inline: auto; }
  .cta, .stats { justify-content: center; }
  .orb { width: min(340px, 74vw); }
  .orbit span { transform: rotate(var(--a)) translateX(min(170px, 37vw)) rotate(calc(-1 * var(--a))); }
  .code-card { display: none; }
  .scroll-hint { display: none; }
  .about-grid, .contact-wrap, .p-layout, .legal-layout { grid-template-columns: 1fr; }
  .toc .sticky, .p-side .sticky { position: static; }
  .kbd-btn span, .kbd-btn kbd { display: none; }
  .kbd-btn { width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 820px) {
  .burger { display: inline-grid; }
  .nav-links { position: absolute; top: 70px; left: 14px; right: 14px; flex-direction: column; padding: 10px; border-radius: 18px; background: color-mix(in srgb, var(--bg-2) 96%, transparent); border: 1px solid var(--border-2); box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); pointer-events: none; transition: all .25s var(--ease); }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 16px; }
  .nav-actions { margin-left: auto; }
  .card.featured { grid-column: auto; }
  .p-hero-grid { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 30px; }
  .p-hero-copy .card-badges, .p-hero-copy .cta { justify-content: center; }
  .p-title { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .section { padding: 80px 0; }
}
@media (max-width: 560px) {
  .services { grid-template-columns: 1fr; }
  .search, .search input, .search input:focus { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .chip { flex: none; }
  .timeline::before { left: 7px; }
  .timeline li { grid-template-columns: 1fr; gap: 8px; padding-left: 30px; }
  .timeline li::before { left: 1px; top: 4px; }
  .t-when { text-align: left; padding: 0; }
  .stat { min-width: calc(50% - 7px); }
  .brand-text small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .nav, .bg-fx, .cursor-glow, .footer, .to-top, .toc, .cta, .crumbs, .scroll-progress, .doc-foot { display: none !important; }
  body { background: #fff; color: #000; }
  .glass, .doc { background: none; border: 0; box-shadow: none; backdrop-filter: none; padding: 0; }
  .reveal { opacity: 1; transform: none; }
  .prose p, .prose li { color: #222; }
  .legal-layout { display: block; }
}
