@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand color tokens */
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --cyan-400: #22d3ee;
  --cyan-500: #06b6d4;
  --cyan-600: #0891b2;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --rose-400: #fb7185;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  
  /* Slate shades */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Typography */
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', Courier, monospace;

  /* DEFAULT THEME (Dark Mode) */
  --bg-primary: #070a14;
  --bg-secondary: #0d1527;
  --bg-card: rgba(13, 21, 39, 0.7);
  --bg-card-hover: rgba(20, 30, 55, 0.85);
  --bg-terminal: #030712;
  --border-color: rgba(99, 102, 241, 0.18);
  --border-hover: rgba(99, 102, 241, 0.35);
  --border-glow: rgba(6, 182, 212, 0.25);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --nav-bg: rgba(7, 10, 20, 0.75);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.15);
  --glass-blur: 16px;
  --timeline-line: var(--slate-800);
}

/* LIGHT THEME OVERRIDES */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(241, 245, 249, 0.95);
  --bg-terminal: #090d16; /* Keep terminal dark for authentic programmer look */
  --border-color: rgba(99, 102, 241, 0.12);
  --border-hover: rgba(99, 102, 241, 0.25);
  --border-glow: rgba(99, 102, 241, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --nav-bg: rgba(248, 250, 252, 0.8);
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.08);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.08);
  --timeline-line: var(--slate-200);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.6;
  overflow-x: hidden;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--slate-700);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--indigo-500);
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

a {
  color: var(--indigo-400);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--cyan-400);
}

/* LAYOUT CONTAINER */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* GLOW EFFECTS */
.glow-text {
  text-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.glow-cyan-text {
  text-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* NAVIGATION BAR */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--nav-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-bottom 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.logo span {
  background: linear-gradient(135deg, var(--indigo-400) 0%, var(--cyan-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--cyan-500) 100%);
  color: white;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  align-items: center;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color 0.2s, transform 0.2s;
  padding: 0.5rem 0;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--indigo-500), var(--cyan-500));
  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--text-primary);
}

nav a:hover::after {
  width: 100%;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* THEME TOGGLE */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--indigo-500);
  color: var(--text-primary);
  background-color: rgba(99, 102, 241, 0.05);
}

.theme-toggle-btn .sun-icon {
  display: none;
}

[data-theme="light"] .theme-toggle-btn .moon-icon {
  display: none;
}

[data-theme="light"] .theme-toggle-btn .sun-icon {
  display: block;
}

/* MOBILE NAV BURGER */
.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 1.5rem;
  height: 1rem;
  cursor: pointer;
  background: none;
  border: none;
}

.burger-menu span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
}

/* HERO SECTION */
.hero {
  padding: 10rem 0 7rem;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
}

/* Canvas/Grid background animations */
.hero-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  z-index: -1;
  mask-image: radial-gradient(circle at 60% 40%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 60% 40%, black 20%, transparent 80%);
}

.hero-blob {
  position: absolute;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
  top: 15%;
  right: 10%;
  filter: blur(40px);
  z-index: -1;
  animation: float-slow 12s ease-in-out infinite;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--indigo-400) 80%, var(--cyan-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.hero-ctas {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3), var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45), 0 0 30px rgba(99, 102, 241, 0.25);
  background: linear-gradient(135deg, var(--indigo-500) 0%, var(--indigo-600) 100%);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(var(--glass-blur));
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--indigo-500);
  background-color: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--cyan-500) 0%, var(--cyan-600) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3), var(--shadow-glow-cyan);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45), 0 0 30px rgba(6, 182, 212, 0.25);
  background: linear-gradient(135deg, var(--cyan-400) 0%, var(--cyan-500) 100%);
}

/* HERO ECOSYSTEM HUD */
.hero-hud {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 1.5rem;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 10;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-hud:hover {
  border-color: var(--indigo-500);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.25);
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.hud-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.hud-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--emerald-400);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald-500);
  animation: pulse-green 2s infinite;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.hud-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.hud-val {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: right;
}

.hud-val.active {
  color: var(--cyan-400);
}

.hud-val.emerald {
  color: var(--emerald-400);
}

@media (max-width: 480px) {
  .hud-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .hud-val {
    text-align: left;
    padding-left: 1.6rem;
  }
}

/* SECTION STYLING */
.section {
  padding: 7rem 0;
  position: relative;
}

.section-alt {
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.badge-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 50px;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--indigo-400);
  border: 1px solid rgba(99, 102, 241, 0.2);
  margin-bottom: 1rem;
}

/* ECOSYSTEM SANDBOX SECTION */
.sandbox-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sandbox-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  flex-wrap: wrap;
  gap: 1rem;
}

.sandbox-selectors {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sandbox-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sandbox-btn.active {
  background-color: var(--indigo-600);
  border-color: var(--indigo-600);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.sandbox-btn:hover:not(.active) {
  border-color: var(--indigo-500);
  color: var(--text-primary);
  background-color: rgba(99, 102, 241, 0.05);
}

.sandbox-board {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
}

.sandbox-visualizer {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.visualizer-container {
  width: 100%;
}

.project-diagram {
  display: none;
  width: 100%;
}

.project-diagram.active {
  display: block;
}

/* DIAGRAM NODES */
.diagram-nodes {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.diagram-nodes.vertical {
  flex-direction: column;
  gap: 0.5rem;
}

.diag-node {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-color);
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 130px;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.diag-node.highlight {
  border-color: var(--indigo-500);
  background-color: rgba(99, 102, 241, 0.05);
  box-shadow: var(--shadow-glow);
}

.diag-node.active-pulse {
  animation: node-flash 0.6s ease;
}

@keyframes node-flash {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 0 25px 10px rgba(6, 182, 212, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.node-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background-color: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo-400);
  margin-bottom: 0.5rem;
}

.diag-node.highlight .node-icon {
  color: var(--cyan-400);
  background-color: rgba(6, 182, 212, 0.1);
}

.node-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.node-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* FLOW LINES */
.flow-line-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-line-container.h-line {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, var(--border-color), rgba(99, 102, 241, 0.4), var(--border-color));
}

.flow-line-container.v-line {
  height: 35px;
  width: 2px;
  background: linear-gradient(180deg, var(--border-color), rgba(99, 102, 241, 0.4), var(--border-color));
  margin: 0.5rem 0;
}

.flow-line {
  width: 100%;
  height: 100%;
  position: relative;
}

.flow-pulse {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--cyan-400);
  box-shadow: 0 0 10px var(--cyan-400);
  opacity: 0;
}

.h-line .flow-pulse {
  top: -1.5px;
}

.v-line .flow-pulse {
  left: -1.5px;
}

.h-line .flow-pulse.animate {
  animation: pulse-h 0.6s linear;
}

.v-line .flow-pulse.animate {
  animation: pulse-v 0.6s linear;
}

@keyframes pulse-h {
  0% { left: 0%; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes pulse-v {
  0% { top: 0%; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* SPINNING VINYL DISC */
.spin-icon svg {
  animation: spin-disc 3s linear infinite;
  animation-play-state: paused;
}

.spin-icon.spinning svg {
  animation-play-state: running;
}

@keyframes spin-disc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* SANDBOX CONSOLE (RIGHT PANEL) */
.sandbox-console {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.console-controls {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 1rem;
}

.console-control-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--indigo-400);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.console-buttons {
  display: none;
}

.console-buttons.active {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.console-action-btn {
  font-size: 0.85rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.5rem;
  box-shadow: none;
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 140px;
}

/* EVENT LOG PANEL */
.console-log-wrapper {
  border: 1px solid var(--border-color);
  background-color: var(--bg-terminal);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  flex-grow: 1;
}

.console-log-header {
  background-color: rgba(15, 23, 42, 0.85);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.console-log-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate-400);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.console-log-body {
  padding: 1.25rem;
  height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: transparent;
}

.log-entry {
  word-break: break-all;
  white-space: pre-wrap;
}

.log-entry.system { color: var(--slate-500); }
.log-entry.info { color: var(--cyan-400); }
.log-entry.success { color: var(--emerald-400); }
.log-entry.warn { color: var(--amber-400); }
.log-entry.error { color: var(--rose-400); }

@media (max-width: 900px) {
  .sandbox-board {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* PORTFOLIO (PROJECTS) SECTION */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--indigo-500), var(--cyan-500));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.project-card:hover::before {
  opacity: 1;
}

.project-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo-400);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.project-card:hover .project-icon {
  color: var(--cyan-400);
  border-color: var(--cyan-500);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
}

.project-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  transition: color 0.2s ease;
}

.project-card:hover h3 {
  color: var(--indigo-400);
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background-color: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.1);
  color: var(--text-secondary);
}

/* Platform / technology badges on project cards */
.project-platforms {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.project-platforms .platform-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-right: 0.15rem;
}

/* An icon + its text name, kept tightly paired */
.platform-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.platform-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1;
}

.platform-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-secondary);
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* Full-colour brand mark (e.g. the Rust game logo) — keep its own colours */
.platform-icon.rust-marque {
  opacity: 1;
  border-radius: 3px;
}

.platform-icon:hover {
  color: var(--text-primary);
  opacity: 1;
}

/* Clickable platform badge (e.g. the Rust game link) */
a.platform-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

a.platform-link .platform-icon {
  transition: none;
}

a.platform-link:hover,
a.platform-link:hover .platform-icon {
  color: var(--indigo-500);
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

/* PORTFOLIO DETAIL MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(8px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 800px;
  border-radius: 1.5rem;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  animation: modal-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--rose-500);
  background-color: rgba(244, 63, 94, 0.05);
}

.modal-header {
  padding: 2.5rem 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.modal-title-row h3 {
  font-size: 1.8rem;
}

.modal-body {
  padding: 2.5rem;
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--indigo-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-features-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--text-secondary);
}

.modal-features-list li svg {
  color: var(--cyan-400);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

/* RESUME SECTION */
.resume-layout {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 4rem;
}

.resume-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: sticky;
  top: 6.5rem;
  height: fit-content;
}

.profile-img-container {
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, var(--indigo-500) 0%, var(--cyan-500) 100%);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.profile-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-secondary);
}

.resume-sidebar h3 {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.resume-subtitle {
  color: var(--indigo-400);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.resume-sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
}

.resume-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a.resume-sidebar-link:hover {
  color: var(--cyan-400);
}

.resume-sidebar-link svg {
  color: var(--cyan-400);
}

/* RESUME TIMELINE */
.resume-timeline {
  position: relative;
  padding-left: 2rem;
}

.resume-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot-indicator {
  position: absolute;
  left: -2.35rem;
  top: 0.35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  border: 3px solid var(--indigo-500);
  z-index: 10;
  transition: background-color 0.2s, border-color 0.2s;
}

.timeline-item:hover .timeline-dot-indicator {
  border-color: var(--cyan-400);
  background-color: var(--cyan-400);
}

.timeline-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-header-meta h4 {
  font-size: 1.25rem;
  font-weight: 700;
}

.timeline-org {
  color: var(--indigo-400);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  display: block;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  background-color: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--indigo-400);
}

.timeline-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.timeline-description ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* SKILLS CARD */
.skills-sec {
  margin-top: 4rem;
}

.skills-sec h3 {
  font-size: 1.75rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.skills-category-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 1rem;
}

.skills-category-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--indigo-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skill-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.skill-name {
  font-weight: 600;
  color: var(--text-primary);
}

.skill-percent {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.skill-bar-outer {
  height: 6px;
  background-color: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.skill-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo-500), var(--cyan-400));
  border-radius: 10px;
  width: 0; /* Animated via JS */
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* SERVICES SECTION */
.services-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.service-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.service-card:hover {
  border-color: var(--indigo-500);
  box-shadow: var(--shadow-glow);
}

.service-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.service-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  background-color: rgba(99, 102, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo-400);
}

.service-card:hover .service-icon {
  color: var(--cyan-400);
  background-color: rgba(6, 182, 212, 0.1);
}

.service-card h3 {
  font-size: 1.25rem;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* SCHEDULER FORM CARD */
.scheduler-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.scheduler-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.scheduler-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.scheduler-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.scheduler-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--border-color);
  transform: translateY(-50%);
  z-index: 1;
}

.step-indicator {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 2;
  transition: all 0.3s ease;
}

.step-indicator.active {
  border-color: var(--indigo-500);
  color: white;
  background-color: var(--indigo-600);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.step-indicator.completed {
  border-color: var(--emerald-500);
  color: white;
  background-color: var(--emerald-600);
}

/* Scheduler Step Content */
.scheduler-content {
  margin-bottom: 2rem;
}

.scheduler-step-pane {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.scheduler-step-pane.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.form-input {
  background-color: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--indigo-500);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.select-card {
  border: 1px solid var(--border-color);
  background-color: rgba(15, 23, 42, 0.3);
  padding: 1.25rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.select-card.selected {
  border-color: var(--indigo-500);
  background-color: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
}

.select-card:hover:not(.selected) {
  border-color: var(--border-hover);
  background-color: rgba(99, 102, 241, 0.03);
}

.select-card-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.select-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.scheduler-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-links-col h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--indigo-400);
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-col a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* BACK TO TOP BUTTON */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 100;
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  color: var(--text-primary);
  border-color: var(--indigo-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* KEYFRAME ANIMATIONS */
@keyframes float-slow {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  .hero-content p {
    margin: 0 auto 2.5rem;
  }
  .hero-ctas {
    justify-content: center;
  }
  .resume-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .resume-sidebar {
    position: relative;
    top: 0;
  }
  .services-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  .hero-content h1 {
    font-size: 2.75rem;
  }
  nav ul {
    display: none;
    position: absolute;
    top: 4.5rem;
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
  }
  nav.mobile-active ul {
    display: flex;
  }
  .burger-menu {
    display: flex;
  }
  /* Burger transformations */
  nav.mobile-active .burger-menu span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  nav.mobile-active .burger-menu span:nth-child(2) {
    opacity: 0;
  }
  nav.mobile-active .burger-menu span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .form-select-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   LANGUAGE PICKER (i18n)
   ========================================================================== */
.lang-picker-container {
  position: relative;
  display: inline-block;
  z-index: 110;
}

.lang-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 0.7rem;
  height: 2.5rem;
  border-radius: 50px;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-picker-btn:hover {
  border-color: var(--indigo-500);
  color: var(--text-primary);
  background-color: rgba(99, 102, 241, 0.05);
}

.lang-picker-btn .globe-icon {
  opacity: 0.85;
}

.lang-picker-btn .chevron-icon {
  opacity: 0.6;
  transition: transform 0.25s ease;
}

.lang-picker-container.open .chevron-icon {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.lang-picker-container.open .lang-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-option {
  background: none;
  border: none;
  padding: 8px 12px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-option:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
}

.lang-option.active {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--indigo-400);
  font-weight: 600;
}

@media (max-width: 768px) {
  .lang-picker-btn #active-lang-text {
    display: none;
  }
  .lang-picker-btn {
    padding: 0;
    width: 2.5rem;
    justify-content: center;
    border-radius: 50%;
  }
  .lang-picker-btn .chevron-icon {
    display: none;
  }
}
