:root {
  --bg: #031026;
  --bg-soft: #052036;
  --surface: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.07);
  --text: #E6F1F5;
  --muted: #9FB6C6;
  --accent: #0EA5C7;
  --accent-2: #7C3AED;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-nav: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(14,165,233,0.06), transparent 18%),
    linear-gradient(180deg, #031026 0%, #062035 45%, #041620 100%);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.02) 1px, transparent 1px);
  background-size: 96px 96px;
  opacity: 0.12;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 92%);
}

h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: capitalize;
  letter-spacing: -0.025em;
}

p {
  line-height: 1.7;
  color: var(--muted);
  font-size: 1.05rem;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.25s ease, transform 0.25s ease;
}

nav {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 5%;
  z-index: 100;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--muted);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

section {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 7.5rem 5% 6rem;
}

#experience {
  padding-top: 9.5rem;
  min-height: 100vh;
}

.hero-intro {
  max-width: 780px;
  margin-bottom: 28rem;
}

.tagline {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-transform: none;
}

.hero-intro h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(3.2rem, 6.5vw, 5.9rem);
  line-height: 0.92;
  position: relative;
  z-index: 2; /* Keeps it above arm */
}

.hero-intro p {
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  max-width: 700px;
}

.section-title {
  position: relative;
  display: inline-block;
  margin-bottom: 2.25rem;
  font-size: clamp(2rem, 3.7vw, 2.75rem);
  color: var(--text);
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.55rem;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-2), transparent);
}

.resume-timeline {
  display: grid;
  gap: 1.4rem;
}

@media (min-width: 768px) {
  .resume-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem;
    align-items: stretch;
  }
}

.resume-item {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.7rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.resume-item:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 139, 61, 0.4);
}

.resume-date {
  display: inline-block;
  width: fit-content;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: #c8b7ff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.resume-item h3 {
  margin-bottom: 0.35rem;
  font-size: 1.3rem;
}

.resume-item h4 {
  margin-bottom: 0.9rem;
  color: var(--text);
  font-size: 0.98rem;
}

#about {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.about-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
  }
}

.about-text p {
  font-size: 1.12rem;
  margin-bottom: 1.2rem;
}

.about-text p span {
  color: var(--text);
  background: rgba(124, 58, 237, 0.16);
  padding: 0.08rem 0.3rem;
  border-radius: 0.25rem;
}

.about-visual {
  position: relative;
}

.visual-box {
  padding: 1.6rem;
  border: 1px solid rgba(255, 139, 61, 0.3);
  border-radius: 1.2rem;
  background: linear-gradient(135deg, rgba(255, 139, 61, 0.12), rgba(124, 58, 237, 0.14));
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
  transition: transform 0.3s ease;
}

.visual-box:hover {
  transform: rotate(0deg) translateY(-4px);
}

.visual-box h3 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.visual-box ul {
  list-style: none;
  display: grid;
  gap: 0.65rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.visual-box ul li::before {
  content: '›';
  color: var(--accent-2);
  margin-right: 0.6rem;
}

.projects-grid {
  display: grid;
  gap: 1.2rem;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.4rem;
  }
}

.project-card {
  position: relative;
  display: flex;
  min-height: 280px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.6rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.062), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.25);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(130deg, rgba(124, 58, 237, 0.15), transparent 35%, rgba(255, 139, 61, 0.16));
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-card * {
  pointer-events: none;
}

.project-tech {
  margin-bottom: 1.2rem;
  color: #c8b7ff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0.12em;
}

.project-title {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

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

footer {
  padding: 2rem 5% 3rem;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

footer a {
  margin: 0 0.5rem;
  color: var(--muted);
}

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

.subpage-overlay {
  position: fixed;
  inset: 0 auto 0 100%;
  width: 100%;
  height: 100vh;
  padding: 5rem 5%;
  background: rgba(6, 7, 10, 0.97);
  backdrop-filter: blur(18px);
  z-index: 1000;
  transition: left 0.4s cubic-bezier(0.2, 0.8, 0.25, 1);
  overflow-y: auto;
  border-left: 1px solid rgba(255, 139, 61, 0.28);
}

.subpage-overlay.active {
  left: 0;
}

.close-btn {
  position: fixed;
  top: 1.3rem;
  right: 1.3rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  z-index: 1001;
}

.close-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.subpage-content {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 2.5rem;
}

.subpage-title {
  margin-bottom: 0.8rem;
  font-size: clamp(2rem, 3.2vw, 2.7rem);
}

.subpage-tech {
  margin-bottom: 1.6rem;
  color: #c8b7ff;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.subpage-body p {
  margin-bottom: 1rem;
  font-size: 1.02rem;
}

.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.24), rgba(124, 58, 237, 0) 70%);
  mix-blend-mode: screen;
  z-index: 0;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.resume-btn {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent) !important; /* Overrides the default nav text color */
  transition: all 0.25s ease;
}

.resume-btn::after {
  display: none; /* Removes the custom underline effect from your normal nav links */
}

.resume-btn:hover {
  background: var(--accent);
  color: #000 !important;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
  transform: translateY(-2px);
}

/* --- ASCII Robot System --- */

.robot-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; 
  z-index: 0;
  overflow: hidden;
  opacity: 0.45;
}

#robot-ascii {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 14px;
  letter-spacing: 0.1em;
  color: var(--accent);
  white-space: pre;
  margin: 0;
}

/* Floating Controls Area (Top Right, fixed to document top) */
.robot-controls {
  position: absolute; /* absolute keeps it at top of page, doesn't follow scroll */
  top: 100px; /* Under the nav bar */
  right: 5%;
  z-index: 90;
  background: rgba(6, 7, 10, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 1rem 1.2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow);
  max-width: 250px;
}

/* Toggle Switch Styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
  margin-left: 8px;
  vertical-align: middle;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 34px;
  border: 1px solid var(--border);
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: var(--muted);
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked + .slider:before {
  transform: translateX(18px);
  background-color: #000;
}

.rc-instructions {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.rc-instructions strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.robot-reset {
  background: transparent;
  border: none;
  color: var(--accent-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
  text-align: left;
  padding: 0;
}

.robot-reset:hover {
  color: var(--text);
  text-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

/* Interactive Drag Targets */
.draggable-target {
  cursor: grab;
  will-change: transform;
}

.draggable-target.dragging {
  cursor: grabbing;
  z-index: 999;
  transition: none !important; 
  border-color: var(--accent) !important;
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.2);
}

@media (max-width: 640px) {
  nav {
    padding: 1rem 1.2rem;
  }
  .nav-links {
    gap: 0.8rem;
  }
  .nav-links a {
    font-size: 0.72rem;
  }
  section {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
  .resume-item,
  .project-card,
  .visual-box {
    padding: 1.25rem;
  }
  .robot-controls {
    top: 80px;
    right: 5%;
    max-width: 200px;
  }
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 768px) {
  .robot-controls {
    /* Remove the absolute positioning */
    position: relative; 
    top: auto;
    right: auto;
    
    /* Center it and pull it up into the blank space below the arm */
    margin: 40rem auto 4rem auto; 
    
    /* Allow it to stretch nicely on mobile */
    width: 90%;
    max-width: 400px; 
    
    /* Optional: center the text/buttons inside */
    z-index:90

  }
}