/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============ THEME TOKENS ============ */
:root {
  /* Morpheus TI palette: emerald -> teal -> sky */
  --c1: #34d399;   /* emerald  (primary)   */
  --c2: #14b8a6;   /* teal     (secondary) */
  --c3: #38bdf8;   /* sky      (tertiary)  */
  --ok: #10b981;   /* deep emerald (success) */
  --amber: #fbbf24;/* warm accent (Java, pads, stars) */
  --rose: #fb7185; /* blocked / busy / walls */
  --grad: linear-gradient(100deg, var(--c1), var(--c2) 52%, var(--c3));

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 18px;
}

/* DARK (default) */
:root, :root[data-theme="dark"] {
  --bg: #060b0a;
  --bg-2: #0a1211;
  --text: #e6f0ec;
  --muted: #93a8a0;
  --surface: rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.055);
  --hair: rgba(255,255,255,0.09);
  --hair-soft: rgba(255,255,255,0.06);
  --hair-strong: rgba(255,255,255,0.2);
  --nav-bg: rgba(6,11,10,0.72);
  --shadow: rgba(0,0,0,0.5);
  --aurora-op: 0.5;
  --on-accent: #06110d;
  color-scheme: dark;
}

/* LIGHT */
:root[data-theme="light"] {
  --bg: #f2f7f5;
  --bg-2: #e6efec;
  --text: #0c1a16;
  --muted: #51635c;
  --surface: rgba(8,45,36,0.04);
  --surface-2: rgba(8,45,36,0.06);
  --hair: rgba(8,45,36,0.13);
  --hair-soft: rgba(8,45,36,0.09);
  --hair-strong: rgba(8,45,36,0.28);
  --nav-bg: rgba(242,247,245,0.82);
  --shadow: rgba(20,60,50,0.16);
  --aurora-op: 0.4;
  --on-accent: #06110d;
  color-scheme: light;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .5s ease, color .5s ease;
}
::selection { background: color-mix(in srgb, var(--c2) 40%, transparent); }

/* scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--grad); z-index: 60;
  box-shadow: 0 0 12px color-mix(in srgb, var(--c2) 70%, transparent);
}

/* aurora nebula blobs */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--aurora-op); transition: opacity .5s; }
.aurora i:nth-child(1) {
  width: 44vw; height: 44vw; left: -12vw; top: -10vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--c1) 24%, transparent), transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  width: 38vw; height: 38vw; right: -10vw; top: 24vh;
  background: radial-gradient(circle, color-mix(in srgb, var(--c2) 24%, transparent), transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  width: 34vw; height: 34vw; left: 28vw; bottom: -14vw;
  background: radial-gradient(circle, color-mix(in srgb, var(--c3) 20%, transparent), transparent 65%);
  animation: drift3 38s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(9vw, 7vh) scale(1.18); } }
@keyframes drift2 { to { transform: translate(-8vw, -9vh) scale(1.12) rotate(24deg); } }
@keyframes drift3 { to { transform: translate(6vw, -7vh) scale(1.22); } }

/* background canvas + cursor glow */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.cursor-glow {
  position: fixed; width: 560px; height: 560px; border-radius: 50%;
  pointer-events: none; z-index: 1; transform: translate(-50%,-50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--c1) 8%, transparent), color-mix(in srgb, var(--c2) 6%, transparent) 40%, transparent 70%);
  transition: opacity .4s;
}
@media (hover: none) { .cursor-glow { display: none; } }

.nav, .hero, .section, .footer { position: relative; z-index: 2; }

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 6vw;
  transition: background .35s, backdrop-filter .35s, border-color .35s, padding .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--hair-soft);
  padding: 13px 6vw;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark {
  font-family: var(--font-mono); font-weight: 600; font-size: 13px;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: var(--grad); color: var(--on-accent);
}
.logo-text { font-family: var(--font-display); font-weight: 600; letter-spacing: .3px; }
.accent { color: var(--c1); }
.nav-links { display: flex; align-items: center; gap: 10px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500;
  transition: color .25s;
}
.nav-links a:hover { color: var(--text); }
/* top-bar shortcut buttons */
.nav-btn {
  color: var(--text) !important;
  border: 1px solid var(--hair); background: var(--surface);
  padding: 8px 16px; border-radius: 99px;
  transition: color .25s, border-color .25s, background .25s, transform .25s;
}
.nav-btn:hover {
  border-color: var(--c1);
  background: color-mix(in srgb, var(--c1) 10%, transparent);
  transform: translateY(-2px);
}
.nav-cta {
  color: var(--text) !important;
  border: 1px solid var(--hair); background: var(--surface);
  padding: 8px 16px; border-radius: 99px;
  transition: border-color .25s, background .25s;
}
.nav-cta:hover { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 10%, transparent); }

/* theme mode control (Auto / Light / Dark) */
.theme-toggle {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  height: 38px; padding: 0 15px 0 13px; border-radius: 99px;
  border: 1px solid var(--hair); background: var(--surface); color: var(--text);
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .5px;
  transition: border-color .25s, background .25s, transform .25s;
}
.theme-toggle:hover { border-color: var(--c2); transform: translateY(-2px); background: color-mix(in srgb, var(--c2) 8%, transparent); }
.theme-toggle svg { width: 17px; height: 17px; display: none; flex: 0 0 auto; }
.theme-mode-label { display: inline-block; min-width: 36px; text-align: left; }
:root[data-theme-mode="auto"] .theme-toggle .i-auto { display: block; }
:root[data-theme-mode="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme-mode="dark"] .theme-toggle .i-moon { display: block; }
@media (max-width: 720px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ============ HERO ============ */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 140px 6vw 96px;
}
.hero-inner { max-width: 1000px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--hair); border-radius: 99px;
  padding: 7px 16px; margin-bottom: 38px; background: var(--surface);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 0%, transparent); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 6.4vw, 76px);
  font-weight: 700; line-height: 1.08; letter-spacing: -1.5px;
  margin-bottom: 30px;
}
.hero-line { display: block; animation: lineRise .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-line:nth-child(1) { animation-delay: .15s; }
.hero-line:nth-child(2) { animation-delay: .34s; }
.hero-line:nth-child(3) { animation-delay: .53s; }
@keyframes lineRise {
  from { opacity: 0; transform: translateY(38px); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: none; clip-path: inset(0 0 -20% 0); }
}
.grad, .grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(17px, 2vw, 21px); color: var(--muted); margin-bottom: 44px; }
.hero-sub strong { color: var(--text); }
.type-wrap { color: var(--c1); font-family: var(--font-mono); font-size: .93em; }
.caret { display: inline-block; width: 9px; height: 1.1em; background: var(--c1); margin-left: 3px; vertical-align: text-bottom; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 72px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 15.5px;
  padding: 14px 28px; border-radius: 99px; text-decoration: none;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
}
.btn-primary { background: var(--grad); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px color-mix(in srgb, var(--c2) 40%, transparent); }
.btn-arrow { transition: transform .25s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-ghost { color: var(--text); border: 1px solid var(--hair); background: var(--surface); }
.btn-ghost:hover { border-color: var(--c2); transform: translateY(-2px); }

.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: clamp(18px, 3.5vw, 48px);
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3.4vw, 40px);
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { font-size: 12.5px; color: var(--muted); letter-spacing: .4px; }
.stat-div { width: 1px; height: 40px; background: var(--hair); }
@media (max-width: 600px) { .stat-div { display: none; } }

.hero-scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 40px; border: 1.5px solid var(--hair); border-radius: 14px;
}
.hero-scroll span {
  position: absolute; top: 7px; left: 50%; width: 4px; height: 8px; border-radius: 3px;
  background: var(--c1); transform: translateX(-50%); animation: scrollhint 1.8s infinite;
}
@keyframes scrollhint { 0% { opacity: 1; top: 7px; } 70% { opacity: 0; top: 22px; } 100% { opacity: 0; } }

/* ============ SECTIONS ============ */
.section { padding: 128px 6vw; max-width: 1240px; margin: 0 auto; }
.section-head { margin-bottom: 64px; }
.section-tag {
  font-family: var(--font-mono); font-size: 13px; color: var(--c1);
  letter-spacing: 2px; text-transform: uppercase;
}
.section-head h2 {
  font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 48px);
  font-weight: 700; letter-spacing: -1px; margin-top: 12px;
  position: relative; display: inline-block; padding-bottom: 12px;
}
.section-head h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 0;
  border-radius: 99px; background: var(--grad);
  transition: width 1s cubic-bezier(.2,.7,.2,1) .3s;
}
.section-head.in h2::after { width: 58%; }
.section-sub { color: var(--muted); margin-top: 12px; max-width: 560px; }

/* ============ TECH TICKER ============ */
.ticker {
  overflow: hidden; position: relative; z-index: 2;
  border-top: 1px solid var(--hair-soft);
  border-bottom: 1px solid var(--hair-soft);
  padding: 18px 0; margin: 0 0 24px;
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.ticker-track {
  display: inline-flex; align-items: center; gap: 34px; white-space: nowrap;
  animation: tickerScroll 34s linear infinite; will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span {
  font-family: var(--font-mono); font-size: 14px; color: var(--muted); letter-spacing: 1px;
}
.ticker-track span:nth-child(even) { color: var(--c2); font-size: 10px; }
@keyframes tickerScroll { to { transform: translateX(-50%); } }

/* reveal animation */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s cubic-bezier(.2,.6,.2,1), transform .8s cubic-bezier(.2,.6,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.done { transition: transform .16s ease-out, opacity .4s; }

/* ============ STORY ============ */
.story-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 72px; align-items: start; }
@media (max-width: 900px) { .story-grid { grid-template-columns: 1fr; gap: 48px; } }
.story-text p { color: var(--muted); margin-bottom: 20px; font-size: 16.5px; }
.story-text .lede { color: var(--text); font-size: 19px; line-height: 1.6; }
.story-text em { color: var(--text); font-style: italic; }
.story-text strong { color: var(--text); }
.story-kicker { font-family: var(--font-display); font-size: 20px !important; color: var(--text) !important; font-weight: 600; }

.timeline { position: relative; padding-left: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(to bottom, var(--c1), var(--c2), var(--c3));
  opacity: .5;
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.6s cubic-bezier(.2,.7,.2,1) .2s;
}
.timeline.in::before { transform: scaleY(1); }
.timeline .tl-item { opacity: 0; transform: translateX(24px); transition: opacity .7s, transform .7s cubic-bezier(.2,.7,.2,1); }
.timeline.in .tl-item { opacity: 1; transform: none; }
.timeline.in .tl-item:nth-child(1) { transition-delay: .25s; }
.timeline.in .tl-item:nth-child(2) { transition-delay: .55s; }
.timeline.in .tl-item:nth-child(3) { transition-delay: .85s; }
.timeline.in .tl-item:nth-child(4) { transition-delay: 1.15s; }
.timeline.in .tl-dot { animation: dotPop .5s cubic-bezier(.3,1.6,.5,1) both; }
.timeline.in .tl-item:nth-child(1) .tl-dot { animation-delay: .35s; }
.timeline.in .tl-item:nth-child(2) .tl-dot { animation-delay: .65s; }
.timeline.in .tl-item:nth-child(3) .tl-dot { animation-delay: .95s; }
.timeline.in .tl-item:nth-child(4) .tl-dot { animation-delay: 1.25s; }
@keyframes dotPop { from { transform: scale(0); } to { transform: scale(1); } }
.tl-item { position: relative; padding: 0 0 36px 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: 8px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2.5px solid var(--c1);
  box-shadow: 0 0 14px color-mix(in srgb, var(--c1) 50%, transparent);
}
.tl-item:nth-child(2) .tl-dot { border-color: var(--c2); box-shadow: 0 0 14px color-mix(in srgb, var(--c2) 50%, transparent); }
.tl-item:nth-child(3) .tl-dot { border-color: var(--c3); box-shadow: 0 0 14px color-mix(in srgb, var(--c3) 50%, transparent); }
.tl-item:nth-child(4) .tl-dot { border-color: var(--ok); box-shadow: 0 0 14px color-mix(in srgb, var(--ok) 50%, transparent); }
.tl-when { font-family: var(--font-mono); font-size: 12px; color: var(--c1); text-transform: uppercase; letter-spacing: 1.5px; }
.tl-body h4 { font-family: var(--font-display); font-size: 18px; margin: 6px 0; }
.tl-body p { color: var(--muted); font-size: 14.5px; }

/* ============ FEATURED ============ */
@property --spin { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.feature {
  position: relative;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 4.5vw, 64px);
  align-items: center; margin-bottom: 104px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 26px;
  padding: clamp(28px, 3.8vw, 52px);
  transition: border-color .4s, box-shadow .4s;
  will-change: transform;
}
.feature:last-of-type { margin-bottom: 0; }
.feature:hover { border-color: var(--hair-strong); box-shadow: 0 30px 80px var(--shadow); }
/* rotating neon border on hover */
.feature::after, .card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--spin),
    transparent 0deg, transparent 250deg,
    color-mix(in srgb, var(--c1) 90%, transparent) 300deg,
    color-mix(in srgb, var(--c3) 90%, transparent) 330deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity .5s;
  animation: borderSpin 3.4s linear infinite;
  pointer-events: none;
}
.feature:hover::after, .card:hover::after { opacity: 1; }
@keyframes borderSpin { to { --spin: 360deg; } }
.feature.flip .feature-preview { order: 2; }
.feature.flip .feature-info { order: 1; }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature.flip .feature-preview { order: 0; }
}
.feature-num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.feature-info h3 { font-family: var(--font-display); font-size: clamp(26px, 3vw, 36px); letter-spacing: -.5px; margin: 8px 0 4px; }
.feature-tag-line { font-family: var(--font-mono); font-size: 13.5px; color: var(--c1); margin-bottom: 18px; }
.feature-story { color: var(--muted); font-size: 15.5px; margin-bottom: 24px; }
.feature-story em { color: var(--text); }
.feature-story code { font-family: var(--font-mono); font-size: .88em; background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); padding: 2px 7px; border-radius: 6px; }
.live-badge {
  font-family: var(--font-mono); font-size: 11px; vertical-align: middle;
  background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 42%, transparent);
  padding: 3px 9px; border-radius: 99px; letter-spacing: 1.5px; margin-left: 8px;
  animation: livePulse 2.4s infinite;
}
@keyframes livePulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 32%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chips span {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--hair);
  padding: 5px 12px; border-radius: 99px;
}
.chips.sm span { font-size: 11px; padding: 4px 10px; }
.feature-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.feature-facts span { font-size: 13px; color: var(--muted); }
.feature-facts span::before { content: "◆ "; color: var(--c2); font-size: 9px; vertical-align: 2px; }
.feature-links { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.mini-btn {
  font-family: var(--font-display); font-size: 13.5px; font-weight: 600;
  color: var(--text); text-decoration: none;
  border: 1px solid var(--hair); padding: 9px 18px; border-radius: 99px;
  transition: border-color .25s, background .25s, transform .25s;
}
.mini-btn:hover { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 10%, transparent); transform: translateY(-2px); }

/* ---- preview windows (always dark, like app screenshots) ---- */
.feature-preview { perspective: 1000px; will-change: transform; }
.win {
  position: relative;
  border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, #0d1512, #080d0c);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  font-family: var(--font-mono);
  animation: winFloat 7s ease-in-out infinite;
}
.feature:nth-of-type(even) .win { animation-delay: 2.2s; }
@keyframes winFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.win::after {
  content: ""; position: absolute; left: 0; right: 0; top: -40%; height: 34%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--c1) 8%, transparent), transparent);
  animation: scanSweep 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scanSweep { 0% { top: -40%; } 60%, 100% { top: 115%; } }
.win-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px; background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.win-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.win-bar i:nth-child(2) { background: #febc2e; }
.win-bar i:nth-child(3) { background: #28c840; }
.win-bar span { margin-left: 10px; font-size: 11.5px; color: #93a8a0; }
.win-body { padding: 22px; color: #e6f0ec; }

/* morpheus preview */
.chat-q {
  font-size: 13px; color: #e6f0ec; background: color-mix(in srgb, var(--c2) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c2) 34%, transparent); border-radius: 12px 12px 12px 3px;
  padding: 10px 14px; margin-bottom: 16px;
}
.agent-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; align-items: center; }
.agent-chip {
  font-size: 10.5px; padding: 4px 10px; border-radius: 99px; letter-spacing: .5px;
  animation: chipGlow 3s infinite;
}
.agent-chip.a1 { background: color-mix(in srgb, var(--c1) 14%, transparent); color: var(--c1); border: 1px solid color-mix(in srgb, var(--c1) 36%, transparent); }
.agent-chip.a2 { background: color-mix(in srgb, var(--c2) 14%, transparent); color: var(--c2); border: 1px solid color-mix(in srgb, var(--c2) 36%, transparent); animation-delay: .7s; }
.agent-chip.a3 { background: color-mix(in srgb, var(--c3) 14%, transparent); color: var(--c3); border: 1px solid color-mix(in srgb, var(--c3) 36%, transparent); animation-delay: 1.4s; }
.agent-chip.a4 { background: color-mix(in srgb, var(--amber) 14%, transparent); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 36%, transparent); animation-delay: 2.1s; }
@keyframes chipGlow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.55); } }
.ai-dots { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.ai-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--c1);
  animation: dotBounce 1.2s ease-in-out infinite;
}
.ai-dots i:nth-child(2) { animation-delay: .18s; }
.ai-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dotBounce { 0%,100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.result-card {
  display: flex; align-items: center; gap: 13px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 12px 15px; margin-bottom: 10px;
  animation: resultIn 9s ease infinite;
}
.result-card.dim { opacity: .65; animation: resultIn2 9s ease infinite; }
@keyframes resultIn {
  0%, 8% { opacity: 0; transform: translateX(-14px); }
  15%, 96% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateX(-14px); }
}
@keyframes resultIn2 {
  0%, 16% { opacity: 0; transform: translateX(-14px); }
  24%, 96% { opacity: .65; transform: none; }
  100% { opacity: 0; transform: translateX(-14px); }
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #06110d;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.avatar.av2 { background: linear-gradient(135deg, var(--c3), var(--c2)); }
.result-info { flex: 1; display: flex; flex-direction: column; }
.result-info b { font-size: 12.5px; color: #e6f0ec; }
.result-info span { font-size: 11px; color: #93a8a0; }
.score-ring {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--c1);
  border: 2px solid color-mix(in srgb, var(--c1) 60%, transparent);
}
.score-ring.r2 { color: var(--c3); border-color: color-mix(in srgb, var(--c3) 55%, transparent); }

/* scheduler preview */
.cal-grid { position: relative; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; overflow: hidden; border-radius: 8px; }
.cal-grid::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 21%; left: -25%;
  background: linear-gradient(to right, transparent, color-mix(in srgb, var(--c1) 12%, transparent), transparent);
  border-left: 1px solid color-mix(in srgb, var(--c1) 28%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--c1) 28%, transparent);
  animation: calScan 4.6s cubic-bezier(.4,0,.4,1) infinite;
  pointer-events: none;
}
@keyframes calScan { 0% { left: -25%; } 55%, 70% { left: 40%; } 100% { left: 110%; } }
.cal-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cal-head span { font-size: 10.5px; color: #93a8a0; text-align: center; letter-spacing: 1px; }
.slot { height: 30px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06); }
.slot.busy { background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--rose) 14%, transparent), color-mix(in srgb, var(--rose) 14%, transparent) 4px, transparent 4px, transparent 9px); border-color: color-mix(in srgb, var(--rose) 28%, transparent); }
.slot.free { background: color-mix(in srgb, var(--c1) 18%, transparent); border-color: color-mix(in srgb, var(--c1) 55%, transparent); animation: freeGlow 2.2s infinite; }
@keyframes freeGlow { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c1) 25%, transparent); } 50% { box-shadow: 0 0 14px 2px color-mix(in srgb, var(--c1) 25%, transparent); } }
.sched-status { font-size: 12px; color: #93a8a0; display: flex; align-items: center; gap: 9px; }
.ok-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.8s infinite; }

/* math preview */
.math-body { text-align: center; }
.math-q { font-family: var(--font-display); font-size: 34px; font-weight: 700; margin: 8px 0 20px; letter-spacing: 1px; color: #e6f0ec; }
.math-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.math-opts span {
  padding: 12px 0; border-radius: 12px; font-size: 16px; font-weight: 600;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09); color: #e6f0ec;
}
.math-correct {
  position: relative;
  background: color-mix(in srgb, var(--c1) 16%, transparent) !important;
  border-color: color-mix(in srgb, var(--c1) 60%, transparent) !important;
  color: var(--c1); animation: correctPop 2.6s infinite;
}
@keyframes correctPop { 0%,100% { transform: scale(1); } 12% { transform: scale(1.09); } 24% { transform: scale(1); } }
.math-correct::before, .math-correct::after {
  content: "✦"; position: absolute; font-size: 11px; color: var(--c1); pointer-events: none;
}
.math-correct::before { top: -6px; left: -4px; animation: sparkA 2.6s infinite; }
.math-correct::after { bottom: -6px; right: -4px; animation: sparkB 2.6s infinite; }
@keyframes sparkA {
  0%, 8% { opacity: 0; transform: translate(4px,4px) scale(.4) rotate(0deg); }
  14% { opacity: 1; }
  30%, 100% { opacity: 0; transform: translate(-7px,-9px) scale(1.15) rotate(140deg); }
}
@keyframes sparkB {
  0%, 10% { opacity: 0; transform: translate(-4px,-4px) scale(.4) rotate(0deg); }
  16% { opacity: 1; }
  34%, 100% { opacity: 0; transform: translate(8px,9px) scale(1.15) rotate(-140deg); }
}
.math-progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; margin-bottom: 16px; }
.math-bar { height: 100%; width: 68%; border-radius: 99px; background: var(--grad); animation: barGrow 3s ease infinite; }
@keyframes barGrow { 0% { width: 40%; } 60% { width: 68%; } 100% { width: 68%; } }
.math-stars { font-size: 22px; color: var(--amber); letter-spacing: 6px; }
.star-empty { opacity: .25; }

/* sa1ntlab preview */
.logic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 18px; }
.logic-grid span {
  aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; font-size: 20px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
}
.lg-wall { background: color-mix(in srgb, var(--rose) 14%, transparent) !important; border-color: color-mix(in srgb, var(--rose) 35%, transparent) !important; }
.lg-pad { background: color-mix(in srgb, var(--amber) 14%, transparent) !important; border-color: color-mix(in srgb, var(--amber) 45%, transparent) !important; box-shadow: inset 0 0 12px color-mix(in srgb, var(--amber) 25%, transparent); }
.lg-goal {
  background: color-mix(in srgb, var(--c1) 14%, transparent) !important;
  border-color: color-mix(in srgb, var(--c1) 50%, transparent) !important;
  animation: goalAwait 7s ease infinite;
}
@keyframes goalAwait {
  0%, 68% { box-shadow: inset 0 0 6px color-mix(in srgb, var(--c1) 20%, transparent); }
  74%, 86% { box-shadow: inset 0 0 22px color-mix(in srgb, var(--c1) 85%, transparent), 0 0 18px color-mix(in srgb, var(--c1) 50%, transparent); background: color-mix(in srgb, var(--c1) 35%, transparent); }
  100% { box-shadow: inset 0 0 6px color-mix(in srgb, var(--c1) 20%, transparent); }
}
.lg-bot { overflow: visible !important; }
.bot-sprite {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-style: normal; position: relative; z-index: 2;
  animation: botWalk 7s ease-in-out infinite;
}
@keyframes botWalk {
  0%, 8%   { transform: translateX(0); }
  16%      { transform: translateX(calc(50% + 4px)) translateY(-6px); }
  24%, 30% { transform: translateX(calc(100% + 7px)); }
  38%      { transform: translateX(calc(150% + 11px)) translateY(-6px); }
  46%, 52% { transform: translateX(calc(200% + 14px)); }
  60%      { transform: translateX(calc(250% + 18px)) translateY(-6px); }
  68%, 72% { transform: translateX(calc(300% + 21px)); }
  76%      { transform: translateX(calc(300% + 21px)) translateY(-9px) rotate(-8deg); }
  80%      { transform: translateX(calc(300% + 21px)) translateY(0) rotate(8deg); }
  84%, 88% { transform: translateX(calc(300% + 21px)) translateY(-9px) rotate(0deg); }
  100%     { transform: translateX(0); }
}
.logic-blocks { display: flex; gap: 8px; flex-wrap: wrap; }
.blk { font-size: 11.5px; padding: 7px 13px; border-radius: 9px; font-weight: 500; }
.blk.b1 { background: color-mix(in srgb, var(--c2) 15%, transparent); color: var(--c2); border: 1px solid color-mix(in srgb, var(--c2) 40%, transparent); }
.blk.b2 { background: color-mix(in srgb, var(--c1) 13%, transparent); color: var(--c1); border: 1px solid color-mix(in srgb, var(--c1) 36%, transparent); }
.blk.b3 { background: color-mix(in srgb, var(--amber) 13%, transparent); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); }

/* ============ PROJECT CAROUSEL ============ */
.carousel { position: relative; }
.carousel-viewport {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  cursor: grab; touch-action: pan-y;
  padding: 14px 4px 22px;
  mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}
.carousel-viewport::-webkit-scrollbar { display: none; }
.carousel-track { display: flex; gap: 24px; width: max-content; }
.carousel-track .card { flex: 0 0 clamp(280px, 78vw, 340px); }
@media (min-width: 700px) { .carousel-track .card { flex-basis: 340px; } }
/* prev/next controls */
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 26px; line-height: 1; padding-bottom: 3px;
  color: var(--text); background: var(--surface); border: 1px solid var(--hair);
  backdrop-filter: blur(8px);
  transition: border-color .25s, background .25s, transform .25s, opacity .25s;
}
.carousel-btn:hover { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 14%, transparent); transform: translateY(-50%) scale(1.08); }
.carousel-btn.prev { left: -6px; }
.carousel-btn.next { right: -6px; }
@media (max-width: 640px) { .carousel-btn { display: none; } }

.card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 28px; position: relative; overflow: hidden;
  transition: border-color .35s, box-shadow .35s, background .35s;
  will-change: transform;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--c2) 12%, transparent), transparent 55%);
  opacity: 0; transition: opacity .35s;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--hair-strong); box-shadow: 0 20px 50px var(--shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; }
.ic-mule { background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); border: 1px solid color-mix(in srgb, var(--c1) 30%, transparent); }
.ic-java { background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); }
.ic-game { background: color-mix(in srgb, var(--c2) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c2) 30%, transparent); }
.ic-docs { background: color-mix(in srgb, var(--c3) 12%, transparent); color: var(--c3); border: 1px solid color-mix(in srgb, var(--c3) 30%, transparent); }
.card-domain { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.card:hover .card-icon { animation: iconPop .55s cubic-bezier(.3,1.8,.5,1); }
@keyframes iconPop { 0% { transform: scale(1) rotate(0); } 45% { transform: scale(1.22) rotate(-7deg); } 100% { transform: scale(1) rotate(0); } }
.card h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 10px; letter-spacing: -.3px; }
.card p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.card p em { color: var(--text); }

/* ============ SKILLS ============ */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.skill-col {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 28px;
  transition: border-color .35s, transform .35s;
}
.skill-col:hover { border-color: var(--hair-strong); transform: translateY(-4px); }
.skill-col h4 { font-family: var(--font-display); font-size: 17px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.skill-glyph { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; }
.g1 { background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); }
.g2 { background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber); }
.g3 { background: color-mix(in srgb, var(--c3) 12%, transparent); color: var(--c3); }
.g4 { background: color-mix(in srgb, var(--c2) 12%, transparent); color: var(--c2); }
.skill-col ul { list-style: none; }
.skill-col li { color: var(--muted); font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--hair-soft); }
.skill-col li:last-child { border-bottom: none; }

/* certifications strip */
.certs { margin-top: 30px; }
.certs-head { font-family: var(--font-display); font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: .3px; margin-bottom: 16px; text-align: center; }
.certs-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cert {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--hair);
  padding: 8px 15px; border-radius: 99px;
  transition: border-color .25s, transform .25s, background .25s;
}
.cert:hover { transform: translateY(-2px); border-color: var(--hair-strong); }
.cert-ai {
  color: var(--c1); font-weight: 500;
  background: color-mix(in srgb, var(--c1) 12%, transparent);
  border-color: color-mix(in srgb, var(--c1) 42%, transparent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--c1) 40%, transparent);
  animation: certPulse 2.8s infinite;
}
.cert-ai:hover { border-color: var(--c1); }
@keyframes certPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c1) 32%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c1) 0%, transparent); }
}

/* ============ CONTACT ============ */
.contact { padding-bottom: 96px; }
.contact-box {
  text-align: center; padding: clamp(48px, 6vw, 88px) clamp(24px, 5vw, 80px);
  border-radius: 30px; position: relative; overflow: hidden;
  background:
    radial-gradient(700px 300px at 50% -60px, color-mix(in srgb, var(--c2) 16%, transparent), transparent),
    var(--surface);
  border: 1px solid var(--hair);
}
.contact-box h2 { font-family: var(--font-display); font-size: clamp(30px, 4.5vw, 52px); letter-spacing: -1px; margin: 12px 0 16px; }
.contact-box p { color: var(--muted); max-width: 540px; margin: 0 auto 36px; }
.contact-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.footer { text-align: center; padding: 36px 6vw 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--hair-soft); }
.footer-links { display: flex; gap: 22px; justify-content: center; margin-top: 12px; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color .25s; }
.footer-links a:hover { color: var(--c1); }

/* static mode: freeze animations (screenshot tooling) + reduced motion */
.static-mode *, .static-mode *::before, .static-mode *::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
