/* Design Tokens */
:root {
  --bg: #0f1115;
  --surface: #151821;
  --text: #e8ecf2;
  --muted: #A6AEC1;
  --accent: #39d98a;
  --link: #7cc7ff;
  --stroke: #212632;
  --focus: #62f1b1;
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #059669;
    --link: #0284c7;
    --stroke: #e2e8f0;
    --focus: #047857;
  }
}

/* Base Reset */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
  margin: 0 0 1rem 0;
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Focus States */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .cursor::after {
    animation: none !important;
  }
}

/* Utility Classes */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

@media (max-width: 768px) {
  .section {
    padding: 2rem 0;
  }
}

/* Terminal Component Styles */
.terminal {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.cursor::after {
  content: '▊';
  color: var(--accent);
  animation: caret 1s steps(1, end) infinite;
}

@keyframes caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Card Styles */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-secondary {
  border-color: var(--stroke);
  color: var(--muted);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--muted);
  transition: all 0.2s ease;
}

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

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Header Styles */
.header {
  position: sticky;
  top: 0;
  background: rgba(15, 17, 21, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke);
  z-index: 100;
  padding: 1rem 0;
}

@media (prefers-color-scheme: light) {
  .header {
    background: rgba(248, 250, 252, 0.95);
  }
}

/* Navigation Active States */
.header nav a[aria-current="page"] {
  color: var(--accent) !important;
  font-weight: 500;
}

.header nav a[aria-current="page"]:hover {
  color: var(--accent) !important;
}

/* Mobile Menu Styles */
.burger-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.burger-line {
  width: 100%;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.burger-menu-btn.active .burger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu-btn.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-menu-btn.active .burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--stroke);
  padding: 1rem 0;
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 99;
}

.mobile-menu:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0.375rem;
  margin: 0 1rem;
}

.mobile-nav-link:hover {
  color: var(--text);
  background: var(--surface);
}

.mobile-nav-link[aria-current="page"] {
  color: var(--accent);
  background: var(--surface);
  font-weight: 500;
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }
}

/* Footer Styles */
.footer {
  border-top: 1px solid var(--stroke);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--muted);
}

/* Social Icons */
.social-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.social-icon:hover {
  opacity: 1;
}

/* Image Styles */
.portrait {
  border-radius: 12px;
  border: 2px solid var(--stroke);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.portrait:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}

/* Section Headings */
.section-heading {
  margin-bottom: 3rem;
}

.eyebrow {
  color: var(--accent);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

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

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-2rem + 1px - 6px);
  top: 0.5rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg);
}
