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

:root {
  /* Terminal color palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-elevated: #151515;

  --text-primary: #e5e5e5;
  --text-muted: #989898;
  --text-dim: #8a8a8a;

  --accent-success: #50fa7b;
  --accent-warning: #f39c12;
  --accent-info: #6c9bd1;
  --accent-error: #ff5555;

  --border-subtle: #2a2a2a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Courier New", monospace;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  padding: 30px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Loading Screen */
.loader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  font-family: "Courier New", monospace;
  padding: 20px;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-prompt {
  color: var(--accent-success);
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
}

.loader-output {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: bold;
}

.loader-label {
  color: var(--text-muted);
}

.loader-progress {
  color: var(--accent-success);
  letter-spacing: -1px;
}

.loader-remaining {
  color: var(--text-dim);
  letter-spacing: -1px;
}

.loader-percent {
  color: var(--accent-info);
  min-width: 40px;
  text-align: right;
}

/* Navigation */
.navbar {
  background-color: var(--bg-primary);
  border-bottom: 2px solid var(--border-subtle);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: -20px -20px 40px -20px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-prompt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: bold;
}

.prompt-user {
  color: var(--accent-success);
}

.prompt-separator {
  color: var(--text-muted);
}

.prompt-path {
  color: var(--accent-info);
}

.prompt-symbol {
  color: var(--text-primary);
}

.prompt-command {
  color: var(--text-muted);
}

/* Blinking cursor */
.cursor {
  color: var(--accent-success);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--accent-error);
}

.nav-link::before {
  content: "> ";
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-link:hover::before {
  opacity: 1;
}

/* Hero Section */
.hero {
  padding: 120px 0 80px 0;
  min-height: 30vh;
  display: flex;
  position: relative;
}

/* Parallax sections */
.projects-section,
.experience-section,
.skills-section,
.contact-section {
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

.hero-content {
  margin-bottom: 24px;
}

.hero-name {
  font-size: 48px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 8px;
  margin-bottom: 12px;
  line-height: 1;
  color: var(--text-primary);
}

.hero-handle {
  display: inline-block;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-success);
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-handle:hover {
  color: var(--accent-error);
}

.hero-role {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-info);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero-text p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 800px;
}

/* Projects Section */
.projects-section {
  padding: 100px 0;
}

.section-title {
  font-size: 36px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 40px;
  letter-spacing: 6px;
  color: var(--text-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 32px;
  perspective: 1000px;
}

.project-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 28px;
  transition: all 0.3s ease, transform 0.15s ease-out;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.project-card:hover {
  border-color: var(--accent-warning);
  background-color: var(--bg-elevated);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.project-status {
  padding: 4px 12px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 11px;
  border: 1px solid var(--accent-success);
  color: var(--accent-success);
  border-radius: 3px;
  letter-spacing: 1px;
}

.project-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-info);
}

.project-description {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text-muted);
}

/* Technical Challenge Toggle */
.tech-challenge-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: "Courier New", monospace;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 12px;
  transition: color 0.2s ease;
  display: block;
}

.tech-challenge-toggle:hover {
  color: var(--accent-warning);
}

.tech-challenge-toggle.active {
  color: var(--accent-warning);
}

.tech-challenge-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-bottom: 12px;
}

.tech-challenge-content.expanded {
  max-height: 500px;
}

.tech-challenge-content p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  padding: 12px;
  background-color: var(--bg-primary);
  border-left: 2px solid var(--accent-warning);
  margin-top: 8px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tech-badge {
  color: var(--accent-info);
  font-size: 13px;
  font-weight: normal;
}

.project-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.project-link {
  color: var(--accent-success);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
  position: relative;
}

.project-link:hover {
  color: var(--accent-error);
}

.project-link::before {
  content: "[";
  margin-right: 2px;
}

.project-link::after {
  content: "]";
  margin-left: 2px;
}

/* Experience Section */
.experience-section {
  padding: 100px 0;
}

.timeline {
  margin-top: 32px;
  position: relative;
}

.experience-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 32px;
  margin-bottom: 48px;
  position: relative;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.experience-item::before {
  content: "";
  position: absolute;
  left: 206px;
  top: 0;
  bottom: -48px;
  width: 1px;
  background-color: var(--border-subtle);
}

.experience-item:last-child::before {
  display: none;
}

.exp-date {
  text-align: right;
  padding-top: 4px;
}

.date-range {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.exp-content {
  padding: 24px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.exp-content:hover {
  border-color: var(--accent-warning);
  background-color: var(--bg-elevated);
}

.exp-content::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 8px;
  width: 8px;
  height: 8px;
  background-color: var(--accent-success);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.exp-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--accent-info);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.exp-status {
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.exp-status.active {
  border: 1px solid var(--accent-success);
  color: var(--accent-success);
}

.exp-status.completed {
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
}

.exp-company {
  font-size: 16px;
  font-weight: bold;
  color: var(--accent-success);
  margin-bottom: 8px;
  transition: color 0.2s ease;
  display: inline-block;
  text-decoration: none;
}

.exp-company-private {
  font-size: 16px;
  font-weight: bold;
  color: var(--accent-success);
  margin-bottom: 8px;
  display: inline-block;
}

.exp-company:hover {
  color: var(--accent-error);
}

.exp-location {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.exp-highlights {
  margin: 16px 0;
  padding-left: 20px;
}

.exp-highlights li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.exp-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tech-badge-small {
  color: var(--accent-info);
  font-size: 12px;
}

/* Skills Section */
.skills-section {
  padding: 100px 0;
}

.skill-category {
  margin-bottom: 40px;
}

.skill-category:last-child {
  margin-bottom: 0;
}

.skill-category-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent-info);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.skill-badge {
  padding: 12px 16px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  text-align: center;
  transition: all 0.3s ease;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.skill-badge:hover {
  border-color: var(--accent-warning);
  background-color: var(--bg-elevated);
}

.skill-name {
  font-size: 14px;
  color: var(--text-muted);
}

/* Contact Section */
.contact-section {
  padding: 100px 0 80px 0;
}

.terminal-output {
  margin-top: 32px;
  max-width: 600px;
}

.terminal-line {
  margin-bottom: 16px;
}

.prompt {
  color: var(--accent-success);
  margin-right: 8px;
}

.command {
  color: var(--text-primary);
}

.contact-tree {
  margin-left: 24px;
  margin-top: 16px;
}

.tree-line {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
}

.tree-icon {
  color: var(--text-dim);
  margin-right: 8px;
  font-weight: bold;
}

.contact-label {
  color: var(--text-muted);
  min-width: 80px;
}

.contact-value {
  color: var(--accent-success);
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-value:hover {
  color: var(--accent-error);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 3px;
  transition: border-color 0.2s ease;
}

.mobile-menu-toggle:hover {
  border-color: var(--accent-error);
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 20px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .terminal-prompt {
    font-size: 14px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    right: 20px;
    background-color: var(--bg-secondary);
    padding: 20px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    flex-direction: column;
    gap: 16px;
    min-width: 200px;
  }

  .nav-links.active {
    display: flex;
  }

  .hero-name {
    font-size: 36px;
    letter-spacing: 6px;
  }

  .hero-handle {
    font-size: 18px;
  }

  .section-title {
    font-size: 28px;
    letter-spacing: 4px;
  }

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

  .experience-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .experience-item::before {
    display: none;
  }

  .exp-date {
    text-align: left;
  }

  .exp-content::before {
    display: none;
  }

  .skill-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: 28px;
    letter-spacing: 4px;
  }

  .section-title {
    font-size: 24px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Text scramble animations */
.scramble-text {
  display: inline-block;
  position: relative;
}

.scramble-init {
  opacity: 0;
}

.scramble-ready {
  opacity: 1;
  animation: fadeIn 0.3s ease-in;
}

/* Fade-in for cards */
.project-card,
.experience-item,
.skill-badge {
  animation: fadeIn 0.6s ease;
}

/* Print Styles */
@media print {
  * {
    background: white !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
    padding: 0;
  }

  .navbar,
  .mobile-menu-toggle,
  .tech-challenge-toggle {
    display: none !important;
  }

  .tech-challenge-content {
    max-height: none !important;
    overflow: visible !important;
  }

  .project-card,
  .experience-item,
  .skill-badge,
  .exp-content {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero {
    padding: 20px 0;
    min-height: auto;
  }

  .section-title {
    color: #000 !important;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666 !important;
  }

  .project-links a::after,
  .contact-value::after {
    content: none;
  }

  .projects-grid {
    display: block;
  }

  .project-card {
    margin-bottom: 20px;
  }

  .experience-item {
    display: block;
    margin-bottom: 24px;
  }

  .experience-item::before {
    display: none;
  }

  .skill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .skill-badge {
    padding: 4px 8px;
    font-size: 10pt;
  }
}