/* ROOT VARIABLES */
:root {
  --bg-color: #11111b;
  --text-main: #cdd6f4;
  --text-muted: #a6adc8;
  --accent: #cba6f7;
  --glass-bg: rgba(30, 30, 46, 0.6);
  --glass-border: #313244;
  
  --font-sans: 'Outfit', sans-serif;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'Space Grotesk', monospace;
}

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

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Hide the native cursor on devices with a mouse/pointer */
@media (pointer: fine) {
  html, 
  body, 
  a, 
  button, 
  .magnetic, 
  .btn, 
  .link-card {
    cursor: none !important;
  }
}

/* CUSTOM CURSOR */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--accent);
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

@media (pointer: coarse) {
  .cursor {
    display: none;
  }
}

/* WEBGL CANVAS */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* LOADER */
.loader {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 4rem;
  pointer-events: none;
}

.loader-background {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: var(--bg-color);
  z-index: 1;
}

.loader-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  overflow: hidden;
}

.loader-counter {
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 15rem);
  font-weight: 900;
  line-height: 0.8;
  color: var(--text-main);
  letter-spacing: -0.05em;
  transform: translateY(100%);
}

.loader-counter .accent-dot {
  color: var(--accent);
}

.loader-label {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 1rem;
  transform: translateY(100%);
  opacity: 0;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  mix-blend-mode: difference;
  opacity: 0;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  display: inline-block;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-item {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  display: inline-block;
  cursor: pointer;
}

/* HERO */
.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-content {
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

body.bw-active .hero-content {
  transform: translateY(-8vh);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-title .char {
  display: inline-block;
  transform: translateY(100%);
}

body.bw-active .hero-title .char {
  transform: translateY(0) !important;
}

.hero-subtitle {
  margin-top: 2rem;
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0;
}

.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
}

.mouse {
  width: 30px;
  height: 50px;
  border: 2px solid var(--text-muted);
  border-radius: 15px;
  position: relative;
}

.wheel {
  width: 4px;
  height: 8px;
  background: var(--text-main);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 1.5s infinite;
}

@keyframes scroll {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 20px); opacity: 0; }
}

/* GENERAL LAYOUT */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 10rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 4rem;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--text-muted);
}

.section-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* GLASS CARD */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 0; /* Sharp, technical workstation aesthetics */
  padding: 3rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ABOUT SECTION */
.about-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.about-text p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.skills h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.skills p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.skill-tag {
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

/* ==========================================
   LAB & AI SECTION
   ========================================== */
.lab-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  margin-top: 2rem;
}

.terminal-card {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: rgba(8, 8, 8, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 !important; /* Let terminal header span full width */
  overflow: hidden;
  height: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  user-select: none;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.btn-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.btn-dot.close { background: #ff5f56; }
.btn-dot.minimize { background: #ffbd2e; }
.btn-dot.expand { background: #27c93f; }

.terminal-title {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background: #27c93f;
  box-shadow: 0 0 8px #27c93f;
  animation: pulse-green 1.5s infinite alternate ease-in-out;
}

@keyframes pulse-green {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.status-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #d1d1d6;
  text-align: left;
  white-space: pre-wrap;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.terminal-line {
  margin-bottom: 0.6rem;
  font-family: inherit;
}

.prompt {
  color: #a6e22e; /* classic terminal green prompt */
  font-weight: 600;
  margin-right: 0.5rem;
}

.command-text {
  color: #f8f8f2;
}

.cursor-blink {
  color: var(--text-main);
  animation: cursor-blink-anim 0.8s step-end infinite;
  margin-left: 2px;
  font-weight: bold;
}

@keyframes cursor-blink-anim {
  from, to { color: transparent }
  50% { color: var(--text-main) }
}

.terminal-output {
  margin-bottom: 1.2rem;
  color: #f8f8f2;
  font-family: inherit;
}

/* Colors inside terminal output */
.text-accent { color: #f5f5f7; }
.text-muted { color: #55555e; }
.text-info { color: #66d9ef; }
.text-success { color: #a6e22e; }
.text-warning { color: #f92672; }

/* LAB INFO STYLING */
.lab-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lab-info h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.lab-info p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.lab-info p strong {
  color: var(--text-main);
}

.highlight-agent {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* TECH STACK ROW */
.tech-stack-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.stack-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.stack-item:hover::before {
  opacity: 1;
}

.stack-item span {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
  white-space: nowrap;
}

.stack-icon-wrapper {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stack-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

/* Custom interactive effects */
.stack-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.stack-item:hover span {
  color: var(--text-main);
}

/* Linux: Gold/Amber glow */
.stack-item:nth-child(1):hover .stack-icon-wrapper {
  color: #f1c40f;
  filter: drop-shadow(0 0 10px rgba(241, 196, 15, 0.6));
  transform: scale(1.15) rotate(-5deg);
}

/* Google: Clean white-blue glow */
.stack-item:nth-child(2):hover .stack-icon-wrapper {
  color: #4285f4;
  filter: drop-shadow(0 0 10px rgba(66, 133, 244, 0.6));
  transform: scale(1.15);
}

/* Docker: Docker blue glow */
.stack-item:nth-child(3):hover .stack-icon-wrapper {
  color: #0db7ed;
  filter: drop-shadow(0 0 10px rgba(13, 183, 237, 0.6));
  transform: scale(1.15) translateY(-2px);
}

/* Networking: High-tech purple glow */
.stack-item:nth-child(4):hover .stack-icon-wrapper {
  color: #a29bfe;
  filter: drop-shadow(0 0 10px rgba(162, 155, 254, 0.6));
  transform: scale(1.15) rotate(5deg);
}

/* Responsive adjustment for Lab */
@media (max-width: 992px) {
  .lab-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .terminal-card {
    height: 420px;
  }
}

@media (max-width: 480px) {
  .tech-stack-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* LINKS SECTION */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.link-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
}

.link-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.link-content p {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.link-arrow {
  font-size: 2rem;
  transition: transform 0.3s ease;
}

.link-card:hover .link-arrow {
  transform: translate(5px, -5px);
}

/* CONTACT SECTION */
.contact-box {
  text-align: center;
  padding: 6rem 3rem;
}

.contact-box p {
  font-size: 1.5rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 3rem auto;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--text-main);
  color: var(--bg-color);
  padding: 1rem 2.5rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.btn span {
  font-family: var(--font-mono);
  font-weight: 400;
  opacity: 0.8;
}

/* FOOTER */
.footer {
  padding: 4rem 0;
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-content p {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .navbar {
    padding: 1.5rem 2rem;
  }
  .nav-menu {
    display: none;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .footer-content {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
}

/* ==========================================
   FOOTER DINO EASTER EGG
   ========================================== */
.footer-dino {
  display: inline-block;
  text-decoration: none;
  padding: 0.6rem;
  border-radius: 50%;
  transition: background 0.3s ease;
  background: transparent;
}

.footer-dino:hover {
  background: rgba(255, 255, 255, 0.04);
}

.mini-dino {
  color: var(--text-muted);
  transition: color 0.3s ease, filter 0.3s ease;
  /* Bobbing up and down animation */
  animation: dino-bob 0.35s infinite alternate ease-in-out;
}

.footer-dino:hover .mini-dino {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* Leg swinging animation logic */
.dino-leg {
  transform-box: fill-box; /* Fixes coordinate origins for SVG browser rendering */
}

.leg-1 {
  transform-origin: 10px 22px;
  animation: dino-run-1 0.35s infinite alternate ease-in-out;
}

.leg-2 {
  transform-origin: 14px 22px;
  animation: dino-run-2 0.35s infinite alternate ease-in-out;
}

@keyframes dino-run-1 {
  0% { transform: rotate(-25deg); }
  100% { transform: rotate(25deg); }
}

@keyframes dino-run-2 {
  0% { transform: rotate(25deg); }
  100% { transform: rotate(-25deg); }
}

@keyframes dino-bob {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.highlight-text {
  font-family: var(--font-mono);
  font-style: italic;
  color: var(--text-main);
}

/* HERMES SKILLS MARKETPLACE */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.skill-card {
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.skill-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-icon svg {
  width: 24px;
  height: 24px;
}

.skill-icon i {
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-info h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.skill-info p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: lowercase;
}

.skill-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-download {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-download:hover {
  background: #ffffff;
  color: #000000;
}

.btn-download.downloading {
  background: rgba(203, 166, 247, 0.1);
  color: var(--accent);
  border-color: rgba(203, 166, 247, 0.4);
  pointer-events: none;
}

.dl-progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

.dl-text {
  position: relative;
  z-index: 2;
  letter-spacing: 0.1em;
}

.btn-download svg {
  width: 16px;
  height: 16px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
.spin-icon { animation: spin 1s linear infinite; }
/* ==========================================
/* ==========================================
   THEME SWITCH OVERRIDES
   ========================================== */

main, nav, #webgl-canvas {
  transition: filter 0.5s ease;
}

body.bw-active main,
body.bw-active nav,
body.bw-active #webgl-canvas {
  filter: grayscale(100%);
}

.bw-alt {
  display: none !important;
}

body.bw-active .bw-default {
  display: none !important;
}

body.bw-active .bw-alt {
  display: inline-block !important;
}

body.bw-active div.bw-alt,
body.bw-active p.bw-alt {
  display: block !important;
}

body.bw-active .skills-grid.bw-alt {
  display: flex !important;
}

.theme-switch {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10000;
  background: var(--glass-bg);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-switch:hover {
  background: var(--text-main);
  color: var(--bg-color);
}
