/* ===========================
   THEME VARIABLES
=========================== */
:root {
  /* Neutral frosted glass palette (Day) */
  --bg: #e9edf4;
  --bg-alt: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-soft: rgba(255, 255, 255, 0.7);
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --accent: #2563eb;
  --border: rgba(148, 163, 184, 0.6);
  --chip-bg: rgba(243, 244, 246, 0.9);
  --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.18);
}

body.dark {
  /* Neutral dark */
  --bg: #020617;
  --bg-alt: #020617;
  --surface: rgba(15, 23, 42, 0.96);
  --surface-soft: rgba(15, 23, 42, 0.88);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --primary: #60a5fa;
  --primary-soft: #172554;
  --accent: #60a5fa;
  --border: rgba(51, 65, 85, 0.9);
  --chip-bg: #020617;
  --shadow-soft: 0 26px 55px rgba(0, 0, 0, 0.85);
}

/* ===========================
   GLOBAL / BASE
=========================== */
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.9) 0,
      transparent 55%
    ),
    radial-gradient(
      circle at top right,
      rgba(191, 219, 254, 0.9) 0,
      transparent 55%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(226, 232, 240, 0.9) 0,
      transparent 55%
    ),
    var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.4rem 1.4rem 3.5rem 1.4rem;
}

/* ===========================
   NAVBAR
=========================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(241, 245, 249, 0.9),
    rgba(241, 245, 249, 0.4),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  opacity: 0;
  transform: translateY(-24px);
  animation: fadeInSection 0.7s cubic-bezier(0.6, 0.2, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

body.dark .navbar {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.65),
    transparent
  );
  border-bottom-color: rgba(30, 64, 175, 0.7);
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 20% 20%, #f97316, #2563eb);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9),
    0 12px 26px rgba(15, 23, 42, 0.55);
}

.brand-text {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  font-size: 0.9rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

.theme-toggle span.icon {
  font-size: 1.05rem;
}

/* Mobile Navbar */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
  margin-right: 0.5rem;
  z-index: 30;
}

.nav-toggle-bar {
  width: 22px;
  height: 3px;
  background: var(--primary);
  margin: 3px 0;
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 720px) {
  .navbar-inner {
    padding-inline: 1rem;
  }

  .nav-links {
    gap: 0.8rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .nav-toggle {
    display: flex;
  }

  .navbar-inner {
    position: relative;
  }

  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    left: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--border);
    z-index: 20;
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-16px);
    transition: opacity 0.25s, transform 0.25s;
  }

  .nav-links.open {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links .theme-toggle {
    margin-top: 0.8rem;
    align-self: flex-start;
  }

  .nav-links a {
    font-size: 1.1rem;
    padding: 0.5rem 0;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .nav-links a.hide-sm {
    display: none;
  }
}

/* ===========================
   HERO
=========================== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr);
  gap: 2.5rem;
  align-items: center;
  margin-top: 2.1rem;
}

.hero-left-surface {
  padding: 1.8rem 1.6rem 1.6rem;
  border-radius: 28px;
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.9),
      transparent 60%
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.96),
      rgba(241, 245, 249, 0.96)
    );
  box-shadow: 0 22px 55px rgba(148, 163, 184, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

body.dark .hero-left-surface {
  background: radial-gradient(
      circle at top left,
      rgba(51, 65, 85, 0.22),
      transparent 60%
    ),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.96));
  border-color: rgba(31, 41, 55, 0.9);
}

.hero-title-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.hero-title-chip span.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #22c55e, #15803d);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  letter-spacing: -0.045em;
  margin: 0 0 0.4rem;
}

.hero h1 span.accent {
  background: linear-gradient(120deg, #2563eb, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.hero-summary {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 95%;
}

.hero-summary strong {
  color: var(--text);
  font-weight: 600;
}

.hero-offer {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-offer span.highlight {
  color: var(--primary);
  font-weight: 600;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
  font-size: 0.85rem;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: var(--surface-soft);
  color: var(--text-muted);
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.contact-pill span.icon {
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.btn-primary,
.btn-ghost {
  border-radius: 999px;
  padding: 0.7rem 1.35rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px rgba(37, 99, 235, 0.65);
}

.btn-ghost {
  border-color: rgba(148, 163, 184, 0.9);
  background: transparent;
  color: var(--text-muted);
}

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

.hero-right {
  justify-self: center;
}

.hero-card {
  width: 100%;
  max-width: 360px;
  border-radius: 26px;
  padding: 1.4rem 1.3rem;
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.9)
  );
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(30, 64, 175, 0.8);
  color: #e5e7eb;
  transition: box-shadow 0.3s, transform 0.3s;
}

body.dark .hero-card {
  background: radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.35),
      transparent 60%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(15, 23, 42, 1),
      rgba(15, 23, 42, 1)
    );
  border-color: rgba(59, 130, 246, 0.9);
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.hero-avatar {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: radial-gradient(circle at 20% 0, #38bdf8, #020617);
  border: 2px solid rgba(248, 250, 252, 0.9);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.85);
}

.hero-card-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-card-title span.name {
  font-size: 1rem;
  font-weight: 600;
}

.hero-card-title span.role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
}

.hero-pill {
  font-size: 0.7rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.7);
  background: rgba(6, 78, 59, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #a7f3d0;
}

.hero-pill span.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
}

.hero-card-body {
  font-size: 0.8rem;
  color: #d1d5db;
  line-height: 1.7;
  margin-bottom: 0.9rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}

.hero-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(75, 85, 99, 0.9);
}

.hero-card-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  align-items: start;
  font-size: 0.75rem;
  color: #9ca3af;
}

.hero-card-footer .stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hero-card-footer .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero-card-footer .value {
  font-weight: 600;
  color: #e5e7eb;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .hero-right {
    justify-self: flex-start;
  }

  .hero-left-surface {
    padding: 1.5rem 1.3rem;
  }
}

@media (max-width: 600px) {
  .hero {
    margin-top: 1.5rem;
  }

  .hero-left-surface {
    border-radius: 20px;
  }

  .hero-summary {
    max-width: 100%;
  }
}

/* ===========================
   SECTIONS GENERIC
=========================== */
section {
  margin-top: 3rem;
}

section:first-of-type {
  margin-top: 2.4rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title-pill {
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 50%;
}

@media (max-width: 800px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-subtitle {
    max-width: 100%;
  }
}

/* ===========================
   SERVICES
=========================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.service-card {
  border-radius: 18px;
  padding: 1rem 1rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(148, 163, 184, 0.25);
  transition: box-shadow 0.3s, transform 0.3s;
}

body.dark .service-card {
  background: var(--surface-soft);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.75);
}

.service-title {
  font-weight: 600;
  font-size: 0.96rem;
  margin-bottom: 0.1rem;
}

.service-icon {
  font-size: 1.1rem;
  margin-right: 0.35rem;
}

.service-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.service-list {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 1rem;
  margin: 0.35rem 0 0;
}

.service-list li {
  margin-bottom: 0.18rem;
}

/* ===========================
   EXPERIENCE
=========================== */
.experience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 1.4rem;
}

@media (max-width: 860px) {
  .experience-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.experience-card {
  border-radius: 18px;
  padding: 1.1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 12px 28px rgba(148, 163, 184, 0.2);
  transition: box-shadow 0.3s, transform 0.3s;
}

body.dark .experience-card {
  background: var(--surface-soft);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.8);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.exp-role {
  font-weight: 600;
  font-size: 0.95rem;
}

.exp-company {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.exp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.75rem;
  margin-top: 0.2rem;
  color: var(--text-muted);
}

.exp-tag {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.exp-body {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.exp-body ul {
  padding-left: 1.1rem;
  margin: 0.35rem 0 0;
}

.exp-body li {
  margin-bottom: 0.22rem;
}

/* ===========================
   SKILLS CARD SECTION
=========================== */
.skills-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(148, 163, 184, 0.25);
  padding: 1rem 1rem 0.9rem 1rem;
  margin: 2.2rem 0 2.8rem 0;
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.3s, transform 0.3s;
}

.skills-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem;
  justify-content: center;
  width: 100%;
}

.skills-col {
  min-width: 220px;
  max-width: 260px;
  flex: 1 1 220px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(148, 163, 184, 0.25);
  padding: 1rem 1rem 0.9rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  transition: box-shadow 0.3s, transform 0.3s;
}

.skills-cat {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 1.13em;
  font-weight: 600;
  margin-bottom: 0.1em;
}

.skills-icon {
  font-size: 1.5em;
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.13));
}

.skills-cat-title {
  font-weight: 600;
  font-size: 0.96rem;
}

.skills-cat-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

body.dark .skills-card {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.75);
}

body.dark .skills-col {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.75);
}

body.dark .skills-cat-desc {
  color: var(--text-muted);
}

/* Skills layout (for pill groups) */
.skills-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .skills-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.pill-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.pill-group-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pill {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
  box-shadow: 0 1px 6px rgba(148, 163, 184, 0.07);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  cursor: pointer;
}

.pill:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
}

body.dark .pill {
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

body.dark .pill:hover {
  background: var(--primary);
  color: var(--surface-soft);
}

@media (max-width: 900px) {
  .skills-columns {
    flex-direction: column;
    gap: 1.2rem;
    align-items: stretch;
  }

  .skills-col {
    max-width: 100%;
    min-width: 0;
  }

  .skills-card {
    padding: 1.2rem 0.7rem 1.1rem 0.7rem;
  }
}

/* ===========================
   PROJECTS
=========================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
}

.project-card {
  border-radius: 18px;
  padding: 1rem 0.95rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 14px 32px rgba(148, 163, 184, 0.28);
  transition: box-shadow 0.3s, transform 0.3s;
}

body.dark .project-card {
  background: var(--surface-soft);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.85);
}

.project-header {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}

.project-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.project-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  background: rgba(219, 234, 254, 0.85);
  color: #1f2937;
  white-space: nowrap;
}

body.dark .project-tag {
  border-color: rgba(37, 99, 235, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
}

.project-stack {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.project-quick {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.project-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
}

.project-link span.icon {
  font-size: 0.9rem;
}

/* Projects Horizontal Scroll */
.projects-scroll-wrapper {
  width: 100%;
  margin-bottom: 2rem;
}

.projects-grid.horizontal-scroll {
  padding-top: 1.2rem;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 1fr);
  grid-auto-columns: minmax(320px, 1fr);
  overflow-x: auto;
  scroll-behavior: smooth;
  max-width: 100%;
  padding-bottom: 1.5rem;
  scrollbar-width: thin;
}

.projects-grid.horizontal-scroll::-webkit-scrollbar {
  height: 10px;
}

.projects-grid.horizontal-scroll::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 5px;
}

@media (max-width: 900px) {
  .projects-grid.horizontal-scroll {
    grid-template-rows: 1fr 1fr;
    grid-auto-columns: 90vw;
  }
}

@media (max-width: 600px) {
  .projects-grid.horizontal-scroll {
    grid-template-rows: 1fr 1fr;
    grid-auto-columns: 95vw;
  }
}

/* ===========================
   TEACHING & ORG
=========================== */
.org-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

/* Teaching/Community card */
.org-card {
  border-radius: 18px;
  padding: 1rem 0.95rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 14px 32px rgba(148, 163, 184, 0.28);
  transition: box-shadow 0.3s, transform 0.3s;
}

body.dark .org-card {
  background: var(--surface-soft);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.85);
}

.org-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  align-items: center;
}

.org-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.org-period {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  background: rgba(219, 234, 254, 0.85);
  color: #1f2937;
  white-space: nowrap;
}

body.dark .org-period {
  border-color: rgba(37, 99, 235, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
}

.org-role {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  margin-bottom: 0.4rem;
}

.org-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.org-highlights {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  margin-left: 1.2rem;
  padding: 0;
}

.org-highlights li {
  margin-bottom: 0.3rem;
}

.org-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.78rem;
}

/* ===========================
   MODAL
=========================== */
.modal-divider {
  margin: 1.2rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

.modal-section-title {
  margin-bottom: 0.4rem;
}

.modal-section-list {
  margin-bottom: 1rem;
}

.modal-link-wrapper {
  margin-top: 1rem;
}

.modal-link {
  color: #2563eb;
  text-decoration: underline;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  min-width: 100vw;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  color: #222;
  border-radius: 12px;
  max-width: 900px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  position: relative;
  animation: modalIn 0.18s cubic-bezier(0.4, 2, 0.6, 1) 1;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #888;
  cursor: pointer;
  transition: color 0.15s;
}

.modal-close:hover {
  color: #222;
}

.modal-content h2 {
  margin-top: 0;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.modal-content ul {
  margin: 0.5rem 0 1rem 1.2rem;
  padding: 0;
}

.modal-content li {
  margin-bottom: 0.3rem;
}

@media (max-width: 600px) {
  .modal-content {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
  }
}

/* ===========================
   CASE STUDY / DETAIL PAGE
=========================== */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  font-size: 0.75rem;
}

.badge {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(243, 244, 246, 0.9);
  color: var(--text-muted);
  white-space: nowrap;
}

body.dark .badge {
  background: rgba(15, 23, 42, 0.9);
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.nav-back {
  margin-top: 1.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.link {
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pill-link {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  color: var(--text-muted);
}

.main-detail {
  background: var(--surface);
  border-radius: 22px;
  padding: 1.5rem 1.4rem 1.6rem;
  border: 1px solid var(--border);
  box-shadow: 0 20px 45px rgba(148, 163, 184, 0.4);
  transition: box-shadow 0.3s, transform 0.3s;
}

body.dark .main-detail {
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.85);
}

h2 {
  font-size: 1.05rem;
  margin: 1.1rem 0 0.5rem;
}

ul {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: 1.2rem;
  margin: 0.3rem 0 0.6rem;
}

@media (max-width: 640px) {
  main {
    border-radius: 18px;
    padding: 1.2rem 1rem 1.3rem;
  }
}

/* ===========================
   FOOTER
=========================== */
footer {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
}

.footer-detail {
  margin-top: 0 !important;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInSection 0.7s cubic-bezier(0.6, 0.2, 0.2, 1) forwards;
  animation-delay: 0.3s;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

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

.footer-links a,
.footer-links span {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.7s cubic-bezier(0.6, 0.2, 0.2, 1) forwards;
}

.footer-links a {
  transition: color 0.2s, transform 0.3s;
}

.footer-links a:hover {
  color: #1d4ed8;
  transform: scale(1.08) translateY(-2px);
}

.footer-links a:nth-child(1) {
  animation-delay: 0.1s;
}

.footer-links a:nth-child(2) {
  animation-delay: 0.2s;
}

.footer-links a:nth-child(3) {
  animation-delay: 0.3s;
}

.footer-links span:nth-child(1) {
  animation-delay: 0.05s;
}

.footer-links span:nth-child(2) {
  animation-delay: 0.15s;
}

.footer-links span:nth-child(3) {
  animation-delay: 0.25s;
}

@media (max-width: 640px) {
  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===========================
   ANIMATIONS & PARALLAX
=========================== */
.animate-section {
  opacity: 0;
  transform: translateY(32px) scale(0.98);
  animation: fadeInSection 0.8s cubic-bezier(0.6, 0.2, 0.2, 1) forwards;
}

@keyframes fadeInSection {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes modalIn {
  from {
    transform: translateY(40px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* Parallax effect for sections */
.parallax-section {
  position: relative;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.6, 0.2, 0.2, 1);
}

/* Shared card hover animation */
.skills-card:hover,
.skills-col:hover,
.service-card:hover,
.experience-card:hover,
.project-card:hover,
.org-card:hover,
.main-detail:hover,
.hero-card:hover {
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.13),
    0 1.5px 8px rgba(0, 0, 0, 0.07);
  transform: scale(1.025) translateY(-2px);
}
