/* ========== 1. Design Tokens ========== */
:root {
  --color-primary: #1a2744;
  --color-accent: #00b4a6;
  --color-accent-dark: #009e92;
  --color-bg: #f8f9fa;
  --color-text: #2d3748;
  --color-white: #ffffff;
  --color-muted: #718096;
  --font-body: 'Inter', sans-serif;
  --font-code: 'Fira Code', monospace;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --max-width: 1100px;
  --transition: 0.3s ease;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

ul {
  list-style: none;
}

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

img {
  max-width: 100%;
  display: block;
}

/* ========== 3. Layout ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2rem;
  text-align: center;
}

/* ========== 4. Header & Nav ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: var(--transition);
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* ========== 5. Hero ========== */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, #243b5e 100%);
  color: var(--color-white);
}

.hero-content {
  max-width: 720px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.hero-bio {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ========== 6. Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

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

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

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

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.btn--disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

/* ========== 7. Skills Matrix ========== */
.skills {
  padding: 5rem 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.skill-group {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.skill-category {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.skill-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent-dark);
  background: rgba(0, 180, 166, 0.08);
  border: 1px solid rgba(0, 180, 166, 0.25);
  border-radius: 999px;
}

/* ========== 8. Projects ========== */
.projects {
  padding: 5rem 0;
  background: var(--color-white);
}

.section-subtitle {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-top: -1rem;
  margin-bottom: 2.5rem;
}

.section-subtitle a {
  color: var(--color-accent);
  font-weight: 600;
}

.section-subtitle a:hover {
  text-decoration: underline;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.project-card-body {
  padding: 2rem;
  flex: 1;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.project-problem {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.project-solution {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tech-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-primary);
  background: rgba(26, 39, 68, 0.06);
  border: 1px solid rgba(26, 39, 68, 0.15);
  border-radius: 999px;
}

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

/* Subsection title */
.subsection-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin: 3rem 0 1.5rem;
}

/* Compact project grid */
.projects-grid-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.project-card-compact {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition);
}

.project-card-compact:hover {
  box-shadow: var(--shadow-card-hover);
}

.project-title-sm {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-card-compact .project-links {
  margin-top: 1rem;
}

.project-media {
  padding: 1.5rem 2rem 2rem;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  max-width: 480px;
  background: rgba(26, 39, 68, 0.04);
  border: 2px dashed rgba(26, 39, 68, 0.15);
  border-radius: var(--radius);
  color: var(--color-muted);
}

.placeholder-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
}

.video-placeholder p {
  font-size: 0.85rem;
}

.project-video {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  background: #000;
}

/* ========== 9. Timeline ========== */
.timeline {
  padding: 5rem 0;
}

.timeline-track {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  padding-left: 2rem;
}

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

.timeline-item {
  position: relative;
}

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

.timeline-year {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.timeline-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
}

.timeline-content p {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ========== 10. Footer ========== */
.footer {
  padding: 4rem 0 2rem;
  background: var(--color-primary);
  color: var(--color-white);
  text-align: center;
}

.footer .section-title {
  color: var(--color-white);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--color-accent);
  font-weight: 500;
  transition: opacity var(--transition);
}

.footer-links a:hover {
  opacity: 0.8;
}

.footer-location {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* ========== 11. Animations ========== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== 12. Media Queries ========== */

/* Mobile nav */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-primary);
    padding: 1rem 1.5rem;
    gap: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

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

  .nav-links li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-ctas {
    flex-direction: column;
  }

  .hero-ctas .btn {
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

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

  .project-card {
    flex-direction: row;
  }

  .project-media {
    display: flex;
    align-items: center;
    padding: 2rem;
    min-width: 320px;
  }

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

  .timeline-track {
    flex-direction: row;
    justify-content: space-between;
    padding-left: 0;
    padding-top: 2.5rem;
    gap: 0;
  }

  .timeline-track::before {
    left: 0;
    right: 0;
    top: 5px;
    bottom: auto;
    width: auto;
    height: 2px;
  }

  .timeline-item {
    flex: 1;
    text-align: center;
  }

  .timeline-item::before {
    left: 50%;
    top: -2.5rem;
    transform: translateX(-50%);
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 2rem;
  }
}
