/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES - Edit these for easy theming
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Light theme colors */
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-hover: #e8e8ed;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --muted: #86868b;
  --border: #d2d2d7;
  --accent: #0071e3; /* Change this to your preferred accent color */
  --accent-hover: #0077ed;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.12);

  /* Spacing & sizing */
  --nav-height: 48px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --container-max: 1120px;
  --section-padding: 80px;

  /* Typography */
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                  Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono",
               "Courier New", monospace;
}

[data-theme="dark"] {
  --bg: #000000;
  --surface: #1d1d1f;
  --surface-hover: #2d2d2f;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --muted: #6e6e73;
  --border: #424245;
  --accent: #2997ff;
  --accent-hover: #409eff;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-lg: rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-system);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--accent);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .nav {
  background: rgba(0, 0, 0, 0.8);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.nav-brand:hover {
  opacity: 0.7;
}

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

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--text);
  outline: none;
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Theme toggle */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 50px;
  height: 26px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  padding: 0;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

.theme-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Toggle slider circle */
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle {
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .theme-toggle::after {
  transform: translate(24px, -50%);
  background: white;
}

/* Mobile menu toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
  font-size: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT & CONTAINERS
   ═══════════════════════════════════════════════════════════════ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--section-padding) 0;
  min-height: 400px;
}

.section-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 21px;
  color: var(--text-secondary);
  margin-bottom: 48px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════ */
#hero {
  padding-top: calc(var(--nav-height) + 120px);
  padding-bottom: 120px;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 28px;
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-weight: 400;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

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

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 32px;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-lg);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════════════════════════ */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.about-text {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   PROJECTS SECTION
   ═══════════════════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.project-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.project-links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.project-link {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.project-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   SKILLS SECTION
   ═══════════════════════════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  transition: all 0.3s ease;
}

.skill-category:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--shadow);
}

.skill-category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s ease;
}

.skill-tag:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   EXPERIENCE SECTION (Timeline)
   ═══════════════════════════════════════════════════════════════ */
.timeline {
  max-width: 800px;
  margin: 48px auto 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline-item {
  position: relative;
  padding-left: 32px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 5.5px;
  top: 20px;
  bottom: -24px;
  width: 1px;
  background: var(--border);
}

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

.timeline-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.timeline-date {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.timeline-company {
  font-size: 16px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   EDUCATION SECTION
   ═══════════════════════════════════════════════════════════════ */
.education-grid {
  max-width: 800px;
  margin: 48px auto 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.education-card {
  text-align: left;
}

.education-degree {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.education-school {
  font-size: 18px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 4px;
}

.education-date {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 16px;
}

.education-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   CONTACT SECTION
   ═══════════════════════════════════════════════════════════════ */
#contact {
  background: var(--surface);
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 32px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--font-system);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

[data-theme="dark"] .form-input:focus {
  box-shadow: 0 0 0 3px rgba(41, 151, 255, 0.1);
}

.form-input::placeholder {
  color: var(--muted);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn {
  width: 100%;
  margin-top: 8px;
}

.form-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  text-align: center;
  display: none;
}

.form-status.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-status.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

[data-theme="dark"] .form-status.success {
  background: rgba(40, 167, 69, 0.2);
  color: #7dcea0;
  border-color: rgba(40, 167, 69, 0.3);
}

[data-theme="dark"] .form-status.error {
  background: rgba(220, 53, 69, 0.2);
  color: #f1948a;
  border-color: rgba(220, 53, 69, 0.3);
}

.contact-info {
  text-align: center;
  margin-bottom: 32px;
}

.contact-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.contact-email-link {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
}

.contact-email-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
    --nav-height: 56px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    box-shadow: 0 8px 24px var(--shadow-lg);
  }

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

  .mobile-toggle {
    display: block;
  }

  .hero-title {
    font-size: 48px;
  }

  .hero-subtitle {
    font-size: 21px;
  }

  .section-title {
    font-size: 36px;
  }

  .section-subtitle {
    font-size: 18px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */
@media print {
  .nav,
  .theme-toggle,
  .mobile-toggle {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  section {
    page-break-inside: avoid;
    padding: 20px 0;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}
