/* ============================================
   JAY BHARTI — PERSONAL PORTFOLIO
   Design System & Styles
   ============================================ */

/* --- Google Fonts loaded via <link> in HTML for non-blocking rendering --- */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Design Tokens (Dark Mode Default) --- */
:root {
  /* Colors — Dark */
  --bg-primary: #0F0F0F;
  --bg-elevated: #1A1A18;
  --bg-surface: #242420;
  --text-primary: #FAF7F0;
  --text-secondary: #B8B2A6;
  --text-muted: #7A756B;
  --accent: #C9A84C;
  --accent-hover: #D4B65E;
  --accent-soft: rgba(201, 168, 76, 0.12);
  --border: rgba(250, 247, 240, 0.08);
  --border-strong: rgba(250, 247, 240, 0.15);
  --shadow: rgba(0, 0, 0, 0.4);

  /* Typography */
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;

  /* Layout */
  --max-width: 1120px;
  --section-padding: var(--space-4xl) var(--space-lg);

  /* Transitions */
  --transition-fast: 200ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-theme: 400ms ease;
}

/* --- Light Mode --- */
[data-theme="light"] {
  --bg-primary: #FAF7F0;
  --bg-elevated: #FFFFFF;
  --bg-surface: #F0EDE4;
  --text-primary: #1A1A18;
  --text-secondary: #4A4740;
  --text-muted: #8A857B;
  --accent: #9E7C2E;
  --accent-hover: #B58E36;
  --accent-soft: rgba(158, 124, 46, 0.08);
  --border: rgba(26, 26, 24, 0.08);
  --border-strong: rgba(26, 26, 24, 0.15);
  --shadow: rgba(0, 0, 0, 0.08);
}

/* --- Base Styles --- */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-theme), color var(--transition-theme);
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

/* --- Utility --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-bottom: var(--space-md);
}

.section-marker {
  display: inline-flex;
  align-items: center;
  margin-bottom: var(--space-md);
}

.concentric-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform var(--transition-fast);
}

.concentric-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 36px;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  line-height: 1.2;
}

.divider {
  width: 48px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
  margin: var(--space-xl) 0;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  transition: background-color var(--transition-base), backdrop-filter var(--transition-base);
}

.nav.scrolled {
  background-color: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav.scrolled {
  background-color: rgba(250, 247, 240, 0.85);
}

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

.nav-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color var(--transition-theme);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width var(--transition-base);
}

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

.nav-links a:hover::after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.nav-cta:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background-color: var(--accent-soft);
}

.nav-cta svg {
  width: 13px;
  height: 13px;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background-color: var(--accent-soft);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-mobile-toggle svg {
  width: 24px;
  height: 24px;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
  position: relative;
}

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

.hero-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 8vw, 64px);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-md);
  transition: color var(--transition-theme);
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(16px, 2.5vw, 19px);
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xl);
}

.hero-tagline .accent {
  color: var(--accent);
}

.hero-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.hero-links a {
  color: var(--text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
}

.hero-links a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.hero-links a svg {
  width: 20px;
  height: 20px;
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  opacity: 0;
  animation: fadeInUp 800ms ease-out 2s forwards;
}

.scroll-indicator .line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 0.5; transform: translateX(-50%) translateY(0); }
}

/* --- Who Am I (About) --- */
.about {
  padding: var(--space-3xl) 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-3xl);
  align-items: start;
}

.about-text p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.about-text p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.2em;
  font-weight: 600;
  float: left;
  line-height: 0.85;
  margin-right: 8px;
  margin-top: 6px;
  color: var(--accent);
}

.about-signature {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: var(--space-xl);
  font-style: italic;
  line-height: 1.6;
}

.about-signature .closing {
  display: block;
  font-size: 16px;
  color: var(--text-muted);
  font-style: normal;
  margin-top: var(--space-sm);
  letter-spacing: 0;
}

.about-photo-wrapper {
  position: relative;
}

.about-photo {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 3/4;
  transition: box-shadow var(--transition-slow);
}

.about-photo-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  pointer-events: none;
  transition: border-color var(--transition-base);
}

.about-photo-wrapper:hover .about-photo {
  box-shadow: 0 8px 40px rgba(201, 168, 76, 0.12);
}

.about-photo-wrapper:hover::after {
  border-color: var(--accent-soft);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Experience Timeline --- */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--border), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-2xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  transition: background-color var(--transition-theme), border-color var(--transition-theme);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.timeline-role {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.timeline-org {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.timeline-org a {
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.timeline-org a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.timeline-desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 580px;
}

.timeline-metric {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 4px;
  margin-top: var(--space-sm);
}

/* --- Education --- */
.education-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.edu-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-xl);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-theme);
}

.edu-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 4px 24px var(--shadow);
}

.edu-degree {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.edu-school {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.edu-school a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.edu-school a:hover {
  color: var(--accent);
}

.edu-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  font-size: 13px;
}

.edu-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 4px;
}

.edu-tag.neutral {
  color: var(--text-muted);
  background: var(--bg-surface);
}

/* --- Skills --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.skill-category h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.skill-list li {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition-fast);
}

.skill-list li:hover {
  color: var(--accent);
}

.certs-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.cert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition-base), background-color var(--transition-theme);
}

.cert:hover {
  border-color: var(--border-strong);
}

.cert-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 6px;
  flex-shrink: 0;
  color: var(--accent);
}

.cert-icon svg {
  width: 16px;
  height: 16px;
}

.cert-info {
  flex: 1;
  min-width: 0;
}

.cert-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.cert-issuer {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Awards --- */
.awards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.award-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-xl);
  transition: border-color var(--transition-base), background-color var(--transition-theme);
}

.award-card:hover {
  border-color: var(--accent-soft);
}

.award-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
  margin-bottom: var(--space-md);
  color: var(--accent);
}

.award-icon svg {
  width: 20px;
  height: 20px;
}

.award-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.award-org {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.award-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Contact / Footer --- */
.contact {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.contact-heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
  margin-bottom: var(--space-xl);
  display: inline-block;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-fast);
}

.contact-email:hover {
  border-bottom-color: var(--accent);
}

.contact-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.contact-socials a {
  color: var(--text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.contact-socials a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.contact-socials a svg {
  width: 22px;
  height: 22px;
}

.footer {
  text-align: center;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-body);
}

/* --- Section Separator --- */
.section-sep {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 0 auto;
  max-width: var(--max-width);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  :root {
    --section-padding: var(--space-2xl) var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

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

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .about-photo-wrapper {
    order: -1;
    max-width: 320px;
    margin: 0 auto;
  }

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

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

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

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

  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
  }

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

  .nav-mobile-toggle {
    display: flex;
  }
}

@media (max-width: 500px) {
  .hero-name {
    font-size: 36px;
  }

  .hero-tagline {
    font-size: 15px;
  }

  .about-text p {
    font-size: 15px;
  }

  .about-stats {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .certs-row {
    grid-template-columns: 1fr;
  }
}

/* --- Side Projects Section --- */
.section-intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 700px;
  margin-bottom: var(--space-2xl);
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.project-card {
  display: grid;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-lg);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-theme);
  overflow: hidden;
  align-items: stretch;
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 30px var(--shadow);
}

.project-card--screenshot {
  grid-template-columns: 180px 1fr;
  gap: var(--space-xl);
}

.project-card--code {
  grid-template-columns: 420px 1fr;
  gap: var(--space-xl);
}

.project-visual {
  position: relative;
  width: 100%;
  background: var(--bg-surface);
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-card--screenshot .project-visual {
  height: 180px;
  aspect-ratio: 1 / 1;
  align-self: start;
  flex-shrink: 0;
}

.project-card--code .project-visual {
  aspect-ratio: 16 / 10;
}

.project-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-screenshot {
  transform: scale(1.02);
}

.project-visual--placeholder {
  border: 1px dashed var(--border-strong);
  background: var(--bg-surface);
}

.project-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
}

.project-placeholder-inner svg {
  color: var(--accent);
  opacity: 0.8;
  transition: transform var(--transition-base);
}

.project-card:hover .project-placeholder-inner svg {
  transform: translateY(-2px);
}

.project-visual--code {
  background: #0D0D0C;
  border: 1px solid var(--border);
  padding: var(--space-md);
  align-items: flex-start;
  justify-content: flex-start;
}

[data-theme="light"] .project-visual--code {
  background: #1A1A18; /* Keep dark editor style in light theme */
}

.project-code-block {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: #FAF7F0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.code-dot-row {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.code-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.code-dot--red { background: #FF5F56; }
.code-dot--yellow { background: #FFBD2E; }
.code-dot--green { background: #27C93F; }

.code-snippet {
  margin: 0;
  overflow-x: auto;
  font-family: inherit;
  color: inherit;
}

.code-snippet code {
  font-family: inherit;
}

.code-comment {
  color: var(--text-muted);
  opacity: 0.75;
  font-style: italic;
}

.project-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-xs) 0;
}

.project-header {
  margin-bottom: var(--space-sm);
}

.project-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.project-type {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.project-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
}

.project-links {
  display: flex;
  gap: var(--space-md);
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.project-link--github {
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.project-link--github:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--border);
}

.project-link--primary {
  color: var(--bg-primary);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.project-link--primary:hover {
  color: var(--bg-primary);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.project-link svg {
  width: 14px;
  height: 14px;
}

/* --- Responsive for Side Projects --- */
@media (max-width: 900px) {
  .project-card--screenshot {
    grid-template-columns: 140px 1fr;
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .project-card--screenshot .project-visual {
    height: 140px;
    width: 140px;
  }

  .project-card--code {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: var(--space-md);
  }

  .project-info {
    padding: 0;
  }

  .project-links {
    margin-top: var(--space-md);
  }
}

@media (max-width: 600px) {
  .project-card--screenshot {
    grid-template-columns: 110px 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm);
  }

  .project-card--screenshot .project-visual {
    height: 110px;
    width: 110px;
  }
}

@media (max-width: 500px) {
  .project-card {
    border-radius: 6px;
  }

  .project-name {
    font-size: 19px;
  }

  .project-desc {
    font-size: 13px;
  }
}

/* --- Project Carousels --- */
.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 6px;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-base), background var(--transition-base), color var(--transition-base), transform var(--transition-base);
  z-index: 10;
  padding: 0;
}

.carousel:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow--left {
  left: 12px;
}

.carousel-arrow--right {
  right: 12px;
}

.carousel-arrow:hover {
  background: rgba(15, 15, 15, 0.75);
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}

.carousel-arrow:focus-visible {
  outline: 2px solid var(--accent);
  opacity: 1;
}

.carousel-indicators {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  padding: 0;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
  background: #ffffff;
  width: 12px;
  border-radius: 3px;
}

/* --- Small Carousel Overrides for Screenshots inside Cards --- */
.project-card--screenshot .carousel-arrow {
  width: 28px;
  height: 28px;
  background: rgba(15, 15, 15, 0.6);
}

.project-card--screenshot .carousel-arrow svg {
  width: 14px;
  height: 14px;
}

.project-card--screenshot .carousel-arrow--left {
  left: 6px;
}

.project-card--screenshot .carousel-arrow--right {
  right: 6px;
}

.project-card--screenshot .carousel-indicators {
  bottom: 8px;
  gap: 4px;
}

.project-card--screenshot .carousel-dot {
  width: 5px;
  height: 5px;
}

.project-card--screenshot .carousel-dot.active {
  width: 10px;
  border-radius: 2px;
}

/* --- Lightbox Modal --- */
.lightbox-modal {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  outline: none;
  z-index: 1000;
  box-sizing: border-box;
  overflow: hidden;
}

.lightbox-modal[open] {
  display: flex;
}

.lightbox-modal::backdrop {
  background-color: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: lightbox-fade-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1005;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: zoom-out;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
  font-family: var(--font-body);
  max-width: 600px;
  line-height: 1.5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 0 16px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 1010;
  padding: 0;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
  color: #fff;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 1010;
  padding: 0;
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-50%) scale(1.05);
}

.lightbox-arrow--left {
  left: 24px;
}

.lightbox-arrow--right {
  right: 24px;
}

.body-lightbox-open {
  overflow: hidden !important;
}

@keyframes lightbox-fade-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .lightbox-arrow {
    width: 42px;
    height: 42px;
  }
  .lightbox-arrow--left {
    left: 12px;
  }
  .lightbox-arrow--right {
    right: 12px;
  }
  .lightbox-close {
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
  .carousel-arrow {
    opacity: 1; /* Show arrows on touch devices */
  }
}

/* Focus on the lower portion of the Sensum keyboard image in the thumbnail view */
.carousel[data-project="sensum"] .carousel-slide:first-child .project-screenshot {
  object-position: bottom center;
}

/* ============================================
   Case Study Reading Modal & Triggers
   ============================================ */
.case-study-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(201, 168, 76, 0.25);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: var(--space-sm);
  transition: all var(--transition-fast);
}

.case-study-trigger-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.case-study-trigger-btn svg {
  transition: transform var(--transition-fast);
}

.case-study-trigger-btn:hover svg {
  transform: translateX(3px);
}

.timeline-metrics-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.timeline-metrics-group .timeline-metric {
  margin-top: 0;
}

.timeline-metrics-group .case-study-trigger-btn {
  margin-top: 0;
}

/* Modal Dialog */
.case-study-modal {
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  max-width: 820px;
  width: min(820px, 92vw);
  max-height: 88vh;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  outline: none;
  overflow: hidden;
}

.case-study-modal::backdrop {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.case-study-dialog-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}

.case-study-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}

.case-study-close:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.case-study-body {
  overflow-y: auto;
  padding: 36px 40px;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  .case-study-body {
    padding: 24px 18px;
  }
}

.case-study-hero-img-wrap {
  margin-bottom: var(--space-xl);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.case-study-hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.case-study-img-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

.case-study-header {
  margin-bottom: var(--space-lg);
}

.case-study-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 8px;
}

.case-study-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 8px;
}

.case-study-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.case-study-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: var(--space-xl);
}

.cs-metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cs-metric-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.cs-metric-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.case-study-content h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.case-study-content p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.case-study-content ul,
.case-study-content ol {
  padding-left: 20px;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.case-study-content li {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 6px;
}

.case-study-content strong {
  color: var(--text-primary);
}

.case-study-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.case-study-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.body-modal-open {
  overflow: hidden !important;
}



