/* =========================================
   1. Variables & Theme Tokens
   ========================================= */
:root {
  --bg: #0c0d10;
  --surface: #13151a;
  --surface-hover: #191c23;
  --border: #232730;
  --text: #eceef2;
  --text-muted: #8b92a0;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --font-sans: 'Varela Round', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-tags: 'Nunito', sans-serif;
  --radius: 6px;
  --max-w: 880px;
}

[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #0284c7;
  --accent-dim: rgba(2, 132, 199, 0.08);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mono {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================
   3. Sticky Navigation
   ========================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

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

.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* =========================================
   4. Hero Section
   ========================================= */
.hero {
  padding: 84px 0 72px;
  border-bottom: 1px solid var(--border);
}

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

.hero-bio {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 32px;
}

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

.btn-primary, .btn-secondary {
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background-color: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent);
  color: var(--bg);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--text-muted);
}

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

/* =========================================
   5. Sections & Shared Headers
   ========================================= */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 32px;
}

.section-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
}

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

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-text strong {
  color: var(--text);
  font-weight: 500;
}

.skills-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.skills-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.skills-list li {
  font-family: var(--font-tags);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text);
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* =========================================
   7. Background / Experience Tabs
   ========================================= */
.tabs-container {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}

.tab-list {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}

.tab-btn {
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  padding: 10px 16px;
  text-align: left;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

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

.tab-btn.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background-color: var(--accent-dim);
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

.panel-header .accent {
  color: var(--accent);
}

.panel-date {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.panel-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 14px;
}

.panel-bullets li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* =========================================
   8. Software Grid
   ========================================= */
.software-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

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

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

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

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

.card-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.tag {
  font-family: var(--font-tags);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

/* =========================================
   9. Visual / Art Archive Grid
   ========================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.art-item {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

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

.art-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-tile {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  background: var(--surface);
  color: var(--text-muted);
}

.video-badge {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.art-label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 6px 8px;
  font-size: 10px;
  background: rgba(12, 13, 16, 0.85);
  color: #eceef2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.art-item:hover .art-label {
  opacity: 1;
}

.art-more-wrap {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

/* =========================================
   10. Footer & Lightbox Modal
   ========================================= */
.footer {
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

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

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.lightbox-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

.lightbox-media img,
.lightbox-media video {
  max-width: 85vw;
  max-height: 75vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

.lightbox-caption {
  align-self: flex-start;
  font-size: 12px;
  color: #d1d5db;
}

/* =========================================
   11. Responsive Breakpoints
   ========================================= */
@media (max-width: 768px) {
  .about-grid,
  .tabs-container,
  .software-grid {
    grid-template-columns: 1fr;
  }

  .tab-list {
    flex-direction: row;
    overflow-x: auto;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }

  .tab-btn {
    border-left: none;
    border-bottom: 2px solid transparent;
    margin-left: 0;
    margin-bottom: -1px;
    white-space: nowrap;
  }

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

  .art-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
