/* ============================================
   Patrick Garrett — Personal Portfolio
   Dark & Minimal Theme
   ============================================ */

/* --- Custom Properties --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --text-primary: #e0e0e0;
  --text-heading: #ffffff;
  --text-muted: #6b7280;
  --accent: #64ffda;
  --accent-dim: rgba(100, 255, 218, 0.1);
  --border: #1e1e2e;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1100px;
  --nav-height: 70px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 25px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled {
  background-color: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 25px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: color 0.3s ease;
  position: relative;
}

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

.nav-links .nav-number {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-right: 4px;
}

.nav-resume {
  border: 1px solid var(--accent);
  color: var(--accent) !important;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.8rem !important;
  font-family: var(--font-mono);
  transition: background-color 0.3s ease, color 0.3s ease !important;
}

.nav-resume:hover {
  background-color: var(--accent-dim);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 1001;
}

.hamburger span {
  width: 25px;
  height: 2px;
  background-color: var(--accent);
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  max-width: 320px;
  height: 100vh;
  background-color: var(--bg-secondary);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding-right: 40px;
  gap: 25px;
  transition: right 0.3s ease;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav a {
  font-size: 1.1rem;
  color: var(--text-primary);
  text-align: right;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.mobile-nav.open a {
  opacity: 1;
  transform: translateX(0);
}

.mobile-nav.open a:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav.open a:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav.open a:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav.open a:nth-child(4) { transition-delay: 0.25s; }
.mobile-nav.open a:nth-child(5) { transition-delay: 0.3s; }
.mobile-nav.open a:nth-child(6) { transition-delay: 0.35s; }
.mobile-nav.open a:nth-child(7) { transition-delay: 0.4s; }

.mobile-nav .nav-number {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-right: 6px;
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.visible {
  opacity: 1;
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 25px;
  width: 100%;
  pointer-events: none;
}

.hero-content a,
.hero-content button {
  pointer-events: auto;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.1;
  margin-bottom: 10px;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.4s;
  opacity: 0;
}

.hero-tagline {
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.1;
  margin-bottom: 15px;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

.hero-typing-wrapper {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 30px;
  min-height: 1.8em;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

.hero-typing-wrapper .typing-prefix {
  color: var(--accent);
}

.hero-typing-wrapper .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background-color: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 1s;
  opacity: 0;
}

.hero-cta {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 14px 32px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: background-color 0.3s ease, transform 0.3s ease;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 1.2s;
  opacity: 0;
}

.hero-cta:hover {
  background-color: var(--accent-dim);
  color: var(--accent);
  transform: translateY(-2px);
}

/* --- Section Shared Styles --- */
section {
  padding: 100px 0;
  position: relative;
  z-index: 1;
}

#about,
#experience,
#publications,
#projects,
#skills {
  background-color: rgba(10, 10, 15, 0.85);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 50px;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background-color: var(--border);
  max-width: 300px;
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.about-text p {
  color: var(--text-primary);
  margin-bottom: 15px;
  line-height: 1.8;
}

.about-text a {
  color: var(--accent);
  position: relative;
}

.about-text a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.about-text a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Terminal Card */
.terminal {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background-color: #ff5f57; }
.terminal-dot.yellow { background-color: #febc2e; }
.terminal-dot.green { background-color: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.9;
}

.terminal-body .prompt {
  color: var(--accent);
}

.terminal-body .command {
  color: var(--text-heading);
}

.terminal-body .output {
  color: var(--text-muted);
  padding-left: 8px;
}

/* --- Projects Section --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 40px rgba(100, 255, 218, 0.05);
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.project-icon {
  color: var(--accent);
}

.project-icon svg {
  width: 36px;
  height: 36px;
}

.project-links {
  display: flex;
  gap: 12px;
}

.project-links a {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.project-links a:hover {
  color: var(--accent);
}

.project-links svg {
  width: 20px;
  height: 20px;
}

.project-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

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

.project-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Skills Section --- */
.skills-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

.skill-category h3 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.skill-pill:hover {
  border-color: var(--accent);
  background-color: var(--accent-dim);
  box-shadow: 0 0 15px rgba(100, 255, 218, 0.08);
}

/* --- Contact Section --- */
#contact {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0;
}

.contact {
  text-align: center;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 0 25px;
}

.contact .section-header {
  justify-content: center;
}

.contact-heading {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 20px;
}

.contact p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 40px;
}

.contact-btn {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 16px 40px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.contact-btn:hover {
  background-color: var(--accent-dim);
  color: var(--accent);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
}

.social-links a {
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.social-links svg {
  width: 22px;
  height: 22px;
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

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

.footer a {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

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

/* --- Experience Timeline --- */
.timeline {
  position: relative;
  padding-left: 40px;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

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

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
  z-index: 1;
}

.timeline-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  transition: border-color 0.3s ease;
}

.timeline-content:hover {
  border-color: var(--accent);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}

.timeline-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.timeline-content h4 {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.timeline-content p {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.7;
}

/* --- Publications Section --- */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pub-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.pub-card:hover {
  border-color: var(--accent);
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 42px;
}

.pub-details h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
  line-height: 1.5;
}

.pub-details h3 a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.pub-details h3 a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  line-height: 1.5;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.pub-citations {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-left: 8px;
  font-style: normal;
}

.pub-scholar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 20px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.pub-scholar-link:hover {
  background-color: var(--accent-dim);
  color: var(--accent);
}

@media (max-width: 480px) {
  .pub-card {
    flex-direction: column;
    gap: 4px;
  }
}

/* --- GitHub Stats --- */
.github-stats {
  display: flex;
  gap: 30px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.github-stat {
  text-align: center;
}

.github-stat .stat-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.github-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Notes Preview (main page) --- */
.notes-intro {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 24px;
}

.notes-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note-preview-card {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.note-preview-card:hover {
  border-color: var(--accent);
}

.note-preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.note-preview-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.note-preview-tags {
  display: flex;
  gap: 6px;
}

.note-preview-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
}

.note-preview-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

.note-preview-card:hover h3 {
  color: var(--accent);
}

.note-preview-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.notes-view-all {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

.notes-view-all:hover {
  text-decoration: underline;
}

/* --- Zen Mode --- */
body.zen-mode {
  overflow: hidden;
}

body.zen-mode .nav,
body.zen-mode .hero-content,
body.zen-mode section:not(.hero),
body.zen-mode .footer,
body.zen-mode .scroll-progress-container {
  display: none !important;
}

body.zen-mode .hero {
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: flex !important;
}

body.zen-mode .hero-canvas {
  z-index: 0;
  pointer-events: auto;
}

/* --- Scroll Progress Bar --- */
.scroll-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1001;
  background: transparent;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* --- Boid Controls Panel --- */
.boid-btn-row {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  gap: 10px;
}

.boid-controls-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.boid-controls-toggle:hover,
.boid-controls-toggle.active {
  color: var(--accent);
  border-color: var(--accent);
}

.boid-controls-toggle.active {
  transform: rotate(45deg);
}

.boid-controls-toggle svg {
  width: 20px;
  height: 20px;
}

.boid-controls {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 100;
  width: 360px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.boid-controls.open {
  max-height: calc(100vh - 120px);
  opacity: 1;
  transform: translateY(0);
  padding: 20px;
  overflow-y: auto;
}

.boid-controls h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 16px;
}

.boid-controls h4 + h4,
.boid-controls h4:not(:first-of-type) {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.boid-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.boid-control-row label {
  font-size: 0.8rem;
  color: var(--text-primary);
  min-width: 90px;
  flex-shrink: 0;
  white-space: nowrap;
}

.boid-control-row input[type="range"] {
  flex: 1;
  margin: 0 8px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.boid-control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.boid-control-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.boid-control-value {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.boid-controls-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.boid-controls-reset,
.boid-controls-randomize {
  flex: 1;
  padding: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.boid-controls-reset:hover,
.boid-controls-randomize:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 480px) {
  .boid-controls {
    right: 12px;
    width: calc(100vw - 24px);
  }
  .boid-btn-row {
    right: 12px;
    bottom: 12px;
  }
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  border-radius: 4px;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

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

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

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8e8ed;
  --text-primary: #374151;
  --text-heading: #0a0a0f;
  --text-muted: #6b7280;
  --accent: #0d9488;
  --accent-dim: rgba(13, 148, 136, 0.1);
  --border: #d1d5db;
}

[data-theme="light"] #about,
[data-theme="light"] #experience,
[data-theme="light"] #publications,
[data-theme="light"] #projects,
[data-theme="light"] #skills {
  background-color: rgba(245, 245, 247, 0.85);
}

[data-theme="light"] .terminal-header {
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav.scrolled {
  background-color: rgba(245, 245, 247, 0.85);
}

[data-theme="light"] .project-card:hover {
  box-shadow: 0 10px 40px rgba(13, 148, 136, 0.08);
}

[data-theme="light"] .skill-pill:hover {
  box-shadow: 0 0 15px rgba(13, 148, 136, 0.12);
}

[data-theme="light"] .timeline-dot {
  border-color: var(--bg-primary);
  box-shadow: 0 0 10px rgba(13, 148, 136, 0.3);
}

[data-theme="light"] ::selection {
  background-color: rgba(13, 148, 136, 0.2);
  color: #0d9488;
}

/* Theme transition */
body,
.nav,
.project-card,
.terminal,
.skill-pill,
.timeline-content,
.footer {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

/* --- Keyframes --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* --- Selection --- */
::selection {
  background-color: var(--accent-dim);
  color: var(--accent);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  section {
    padding: 60px 0;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-categories {
    grid-template-columns: 1fr;
  }

  .contact-heading {
    font-size: 1.8rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-content {
    padding: 0 16px;
  }

  .hero-greeting {
    font-size: 0.9rem;
  }

  .hero-typing-wrapper {
    font-size: 0.95rem;
  }

  .project-card {
    padding: 24px 20px;
  }

  .contact {
    padding: 60px 16px;
  }
}
