:root {
  --bg: #f5f6fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --border: rgba(15, 23, 42, 0.09);
  --text: #0f172a;
  --muted: #5a6478;
  --primary: #6d4aff;
  --primary-2: #0ea5b7;
  --accent: #e5387f;
  --lime: #16a34a;
  --grad: linear-gradient(120deg, #6d4aff 0%, #0ea5b7 58%, #e5387f 100%);
  --grad-soft: linear-gradient(120deg, rgba(109, 74, 255, 0.12), rgba(14, 165, 183, 0.12));
  --radius: 18px;
  --shadow: 0 24px 60px -28px rgba(35, 42, 90, 0.35);
  --shadow-sm: 0 10px 30px -18px rgba(35, 42, 90, 0.35);
  --maxw: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(109, 74, 255, 0.1);
  color: #5b3fd6;
  padding: 0.1em 0.45em;
  border-radius: 6px;
}
strong { font-weight: 700; }
em { font-style: italic; }

.grad-text {
  background: var(--grad);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  animation: gradShift 8s ease infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- Background: canvas + orbs ---------- */
#particles {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  opacity: 0.7;
}
.bg-orbs { position: fixed; inset: 0; z-index: -3; overflow: hidden; }
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.4;
  animation: float 18s var(--ease) infinite alternate;
}
.orb-1 { width: 480px; height: 480px; background: #c7b8ff; top: -120px; left: -100px; }
.orb-2 { width: 420px; height: 420px; background: #a5ecf3; top: 32%; right: -140px; animation-delay: -6s; }
.orb-3 { width: 380px; height: 380px; background: #ffc2dc; bottom: -140px; left: 32%; animation-delay: -12s; }
@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, -50px, 0) scale(1.18); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 5vw, 4rem);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s, border-color 0.4s, box-shadow 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(245, 246, 251, 0.82);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.nav__logo { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.01em; font-family: var(--mono); }
.nav__logo span {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav__links { display: flex; gap: 1.7rem; }
.nav__links a {
  position: relative; font-size: 0.94rem; color: var(--muted); font-weight: 500; transition: color 0.25s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--grad); transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s var(--ease); }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 7.5rem clamp(1.2rem, 5vw, 4rem) 5rem;
}
.hero__grid {
  display: grid; grid-template-columns: 1.25fr 0.9fr;
  gap: 3rem; align-items: center; width: 100%;
}
.hero__eyebrow {
  font-family: var(--mono); color: var(--primary-2);
  font-size: 0.92rem; letter-spacing: 0.02em; margin-bottom: 1.1rem;
}
.hero__title {
  font-size: clamp(3.4rem, 11vw, 7.5rem);
  font-weight: 900; line-height: 0.95; letter-spacing: -0.04em; margin-bottom: 1.1rem;
}
.hero__title em {
  font-style: normal;
  background: var(--grad); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 6s ease infinite;
}
.hero__typed {
  font-family: var(--mono); font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--primary); margin-bottom: 1.4rem; min-height: 1.6em;
}
.hero__typed-prefix { color: var(--primary-2); margin-right: 0.4rem; }
.caret {
  display: inline-block; width: 9px; height: 1.05em; margin-left: 3px;
  background: var(--primary); vertical-align: -0.15em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero__subtitle {
  font-size: clamp(1rem, 2.1vw, 1.24rem); color: var(--muted);
  max-width: 620px; margin-bottom: 2.2rem;
}
.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2.4rem; }
.hero__socials { display: flex; gap: 1.1rem; }
.hero__socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  color: var(--muted); border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: 0.3s var(--ease);
}
.hero__socials a:hover {
  color: #fff; border-color: transparent; transform: translateY(-4px);
  box-shadow: 0 16px 34px -14px rgba(109, 74, 255, 0.8); background: var(--grad);
}

.hero__terminal { animation: floatY 6s ease-in-out infinite; }
@keyframes floatY { 50% { transform: translateY(-14px); } }

/* ---------- Terminal ---------- */
.terminal {
  border-radius: 16px; overflow: hidden;
  background: #0e1424;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.75);
  font-family: var(--mono); font-size: 0.86rem;
}
.terminal__bar {
  display: flex; align-items: center; gap: 7px;
  padding: 0.7rem 0.95rem; background: #161d31;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.terminal__bar span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #ff5f57; display: inline-block;
}
.terminal__bar span:nth-child(2) { background: #febc2e; }
.terminal__bar span:nth-child(3) { background: #28c840; }
.terminal__bar em { margin-left: auto; color: #6b7690; font-style: normal; font-size: 0.72rem; }
.terminal__body { padding: 1.2rem 1.2rem 1.4rem; color: #c9d3ea; }
.terminal__body p { margin-bottom: 0.35rem; white-space: nowrap; }
.terminal__body p:last-child { margin-bottom: 0; }
.t-prompt { color: #7ef0c0; }
.t-sep { color: #6b7690; }
.t-path { color: #6fb3ff; }
.t-out { color: #8b96b0; }
.t-warn { color: #ffb454; }
.t-blink { display: inline-block; width: 8px; height: 1em; background: #7ef0c0; vertical-align: -0.15em; animation: blink 1s steps(1) infinite; }

.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--border); border-radius: 14px;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  width: 4px; height: 8px; border-radius: 3px; background: var(--primary-2);
  animation: scroll 1.6s infinite;
}
@keyframes scroll {
  0% { opacity: 0; top: 8px; } 40% { opacity: 1; } 100% { opacity: 0; top: 22px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.7rem; border-radius: 999px;
  font-weight: 600; font-size: 0.97rem; cursor: pointer;
  transition: 0.3s var(--ease); border: 1px solid transparent;
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 16px 34px -14px rgba(109, 74, 255, 0.75); }
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -14px rgba(109, 74, 255, 0.9); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--primary-2); color: var(--primary-2); transform: translateY(-3px); }
.btn--lg { padding: 1rem 2.4rem; font-size: 1.05rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(4.5rem, 10vw, 8rem) clamp(1.2rem, 5vw, 4rem); position: relative; }
.container { max-width: var(--maxw); margin: 0 auto; }
.section__eyebrow {
  font-family: var(--mono); color: var(--primary-2);
  font-size: 0.85rem; letter-spacing: 0.12em; margin-bottom: 0.8rem;
}
.section__title {
  font-size: clamp(1.8rem, 4.2vw, 2.8rem);
  font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1.4rem; max-width: 22ch;
}
.section__lead { color: var(--muted); font-size: 1.08rem; max-width: 720px; margin-bottom: 2.6rem; }
.muted { color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.7fr 1fr; gap: 3rem; align-items: center; margin-top: 1rem; }
.about__text p { color: var(--muted); margin-bottom: 1.1rem; font-size: 1.05rem; }
.quote {
  position: relative; padding: 1.3rem 1.5rem 1.3rem 3rem;
  border-radius: 14px; background: var(--grad-soft);
  border: 1px solid var(--border); font-size: 1.1rem; font-weight: 600; color: var(--text);
  margin-bottom: 1.6rem;
}
.quote::before {
  content: "“"; position: absolute; left: 0.9rem; top: 0.2rem;
  font-size: 3.4rem; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.about__stats { display: grid; gap: 1rem; }
.about__stats li {
  display: flex; flex-direction: column; padding: 1.3rem 1.6rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: 0.35s var(--ease);
}
.about__stats li:hover { transform: translateX(6px); border-color: var(--primary); }
.about__stats strong {
  font-size: 1.6rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.about__stats span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; margin: 0 0 3rem; padding: 1rem 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: inline-flex; gap: 1.4rem; white-space: nowrap;
  font-family: var(--mono); font-size: 1rem; color: var(--muted);
  animation: marquee 34s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span:nth-child(odd) { color: var(--primary); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Research questions ---------- */
.research__sub { font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 700; margin: 0 0 1.6rem; max-width: 30ch; }
.questions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.question {
  position: relative; padding: 1.8rem 1.6rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: 0.4s var(--ease);
}
.question::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: var(--grad); transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.question:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: rgba(109,74,255,0.35); }
.question:hover::after { transform: scaleX(1); }
.question__num {
  font-family: var(--mono); font-weight: 700; font-size: 0.8rem;
  color: transparent; background: var(--grad); -webkit-background-clip: text; background-clip: text;
}
.question h4 { font-size: 1.15rem; margin: 0.5rem 0 0.5rem; }
.question p { color: var(--muted); font-size: 0.93rem; }

/* ---------- Stack ---------- */
.section--stack { background: linear-gradient(180deg, transparent, rgba(109,74,255,0.045), transparent); }
.stack { display: grid; gap: 0.55rem; margin-bottom: 2rem; }
.stack__layer {
  display: grid; grid-template-columns: 220px 1fr 110px; align-items: center; gap: 1rem;
  padding: 0.75rem 1rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateX(-26px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), border-color 0.3s, background 0.3s;
  transition-delay: calc(var(--i) * 90ms);
}
.stack.is-visible .stack__layer { opacity: 1; transform: none; }
.stack__layer:hover { border-color: rgba(109,74,255,0.45); background: linear-gradient(90deg, rgba(109,74,255,0.06), transparent); }
.stack__name { font-family: var(--mono); font-weight: 600; font-size: 0.92rem; }
.stack__bar {
  height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative;
}
.stack__bar::before {
  content: ""; position: absolute; inset: 0; width: 0;
  background: var(--grad); border-radius: inherit;
  transition: width 1s var(--ease);
  transition-delay: calc(var(--i) * 90ms + 200ms);
}
.stack.is-visible .stack__bar::before { width: calc(100% - var(--i) * 10%); }
.stack__cn { color: var(--muted); font-size: 0.82rem; text-align: right; }
.stack__note { color: var(--muted); max-width: 680px; }

/* ---------- Engineering ---------- */
.engineering { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
.ask { margin: 1.2rem 0 1.6rem; display: grid; gap: 0.6rem; }
.ask li {
  position: relative; padding: 0.6rem 0.9rem 0.6rem 2.4rem;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.9rem;
  transition: 0.3s var(--ease);
}
.ask li::before {
  content: "?"; position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--accent);
}
.ask li:hover { transform: translateX(6px); border-color: rgba(229,56,127,0.4); }
.terminal--big .terminal__body p { white-space: normal; }

/* ---------- AI ---------- */
.section--ai { background: linear-gradient(180deg, transparent, rgba(14,165,183,0.05), transparent); }
.ai-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2.4rem; align-items: start; }
.ai-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ai-tags li {
  font-family: var(--mono); font-size: 0.85rem; padding: 0.5rem 0.95rem; border-radius: 999px;
  background: var(--surface); border: 1px solid rgba(109,74,255,0.25); color: #5b3fd6;
  box-shadow: var(--shadow-sm);
  transition: 0.3s var(--ease);
}
.ai-tags li:hover { transform: translateY(-4px) scale(1.04); background: var(--grad); color: #fff; border-color: transparent; }
.ai-qa { display: grid; gap: 0.9rem; }
.ai-qa__q {
  padding: 1rem 1.2rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--primary-2);
  font-weight: 600; font-size: 1rem; box-shadow: var(--shadow-sm);
  transition: 0.3s var(--ease);
}
.ai-qa__q:hover { transform: translateX(6px); }

/* ---------- Life ---------- */
.life-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.life {
  padding: 1.9rem 1.7rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: 0.45s var(--ease); position: relative; overflow: hidden;
}
.life::before {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-soft); opacity: 0; transition: opacity 0.4s;
}
.life:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: rgba(109,74,255,0.35); }
.life:hover::before { opacity: 1; }
.life > * { position: relative; }
.life__emoji { font-size: 2.1rem; margin-bottom: 0.8rem; transition: transform 0.4s var(--ease); display: inline-block; }
.life:hover .life__emoji { transform: scale(1.2) rotate(-8deg); }
.life h3 { font-size: 1.14rem; margin-bottom: 0.5rem; }
.life p { color: var(--muted); font-size: 0.93rem; }

/* ---------- Traits ---------- */
.section--traits { background: linear-gradient(180deg, transparent, rgba(229,56,127,0.04), transparent); }
.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; }
.trait {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1.5rem 1.6rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: 0.35s var(--ease);
}
.trait:hover { transform: translateY(-6px); border-color: rgba(109,74,255,0.4); box-shadow: var(--shadow); }
.trait strong {
  font-size: 1.06rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.trait span { color: var(--muted); font-size: 0.92rem; }

/* ---------- Vision ---------- */
.section--vision { text-align: left; }
.vision {
  padding: clamp(2rem, 5vw, 3.4rem); border-radius: 24px;
  background: linear-gradient(135deg, rgba(109,74,255,0.08), rgba(14,165,183,0.08));
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.vision .section__title { margin-bottom: 1.2rem; max-width: 30ch; }
.vision p { color: var(--muted); font-size: 1.05rem; margin-bottom: 1rem; max-width: 820px; }
.vision p:last-child { margin-bottom: 0; }
.vision em { color: var(--text); font-weight: 600; }

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact { display: flex; flex-direction: column; align-items: center; }
.contact .section__title { max-width: none; }
.contact__lead { color: var(--muted); font-size: 1.08rem; max-width: 640px; margin-bottom: 2rem; }
.contact__socials { margin-top: 2rem; display: flex; gap: 0.8rem; color: var(--muted); }
.contact__socials a { transition: color 0.25s; }
.contact__socials a:hover { color: var(--primary-2); }

/* ---------- Footer ---------- */
.footer {
  text-align: center; padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem;
}
.footer__sign { font-family: var(--mono); color: var(--primary); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.life.reveal, .trait.reveal, .question.reveal { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .hero__terminal { max-width: 520px; }
  .engineering { grid-template-columns: 1fr; gap: 2rem; }
  .ai-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .about__stats { grid-template-columns: repeat(3, 1fr); }
  .about__stats li { padding: 1rem 0.9rem; text-align: center; align-items: center; }
  .about__stats strong { font-size: 1.25rem; }
  .stack__layer { grid-template-columns: 1fr; gap: 0.4rem; padding: 0.9rem 1rem; }
  .stack__bar { width: 100%; }
  .stack__cn { text-align: left; }
}
@media (max-width: 680px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: min(76vw, 310px);
    flex-direction: column; gap: 1.6rem; padding: 6rem 2rem;
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(20px);
    border-left: 1px solid var(--border); box-shadow: var(--shadow);
    transform: translateX(100%); transition: transform 0.4s var(--ease); font-size: 1.1rem;
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { color: var(--text); }
  .about__stats { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1; }
  .terminal__body p { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .stack__layer { opacity: 1; transform: none; }
  .stack__bar::before { width: calc(100% - var(--i) * 10%); }
  #particles { display: none; }
}
