@import url('https://fonts.googleapis.com/css2?family=Antonio:wght@100..700&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

:root {
  --bg: #000000;
  --fg: #ffffff;
  --accent: #FF5722; /* Safety Orange */
  --accent-rgb: 255, 87, 34;
  --muted: #444444;
  --grid: rgba(255, 255, 255, 0.05);
  
  --font-display: 'Antonio', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body.light-theme {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #888888;
  --grid: rgba(0, 0, 0, 0.05);
}

body.light-theme .main-nav, 
body.light-theme .main-footer {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .story-text span,
body.light-theme .story-title,
body.light-theme .archive-title,
body.light-theme .work-title {
  color: var(--fg) !important;
}

body.light-theme .story-title span,
body.light-theme .archive-title span,
body.light-theme .work-title span,
body.light-theme .faded-subtitle {
  color: #444444 !important;
  opacity: 1 !important;
}

body.light-theme .diag-metadata,
body.light-theme .entry-meta,
body.light-theme .entry-category,
body.light-theme .work-meta {
  color: #555555 !important;
}

body.light-theme .entry-title {
  color: var(--fg);
}

body.light-theme .archive-entry:hover .entry-title {
  color: var(--accent) !important;
}

body.light-theme .archive-entry {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .repo-link,
body.light-theme .entry-meta {
  color: #666666;
}

.theme-toggle {
  background: none;
  border: 1px solid rgba(128, 128, 128, 0.2);
  color: var(--fg);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 2rem;
  transition: all 0.3s ease;
  font-family: var(--font-mono);
}

    .laptop-container {
      position: absolute;
      bottom: 58vh;
      right: 15%;
      width: 320px;
      height: 220px;
      z-index: 10;
      transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .laptop-svg {
      width: 100%;
      height: 100%;
      filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5));
    }

    .laptop-screen-frame {
      fill: #1a1a1a;
      stroke: var(--muted);
      stroke-width: 1;
    }

    .laptop-screen-content {
      fill: #0a0a0a;
    }

    .laptop-base {
      fill: #222222;
      stroke: var(--muted);
      stroke-width: 1;
    }

    .laptop-trackpad {
      fill: #111111;
      stroke: rgba(255,255,255,0.05);
    }

    .laptop-display-text {
      position: absolute;
      top: 45px;
      left: 75px;
      width: 170px;
      height: 90px;
      padding: 5px;
      overflow: hidden;
      pointer-events: none;
      font-family: var(--font-mono);
      color: var(--accent);
      opacity: 0.9;
    }

    .laptop-container:hover .laptop-screen-frame,
    .laptop-container:hover .laptop-base {
      stroke: var(--accent);
      stroke-width: 1.5;
    }

    .laptop-container:hover .laptop-svg {
      filter: drop-shadow(0 0 15px rgba(var(--accent-rgb), 0.4));
    }

    .laptop-container:hover {
      z-index: 1000;
      transform: scale(1.05) translateY(-5px);
      filter: drop-shadow(0 0 20px var(--accent));
    }

    .laptop-container:active {
      transform: scale(0.98) translateY(2px);
    }

    body.light-theme .laptop-screen-frame { fill: #e0e0e0; stroke: #ccc; }
    body.light-theme .laptop-screen-content { fill: #f5f5f5; }
    body.light-theme .laptop-base { fill: #d0d0d0; stroke: #ccc; }
    body.light-theme .laptop-display-text { color: #333; }

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: none; /* We'll implement a custom cursor */
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Lidar Grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -2;
  opacity: var(--grid-opacity, 0.05);
  transition: opacity 0.5s ease;
}

/* Scanline Effect */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  opacity: 0.3;
  pointer-events: none;
  z-index: 100;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

/* Custom Cursor */
#cursor {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s, height 0.3s;
}

#cursor::before, #cursor::after {
  content: "";
  position: absolute;
  background: var(--accent);
}

#cursor::before { width: 100%; height: 1px; }
#cursor::after { width: 1px; height: 100%; }

/* Typography */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.85;
  letter-spacing: -0.05em;
}

/* Global Nav/Footer */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6rem;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
}

.nav-brand {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
  background: none;
}

/* Navigation Architecture */

.nav-links {
  list-style: none;
  display: flex;
  gap: 3rem;
}

.nav-links a {
  text-decoration: none;
  color: #888888;
  font-size: 0.8rem;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--fg);
  text-shadow: 0 0 8px var(--accent);
}

.nav-links a.hire-btn {
  border: 1px solid var(--accent);
  padding: 5px 15px;
  color: var(--accent);
  margin-left: 1rem;
  transition: all 0.3s ease;
}

.nav-links a.hire-btn:hover {
  background: var(--accent);
  color: white;
  text-shadow: none;
  box-shadow: 0 0 15px var(--accent);
}

.main-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6rem;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(10px);
  border-top: none;
  z-index: 100;
}

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

.footer-social a {
  text-decoration: none;
  color: #888888;
  font-size: 0.7rem;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--accent);
}

.footer-metadata {
  font-size: 0.6rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  letter-spacing: 1px;
}

.massive-type {
  font-size: clamp(5rem, 15vw, 12rem); /* Reduced size */
  color: var(--bg);
  -webkit-text-stroke: 1px var(--fg);
  opacity: 0.1;
  position: absolute;
  top: 40vh; /* Pushed up slightly */
  right: 6rem;
  text-align: right;
  z-index: -1;
  line-height: 0.8;
  pointer-events: none;
}

.hero-main-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-top: 5rem; /* Balanced top offset */
}

/* UI Elements */
.diag-metadata {
  border-left: 1px solid var(--muted);
  padding-left: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 100;
  transition: all 0.3s ease;
  min-width: 300px;
  margin-top: 2rem; /* Minor visual tweak to align with letter top */
}

.interactive-diag {
  cursor: pointer;
  pointer-events: auto;
}

.interactive-diag:hover {
  border-left-color: var(--accent);
  background: rgba(255, 87, 34, 0.05);
  filter: drop-shadow(0 0 10px rgba(255, 87, 34, 0.3));
}

.diag-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.diag-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

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

@keyframes boot-progress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* Container & Sections */
.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 9rem;
  position: relative;
}

section {
  padding: 15rem 0;
  position: relative;
  border-bottom: 1px solid var(--muted);
}

.section-module {
  position: absolute;
  top: 4rem;
  right: 4rem;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Kinetic Elements */
.amr-scurrier, .quadruped-roamer {
  position: fixed;
  z-index: 1000;
  pointer-events: auto; /* ENABLED for clicking */
  cursor: pointer;
  opacity: 0.6;
  filter: drop-shadow(0 0 8px var(--accent));
  transition: transform 0.1s linear, filter 0.3s ease;
}

.amr-scurrier:hover svg rect, .amr-scurrier:hover svg circle, .amr-scurrier:hover svg line {
  stroke: var(--bg);
  fill: var(--accent);
  stroke-width: 1;
}

.amr-scurrier:hover {
  filter: drop-shadow(0 0 20px var(--accent));
  opacity: 1;
}

.quadruped-roamer:hover {
  filter: drop-shadow(0 0 15px var(--accent)) brightness(1.2);
  opacity: 1;
}

.amr-scurrier {
  width: 120px;
  height: 80px;
}

.quadruped-roamer {
  width: 180px;
  height: 120px;
}

.leg .thigh, .leg .calf {
  stroke-linecap: round;
  transition: transform 0.1s ease-out;
}

.network-edge {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.network-node {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1;
}

.cobot-container {
  position: absolute;
  bottom: 250px;
  right: 5%;
  width: 450px;
  height: 700px;
  z-index: 5;
  pointer-events: auto; /* Enable hover */
  transition: all 0.3s ease;
}

.cobot-container:hover {
  z-index: 1000;
  filter: drop-shadow(0 0 20px var(--accent));
}

.cobot-container:hover .cobot-joint {
  fill: var(--accent);
  stroke: white;
}

#cobot-svg {
  pointer-events: auto; /* ENABLED */
  cursor: pointer;
}

#cobot-svg:hover .cobot-link {
  filter: drop-shadow(0 0 10px var(--accent));
  stroke: var(--accent);
}

#network-map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 999; /* Top-most interactive layer */
  pointer-events: none;
  opacity: 0.4;
}

#network-nodes circle, #network-edges line, #stations g {
  pointer-events: auto; /* ENABLED */
  cursor: pointer;
  transition: all 0.3s ease;
}

#network-nodes circle:hover, #network-edges line:hover, #stations g:hover {
  filter: drop-shadow(0 0 10px var(--accent));
  stroke-width: 3;
}

/* Dog Home Dock */
#dog-home {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 100px;
  height: 100px;
  border: 1px dashed var(--accent);
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: var(--accent);
}

.cobot-joint {
  stroke: var(--accent);
  stroke-width: 2;
  fill: rgba(0,0,0,0.8);
}

.cobot-link {
  stroke: var(--muted);
  stroke-width: 15;
  stroke-linecap: round;
}

/* Hero */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: 4rem;
}

.hero-content {
  position: relative;
  z-index: 50;
  pointer-events: none; /* Allow hovering background elements through the text box */
}

.hero-title, .hero-subtitle {
  pointer-events: auto; /* Re-enable clicks/hovers for text and links */
}

.hero-title {
  margin-bottom: 0.1em;
  margin-top: 0;
  line-height: 0.8;
}

.name-first {
  font-size: clamp(8rem, 18vw, 18rem);
  color: var(--fg); /* Brilliant White */
}

.name-last {
  font-size: clamp(5rem, 10vw, 11rem);
  color: #888888; /* Greyish White */
  opacity: 0.8;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: #bbbbbb;
  border-left: 2px solid var(--accent);
  padding-left: 3rem;
  margin-top: 2rem;
  max-width: 900px;
  line-height: 1.2;
}

.hero-subtitle a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

.hero-subtitle a:hover {
  color: var(--accent);
}

/* Stations */
.station-outline {
  stroke: var(--accent);
  stroke-width: 1;
  fill: none;
  opacity: 0.4;
}

.station-label {
  font-size: 0.5rem;
  fill: var(--accent);
  text-transform: uppercase;
}

/* Projects */
.project-card {
  border-top: 1px solid var(--fg);
  padding: 4rem 0;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  gap: 2rem;
  transition: background 0.3s ease;
}

.project-card:hover {
  background: rgba(var(--accent-rgb), 0.05);
}

.project-card h3 {
  font-size: 4rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--muted);
}

.project-card .link {
  text-align: right;
  font-size: 1.5rem;
}

/* CV */
.cv-item {
  margin-bottom: 8rem;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
}

.cv-item h4 {
  font-size: 2.5rem;
  font-family: var(--font-display);
}

.cv-item ul {
  list-style: none;
}

.cv-item li {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--muted);
}

/* Footer */
footer {
  padding: 10rem 0 5rem;
  font-size: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

/* Glitch Utility */
.glitch-hover:hover {
  animation: glitch-text 0.2s infinite;
}

@keyframes glitch-text {
  0% { transform: translate(0); }
  25% { transform: translate(2px, -2px); text-shadow: 2px 0 red, -2px 0 blue; }
  50% { transform: translate(-2px, 2px); text-shadow: -2px 0 red, 2px 0 blue; }
  75% { transform: translate(2px, 2px); }
  100% { transform: translate(0); }
}

@media (max-width: 1024px) {
  .project-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .cv-item {
    grid-template-columns: 1fr;
  }
}

/* Global Responsiveness Overhaul */
@media (max-width: 1024px) {
  .main-nav, .main-footer { padding: 0 2rem; }
  .nav-links { gap: 1.5rem; }
  .container { padding: 0 2rem; }
}

@media (max-width: 768px) {
  .main-nav { 
    height: auto; 
    padding: 1rem 1.5rem; 
    flex-direction: column; 
    gap: 1rem; 
    background: rgba(10, 10, 10, 0.95);
  }
  .nav-links { 
    gap: 1rem; 
    flex-wrap: wrap; 
    justify-content: center; 
  }
  .nav-brand { font-size: 0.75rem; text-align: center; }
  .main-footer { 
    height: auto; 
    padding: 1.5rem 1rem; 
    flex-direction: column; 
    gap: 1rem; 
    position: relative; /* Unlock from bottom on small screens to prevent overlap */
  }
  .footer-social { 
    gap: 1rem; 
    flex-wrap: wrap; 
    justify-content: center; 
  }
  .massive-type { display: none; } /* Hide background text on mobile for performance */
}

@media (max-width: 480px) {
  .nav-links a { font-size: 0.65rem; }
  .nav-links a.hire-btn { margin-left: 0; }
  .footer-social a { font-size: 0.55rem; }
}
