:root {
  --bg: #06070d;
  --bg-2: #0b0d17;
  --ink: #eef1f8;
  --mist: #eef1f8;
  --mist-dim: #8b94a9;
  --aurora: #a78bfa;
  --aurora-violet: #a78bfa;
  --aurora-cyan: #67e8f9;
  --line: rgba(255, 255, 255, 0.12);
  --display: "Fraunces", serif;
  --body: "Inter", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--aurora-violet); color: #0a0a14; }

a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); }

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(230, 230, 230, 0.035) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(230, 230, 230, 0.035) 0 1px, transparent 1px 48px);
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 40;
  padding: 16px;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px;
  background: rgba(6, 7, 13, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 32px;
}

.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.wordmark .dot { color: var(--aurora-violet); }

.nav-links {
  display: flex;
  gap: 28px;
  margin-right: auto;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--mist-dim);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--mist); }

.btn-nav {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  background: var(--aurora-violet);
  color: #0a0a14;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-nav:hover { background: #c4b5fd; transform: translateY(-1px); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 160px 32px 80px;
  position: relative;
  overflow: hidden;
}

#hero-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: orb-drift 16s ease-in-out infinite;
}
.orb-1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.35), transparent 70%);
}
.orb-2 {
  width: 360px;
  height: 360px;
  bottom: -100px;
  left: -60px;
  background: radial-gradient(circle, rgba(103, 232, 249, 0.28), transparent 70%);
  animation-delay: -8s;
}
@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 24px) scale(0.95); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--mist-dim);
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 7px 14px;
  margin-bottom: 24px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
  margin-bottom: 22px;
}
.hero h1 em { color: var(--aurora-violet); font-style: normal; }

.hero-role {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.15;
  color: var(--mist);
  margin-bottom: 16px;
}
.hero-role em { color: var(--aurora-cyan); font-style: normal; }

.hero-sub {
  color: var(--mist-dim);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  max-width: 560px;
  margin-bottom: 30px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--mist-dim);
}

.btn {
  display: inline-block;
  padding: 14px 26px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--aurora-violet);
  color: #0a0a14;
}
.btn-primary:hover { background: #c4b5fd; }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--aurora-violet); color: var(--aurora-violet); }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 1100px;
  margin: 0 auto;
}
.stat {
  padding: 26px 10px;
  text-align: center;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat:first-child { border-left: 0; }
.stat b {
  font-family: var(--mono);
  font-size: 1.35rem;
  color: var(--aurora-violet);
  font-weight: 700;
}
.stat span { font-size: 0.8rem; color: var(--mist-dim); }

/* ---------- scroll narrative (sticky + flying panels) ---------- */
.narrative {
  position: relative;
  height: 500vh;
}

.scroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.scroll-stage {
  position: relative;
  width: 100%;
  max-width: 1100px;
  padding: 0 32px;
}

.scroll-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
  opacity: 0;
  will-change: transform, opacity;
  pointer-events: none;
}
.scroll-panel[data-side="right"] {
  margin-left: auto;
  text-align: right;
}

.scroll-panel .scroll-label,
.scroll-panel h2 {
  position: relative;
  z-index: 1;
}

.scroll-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--aurora-violet);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.scroll-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.6));
}
.scroll-icon svg { width: 100%; height: 100%; display: block; }

.scroll-panel[data-side="right"] .scroll-label {
  flex-direction: row-reverse;
}

.scroll-panel h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4.4vw, 3.3rem);
  line-height: 1.1;
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--mist-dim);
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--line);
  overflow: hidden;
}
.scroll-line span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--aurora-violet);
  transform: translateY(-100%);
  animation: scroll-line 1.8s ease-in-out infinite;
}
@keyframes scroll-line {
  0% { transform: translateY(-100%); }
  50% { transform: translateY(0); }
  100% { transform: translateY(100%); }
}

.scroll-progress {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.scroll-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--aurora-violet), var(--aurora-cyan));
  transform: scaleX(0);
  transform-origin: left;
  border-radius: 2px;
}

/* ---------- sections ---------- */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 120px 32px;
  scroll-margin-top: 90px;
}

.section-head { margin-bottom: 48px; }

.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--aurora-violet);
  margin-bottom: 14px;
  font-family: var(--mono);
}

.section h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  line-height: 1.08;
  margin-bottom: 14px;
}
.section h2 em { color: var(--aurora-violet); font-style: normal; }

.lede { color: var(--mist-dim); max-width: 600px; }

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  opacity: 0;
  transform: translateY(50px);
}
.card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.2s ease, background 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.04);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.07);
  color: var(--aurora-violet);
  border-radius: 8px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.card-icon svg { width: 20px; height: 20px; }
.card:hover .card-icon {
  color: var(--aurora-cyan);
  border-color: rgba(103, 232, 249, 0.45);
  background: rgba(103, 232, 249, 0.06);
}

.card-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--mist-dim);
  border: 1px solid var(--line);
  padding: 3px 10px;
}

.status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.status.active { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.status.wip { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }

.card h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.card-tech {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--aurora-violet);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.card-desc { color: var(--mist-dim); font-size: 0.94rem; margin-bottom: 22px; }

.card-link {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--ink);
}
.card:hover .card-link { color: var(--aurora-violet); }

/* ---------- pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pillar {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 28px;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.2s ease;
}
.pillar.visible { opacity: 1; transform: translateY(0); }
.pillar:hover { border-color: rgba(167, 139, 250, 0.4); }

.pillar-num {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--mist-dim);
  margin-bottom: 18px;
}

.pillar h4 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3rem;
  margin-bottom: 12px;
  line-height: 1.2;
}

.pillar p:not(.pillar-num) {
  color: var(--mist-dim);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ---------- about ---------- */
.about-section h2 { max-width: 720px; margin-bottom: 60px; }

.about-story {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
}

.about-left h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
}

.about-right { display: flex; flex-direction: column; gap: 20px; }
.about-right p { color: var(--mist-dim); font-size: 1.02rem; line-height: 1.7; }
.about-right .about-highlight { color: var(--ink); }

/* ---------- beliefs ---------- */
.beliefs-section { padding-top: 0; }

.beliefs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.belief { border-top: 2px solid var(--line); padding-top: 22px; }

.belief h4 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  margin-bottom: 12px;
  line-height: 1.25;
}

.belief p { color: var(--mist-dim); line-height: 1.65; }

/* ---------- quotes ---------- */
.quotes-section { padding-top: 0; }

.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.quote {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  padding: 28px;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.quote.visible { opacity: 1; transform: translateY(0); }

.quote blockquote {
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.quote figcaption {
  color: var(--mist-dim);
  font-size: 0.85rem;
}

/* ---------- contact ---------- */
.contact-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 56px;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.contact-box.visible { opacity: 1; transform: translateY(0); }

.contact-left h2 { margin-bottom: 12px; }
.contact-left p { color: var(--mist-dim); max-width: 420px; }

.contact-right { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 32px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-name {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.footer-tag { color: var(--mist-dim); font-size: 0.92rem; max-width: 260px; }

.footer-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist-dim);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--mist-dim); font-size: 0.92rem; }
.footer-col a:hover { color: var(--ink); }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--mist-dim);
  font-size: 0.8rem;
}
.footer-bottom .mono { font-size: 0.72rem; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero { padding-top: 130px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .beliefs { grid-template-columns: 1fr; }
  .quotes { grid-template-columns: 1fr; }
  .about-story { grid-template-columns: 1fr; }
  .contact-box { grid-template-columns: 1fr; padding: 32px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@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; }
}

/* ---------- skip link ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--aurora-violet);
  color: #0a0a14;
  padding: 8px 14px;
  z-index: 60;
  font-size: 0.8rem;
}
.skip:focus { left: 0; }

/* ---------- grain overlay (static, zero-repaint) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- boot screen ---------- */
#boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#boot.done {
  opacity: 0;
  visibility: hidden;
}
.boot-box {
  max-width: 560px;
  width: 90%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 28px;
}
.boot-title {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--aurora-violet);
  margin-bottom: 18px;
}
.boot-log {
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--mist-dim);
  min-height: 170px;
  white-space: pre-wrap;
  word-break: break-word;
}
.boot-skip {
  margin-top: 16px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(139, 148, 169, 0.55);
  text-align: right;
}

/* ---------- terminal ---------- */
.terminal-section { scroll-margin-top: 90px; }
section[id] { scroll-margin-top: 90px; }
.terminal {
  border: 1px solid var(--line);
  background: #080a12;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.terminal.visible { opacity: 1; transform: translateY(0); }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ff5d5d; }
.dot-yellow { background: #ffd166; }
.dot-green { background: #3ecf8e; }
.terminal-title {
  margin-left: 10px;
  font-size: 0.72rem;
  color: var(--mist-dim);
}
.terminal-body {
  height: 300px;
  overflow-y: auto;
  padding: 18px 20px;
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--mist-dim);
}
.term-line.cmd { color: var(--aurora-violet); }
.term-line.err { color: #ff8a8a; }
.terminal-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.prompt {
  color: var(--aurora-violet);
  font-size: 0.82rem;
  white-space: nowrap;
}
#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
}
#terminal-input::placeholder { color: rgba(139, 148, 169, 0.5); }

/* ---------- magnetic ---------- */
.magnetic { transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.15s ease, border-color 0.15s ease; }
