/* =========================================================
   Portfolio Modern Cyber-Minimalist Theme (ThreeUI & Glassmorphic)
   ========================================================= */

:root {
  --bg-primary: #060913;
  --bg-secondary: #0b1120;
  --bg-card: rgba(13, 20, 38, 0.72);
  --bg-card-hover: rgba(18, 28, 52, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(0, 242, 254, 0.16);
  --border-card-hover: rgba(0, 242, 254, 0.45);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #00f2fe;
  --accent-blue: #38bdf8;
  --accent-emerald: #10b981;
  --accent-indigo: #818cf8;
  --accent-purple: #c084fc;
  --accent-yellow: #facc15;
  --accent-orange: #fb923c;
  --gradient-glow: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --glow-cyan: 0 0 25px rgba(0, 242, 254, 0.35);
  --glow-subtle: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

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

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Three.js Canvas Container */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  display: block;
}

/* Glow ambient lights */
.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
  opacity: 0.12;
}

.ambient-glow.glow-1 {
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, #00f2fe 0%, transparent 70%);
}

.ambient-glow.glow-2 {
  bottom: 10%;
  right: -150px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

/* Page Shell */
.site-shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Top Navigation Bar */
.topbar {
  position: sticky;
  top: 16px;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(6, 9, 19, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.topbar.scrolled {
  background: rgba(6, 9, 19, 0.92);
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 242, 254, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.25));
  border: 1px solid rgba(0, 242, 254, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.brand-core {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, rgba(0, 242, 254, 0.3), transparent 70%);
}

.brand-mark {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-cyan);
  position: relative;
  z-index: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-role {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
  position: relative;
  padding: 6px 0;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-cyan);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-glow);
  transition: width 0.25s ease;
  border-radius: 2px;
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.25s ease;
}

.nav-cta:hover {
  background: var(--accent-cyan);
  color: #040814;
  box-shadow: var(--glow-cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.btn.primary {
  background: linear-gradient(135deg, #00f2fe 0%, #0284c7 100%);
  color: #040814;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.35);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 242, 254, 0.55);
}

.btn.glass-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.btn.glass-btn:hover {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.4);
  color: #fff;
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  min-height: 80vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
  padding: 60px 0 80px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-emerald);
  margin-bottom: 24px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
}

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

.hero-copy h1 {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #00f2fe 10%, #38bdf8 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 580px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
}

.metrics-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-val {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.metric-lbl {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

/* 3D Glass Console Card (Hero Right) */
.hero-visual {
  perspective: 1000px;
}

.glass-3d-card {
  background: linear-gradient(145deg, rgba(17, 24, 48, 0.85) 0%, rgba(10, 15, 30, 0.92) 100%);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.mac-buttons {
  display: flex;
  gap: 6px;
}

.mac-btn {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.mac-btn.red { background: #ef4444; }
.mac-btn.yellow { background: #f59e0b; }
.mac-btn.green { background: #10b981; }

.card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

.signal-indicator {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 12px;
}

.signal-bar {
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 1px;
}

.signal-bar.bar1 { height: 4px; }
.signal-bar.bar2 { height: 8px; }
.signal-bar.bar3 { height: 12px; }

.developer-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.avatar-ring {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(99, 102, 241, 0.3));
  border: 1px solid rgba(0, 242, 254, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-inner {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-cyan);
}

.avatar-meta h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.avatar-meta p {
  font-size: 12px;
  color: var(--text-muted);
}

.code-terminal {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #cbd5e1;
  background: rgba(6, 9, 19, 0.6);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.code-line {
  margin-bottom: 4px;
}

.code-line.indent {
  padding-left: 18px;
}

.c-purple { color: var(--accent-purple); }
.c-blue { color: var(--accent-blue); }
.c-cyan { color: var(--accent-cyan); }
.c-green { color: #34d399; }
.c-yellow { color: var(--accent-yellow); }
.c-orange { color: var(--accent-orange); }

.hologram-footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.holo-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.holo-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

.holo-badge {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  font-size: 10px;
}

/* Sections Base */
.section {
  padding: 80px 0;
}

.section-heading {
  margin-bottom: 48px;
  text-align: left;
}

.section-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 8px;
}

.section-heading h2 {
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 600px;
}

/* Strip Section / Engineering Ethos Card */
.intro-strip {
  margin: 40px 0 80px;
  background: linear-gradient(90deg, rgba(13, 20, 38, 0.8) 0%, rgba(20, 30, 58, 0.8) 100%);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-lg);
  padding: 42px 48px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.intro-content {
  display: flex;
  flex-direction: column;
}

.intro-content h2 {
  font-size: clamp(20px, 2.5vw, 27px);
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.intro-desc {
  display: flex;
  align-items: center;
}

.intro-desc p {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.75;
}

/* Skills 3D Cards Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.skill-card-3d {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.skill-card-3d:hover {
  transform: translateY(-6px);
  border-color: var(--border-card-hover);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.15);
  background: var(--bg-card-hover);
}

.skill-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.skill-num {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}

.skill-card-3d h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.skill-card-3d p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tags span {
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

/* =========================================================
   Projects Showcase
   ========================================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card-featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(13, 19, 36, 0.9) 0%, rgba(18, 27, 51, 0.8) 100%);
  border: 1px solid rgba(0, 242, 254, 0.32);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  backdrop-filter: blur(18px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.project-card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.project-card-featured:hover {
  border-color: rgba(0, 242, 254, 0.55);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(0, 242, 254, 0.2);
  transform: translateY(-4px);
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 34px;
  backdrop-filter: blur(14px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.project-card:hover {
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 242, 254, 0.16);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

.project-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.project-card-badge, .project-type-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 5px 12px;
  border-radius: 999px;
}

.project-shot-count {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.project-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-info h3 {
  font-size: 23px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.3;
}

.project-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.project-desc.secondary {
  font-size: 13.5px;
  color: #93c5fd;
  margin-bottom: 16px;
  line-height: 1.65;
}

.project-tech-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 24px;
}

.project-tech-pills span {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

/* User specified exact rule */
.project-action-row {
  display: flex;
  align-items: center;
}

.project-preview-btn {
  font-size: 13.5px;
  padding: 11px 22px;
  gap: 9px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Timeline Experience */
.timeline-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 860px;
}

.timeline-glow-line {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 20px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-cyan) 0%, rgba(0, 242, 254, 0.1) 100%);
}

.timeline-card {
  position: relative;
  display: flex;
  align-items: flex-start;
}

.timeline-marker {
  position: absolute;
  left: 13px;
  top: 28px;
  z-index: 2;
}

.timeline-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 14px var(--accent-cyan);
  border: 3px solid #060913;
}

.timeline-body {
  margin-left: 48px;
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.timeline-body:hover {
  border-color: var(--border-card);
  transform: translateX(4px);
}

.timeline-header {
  margin-bottom: 12px;
}

.timeline-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
}

.timeline-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.timeline-org {
  font-size: 13.5px;
  font-weight: 600;
  color: #38bdf8;
  display: block;
}

.timeline-org a {
  color: inherit;
  text-decoration: none;
}

.timeline-org a:hover {
  text-decoration: underline;
}

.timeline-body p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Contact Box / CTA */
.contact-section {
  padding: 60px 0 20px;
}

.contact-box {
  background: linear-gradient(135deg, rgba(14, 22, 44, 0.85) 0%, rgba(20, 32, 64, 0.85) 100%);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-xl);
  padding: 60px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.contact-text h2 {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
}

.contact-text p {
  font-size: 15.5px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 32px;
}

.contact-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 20px;
  margin-top: 60px;
  text-align: center;
}

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

/* Lightbox Modal (Modern Screenshots Gallery) */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gallery-modal.is-open {
  display: flex;
}

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 16, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.gallery-frame {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  max-height: 85vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-frame img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 242, 254, 0.2);
}

.gallery-caption {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 8px;
}

#gallery-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

#gallery-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-cyan);
}

.gallery-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gallery-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.gallery-nav:hover {
  background: var(--accent-cyan);
  color: #060913;
  box-shadow: var(--glow-cyan);
}

.gallery-prev { left: 24px; }
.gallery-next { right: 24px; }

/* Animations on Scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* =========================================================
   Mobile & Tablet Responsive System
   ========================================================= */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px 0 60px;
  }
  .intro-strip {
    grid-template-columns: 1fr;
    padding: 32px 28px;
    gap: 20px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-shell {
    padding: 0 16px 60px;
  }

  .topbar {
    top: 10px;
    margin-top: 10px;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 6px 0;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
  }

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

  .nav-links a {
    font-size: 13px;
    padding: 4px 0;
  }

  .nav-cta {
    padding: 6px 14px;
    font-size: 12px;
  }

  .hero-copy h1 {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.2;
  }

  .hero-lead {
    font-size: 14.5px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .metrics-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 18px;
  }

  .metric-divider {
    display: none;
  }

  .metric-val {
    font-size: 20px;
  }

  .metric-lbl {
    font-size: 10px;
  }

  .intro-strip {
    padding: 28px 20px;
  }

  .project-card-featured {
    padding: 28px 20px;
  }

  .project-card {
    padding: 24px 18px;
  }

  .project-info h3 {
    font-size: 20px;
  }

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

  .project-tech-pills {
    margin-bottom: 20px;
  }

  .timeline-marker {
    left: 8px;
  }

  .timeline-glow-line {
    left: 15px;
  }

  .timeline-body {
    margin-left: 36px;
    padding: 20px 18px;
  }

  .contact-box {
    padding: 40px 20px;
  }

  .contact-text h2 {
    font-size: 24px;
  }

  .contact-buttons {
    flex-direction: column;
  }

  .contact-buttons .btn {
    width: 100%;
  }

  .gallery-prev { left: 10px; width: 40px; height: 40px; }
  .gallery-next { right: 10px; width: 40px; height: 40px; }
  .gallery-close { top: 12px; right: 12px; width: 38px; height: 38px; }
  .gallery-frame img { max-height: 65vh; }
}

@media (max-width: 480px) {
  .status-pill {
    font-size: 10.5px;
    padding: 5px 10px;
  }

  .metrics-bar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-card-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .project-preview-btn {
    width: 100%;
  }
}
