* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
}

.section {
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
 *  ARM SECTION
 * ═══════════════════════════════════════════════════════════════ */

.section-arm {
  height: 600px;
  background: #010b2c;
  cursor: none;
}

/* subtle dot grid background */
.section-arm::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

#arm-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Reach envelope */
.arm-reach {
  fill: none;
  stroke: rgba(0, 212, 255, 0.04);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

/* Links */
.arm-link {
  stroke-width: 14;
  stroke-linecap: round;
  stroke: #2a3040;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.arm-link-0 {
  stroke: #333b4f;
  stroke-width: 32;
}

.arm-link-1 {
  stroke: #2e3545;
  stroke-width: 26;
}

.arm-link-2 {
  stroke: #282f3e;
  stroke-width: 20;
}

/* Joints */
.arm-joint {
  fill: #1a1f2e;
  stroke: #00d4ff;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.3));
}

/* End effector */
.arm-effector {
  fill: #00d4ff;
  stroke: none;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
}

/* Target indicator */
.arm-target {
  fill: rgba(0, 212, 255, 0.5);
}

.arm-target-ring {
  fill: none;
  stroke: rgba(0, 212, 255, 0.2);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

/* Base pedestal */
.arm-base-pedestal {
  position: absolute;
  bottom: 30px;
  left: 75%;
  transform: translateX(-50%);
  width: 100px;
  height: 36px;
  background: linear-gradient(180deg, #2a3040 0%, #1a1f2e 100%);
  border-radius: 6px 6px 10px 10px;
  border: 1.5px solid #3a4050;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 3;
}

.arm-base-pedestal::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  border-radius: 2px;
  opacity: 0.5;
}

/* Skills block */
.skills-content {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  width: 45%;
  z-index: 3;
  pointer-events: none;
}

.skills-heading {
  color: #ff3c3c;
  font-size: 48px;
  font-weight: 800;
  margin: 0 0 20px 0;
}

.skills-text {
  color: #e0e0e0;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
 *  FOOTER SECTION (Robot Car)
 * ═══════════════════════════════════════════════════════════════ */

.section-footer {
  height: 340px;
  background: #010b2c;
  color: #ffffff;
}

#sim-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#terrain-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#terrain-fill {
  fill: url(#terrain-grad);
}

#terrain-surface {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2;
  stroke-linejoin: round;
}

/* ── Car ── */

.car {
  position: absolute;
  width: 160px;
  height: 96px;
  transform: translate(-50%, -50%) scale(0.55);
  transform-origin: center center;
  z-index: 3;
}

.car-body {
  position: absolute;
  left: 20px;
  top: 8px;
  width: 120px;
  height: 48px;
  background: linear-gradient(180deg, #3a3f4b 0%, #2a2e38 50%, #1e2128 100%);
  border-radius: 8px;
  border: 1.5px solid #4a5060;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.body-accent {
  position: absolute;
  bottom: 6px;
  left: 8px;
  right: 8px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  border-radius: 2px;
  opacity: 0.6;
}

/* ── Visor & Eyes ── */

.robot-visor {
  position: absolute;
  left: 38px;
  top: 10px;
  width: 84px;
  height: 28px;
  background: rgba(0, 10, 20, 0.7);
  border-radius: 14px;
  border: 1.5px solid rgba(0, 212, 255, 0.35);
  box-shadow:
    0 0 10px rgba(0, 212, 255, 0.15),
    inset 0 0 8px rgba(0, 212, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 10px;
  z-index: 4;
}

.eye {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #0d1520, #060a10);
  border: 1.5px solid #00d4ff;
  box-shadow:
    0 0 6px rgba(0, 212, 255, 0.5),
    inset 0 0 4px rgba(0, 212, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.pupil {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #00ffff, #0090cc);
  box-shadow: 0 0 5px #00d4ff, 0 0 2px #00ffff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

/* ── Antenna ── */

.antenna {
  position: absolute;
  left: 72px;
  top: 0px;
  width: 2px;
  height: 12px;
  background: #4a5060;
  border-radius: 1px;
  z-index: 5;
}

.antenna::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -2.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00d4ff;
  box-shadow: 0 0 6px #00d4ff, 0 0 12px rgba(0, 212, 255, 0.4);
  animation: antenna-pulse 2s ease-in-out infinite;
}

@keyframes antenna-pulse {

  0%,
  100% {
    opacity: 0.6;
    box-shadow: 0 0 4px #00d4ff;
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 8px #00d4ff, 0 0 16px rgba(0, 212, 255, 0.5);
  }
}

/* ── Wheels ── */

.wheel {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #1e2230, #0a0e16);
  border: 3px solid #3a4050;
  top: 44px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2a3040;
  border: 1.5px solid #4a5568;
}

.wheel-left {
  left: 16px;
}

.wheel-right {
  right: 16px;
}

/* ── Footer Credit ── */

.footer-credit {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 4;
  pointer-events: none;
}

.footer-line {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.5px;
  font-weight: 300;
}

.footer-line strong {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.footer-sub {
  margin: 4px 0 0;
  font-size: 11px;
  color: rgba(0, 212, 255, 0.45);
  letter-spacing: 1.5px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
 *  NAV SECTION (Top-Down Navigation Robot)
 * ═══════════════════════════════════════════════════════════════ */

.section-nav {
  min-height: max(100vh, 800px);
  background:
    radial-gradient(ellipse at 50% 0%, #161d30 0%, #0c1018 70%);
  cursor: crosshair;
}

.section-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

#nav-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ── Robot ── */

#nav-robot {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #ff5050, #cc2020);
  border: 2px solid rgba(255, 100, 100, 0.4);
  box-shadow:
    0 0 12px rgba(255, 50, 50, 0.4),
    0 0 4px rgba(255, 50, 50, 0.8);
  z-index: 5;
  pointer-events: none;
  will-change: transform;
}

#nav-robot::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* ── Top Navbar ── */

.top-navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: min(24px, 2.6dvh) 48px;
  box-sizing: border-box;
  z-index: 10;
  pointer-events: none;
}

.top-navbar * {
  pointer-events: auto;
}

.nav-logo-collision {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s, filter 0.2s;
}

.nav-logo-collision img {
  height: min(48px, 5.3dvh);
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: min(40px, 4.4dvh);
}

.nav-link-collision {
  font-size: min(18px, 2dvh);
  font-weight: 600;
  color: #fff;
  letter-spacing: 1.5px;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link-collision:hover {
  color: #ff3c3c;
}

/* ── Hero Container ── */

.hero-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: min(140px, 15.5dvh) 48px min(80px, 8.8dvh);
  max-width: 960px;
  margin: 0 auto;
}

.hero-title-first-collision,
.hero-title-second-collision {
  margin: 0;
  font-size: min(64px, 7.1dvh);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  text-align: center;
}

.hero-center-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: min(24px, 2.6dvh);
  margin: min(50px, 5.5dvh) 0;
}

.hero-bubble-collision {
  background: #fff;
  color: #111;
  padding: min(12px, 1.3dvh) min(20px, 2.2dvh);
  border-radius: 40px;
  font-size: min(14px, 1.5dvh);
  font-weight: 600;
  max-width: 180px;
  text-align: center;
  line-height: 1.4;
  margin-bottom: min(30px, 3.3dvh);
}

.hero-image-collision {
  width: min(160px, 17.7dvh);
  height: min(160px, 17.7dvh);
  border-radius: 50%;
  overflow: hidden;
  background: #111;
}

.hero-image-collision img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: min(12px, 1.3dvh);
}

.hero-btn-collision {
  background: #fff;
  color: #111;
  text-decoration: none;
  font-weight: 800;
  font-size: min(14px, 1.5dvh);
  padding: min(6px, 0.6dvh) min(16px, 1.7dvh);
  border-radius: 20px;
  text-align: center;
  transition: transform 0.2s;
  display: inline-block;
}

.hero-btn1-collision {
  position: relative;
  left: 0px;
}

.hero-btn2-collision {
  position: relative;
  left: 30px;
}

.hero-btn3-collision {
  position: relative;
  left: 30px;
}

.hero-btn4-collision {
  position: relative;
  left: 0px;
}

.hero-btn-collision:hover {
  transform: scale(1.05);
}

.hero-text-block {
  display: flex;
  flex-direction: column;
  gap: min(20px, 2.2dvh);
  max-width: 800px;
  text-align: center;
}

.hero-text-collision {
  margin: 0;
  font-size: min(14px, 1.5dvh);
  line-height: 1.8;
  color: #e0e0e0;
}

.hero-text-italic-collision {
  margin: 0;
  font-size: min(12px, 1.3dvh);
  line-height: 1.8;
  color: #e0e0e0;
  font-style: italic;
}

.blue-text {
  color: #2160ff;
  font-weight: 600;
}

/* ── Map Popup ── */

#map-popup {
  position: absolute;
  z-index: 10;
  transform: translate(-50%, -100%);
  background: rgba(8, 12, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  display: none;
  backdrop-filter: blur(8px);
}

#map-popup::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid rgba(8, 12, 18, 0.92);
}

.map-popup-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
}

.map-popup-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.map-popup-label {
  margin: 0 0 3px;
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.map-popup-row canvas {
  display: block;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ═══════════════════════════════════════════════════════════════
 *  MOBILE & TOUCH RESPONSIVENESS
 * ═══════════════════════════════════════════════════════════════ */

/* Hide physics elements on touch devices */
@media (hover: none) and (pointer: coarse) {
  #nav-robot,
  #nav-canvas,
  #arm-svg,
  .arm-base-pedestal,
  #sim-layer {
    display: none !important;
  }
}

/* Hamburger button styling */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 20;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
  .hamburger-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(8, 12, 18, 0.95);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 15;
  }

  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
  }
  
  .nav-link-collision {
    font-size: 24px;
  }

  .hero-container {
    padding: 120px 24px 60px;
  }

  .hero-title-first-collision,
  .hero-title-second-collision {
    font-size: 40px;
  }

  .hero-center-row {
    flex-direction: column;
    margin: 40px 0 60px;
  }

  .hero-bubble-collision {
    margin-bottom: 0;
  }

  .hero-image-collision {
    margin: 20px 0;
  }

  .hero-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }

  .hero-btn1-collision,
  .hero-btn2-collision,
  .hero-btn3-collision,
  .hero-btn4-collision {
    position: static;
    margin: 0;
  }

  .skills-content {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    padding: 40px 24px;
  }
  
  .skills-heading {
    font-size: 36px;
  }

  .section-arm {
    height: auto;
  }
}