@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* =====================
   CSS Variables
===================== */
:root {
  --bg-dark: #0b0e14;
  --bg-gradient: linear-gradient(135deg, #0b0e14 0%, #1e1b4b 50%, #0f172a 100%);
  --cover: #1e1b4b;
  --cover2: #0f172a;
  --paper: #ffffff;
  --ink: #111;
  --muted: #64748b;
  --accent: #c4b5fd;
  --accent-light: #ddd6fe;
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.3);
  --rule: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.35);
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(255, 255, 255, 0.08);
  --nav-width-collapsed: 60px;
  --nav-width-expanded: 200px;
}


/* =====================
   Reset
===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--accent);
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

ul {
  list-style: none;
}


/* =====================
   Landing Page
===================== */
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  padding: 24px;
}

.landing-card {
  text-align: center;
  padding: 64px 48px;
  max-width: 480px;
  border-radius: 15px;
}

.landing-name {
  font-size: 2.8rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.landing-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
}

.landing-tagline {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 40px;
}

.landing-cta {
  display: inline-block;
  padding: 14px 36px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.landing-cta:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px var(--primary-glow);
}


/* =====================
   Main Site Layout
===================== */
.main-site {
  height: 100vh;
  overflow: hidden;
  background: var(--bg-gradient);
  position: relative;
}

.content {
  margin-left: var(--nav-width-collapsed);
  padding: 0;
  height: 100vh;
  position: relative;
  transition: margin-left 0.3s ease;
}

/* Main Page Particle Canvas */
#particles-main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}


/* =====================
   Side Navigation
===================== */
.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width-collapsed);
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  z-index: 100;
  overflow: hidden;
  transition: width 0.3s ease;
}


.side-nav:hover {
  width: var(--nav-width-expanded);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  color: var(--accent-light);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #fff;
  border-left-color: var(--primary);
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-label {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.side-nav:hover .nav-label {
  opacity: 1;
}



/* =====================
   Sections (Snap-Scroll)
===================== */
.section {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s ease;
  z-index: 1;
}


/* Active section */
.section.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Fade out animation (going away) */
.section.fade-out {
  opacity: 0;
  visibility: visible;
}

.section.fade-out.slide-up {
  transform: translateY(-30px);
}

.section.fade-out.slide-down {
  transform: translateY(30px);
}

/* Fade in animation (coming in) */
.section.fade-in {
  visibility: visible;
}

.section.fade-in.from-below {
  opacity: 1;
  transform: translateY(0);
  animation: slideFromBelow 0.6s ease forwards;
}

.section.fade-in.from-above {
  opacity: 1;
  transform: translateY(0);
  animation: slideFromAbove 0.6s ease forwards;
}

@keyframes slideFromBelow {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideFromAbove {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-inner {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 20px;
}

/* Custom scrollbar for section content */
.section-inner::-webkit-scrollbar {
  width: 6px;
}

.section-inner::-webkit-scrollbar-track {
  background: transparent;
}

.section-inner::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 3px;
}

.section-inner::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.5);
}

.section-heading {
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.section-intro {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 600px;
}


/* =====================
   Buttons
===================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-icon {
  width: 18px;
  height: 18px;
}


/* =====================
   Education Cards
===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.edu-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--primary-glow);
}

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.edu-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.edu-date {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.edu-school {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.edu-gpa {
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.edu-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.edu-link {
  font-size: 0.9rem;
  font-weight: 500;
}


/* =====================
   About Section
===================== */
.about-meta {
  display: grid;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.meta-item {
  display: flex;
  gap: 16px;
}

.meta-item strong {
  color: var(--muted);
  font-weight: 500;
  min-width: 140px;
  flex-shrink: 0;
}

.meta-item span {
  color: var(--accent-light);
}

/* About Section Layout */
.about-layout {
  display: flex;
  gap: 60px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.about-text {
  flex: 1;
  min-width: 0;
}

.about-text p {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 20px;
  line-height: 1.7;
}

.about-photo {
  flex-shrink: 0;
  width: 220px;
}

.profile-img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--card-border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.profile-img:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px var(--primary-glow);
}

/* Hockey Easter Egg */
.hockey-easter-egg {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  cursor: pointer;
}

.hockey-easter-egg:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--primary), 0 0 16px var(--primary), 0 0 24px var(--primary);
}

/* Responsive About Layout */
@media (max-width: 900px) {
  .about-layout {
    flex-direction: column-reverse;
    gap: 32px;
    align-items: center;
  }

  .about-photo {
    width: 200px;
  }

  .about-text {
    text-align: center;
  }

  .about-meta {
    text-align: left;
  }
}


/* =====================
   Skills Section
===================== */
.skill-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.skill-category h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
}

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

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.skill-tag:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-2px);
}


/* =====================
   Experience Timeline
===================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.timeline-item {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--card-border);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

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

.timeline-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.timeline-bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  list-style: disc;
}

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


/* =====================
   Contact Section
===================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--accent);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.contact-item:hover {
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--primary-glow);
}

.contact-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.resume-btn {
  margin-top: 16px;
}


/* =====================
   Footer
===================== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: var(--nav-width-collapsed);
  right: 0;
  padding: 20px 60px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.site-footer.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.footer-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-links svg {
  width: 22px;
  height: 22px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--muted);
}


/* =====================
   Modal
===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.modal-content {
  position: relative;
  width: 90vw;
  max-width: 1200px;
  height: 80vh;
  max-height: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-close svg {
  width: 24px;
  height: 24px;
  color: #fff;
}


/* =====================
   Flipbook (in modal)
===================== */
.flipbook {
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 720px;
  border-radius: 12px;
}

.flipbook .page,
.flipbook .hard {
  border-radius: 6px;
  overflow: hidden;
}

/* Hard covers */
.flipbook .hard {
  background: linear-gradient(145deg, var(--cover), var(--cover2)) !important;
  color: #f8fafc;
  border: none;
  position: relative;
}

.flipbook .hard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.35));
  box-shadow: inset -1px 0 rgba(255,255,255,0.08);
  opacity: 0.9;
  pointer-events: none;
}

.flipbook .hard::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,0.06), transparent 55%),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.03),
      rgba(255,255,255,0.03) 1px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 7px
    );
  opacity: 0.35;
  pointer-events: none;
}

.cover-inner {
  height: 100%;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.cover-inner h1 {
  font-size: 2.2rem;
  letter-spacing: 1px;
}

.cover-inner h2 {
  font-size: 1.05rem;
  font-weight: 500;
  opacity: 0.9;
}

.cover-subtitle {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--accent);
}

.cover-note {
  margin-top: 18px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.inside-cover {
  background: #0b1220 !important;
}

/* Paper pages */
.flipbook .page {
  background: var(--paper);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(0,0,0,0.03), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(0,0,0,0.025), transparent 55%),
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,0.015),
      rgba(0,0,0,0.015) 1px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 10px
    );
}

.page-inner {
  height: 100%;
  padding: 46px 52px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Project pages */
.project-page .page-inner {
  color: var(--ink);
}

.project-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.project-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.project-desc {
  font-size: 0.85rem;
  color: #333;
  line-height: 1.5;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.project-tech span {
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Visual page (right side) */
.project-visual {
  justify-content: center;
  align-items: center;
}

.project-placeholder {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Wrapper that frames the video with a label and subtle border */
.video-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Outer frame: dark background echoes game/media context */
.video-frame {
  background: #111;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.project-video {
  width: 100%;
  max-height: 260px;
  border-radius: 6px;
  background: #0a0a0a;
  object-fit: contain;
  display: block;
}

/* Photo grid for project pages */
.project-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.grid-photo {
  margin: 0;
}

.grid-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  background: #0a0a0a;
}

.grid-photo figcaption {
  font-size: 0.65rem;
  color: var(--text-muted, #888);
  text-align: center;
  margin-top: 4px;
}

/* Clickable photo hint */
.grid-photo img {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.grid-photo img:hover {
  opacity: 0.85;
}

/* Photo Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  color: #ccc;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin-top: 16px;
  color: #ccc;
  font-size: 0.95rem;
  text-align: center;
}

/* Inline screenshot below project description */
.project-inline-photo {
  width: 100%;
  max-height: 120px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top;
  margin-top: 16px;
}

.project-links {
  display: flex;
  gap: 20px;
  margin-top: 24px;
}

.project-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Turn.js polish */
.flipbook .page,
.flipbook .hard {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}


/* =====================
   Coursework Page
===================== */
.coursework-page {
  min-height: 100vh;
  background: var(--bg-gradient);
  padding: 80px 60px;
}

.coursework-header {
  max-width: 900px;
  margin: 0 auto 48px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--primary);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

.coursework-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.coursework-header p {
  color: var(--muted);
}

.coursework-content {
  max-width: 900px;
  margin: 0 auto;
}

.course-group {
  margin-bottom: 48px;
}

.course-group h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.course-list {
  display: grid;
  gap: 12px;
}

.course-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  transition: border-color 0.2s ease;
}

.course-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.course-info {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.course-code {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 90px;
}

.course-name {
  font-size: 0.95rem;
  color: var(--accent);
}

.course-link {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.course-link:hover {
  color: var(--primary);
}


/* =====================
   Responsive
===================== */
@media (max-width: 1024px) {
  .section {
    padding: 40px 60px;
  }


  .site-footer {
    padding: 16px 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-width-collapsed: 0px;
  }

  .side-nav {
    width: 60px;
    padding: 12px 0;
  }

  .nav-item {
    padding: 10px 18px;
  }

  .nav-label {
    display: none;
  }

  .side-nav:hover {
    width: 60px;
  }

  .content {
    margin-left: 60px;
  }

  .section {
    padding: 30px 20px;
  }


  .section-inner {
    max-height: calc(100vh - 120px);
    padding: 16px;
  }

  .section-heading {
    font-size: 1.6rem;
  }

  .landing-name {
    font-size: 2.2rem;
  }

  .landing-card {
    padding: 48px 32px;
  }

  .site-footer {
    left: 60px;
    padding: 16px 24px;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .modal-content {
    width: 95vw;
    height: 60vh;
  }

  .modal-close {
    top: -40px;
  }

  .coursework-page {
    padding: 48px 24px;
  }

  .course-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .course-info {
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .side-nav {
    display: none;
  }

  .content {
    margin-left: 0;
  }

  .section {
    padding: 20px 16px;
  }


  .site-footer {
    left: 0;
  }

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .edu-header {
    flex-direction: column;
    gap: 4px;
  }

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

  .skill-icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
  }

  .skill-tag {
    font-size: 0.8rem;
    padding: 5px 10px;
  }
}


/* =====================
   Landing Animations
===================== */

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

/* Landing card sits above particles */
.landing-card {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.landing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px var(--primary-glow);
}

/* Fade-slide-up animation */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation class */
.anim-fade-up {
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards;
}

/* Staggered delays */
.landing-name.anim-fade-up {
  animation-delay: 0.3s;
}

.landing-title.anim-fade-up {
  animation-delay: 0.6s;
}

.landing-tagline.anim-fade-up {
  animation-delay: 0.9s;
}

.landing-cta.anim-fade-up {
  animation-delay: 1.2s;
}

/* Button Particle Canvas */
.button-container {
  position: relative;
  display: inline-block;
}

#buttonParticles {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

/* Modal Loading Spinner */
.modal-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-loader.active {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--card-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-loader p {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Stagger Animations for Section Content */
.stagger-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--stagger-delay, 0) * 0.1s);
}

.stagger-animate.animate-in {
  opacity: 1;
  transform: translateY(0);
}


/* =====================
   Reduced Motion
===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .flipbook {
    transition: none !important;
    transform: none !important;
  }

  /* Show landing elements immediately without animation */
  .anim-fade-up {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Disable particle canvas */
  #particles,
  #particles-main,
  #buttonParticles {
    display: none !important;
  }

  /* Disable stagger animations */
  .stagger-animate {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Instant section transitions */
  .section {
    transition: none !important;
  }

  .section.fade-in.from-below,
  .section.fade-in.from-above {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
