/* =========================================================
   Projects Showcase & Hub
   Design Language & CSS matching nguyenphandangkhoa.net
   Author: Dang Khoa Nguyen Phan (@npdk1 / ! Phaphela)
   ========================================================= */

:root {
  --bg: #050508;
  --bg-card: rgba(12, 13, 20, 0.72);
  --bg-card-hover: rgba(18, 20, 32, 0.85);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.74);
  --text-faint: rgba(255, 255, 255, 0.45);

  --accent: #ef4444;
  --accent-2: #f97316;
  --accent-3: #dc2626;
  --accent-rgb: 239, 68, 68;
  --accent-2-rgb: 249, 115, 22;
  --accent-glow: rgba(239, 68, 68, 0.45);

  --glass: rgba(10, 10, 16, 0.62);
  --glass-elevated: rgba(13, 14, 22, 0.92);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(255, 255, 255, 0.25);

  --radius-lg: 22px;
  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-full: 999px;

  --font: "Onest", "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Outfit", "Onest", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-w: 1240px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Background Stage */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
  pointer-events: none;
}

.bg-radial {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 15%, rgba(239, 68, 68, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 82% 28%, rgba(249, 115, 22, 0.1) 0%, transparent 42%),
    radial-gradient(circle at 50% 85%, rgba(99, 102, 241, 0.08) 0%, transparent 55%);
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 65% at 50% 40%, transparent 20%, rgba(0, 0, 0, 0.65) 100%),
    linear-gradient(180deg, rgba(5, 5, 8, 0.4) 0%, transparent 20%, transparent 80%, rgba(5, 5, 8, 0.85) 100%);
}

.bg-grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* Glass Utility */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.glass-elevated {
  background: var(--glass-elevated);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

/* App Shell */
.app-shell {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(16px, 3.5vw, 32px);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 0;
  background: rgba(5, 5, 8, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-mini-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.avatar-mini-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  animation: spin 5s linear infinite;
  box-shadow: 0 0 14px var(--accent-glow);
}

.avatar-mini {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  overflow: hidden;
  background: #100b14;
  border: 2px solid rgba(10, 10, 16, 0.95);
}

.avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-meta h1 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-meta .badge-subpage {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.2);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-meta p {
  font-size: 0.76rem;
  color: var(--text-faint);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
  transition: all 0.25s var(--ease);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
  filter: brightness(1.08);
}

/* Audio Player HUD in Header (Muted / Volume 0 by default) */
.sound-dock {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 4px 0 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.25s var(--ease);
  position: relative;
}

.sound-dock:hover,
.sound-dock:focus-within {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 18px var(--accent-glow);
  background: rgba(255, 255, 255, 0.08);
}

.vol-slider-wrap {
  width: 72px;
  display: flex;
  align-items: center;
  margin-right: 6px;
  transition: width 0.3s var(--ease);
}

.vol-slider {
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  outline: none;
}

.btn-sound {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: color 0.2s, background 0.2s;
}

.btn-sound:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Audio waves icon states */
.sound-waves {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sound-slash {
  transition: opacity 0.2s ease;
}

body.is-audio-playing .sound-slash {
  opacity: 0;
  display: none;
}

body.is-audio-playing .sound-waves {
  opacity: 1;
}

body:not(.is-audio-playing) .sound-waves {
  opacity: 0.35;
}

body:not(.is-audio-playing) .sound-slash {
  opacity: 1;
  stroke: #f43f5e;
}

/* Hero Section */
.hero-sec {
  padding: clamp(36px, 6vw, 64px) 0 28px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 18px;
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
}

.hero-pill .ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
  animation: pulse 2s infinite;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero-title .name-glow {
  text-shadow:
    0 0 24px rgba(255, 255, 255, 0.3),
    0 0 50px var(--accent-glow);
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #fff 25%, var(--accent) 70%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  max-width: 680px;
  margin: 0 auto 28px;
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Stats Ribbon */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.stat-item {
  padding: 16px 20px;
  text-align: left;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.8;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* Filter & Controls Bar */
.controls-sec {
  margin-bottom: 32px;
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s var(--ease);
}

.cat-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.cat-pill.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-2-rgb), 0.25));
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 16px var(--accent-glow);
}

.search-sort-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-box {
  position: relative;
  width: 230px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 14px 8px 34px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  outline: none;
  transition: all 0.2s var(--ease);
}

.search-input:focus {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 14px var(--accent-glow);
  background: rgba(255, 255, 255, 0.09);
}

.sort-select {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.sort-select option {
  background: #0f1019;
  color: #fff;
}

/* Section Header */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sec-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sec-counter {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: #fff;
}

/* =========================================================
   PROJECT CARDS RESPONSIVE GRID
   ========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 30vw, 380px), 1fr));
  gap: clamp(16px, 2.5vw, 26px);
  margin-bottom: 50px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  will-change: transform, box-shadow;
  cursor: pointer;
  opacity: 1;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-accent, rgba(var(--accent-rgb), 0.6));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 30px var(--card-glow, var(--accent-glow));
}

.card-top-banner {
  position: relative;
  height: 180px;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--banner-bg, #0d1222);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-top-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(12, 13, 20, 0.95) 100%);
  pointer-events: none;
}

.banner-row-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--card-accent, var(--accent));
  text-transform: uppercase;
}

.card-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(10, 10, 16, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.status-dot.emerald { background: #10b981; box-shadow: 0 0 8px #10b981; }
.status-dot.amber { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.status-dot.indigo { background: #6366f1; box-shadow: 0 0 8px #6366f1; }
.status-dot.rose { background: #f43f5e; box-shadow: 0 0 8px #f43f5e; }

/* Project Logo in Card */
.banner-row-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-logo-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(8, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease);
}

.project-card:hover .card-logo-box {
  transform: scale(1.08);
  border-color: var(--card-accent);
}

.card-logo-img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  display: block;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
  gap: 14px;
}

.card-tagline {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
  min-height: 2.7em;
}

/* Feature Bullets in Card */
.card-bullets {
  list-style: none;
  display: grid;
  gap: 6px;
}

.card-bullets li {
  font-size: 0.82rem;
  color: var(--text-dim);
  padding-left: 16px;
  position: relative;
  line-height: 1.45;
}

.card-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--card-accent, var(--accent));
}

/* Card Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
}

.tag-pill:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

/* Card Footer Actions */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-card-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--card-accent, var(--accent)), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.2s var(--ease);
}

.btn-card-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px var(--card-glow, var(--accent-glow));
}

.btn-card-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s var(--ease);
}

.btn-card-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-card-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--card-accent, var(--accent));
  transition: all 0.2s var(--ease);
}

.btn-card-detail:hover {
  letter-spacing: 0.02em;
  filter: brightness(1.2);
}

/* =========================================================
   PROJECT DETAIL MODAL (Matching .more-sheet in bio)
   ========================================================= */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vh, 40px) clamp(16px, 4vw, 40px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 0s linear 0.45s, opacity 0.4s var(--ease);
}

.detail-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: visibility 0s linear 0s, opacity 0.4s var(--ease);
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modal-sheet {
  position: relative;
  z-index: 2;
  width: 900px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 16, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  transform: translateY(20px) scale(0.97);
  filter: blur(8px);
  opacity: 0;
  transition: all 0.45s var(--ease);
  overflow: hidden;
}

.detail-modal.is-open .modal-sheet {
  transform: translateY(0) scale(1);
  filter: blur(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.modal-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--modal-accent, var(--accent));
  text-transform: uppercase;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-close-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: all 0.2s var(--ease);
}

.btn-close-modal:hover {
  background: rgba(var(--accent-rgb), 0.25);
  border-color: rgba(var(--accent-rgb), 0.45);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(16px, 3vw, 24px);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.4) transparent;
}

/* Modal Hero Banner */
.modal-hero-banner {
  border-radius: var(--radius-md);
  padding: 24px 22px;
  margin-bottom: 24px;
  background: var(--modal-banner-bg, linear-gradient(135deg, #101224, #191c36));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.modal-logo-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(8, 10, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  overflow: hidden;
}

.modal-logo-img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.modal-hero-tagline {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.45;
}

.modal-actions-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.modal-sec {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-sec:last-child {
  border-bottom: none;
}

.modal-sec-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.modal-sec-title .sec-ico {
  color: var(--modal-accent, var(--accent));
}

.modal-desc-p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-dim);
}

.modal-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(260px, 45%, 400px), 1fr));
  gap: 12px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.highlight-item svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--modal-accent, var(--accent));
  margin-top: 2px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.metric-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

/* Modal Showcase Video Player */
.modal-showcase-box {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(var(--accent-rgb), 0.15);
  position: relative;
}

.modal-showcase-video {
  width: 100%;
  max-height: 480px;
  display: block;
  object-fit: contain;
  background: #07080f;
  outline: none;
}

/* =========================================================
   GSAP INTRO LOADING SCREEN
   ========================================================= */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050508;
  display: grid;
  place-items: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s ease;
}

.loading-screen.is-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 24px;
}

.loading-avatar-wrap {
  position: relative;
  width: 76px;
  height: 76px;
}

.loading-avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  animation: spin 3.5s linear infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}

.loading-avatar {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  overflow: hidden;
  background: #100b14;
  border: 2px solid rgba(10, 10, 16, 0.95);
}

.loading-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loading-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 0 24px var(--accent-glow);
}

.loading-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.loading-bar-shell {
  width: 200px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 6px;
}

.loading-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-glow);
  border-radius: 999px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 36px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(5, 5, 8, 0.9);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand p {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-social-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
}

.footer-social-btn:hover {
  color: #fff;
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-2px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: rgba(14, 15, 24, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.3s var(--ease) forwards;
  pointer-events: auto;
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.15); }
}

/* =========================================================
   RESPONSIVE DESIGN SYSTEM ACROSS ALL DEVICES
   ========================================================= */
@media (max-width: 1024px) {
  .stats-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 840px) {
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-sort-group {
    width: 100%;
    margin-left: 0;
  }
  .search-box {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 640px) {
  .nav-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .stats-ribbon {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .modal-sheet {
    width: 100vw;
    height: 94vh;
    max-width: 96vw;
    border-radius: 16px;
  }
  .modal-highlights-grid {
    grid-template-columns: 1fr;
  }
  .modal-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-actions-bar a,
  .modal-actions-bar button {
    justify-content: center;
    width: 100%;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
