/* ============================================
   BASE & RESET
============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #0a0a0a;
  --bg-surface:   #111111;
  --bg-elevated:  #1a1a1a;
  --border:       #222222;
  --border-hover: #333333;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted:   #555555;
  --accent:       #4f8ef7;
  --accent-dim:   #1a2d4f;
  --tag-ai:       #1a3a2a;
  --tag-ai-text:  #4caf82;
  --tag-sec:      #3a1a1a;
  --tag-sec-text: #e07070;
  --tag-algo:     #2a2a1a;
  --tag-algo-text:#d4b84a;
  --tag-aws:      #1a2a3a;
  --tag-aws-text: #5b9bd5;
  --tag-stoic:    #2a1a3a;
  --tag-stoic-text:#b07fd4;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:       6px;
  --transition:   150ms ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.8;
}

/* ============================================
   LAYOUT
============================================ */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 80px 0 120px;
}

/* ============================================
   NAV
============================================ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  transition: color var(--transition);
}

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
}

/* ============================================
   HERO
============================================ */
.hero {
  padding: 80px 0 60px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero h1 .dim {
  color: var(--text-muted);
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #3d7de8;
  opacity: 1;
}

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

.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  opacity: 1;
}

/* ============================================
   SECTION HEADERS
============================================ */
.section-header {
  margin-bottom: 40px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-desc {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 480px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 60px 0;
}

/* ============================================
   CARDS
============================================ */
.card-grid {
  display: grid;
  gap: 16px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition), background var(--transition);
  cursor: default;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-link {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--transition);
}

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

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.tag-ai     { background: var(--tag-ai);    color: var(--tag-ai-text); }
.tag-sec    { background: var(--tag-sec);   color: var(--tag-sec-text); }
.tag-algo   { background: var(--tag-algo);  color: var(--tag-algo-text); }
.tag-aws    { background: var(--tag-aws);   color: var(--tag-aws-text); }
.tag-stoic  { background: var(--tag-stoic); color: var(--tag-stoic-text); }
.tag-default{ background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================
   SKILLS GRID
============================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.skill-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.skill-group-title {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-list li {
  font-size: 13px;
  color: var(--text-secondary);
}

.skill-list li::before {
  content: '—  ';
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ============================================
   PROJECT CATEGORY TABS
============================================ */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  font-family: var(--font-sans);
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================
   STOICISM PAGE
============================================ */
.quote-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--tag-stoic-text);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}

.quote-card:hover {
  border-color: var(--border-hover);
  border-left-color: var(--tag-stoic-text);
}

.quote-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 16px;
}

.quote-source {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.reflection {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  line-height: 1.75;
}

/* ============================================
   CONTACT
============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition);
}

.contact-item:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  opacity: 1;
}

.contact-icon {
  font-size: 16px;
  opacity: 0.6;
}

/* ============================================
   FOOTER
============================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text-secondary);
  opacity: 1;
}

/* ============================================
   ABOUT PAGE
============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

.about-body p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.85;
  margin-bottom: 16px;
}

.about-body p:last-child {
  margin-bottom: 0;
}

.about-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 640px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

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

  .nav-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 28px;
  }

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