:root {
  --bg: #fbfbfd;
  --bg-2: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: rgba(0, 0, 0, .08);
  --accent: #7b3fe4;
  --accent-2: #2f6bff;
  --pink: #d63bd0;
  --nav: rgba(251, 251, 253, .72);
  --shadow: 0 2px 6px rgba(0, 0, 0, .04), 0 18px 48px rgba(0, 0, 0, .07);
  --code-bg: #0e0e14;
  --radius: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000;
    --bg-2: #0d0d10;
    --card: #141418;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --line: rgba(255, 255, 255, .1);
    --nav: rgba(10, 10, 12, .72);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 60px rgba(0, 0, 0, .6);
    --accent: #a77bff;
    --accent-2: #6c9bff;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  letter-spacing: -.011em;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { width: min(1080px, 100% - 40px); margin: 0 auto; }

/* nav */
nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
nav .brand img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
nav ul { display: flex; gap: 28px; list-style: none; font-size: 13px; color: var(--text-2); }
nav ul a { transition: color .2s; }
nav ul a:hover { color: var(--text); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 22px; border-radius: 980px;
  font-size: 15px; font-weight: 500;
  transition: transform .3s var(--ease), background .2s, opacity .2s;
}
.btn:hover { transform: scale(1.03); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.ghost { color: var(--accent); }
.btn.ghost:hover { text-decoration: underline; }
.btn svg { width: 16px; height: 16px; }

/* hero */
.hero { padding: 96px 0 72px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 620px; z-index: -1;
  background:
    radial-gradient(40% 50% at 30% 40%, rgba(123, 63, 228, .18), transparent 70%),
    radial-gradient(35% 45% at 70% 35%, rgba(47, 107, 255, .16), transparent 70%),
    radial-gradient(30% 40% at 50% 70%, rgba(214, 59, 208, .12), transparent 70%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(0, 30px, 0) scale(1.06); } }
.avatar {
  width: 132px; height: 132px; margin: 0 auto 28px; border-radius: 50%;
  padding: 3px; background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--pink), var(--accent));
  box-shadow: 0 20px 50px rgba(123, 63, 228, .3);
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 82% 22%; border: 3px solid var(--bg); }
.eyebrow { font-size: 17px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.hero h1 { font-size: clamp(44px, 8vw, 88px); line-height: 1.02; font-weight: 700; letter-spacing: -.04em; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 50%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede { font-size: clamp(19px, 2.4vw, 24px); color: var(--text-2); max-width: 640px; margin: 22px auto 34px; line-height: 1.4; }
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* stats strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 22px; overflow: hidden; margin-top: 72px; }
.strip div { background: var(--bg); padding: 24px 12px; text-align: center; }
.strip b { display: block; font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.strip span { font-size: 13px; color: var(--text-2); }

/* sections */
section { padding: 96px 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em; }
.section-head p { color: var(--text-2); font-size: 19px; margin-top: 12px; }

/* featured projects */
.project {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 0;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 28px; min-height: 460px;
}
.project:nth-of-type(even) { grid-template-columns: 1.1fr 1fr; }
.project:nth-of-type(even) .copy { order: 2; }
.project .copy { padding: 52px 48px; display: flex; flex-direction: column; justify-content: center; }
.tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 10px; }
.project h3 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; }
.project .sub { font-size: 19px; color: var(--text-2); margin: 12px 0 22px; line-height: 1.4; }
.project ul { list-style: none; display: grid; gap: 10px; margin-bottom: 26px; font-size: 15px; }
.project li { display: flex; gap: 10px; align-items: flex-start; }
.project li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chips span { font-size: 12px; padding: 5px 11px; border-radius: 980px; background: var(--bg-2); color: var(--text-2); border: 1px solid var(--line); }
.project .links { display: flex; gap: 18px; align-items: center; font-size: 15px; }
.project .links a { color: var(--accent); font-weight: 500; }
.project .links a:hover { text-decoration: underline; }
.project .links .muted { color: var(--text-2); font-size: 13px; }

.visual { position: relative; display: grid; place-items: center; padding: 36px; overflow: hidden; }
.visual.v1 { background: linear-gradient(145deg, #1a0b3a, #0b1b4a 60%, #2a0b3a); }
.visual.v2 { background: linear-gradient(145deg, #0b0b12, #1b1030); }
.visual.v3 { background: linear-gradient(145deg, #0c1a3a, #2b0e45); }

/* v1: chart */
.chart { width: 100%; max-width: 440px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px; padding: 20px; color: #fff; backdrop-filter: blur(10px); }
.chart .row { display: flex; justify-content: space-between; font-size: 12px; opacity: .7; }
.chart .big { font-size: 28px; font-weight: 700; margin: 4px 0 10px; letter-spacing: -.02em; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .line { fill: none; stroke: url(#lg); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; }
.in .chart .line { animation: draw 2.2s var(--ease) .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .area { fill: url(#ag); opacity: 0; transition: opacity 1.2s 1s; }
.in .chart .area { opacity: 1; }
.gates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.gates span { font-size: 11px; text-align: center; padding: 7px 4px; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.gates span i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #3ddc84; margin-right: 5px; vertical-align: middle; }

/* v2: terminal */
.term { width: 100%; max-width: 460px; background: var(--code-bg); border-radius: 16px; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); overflow: hidden; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: #e6e6f0; }
.term .bar { display: flex; gap: 7px; padding: 12px 14px; background: rgba(255, 255, 255, .04); }
.term .bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term .bar i:nth-child(2) { background: #febc2e; }
.term .bar i:nth-child(3) { background: #28c840; }
.term pre { padding: 16px 18px 20px; white-space: pre-wrap; min-height: 230px; }
.term .p { color: #a77bff; }
.term .ok { color: #3ddc84; }
.term .dim { color: #8a8a99; }
.term .cursor { display: inline-block; width: 8px; height: 15px; background: #e6e6f0; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* v3: fleet dashboard */
.fleet { width: 100%; max-width: 440px; display: grid; gap: 10px; }
.agent-row { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: 12px 14px; color: #fff; font-size: 13px; opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.in .agent-row { opacity: 1; transform: none; }
.in .agent-row:nth-child(2) { transition-delay: .12s; }
.in .agent-row:nth-child(3) { transition-delay: .24s; }
.in .agent-row:nth-child(4) { transition-delay: .36s; }
.agent-row .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.agent-row .meta { flex: 1; min-width: 0; }
.agent-row .meta b { display: block; font-weight: 600; }
.agent-row .meta small { opacity: .6; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 980px; font-weight: 600; }
.pill.work { background: rgba(61, 220, 132, .18); color: #3ddc84; }
.pill.wait { background: rgba(254, 188, 46, .18); color: #febc2e; }
.pill.idle { background: rgba(255, 255, 255, .12); color: #ccc; }
.pill.work::before { content: "● "; animation: blink 1.2s steps(1) infinite; }
.cost { font-variant-numeric: tabular-nums; opacity: .8; font-size: 12px; width: 52px; text-align: right; }

/* more work */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mini { background: var(--card); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); transition: transform .4s var(--ease); }
.mini:hover { transform: translateY(-4px); }
.mini h4 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 6px; }
.mini p { font-size: 14px; color: var(--text-2); line-height: 1.45; }
.mini .k { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 8px; }

/* principles */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.principles h4 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 14px 0 8px; }
.principles p { color: var(--text-2); font-size: 15px; }
.principles .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.principles .icon svg { width: 22px; height: 22px; }

/* about */
.about { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; }
.about img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.about h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.06; letter-spacing: -.035em; margin-bottom: 18px; }
.about p { font-size: 19px; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
.about p b { color: var(--text); font-weight: 600; }

/* contact */
.contact { text-align: center; background: var(--bg-2); border-radius: 36px; padding: 80px 24px; }
.contact h2 { font-size: clamp(36px, 6vw, 64px); line-height: 1.04; letter-spacing: -.04em; font-weight: 700; }
.contact p { color: var(--text-2); font-size: 19px; margin: 14px 0 30px; }
.contact .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

footer { padding: 40px 0 60px; text-align: center; font-size: 12px; color: var(--text-2); }

/* reveal */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .agent-row { opacity: 1; transform: none; }
  .chart .line { stroke-dashoffset: 0; }
  .chart .area { opacity: 1; }
}

/* responsive */
@media (max-width: 900px) {
  .wrap { width: calc(100% - 32px); }
  nav ul { display: none; }
  .hero { padding: 64px 0 48px; }
  .strip { grid-template-columns: repeat(2, 1fr); margin-top: 48px; }
  section { padding: 64px 0; }
  .project, .project:nth-of-type(even) { grid-template-columns: 1fr; min-height: 0; }
  .project:nth-of-type(even) .copy { order: 0; }
  .project .copy { padding: 36px 24px; }
  .visual { padding: 28px 16px; }
  .grid, .principles { grid-template-columns: 1fr; }
  .principles { gap: 32px; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about img { max-width: 260px; margin: 0 auto; }
  .contact { padding: 56px 20px; border-radius: 28px; }
}
