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

:root {
  --bg: #0a0a0a;
  --bg-light: #111;
  --text: #e0e0e0;
  --text-muted: #aaa;
  --primary: #00ff41;
  --accent: #00d4ff;
  --border: #222;
  --card-bg: #0f0f0f;
  --font-mono: 'JetBrains Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Typography ===== */
h1, h2, h3 {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: var(--primary);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.5);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Header ===== */
.header {
  padding: 2rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.name {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.title {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}

.contact-links a:hover {
  border-color: var(--primary);
  background: rgba(0, 255, 65, 0.05);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.contact-links span {
  display: none;
}

@media (min-width: 480px) {
  .contact-links span {
    display: inline;
  }
}

/* ===== Terminal ===== */
.terminal-section {
  padding: 2rem 1rem;
}

.terminal {
  max-width: 600px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-light);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

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

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

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

.terminal-body {
  padding: 1rem;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
}

.terminal-output {
  margin-bottom: 1rem;
}

.terminal-output .line {
  margin-bottom: 0.25rem;
}

.terminal-output .command {
  color: var(--accent);
}

.terminal-output .response {
  color: var(--text);
  white-space: pre-wrap;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prompt {
  color: var(--primary);
  font-weight: bold;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  outline: none;
  caret-color: var(--primary);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  background: var(--primary);
  animation: blink 1s step-end infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.terminal-input:focus + .cursor {
  display: none;
}

.terminal-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
}

.terminal-buttons button {
  flex: 1;
  min-width: 80px;
  padding: 0.75rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.terminal-buttons button:hover,
.terminal-buttons button:focus {
  border-color: var(--primary);
  background: rgba(0, 255, 65, 0.1);
  color: var(--primary);
  outline: none;
}

/* Hide buttons on desktop, show input */
@media (min-width: 768px) {
  .terminal-buttons {
    display: none;
  }
}

/* ===== Sections ===== */
.section {
  padding: 3rem 1rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.project-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
}

@media (min-width: 600px) {
  .project-card.featured {
    grid-column: span 2;
  }
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.project-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.project-card p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tags span {
  padding: 0.25rem 0.5rem;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent);
}

/* ===== Timeline ===== */
.timeline {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  padding-left: 2rem;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  transform: translateX(-5px);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.timeline-content .role {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.timeline-content .period {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.timeline-content ul {
  list-style: none;
}

.timeline-content li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.timeline-content li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 480px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.skill-category h3 {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
  text-shadow: none;
}

.skill-category ul {
  list-style: none;
}

.skill-category li {
  padding: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Associations ===== */
.association,
.interests {
  max-width: 700px;
  margin: 0 auto 2rem;
}

.association h3,
.interests h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.association .role {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.association ul {
  list-style: none;
}

.association li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.association li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--primary);
}

.interests p {
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.footer {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Scan Line Effect (subtle) ===== */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.03),
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
}
