/* ═══════════════════════════════════════════════════════════════
   NITIN KUMAR — Core ML Portfolio Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0b0f19;
  --bg-elevated: #111827;
  --bg-card: #151c2c;
  --bg-terminal: #0d1117;
  --border-subtle: rgba(0, 229, 255, 0.12);
  --border-glow: rgba(16, 185, 129, 0.35);
  --accent-cyan: #00e5ff;
  --accent-emerald: #10b981;
  --accent-mixed: #06d6a0;
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-glow: 0 0 40px rgba(0, 229, 255, 0.08);
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vh;
  background: radial-gradient(ellipse, rgba(16, 185, 129, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-emerald);
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

section {
  padding: 5rem 0;
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-emerald);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.nav-links a:hover {
  color: var(--accent-cyan);
}

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 4rem;
}

.hero-content {
  animation: hero-in 0.8s ease-out;
}

.terminal-widget {
  animation: hero-in 0.8s ease-out 0.15s both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-title .slash {
  color: var(--accent-cyan);
  font-weight: 400;
}

.hero-title .role {
  display: block;
  font-size: 0.55em;
  font-weight: 600;
  color: var(--accent-emerald);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent-cyan);
  min-height: 1.5em;
  margin-bottom: 2rem;
}

.hero-subtitle .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-emerald);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  background: transparent;
  color: var(--text-primary);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(16, 185, 129, 0.15));
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.1);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.25);
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.btn-matrix {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-matrix::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn-matrix:hover::before {
  transform: translateX(100%);
}

.btn-matrix:hover {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.2);
}

/* Achievement orbits */
.achievement-tags {
  position: relative;
  margin-top: 2.5rem;
  min-height: 120px;
}

.achievement-orbit {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(21, 28, 44, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  box-shadow: var(--shadow-glow);
  animation: float 6s ease-in-out infinite;
}

.achievement-orbit:nth-child(1) {
  top: 0;
  left: 0;
  animation-delay: 0s;
}

.achievement-orbit:nth-child(2) {
  top: 3.5rem;
  left: 2rem;
  animation-delay: -2s;
  border-color: rgba(16, 185, 129, 0.25);
}

.achievement-orbit .badge-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--accent-cyan);
  flex-shrink: 0;
  animation: spin-slow 12s linear infinite;
}

.achievement-orbit:nth-child(2) .badge-ring {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

/* Terminal widget */
.terminal-widget {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-glow), 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.terminal-widget:hover {
  border-color: rgba(0, 229, 255, 0.25);
  box-shadow: 0 0 50px rgba(0, 229, 255, 0.12);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.terminal-body {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  min-height: 280px;
}

.terminal-line {
  margin-bottom: 0.35rem;
  opacity: 0;
  animation: fade-in-line 0.4s forwards;
}

.terminal-line .prompt {
  color: var(--accent-emerald);
}

.terminal-line .cmd {
  color: var(--text-primary);
}

.terminal-line .metric {
  color: var(--accent-cyan);
}

.terminal-line .success {
  color: var(--accent-emerald);
}

.terminal-line .warn {
  color: #fbbf24;
}

@keyframes fade-in-line {
  to { opacity: 1; }
}

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.metric-card {
  text-align: center;
  padding: 0.5rem;
  background: rgba(0, 229, 255, 0.05);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.metric-card .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-variant-numeric: tabular-nums;
}

.metric-card .label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card .value.pulse {
  animation: metric-pulse 2s ease-in-out infinite;
}

@keyframes metric-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; text-shadow: 0 0 12px var(--accent-cyan); }
}

/* ─── Skill Matrix ─── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.03), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.skill-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.skill-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.skill-card h3 {
  font-size: 1rem;
  font-weight: 600;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: default;
  transition: all 0.25s ease;
  position: relative;
}

.skill-tag:hover,
.skill-tag.active {
  color: var(--accent-cyan);
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}

.skill-dependency {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border-left: 3px solid var(--accent-emerald);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  min-height: 2.5rem;
  transition: all var(--transition);
}

.skill-dependency strong {
  color: var(--accent-emerald);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.skill-dependency .dep-text {
  color: var(--accent-cyan);
}

/* ─── Projects ─── */
.projects-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.project-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-tab {
  padding: 1rem 1.25rem;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  color: var(--text-muted);
}

.project-tab:hover {
  border-color: rgba(0, 229, 255, 0.2);
  color: var(--text-primary);
}

.project-tab.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.06);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.08);
}

.project-tab .tab-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
}

.project-tab .tab-sub {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.project-panel {
  display: none;
  animation: panel-in 0.4s ease;
}

.project-panel.active {
  display: block;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.project-subtext {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-emerald);
  margin-bottom: 1.25rem;
}

.project-bullets {
  list-style: none;
  margin-bottom: 1.5rem;
}

.project-bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.project-bullets li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-weight: bold;
}

.btn-console {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(0, 229, 255, 0.1));
  border-color: rgba(16, 185, 129, 0.4);
  margin-bottom: 1rem;
}

.btn-console:hover {
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.25);
}

/* Interactive console demo area */
.console-demo {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  min-height: 220px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  overflow: hidden;
  position: relative;
}

.console-demo.hidden {
  display: none;
}

.console-demo.visible {
  display: block;
  animation: panel-in 0.35s ease;
}

/* Node graph (CrisisComms) */
.node-graph {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  min-height: 140px;
}

.graph-node {
  padding: 0.6rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-align: center;
  min-width: 100px;
  transition: all 0.4s ease;
  opacity: 0.4;
}

.graph-node.active {
  opacity: 1;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.graph-node.done {
  opacity: 1;
  border-color: var(--accent-cyan);
}

.graph-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
  transition: color 0.3s;
}

.graph-arrow.active {
  color: var(--accent-cyan);
}

.graph-packet {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-cyan);
  opacity: 0;
  pointer-events: none;
}

/* MediGuide pipeline */
.pipeline-log {
  max-height: 180px;
  overflow-y: auto;
}

.pipeline-log .log-line {
  margin-bottom: 0.3rem;
  opacity: 0;
  animation: fade-in-line 0.3s forwards;
}

.upload-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin: 0.75rem 0;
  overflow: hidden;
}

.upload-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  transition: width 0.5s ease;
}

.backoff-timer {
  color: #fbbf24;
  font-weight: 600;
}

/* NeuroPulse 2D plane */
.similarity-viz {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.coord-plane {
  width: 200px;
  height: 200px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
}

.coord-plane svg {
  width: 100%;
  height: 100%;
}

.similarity-stats {
  flex: 1;
  min-width: 180px;
}

.sim-score {
  font-size: 1.5rem;
  color: var(--accent-cyan);
  font-weight: 700;
  margin: 0.5rem 0;
}

.tier-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  border-radius: 6px;
  color: var(--accent-emerald);
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* ─── Milestones ─── */
.milestones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.milestone-column h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.milestone-item {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}

.milestone-item:hover {
  border-color: rgba(16, 185, 129, 0.25);
}

.milestone-item h4 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.milestone-item .meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-emerald);
  margin-bottom: 0.5rem;
}

.milestone-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ─── Footer ─── */
.footer {
  padding: 3rem 0 5rem;
  border-top: 1px solid var(--border-subtle);
}

.contact-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid transparent;
  transition: all var(--transition);
}

.contact-link:hover {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.contact-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.8;
}

.watermark {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  padding-top: 1rem;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid .terminal-widget {
    order: -1;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .projects-wrapper {
    grid-template-columns: 1fr;
  }

  .project-tabs {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .project-tab {
    min-width: 200px;
    flex-shrink: 0;
  }

  .milestones-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }

  .achievement-orbit:nth-child(2) {
    left: 0;
    top: 4.5rem;
  }
}

@media (max-width: 600px) {
  section {
    padding: 3.5rem 0;
  }

  .metrics-bar {
    grid-template-columns: 1fr;
  }

  .node-graph {
    flex-direction: column;
  }

  .graph-arrow {
    transform: rotate(90deg);
  }
}
