/* ═══════════════════════════════════════════
   CSS VARIABLES & DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  --bg: #020817;
  --bg-secondary: #0a1628;
  --surface: rgba(10, 22, 42, 0.75);
  --surface-strong: #0d1f3c;
  --text: #e8f4fd;
  --muted: #7a9ec4;
  --primary: #00d4ff;
  --primary-dim: rgba(0, 212, 255, 0.15);
  --secondary: #a855f7;
  --secondary-dim: rgba(168, 85, 247, 0.15);
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.15);
  --border: rgba(0, 212, 255, 0.14);
  --border-strong: rgba(0, 212, 255, 0.35);
  --mono: "JetBrains Mono", monospace;
  --sans: "Inter", sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

/* ═══════════════════════════════════════════
   ANIMATED CANVAS BACKGROUND
═══════════════════════════════════════════ */
#data-network {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   FLOATING DATA STREAMS
═══════════════════════════════════════════ */
.data-stream {
  position: fixed;
  width: 1px;
  top: 0;
  bottom: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.stream-1 { left: 8%; }
.stream-2 { right: 11%; }

.data-stream::before {
  content: "";
  display: block;
  width: 100%;
  height: 180px;
  background: linear-gradient(to bottom, transparent, var(--primary), transparent);
  animation: stream-flow 5s ease-in-out infinite;
  opacity: 0.35;
}

.stream-2::before {
  background: linear-gradient(to bottom, transparent, var(--secondary), transparent);
  animation-delay: 2.4s;
  animation-duration: 7s;
}

@keyframes stream-flow {
  0%   { transform: translateY(-200px); }
  100% { transform: translateY(110vh); }
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: min(1200px, 94%);
  margin: 12px auto 0;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(2, 8, 23, 0.85);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  gap: 14px;
  animation: header-slide-in 0.6s ease both;
}

@keyframes header-slide-in {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.logo span { color: var(--primary); }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0; right: 100%;
  height: 1px;
  background: var(--primary);
  transition: right 0.25s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { right: 0; }

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  width: 44px;
  height: 40px;
  padding: 9px 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  border-radius: 99px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s, background 0.22s;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 212, 255, 0.18);
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #020817;
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 12px 30px rgba(0, 212, 255, 0.35);
}

.btn-outline {
  background: rgba(0, 212, 255, 0.04);
  border-color: var(--border-strong);
}

.btn-outline:hover { border-color: var(--primary); background: var(--primary-dim); }

.btn-secondary {
  background: var(--secondary-dim);
  border-color: rgba(168, 85, 247, 0.5);
}

.btn-secondary:hover {
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.3);
  border-color: var(--secondary);
}

/* ═══════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════ */
main {
  width: min(1200px, 94%);
  margin: 0 auto;
  padding-bottom: 96px;
}

/* ═══════════════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════════════ */
.mono-tag {
  font-family: var(--mono);
  color: var(--primary);
  font-size: 0.78rem;
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  background: var(--primary-dim);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 16px;
  padding: 5px 14px;
}

/* ═══════════════════════════════════════════
   SCROLL REVEAL ANIMATIONS
═══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { --delay: 140ms; }
.reveal-delay-2 { --delay: 280ms; }

/* ═══════════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════════ */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 36px;
  align-items: center;
  padding: 100px 0 56px;
}

.hero-intro h1 {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.1;
  font-weight: 800;
  margin: 0 0 18px;
}

.hero-text {
  color: var(--muted);
  line-height: 1.78;
  max-width: 560px;
  margin-bottom: 10px;
}

/* ─── Typewriter ─── */
.typewriter-wrap {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--muted);
  margin: 12px 0 28px;
  min-height: 1.4em;
}

.typewriter { color: var(--teal); }

.cursor {
  color: var(--primary);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.social-links {
  display: flex;
  gap: 18px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
}

.social-links a:hover { color: var(--primary); }

/* ─── Hero Panel ─── */
.hero-panel {
  background: linear-gradient(160deg, rgba(0,212,255,0.06) 0%, rgba(10,22,42,0.92) 60%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(0,212,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}

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

.panel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.dot-green { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.6); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  border: 1px solid rgba(0,212,255,0.15);
  background: rgba(0, 212, 255, 0.04);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  transition: border-color 0.25s, background 0.25s;
}

.stat-card:hover {
  border-color: var(--border-strong);
  background: var(--primary-dim);
}

.stat-number {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-plus {
  font-size: 1.1rem;
  color: var(--secondary);
}

.stat-label {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 5px;
  line-height: 1.3;
}

.panel-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-chip {
  font-family: var(--mono);
  font-size: 0.7rem;
  background: rgba(0,212,255,0.08);
  border: 1px solid var(--border);
  color: var(--primary);
  border-radius: 6px;
  padding: 3px 9px;
  transition: background 0.2s;
}

.tool-chip:hover { background: var(--primary-dim); }

/* ═══════════════════════════════════════════
   SECTION HEADING
═══════════════════════════════════════════ */
.section { margin-top: 80px; }

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

.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-top: 12px;
}

/* ═══════════════════════════════════════════
   SKILLS SECTION
═══════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.skill-group-title {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

.skill-bar-wrap { margin-bottom: 16px; }

.skill-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text);
  margin-bottom: 6px;
}

.skill-pct {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--primary);
}

.skill-track {
  height: 5px;
  background: rgba(0,212,255,0.1);
  border-radius: 99px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(0,212,255,0.5);
}

/* ═══════════════════════════════════════════
   PROJECT GRID
═══════════════════════════════════════════ */
.project-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 50px rgba(0, 212, 255, 0.1);
}

/* Coloured accent bar at top of featured cards */
.card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.accent-purple { background: linear-gradient(90deg, var(--secondary), #ec4899); }
.accent-teal   { background: linear-gradient(90deg, var(--teal), var(--primary)); }

.project-card:hover .card-accent { transform: scaleX(1); }

.project-card.featured {
  background: linear-gradient(150deg, rgba(0,212,255,0.07) 0%, rgba(10,22,42,0.95) 55%);
}

.card-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.card-tech {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.project-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.68;
  margin-bottom: 12px;
}

.project-card p strong { color: var(--primary); font-weight: 600; }

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.project-actions a {
  border: 1px solid rgba(0,212,255,0.3);
  border-radius: 8px;
  padding: 7px 13px;
  background: rgba(0,212,255,0.05);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.project-actions a:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   TABLEAU EMBED
═══════════════════════════════════════════ */
.tableau-embed-wrap {
  margin-top: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.tableau-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,212,255,0.04);
}

.tableau-dots {
  display: flex;
  gap: 7px;
}

.tableau-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.tableau-dots span:nth-child(1) { background: #ff5f57; }
.tableau-dots span:nth-child(2) { background: #febc2e; }
.tableau-dots span:nth-child(3) { background: #28c840; }

.tableau-embed {
  width: 100%;
  height: 80vh;
  min-height: 680px;
  max-height: 900px;
  border: 0;
  display: block;
}

/* ═══════════════════════════════════════════
   ABOUT SECTION
═══════════════════════════════════════════ */
.about-section {
  background: rgba(10, 22, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.about-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  margin-top: 8px;
}

.about-text {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 18px;
}

.about-list {
  padding-left: 22px;
  color: #a8c8ea;
  line-height: 2;
  font-size: 0.93rem;
}

.about-list li::marker { color: var(--primary); }

.about-actions { margin-top: 22px; }

/* ─── Code Block ─── */
.about-code-block {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--mono);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0,212,255,0.06);
  border-bottom: 1px solid var(--border);
}

.code-snippet {
  background: rgba(2,8,23,0.95);
  padding: 18px;
  font-size: 0.78rem;
  line-height: 1.9;
  overflow-x: auto;
}

code { font-family: inherit; }
.c-kw  { color: #c792ea; }
.c-cls { color: #82aaff; }
.c-str { color: #c3e88d; }
.c-fn  { color: #82aaff; }

/* ═══════════════════════════════════════════
   CONTACT SECTION
═══════════════════════════════════════════ */
.contact-layout {
  margin-top: 22px;
  display: grid;
  gap: 28px;
  grid-template-columns: 0.85fr 1.15fr;
}

.contact-note {
  color: var(--muted);
  line-height: 1.78;
  margin-bottom: 20px;
}

.contact-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  background: var(--primary-dim);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary);
}

.contact-form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  display: grid;
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: #a8d4f0;
  font-size: 0.88rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  font: inherit;
  color: var(--text);
  background: rgba(2, 8, 23, 0.8);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(122, 158, 196, 0.5); }

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.site-footer {
  width: min(1200px, 94%);
  margin: 0 auto 36px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--primary); }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .hero,
  .about-layout,
  .contact-layout { grid-template-columns: 1fr; }

  .menu-toggle { display: flex; }
  .site-header .btn { display: none; }

  .nav-links {
    position: absolute;
    left: 3%; right: 3%;
    top: calc(100% + 8px);
    border: 1px solid var(--border);
    background: rgba(2, 8, 23, 0.97);
    border-radius: 12px;
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 14px;
    margin-left: 0;
  }

  .nav-links.open { display: flex; }

  .tableau-embed { min-height: 460px; }
  .about-layout  { grid-template-columns: 1fr; }

  .data-stream { opacity: 0.15; }
}

@media (max-width: 560px) {
  .hero { padding: 72px 0 36px; }
  .project-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
