/* ═══════════════════════════════════════════
   NEURAL COMMAND CENTER — Premium AI Portfolio
   ═══════════════════════════════════════════ */
:root {
  --bg: #05070d;
  --panel: rgba(13, 18, 32, 0.55);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(34, 211, 238, 0.5);
  --fg: #e6edf3;
  --fg-soft: #9aa7b8;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #34d399;
  --grad: linear-gradient(90deg, #22d3ee, #a78bfa);
  --glow: 0 0 40px rgba(34, 211, 238, 0.12);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: rgba(34, 211, 238, 0.3);
}
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #05070d;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(#22d3ee, #a78bfa);
  border-radius: 9px;
}

/* ── Ambient layers ── */
.bg-grad {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 60% 45% at 15% 0%,
      rgba(34, 211, 238, 0.09),
      transparent 60%
    ),
    radial-gradient(
      ellipse 55% 45% at 90% 20%,
      rgba(167, 139, 250, 0.09),
      transparent 60%
    ),
    radial-gradient(
      ellipse 50% 40% at 50% 100%,
      rgba(34, 211, 238, 0.05),
      transparent 60%
    );
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    black 30%,
    transparent 75%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    black 30%,
    transparent 75%
  );
}
#neural {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 560px;
  height: 560px;
  z-index: 2;
  background: radial-gradient(
    circle,
    rgba(34, 211, 238, 0.07),
    transparent 60%
  );
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform;
}
@media (hover: none) {
  .cursor-glow {
    display: none;
  }
}

main {
  position: relative;
  z-index: 10;
}

/* ── Typography helpers ── */
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.muted {
  color: var(--fg-soft);
}
b {
  color: var(--cyan);
  font-weight: 600;
}

/* ── Reveal animation ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.d1 {
  transition-delay: 0.1s;
}
.d2 {
  transition-delay: 0.2s;
}
.d3 {
  transition-delay: 0.3s;
}
.d4 {
  transition-delay: 0.4s;
}
.d5 {
  transition-delay: 0.5s;
}

/* ── Pulse dot ── */
.pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

/* ══ SIDE RAIL (desktop) ══ */
.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 76px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
  border-right: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.5);
  backdrop-filter: blur(12px);
}
.rail-logo {
  font-family: "Space Grotesk";
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--fg);
  text-decoration: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  box-shadow: var(--glow);
}
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.rail-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.r-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: all 0.3s;
  margin-left: 34px;
  flex-shrink: 0;
}
.r-label {
  font-family: "JetBrains Mono";
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-soft);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.rail-nav a:hover .r-label,
.rail-nav a.active .r-label {
  opacity: 1;
  transform: none;
}
.rail-nav a:hover .r-dot {
  background: var(--cyan);
}
.rail-nav a.active .r-dot {
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  transform: scale(1.3);
  margin-left: 30px;
}
.rail-status {
  font-family: "JetBrains Mono";
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fg-soft);
  writing-mode: vertical-rl;
}
.rail-status .pulse {
  margin: 0 0 8px 0;
}

/* ══ MOBILE TOPBAR ══ */
.topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 14px 20px;
  justify-content: space-between;
  align-items: center;
  background: rgba(5, 7, 13, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.tb-logo {
  font-family: "Space Grotesk";
  font-weight: 700;
  font-size: 1.1rem;
}
.blink {
  color: var(--cyan);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.tb-nav {
  display: flex;
  gap: 18px;
}
.tb-nav a {
  font-family: "JetBrains Mono";
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
  text-decoration: none;
  text-transform: uppercase;
}
.tb-nav a:hover {
  color: var(--cyan);
}

/* ══ LAYOUT ══ */
.section,
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 110px 32px 0 108px;
}
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 60px;
  position: relative;
}

/* Section headers */
.sec-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 48px;
}
.sec-num {
  font-family: "JetBrains Mono";
  color: var(--cyan);
  font-size: 0.9rem;
}
.sec-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sec-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-hi), transparent);
}

/* ══ HERO ══ */
.hero-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-family: "JetBrains Mono";
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.06);
  margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(3rem, 8.5vw, 7rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-type {
  font-family: "JetBrains Mono";
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  margin-bottom: 22px;
  min-height: 1.6em;
}
.caret {
  display: inline-block;
  width: 10px;
  height: 1.15em;
  background: var(--cyan);
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: blink 1s steps(1) infinite;
}
.hero-sub {
  max-width: 640px;
  color: var(--fg-soft);
  font-size: 1.06rem;
  margin-bottom: 38px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk";
  font-weight: 600;
  font-size: 0.95rem;
  padding: 15px 32px;
  border-radius: 12px;
  text-decoration: none;
  transition:
    box-shadow 0.3s,
    background 0.3s,
    border-color 0.3s;
  will-change: transform;
}
.btn.primary {
  background: var(--grad);
  color: #041018;
  box-shadow: 0 8px 32px rgba(34, 211, 238, 0.35);
}
.btn.primary:hover {
  box-shadow: 0 8px 48px rgba(34, 211, 238, 0.55);
}
.btn.ghost {
  border: 1px solid var(--border-hi);
  color: var(--fg);
  background: rgba(34, 211, 238, 0.05);
}
.btn.ghost:hover {
  background: rgba(34, 211, 238, 0.12);
}
.btn.xl {
  font-size: 1.1rem;
  padding: 20px 44px;
}
.arr {
  transition: transform 0.3s;
}
.btn:hover .arr {
  transform: translate(3px, -3px);
}
.hero-cta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

/* Stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 860px;
}
.stat {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  transition: all 0.35s;
}
.stat:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}
.stat .num {
  font-family: "Space Grotesk";
  font-size: 2rem;
  font-weight: 700;
  color: var(--cyan);
}
.stat p {
  font-size: 0.78rem;
  color: var(--fg-soft);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "JetBrains Mono";
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--fg-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.s-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--cyan), transparent);
  animation: drop 1.8s var(--ease) infinite;
}
@keyframes drop {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  45% {
    transform: scaleY(1);
    transform-origin: top;
  }
  55% {
    transform: scaleY(1);
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}

/* ══ ABOUT ══ */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.about-text .big {
  font-family: "Space Grotesk";
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 20px;
}
.about-text p {
  color: var(--fg-soft);
  margin-bottom: 16px;
}
.about-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.about-tags span {
  font-family: "JetBrains Mono";
  font-size: 0.74rem;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.05);
}

/* Terminal card */
.term-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(8, 12, 22, 0.85);
  backdrop-filter: blur(12px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    var(--glow);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot.red {
  background: #ff5f57;
}
.dot.yellow {
  background: #febc2e;
}
.dot.green {
  background: #28c840;
}
.term-title {
  margin-left: auto;
  font-family: "JetBrains Mono";
  font-size: 0.68rem;
  color: var(--fg-soft);
}
.term-body {
  font-family: "JetBrains Mono";
  font-size: 0.82rem;
  line-height: 1.85;
  padding: 22px 24px;
  color: var(--fg);
  overflow-x: auto;
}
.term-body .k {
  color: var(--cyan);
}
.term-body .s {
  color: #a5d6a7;
}
.term-body .g {
  color: var(--green);
  font-weight: 600;
}

/* ══ SKILLS ══ */
.glow-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  transition:
    border-color 0.35s,
    box-shadow 0.35s,
    transform 0.35s;
}
.glow-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--glow);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.skill-card {
  padding: 28px;
}
.skill-card.wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 22px 28px;
}
.sk-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.sk-icon {
  font-size: 1.4rem;
}
.sk-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bar-row {
  display: flex;
  justify-content: space-between;
  font-family: "JetBrains Mono";
  font-size: 0.74rem;
  color: var(--fg-soft);
  margin-bottom: 7px;
}
.bar-row:not(:first-child) {
  margin-top: 16px;
}
.pct {
  color: var(--cyan);
}
.bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
  transition: width 1.4s var(--ease);
}
.also {
  font-family: "JetBrains Mono";
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--fg-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.chips span {
  font-family: "JetBrains Mono";
  font-size: 0.76rem;
  color: var(--fg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.25s;
  cursor: default;
}
.chips span:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}
.chips.sm span {
  font-size: 0.68rem;
  padding: 4px 11px;
}

/* ══ PROJECTS ══ */
.proj {
  padding: 34px;
}
.proj.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 24px;
  transform-style: preserve-3d;
}
.proj-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.live {
  display: inline-flex;
  align-items: center;
  font-family: "JetBrains Mono";
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 4px 12px;
  border-radius: 999px;
}
.proj-year {
  font-family: "JetBrains Mono";
  font-size: 0.72rem;
  color: var(--fg-soft);
}
.proj h3 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.proj p {
  color: var(--fg-soft);
  font-size: 0.96rem;
  margin-bottom: 20px;
}
.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-family: "Space Grotesk";
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
}
.proj-link:hover .arr {
  transform: translate(3px, -3px);
}
.proj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.metric {
  font-size: 0.9rem;
  color: var(--fg-soft);
  margin-bottom: 18px;
}
.metric .grad-text {
  font-family: "Space Grotesk";
  font-size: 1.5rem;
  font-weight: 700;
  margin-right: 8px;
}

/* Agent log */
.agent-log {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(5, 9, 18, 0.9);
}
.log-body {
  font-family: "JetBrains Mono";
  font-size: 0.76rem;
  line-height: 2.1;
  padding: 20px 22px;
  min-height: 220px;
}
.log-line {
  white-space: pre-wrap;
}
.log-line .p {
  color: var(--cyan);
}
.log-line .ok {
  color: var(--green);
}
.log-line .t {
  color: var(--fg-soft);
}

/* ══ TIMELINE ══ */
.timeline {
  position: relative;
  padding-left: 36px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--cyan), var(--violet), transparent);
}
.tl-entry {
  position: relative;
  margin-bottom: 34px;
}
.tl-dot {
  position: absolute;
  left: -34px;
  top: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--cyan);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.6);
}
.tl-card {
  padding: 30px 34px;
}
.tl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.tl-head h3 {
  font-size: 1.2rem;
  font-weight: 600;
}
.tl-date {
  font-family: "JetBrains Mono";
  font-size: 0.74rem;
  color: var(--cyan);
}
.tl-co {
  font-size: 0.85rem;
  color: var(--fg-soft);
  margin-bottom: 16px;
}
.tl-card ul {
  padding-left: 18px;
  color: var(--fg-soft);
  font-size: 0.94rem;
}
.tl-card li {
  margin-bottom: 7px;
}
.tl-card li::marker {
  color: var(--cyan);
}

/* ══ CONTACT ══ */
.contact-wrap {
  text-align: center;
  padding-bottom: 40px;
}
.contact-big {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 40px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
  text-align: left;
}
.c-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px 28px;
  text-decoration: none;
}
.c-card:hover {
  transform: translateY(-5px);
}
.c-label {
  font-family: "JetBrains Mono";
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}
.c-val {
  color: var(--fg);
  font-size: 1.05rem;
  font-weight: 500;
}

/* ══ FOOTER ══ */
.footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 44px 24px;
  border-top: 1px solid var(--border);
  margin-top: 100px;
}
.footer p {
  font-family: "JetBrains Mono";
  font-size: 0.72rem;
  color: var(--fg-soft);
  letter-spacing: 0.06em;
}

/* ══ RESPONSIVE ══ */
@media (max-width: 1024px) {
  .rail {
    display: none;
  }
  .topbar {
    display: flex;
  }
  .section,
  .hero {
    padding: 90px 24px 0;
  }
  .hero {
    padding-top: 90px;
  }
  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }
  .proj.featured {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }
  .skills-grid,
  .proj-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ══ REDUCED MOTION & PRINT ══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
@media print {
  .rail,
  .topbar,
  #neural,
  .cursor-glow,
  .bg-grad,
  .bg-grid,
  .scroll-hint {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .glow-card,
  .stat,
  .term-card {
    border-color: #000;
    background: #fff;
    box-shadow: none;
  }
}
