/* ============================================ */
/* CORE — Reset, Layout, Theme Switcher        */
/* Theme-agnostic structural styles            */
/* ============================================ */

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

body {
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  transition: color 0.2s ease;
}

ul, ol { list-style: none; }

/* ============================================ */
/* THEME CANVAS + OVERLAY                      */
/* ============================================ */

#theme-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#theme-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: none;
}

#theme-overlay.active {
  display: block;
  pointer-events: all;
}

/* ============================================ */
/* LAYOUT                                      */
/* ============================================ */

.section {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  background: var(--section-bg, transparent);
}

.section-container {
  max-width: 1100px;
  width: 100%;
  position: relative;
}

.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
}

.hero-contact-bar {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 16px;
  z-index: 10;
}

.hero-center {
  text-align: center;
  z-index: 2;
}

.hero-name-wrapper {
  margin-bottom: 16px;
}

.hero-metrics {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

/* Overview */
.overview-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.overview-core {
  max-width: 700px;
  width: 100%;
  text-align: center;
  padding: 32px;
}

.overview-satellites {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 900px;
}

/* Timeline */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 40px;
  margin-bottom: 48px;
}

.timeline-item:last-child { margin-bottom: 0; }
.timeline-right { margin-left: 50%; }
.timeline-left { margin-right: 50%; }

/* Grids */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skill-category {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

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

.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.contact-channels {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#contact .section-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Spec rows */
.spec-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  font-size: 13px;
}

/* ============================================ */
/* THEME SWITCHER                              */
/* ============================================ */

.theme-switcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.theme-switcher-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}

.theme-switcher-toggle:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.85);
}

.switcher-icon {
  display: flex;
  align-items: center;
}

.theme-switcher-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(10,10,20,0.92);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.theme-switcher-panel[hidden] { display: none; }

.switcher-title {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
  padding: 4px 8px 8px;
}

.theme-switcher-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.theme-switcher-panel button:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.theme-switcher-panel button.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.swatch {
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0;
}

.swatch::before,
.swatch::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.swatch::before { background: var(--s1); border: 1px solid rgba(255,255,255,0.1); }
.swatch::after { background: linear-gradient(135deg, var(--s2), var(--s3)); }

.reset-btn {
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 0 0 6px 6px !important;
  font-size: 11px !important;
  color: rgba(255,255,255,0.4) !important;
}

/* ============================================ */
/* NAVIGATION (structural)                     */
/* ============================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  backdrop-filter: blur(12px);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.site-nav.visible {
  transform: translateY(0);
}

.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

/* ============================================ */
/* SCROLL REVEAL (initial hidden state)        */
/* ============================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

.section-label,
.section-title {
  opacity: 0;
  transform: translateY(20px);
}

/* ============================================ */
/* SITE FOOTER (structural)                    */
/* ============================================ */

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 24px;
  font-size: 11px;
}

/* ============================================ */
/* RESUME MODAL                                */
/* ============================================ */

button.download-btn {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

.resume-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.resume-modal.active {
  display: flex;
}

.resume-modal-content {
  position: relative;
  max-width: 420px;
  width: 90%;
  padding: 40px 32px;
  border-radius: 12px;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.resume-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.resume-modal-close:hover { color: #fff; }

.resume-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.resume-modal-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 24px;
}

.resume-modal-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: #0A66C2;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.2s, transform 0.2s;
}

.resume-modal-link:hover {
  background: #004182;
  color: #fff;
  transform: translateY(-1px);
}

/* ============================================ */
/* RESPONSIVE — STRUCTURAL                     */
/* ============================================ */

/* Ultra-wide (1600px+) */
@media (min-width: 1600px) {
  .section-container { max-width: 1300px; }
  .section { padding: 120px 48px; }
  .hero-metrics { gap: 48px; }
  .achievements-grid { gap: 32px; }
}

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .section-container { max-width: 1200px; }
}

/* Small Desktop / Large Tablet Landscape (1024-1199px) */
@media (max-width: 1199px) {
  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .achievements-grid .achievement-card:last-child {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
  }
  .skill-category {
    flex-direction: column;
    gap: 8px;
  }
  .section { padding: 80px 24px; }
}

/* Tablet Portrait (768-1023px) */
@media (max-width: 1023px) {
  .hero-name { font-size: clamp(2rem, 6vw, 4rem); }
  .hero-title { font-size: clamp(0.75rem, 2vw, 1rem); }
  .overview-satellites { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .education-grid { grid-template-columns: 1fr; }
  .hero-contact-bar { gap: 12px; }
  .timeline-item { padding: 0 24px; }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
  .section {
    padding: 60px 16px;
    min-height: auto;
  }
  .site-nav { padding: 8px 12px; }
  .hero-section {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 16px 80px;
  }
  .hero-contact-bar {
    position: relative;
    top: auto;
    right: auto;
    justify-content: center;
    margin-bottom: 24px;
  }
  .hero-metrics {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .hero-name { font-size: clamp(1.8rem, 8vw, 3rem); }
  .hero-title { font-size: clamp(0.65rem, 2.5vw, 0.9rem); }
  .scroll-indicator { bottom: 16px; }
  .overview-satellites { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .timeline-item {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 40px;
    padding-right: 0;
  }
  .achievements-grid { grid-template-columns: 1fr; }
  .achievements-grid .achievement-card:last-child { max-width: none; }
  .skill-category { flex-direction: column; gap: 8px; }
  .education-grid { grid-template-columns: 1fr; }
  .site-footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    font-size: 9px;
  }
  .footer-sep { display: none; }
  .spec-row { flex-direction: column; gap: 2px; }
  .theme-switcher-toggle { padding: 6px 10px; font-size: 10px; }
  .theme-switcher-panel { min-width: 190px; }
  .overview-core { padding: 20px 16px; }
}

/* Small Mobile (max 479px) */
@media (max-width: 479px) {
  .overview-satellites { grid-template-columns: 1fr 1fr; }
  .hero-section { padding: 32px 12px 60px; }
  .hero-name { font-size: clamp(1.5rem, 10vw, 2.5rem); }
  .hero-contact-bar { gap: 8px; }
  .hero-contact-item span { font-size: 9px; }
  .section { padding: 48px 12px; }
  .nav-link { font-size: 10px; padding: 4px 8px; }
  .timeline-item { padding-left: 30px; }
  .theme-switcher { bottom: 12px; right: 12px; }
}

/* Dynamic viewport height for mobile browsers */
@supports (height: 100dvh) {
  .hero-section { min-height: 100dvh; }
}

/* ============================================ */
/* REDUCED MOTION                              */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
