/* Design System Constants */
:root {
  /* Premium Typography */
  --font-heading: 'Outfit', 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;

  /* Sizing and Spacers */
  --pad-xs: 0.5rem;
  --pad-sm: 1rem;
  --pad-md: 2rem;
  --pad-lg: 3.5rem;
  --pad-xl: 6rem;

  /* Board Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Dynamics */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --trans-fast: 0.25s var(--ease-out);
  --trans-normal: 0.45s var(--ease-out);
  --trans-slow: 0.75s var(--ease-out);

  /* Shadows */
  --shadow-flat: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-mockup: 0 25px 65px -15px rgba(0, 0, 0, 0.5), 0 15px 35px -20px rgba(0, 0, 0, 0.3);
  --shadow-neon: 0 0 40px -10px rgba(99, 102, 241, 0.25);
}

/* Dark Palette (Default Dribbble Deep Dark) */
.dark-theme {
  --bg-base: #030712; /* Slate 950 */
  --bg-pane: #0b0f19;
  --bg-inner: rgba(17, 24, 39, 0.65);
  --bg-input: #111827;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-bold: rgba(255, 255, 255, 0.15);
  --text-title: #f9fafb;
  --text-body: #9ca3af;
  --text-muted: #4b5563;
  --accent-cyan: #06b6d4;
  --accent-magenta: #ec4899;
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --grad-hero: linear-gradient(135deg, #f9fafb 20%, #9ca3af 100%);
  --grad-symbol: linear-gradient(135deg, #6366f1, #ec4899);
  --glow-blur-1: rgba(99, 102, 241, 0.12);
  --glow-blur-2: rgba(236, 72, 153, 0.08);
  --glow-blur-3: rgba(6, 182, 212, 0.08);
  --panel-backdrop: rgba(3, 7, 18, 0.7);
}

/* Light Palette (Premium Editorial White) */
.light-theme {
  --bg-base: #f8fafc;
  --bg-pane: #ffffff;
  --bg-inner: rgba(248, 250, 252, 0.85);
  --bg-input: #f1f5f9;
  --border-subtle: rgba(15, 23, 42, 0.06);
  --border-bold: rgba(15, 23, 42, 0.12);
  --text-title: #0f172a;
  --text-body: #475569;
  --text-muted: #94a3b8;
  --accent-cyan: #0891b2;
  --accent-magenta: #db2777;
  --accent-indigo: #4f46e5;
  --accent-green: #059669;
  --grad-hero: linear-gradient(135deg, #0f172a 30%, #475569 100%);
  --grad-symbol: linear-gradient(135deg, #4f46e5, #db2777);
  --glow-blur-1: rgba(79, 70, 229, 0.04);
  --glow-blur-2: rgba(219, 39, 119, 0.03);
  --glow-blur-3: rgba(8, 145, 178, 0.03);
  --panel-backdrop: rgba(15, 23, 42, 0.4);
}

/* Document Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-base);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.625;
  min-height: 100vh;
  position: relative;
  transition: background-color var(--trans-normal), color var(--trans-normal);
}

/* Floating Aura Blobs */
.aura-glow {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(160px);
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: all var(--trans-slow);
}

.aura-glow-indigo {
  top: -120px;
  right: -50px;
  width: 550px;
  height: 550px;
  background-color: var(--glow-blur-1);
}

.aura-glow-magenta {
  top: 450px;
  left: -150px;
  width: 650px;
  height: 650px;
  background-color: var(--glow-blur-2);
}

.aura-glow-cyan {
  bottom: 50px;
  right: 15%;
  width: 500px;
  height: 500px;
  background-color: var(--glow-blur-3);
}

/* Header Elements */
header {
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(var(--bg-base), 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: border var(--trans-normal);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 74px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-symbol {
  width: 38px;
  height: 38px;
  background: var(--grad-symbol);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -1px;
}

.logo-symbol span:last-child {
  opacity: 0.7;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -1.2px;
  color: var(--text-title);
  text-transform: lowercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Pulsing Status Dot (CNN Energy) */
.live-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-pane);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.ticker-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--accent-magenta);
  border-radius: var(--radius-full);
  position: relative;
}

.ticker-pulse::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--accent-magenta);
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.ticker-label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: 0.8px;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* Theme Toggle Button */
.theme-btn {
  background: var(--bg-pane);
  border: 1px solid var(--border-subtle);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
}

.theme-btn:hover {
  border-color: var(--border-bold);
  transform: translateY(-1.5px);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-title);
}

.dark-theme .sun-icon { display: block; }
.dark-theme .moon-icon { display: none; }
.light-theme .sun-icon { display: none; }
.light-theme .moon-icon { display: block; }

/* Hero Magazine Section */
.hero-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--pad-md) var(--pad-md) 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-cat-tag {
  color: var(--accent-indigo);
}

.bullet-divider {
  width: 4px;
  height: 4px;
  background-color: var(--text-muted);
  border-radius: var(--radius-full);
}

.hero-date {
  color: var(--text-muted);
}

.hero-section h1 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 850;
  letter-spacing: -2.2px;
  line-height: 1.08;
  margin: 0;
  max-width: 1100px;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-body);
  max-width: 800px;
  line-height: 1.55;
  margin-bottom: var(--pad-md);
}

/* Stats Row */
.hero-stats {
  display: flex;
  gap: 3rem;
}

.hero-stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-title);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Grid & Showcase Section */
.showcase-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--pad-md);
}

/* CNN-style Toolbar (Search & Filter Row) */
.toolbar {
  margin-bottom: var(--pad-md);
}

.toolbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--pad-sm);
  padding-bottom: var(--pad-sm);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.search-bar-wrapper {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.search-bar-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-bar-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background-color: var(--bg-pane);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-title);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: all var(--trans-fast);
}

.search-bar-wrapper input:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.results-tracker {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.toolbar-bottom {
  padding-top: var(--pad-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-scroller-fade {
  display: flex;
}

.filter-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: transparent;
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--trans-fast);
}

.tab-btn:hover {
  border-color: var(--border-bold);
  color: var(--text-title);
}

.tab-btn.active {
  background-color: var(--text-title);
  color: var(--bg-base);
  border-color: var(--text-title);
}

/* Editorial Masonry Grid */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.25rem;
}

/* Custom Dribbble Card Layout */
.project-card {
  background: var(--bg-pane);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--trans-normal);
  position: relative;
  box-shadow: var(--shadow-flat);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-bold);
  box-shadow: var(--shadow-mockup);
}

/* CNN/Dribbble Browser Mockup Frame */
.browser-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1.55 / 1;
  background-color: var(--bg-input);
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.browser-titlebar {
  background-color: rgba(30, 41, 59, 0.15);
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 5;
}

.browser-dots {
  display: flex;
  gap: 6px;
  position: absolute;
  left: 14px;
}

.browser-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}
.browser-dot.red { background-color: #ff5f56; }
.browser-dot.yellow { background-color: #ffbd2e; }
.browser-dot.green { background-color: #27c93f; }

.browser-url-input {
  flex: 1;
  max-width: 260px;
  margin: 0 auto;
  background: var(--bg-pane);
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.browser-screen {
  width: 100%;
  height: calc(100% - 32px);
  position: relative;
  overflow: hidden;
}

.browser-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--trans-slow);
}

.project-card:hover .browser-screen img {
  transform: scale(1.04);
}

.browser-screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.project-card:hover .browser-screen-overlay {
  opacity: 1;
}

.dribbble-action-circle {
  background-color: var(--text-title);
  color: var(--bg-base);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  opacity: 0;
  transition: all var(--trans-normal);
}

.project-card:hover .dribbble-action-circle {
  transform: scale(1);
  opacity: 1;
}

/* Card Information Body */
.card-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-metadata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Fine-tuned Badge Colors */
.tag-recruitment { background-color: rgba(99, 102, 241, 0.1); color: var(--accent-indigo); }
.tag-ngo { background-color: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.tag-food { background-color: rgba(236, 72, 153, 0.1); color: var(--accent-magenta); }
.tag-sports { background-color: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); }
.tag-agency { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.tag-edtech { background-color: rgba(168, 85, 247, 0.1); color: #a855f7; }
.tag-saas { background-color: rgba(244, 63, 94, 0.1); color: #f43f5e; }

.project-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.project-card p {
  color: var(--text-body);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.card-footer-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: color var(--trans-fast);
}

.card-footer-link:hover {
  color: var(--text-title);
}

.card-footer-link svg {
  width: 12px;
  height: 12px;
}

.btn-open-panel {
  background: transparent;
  border: none;
  color: var(--accent-indigo);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-open-panel svg {
  transition: transform var(--trans-fast);
}

.btn-open-panel:hover svg {
  transform: translateX(3px);
}

/* 🏆 Dynamic CNN-Style Spotlight Card (Index 0 or Featured) */
.featured-card {
  grid-column: span 2;
  flex-direction: row;
}

.featured-card .browser-frame {
  width: 55%;
  aspect-ratio: auto;
  height: 100%;
  border-bottom: none;
  border-right: 1px solid var(--border-subtle);
}

.featured-card .browser-screen {
  height: calc(100% - 32px);
}

.featured-card .card-details {
  width: 45%;
  padding: var(--pad-md);
  justify-content: center;
}

.featured-card p {
  -webkit-line-clamp: 4;
}

.featured-badge {
  background-color: var(--accent-indigo);
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-right: 8px;
}

/* Dribbble Slide-Over Modal Styles */
.slide-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
  transition: visibility var(--trans-normal);
  overflow: hidden;
}

.slide-modal.active {
  pointer-events: auto;
  visibility: visible;
}

.slide-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--panel-backdrop);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--trans-normal);
}

.slide-modal.active .slide-modal-backdrop {
  opacity: 1;
}

.slide-modal-panel {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 100vh;
  background-color: var(--bg-pane);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--trans-normal);
  z-index: 10;
}

.slide-modal.active .slide-modal-panel {
  transform: translateX(0);
}

.slide-modal-header {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--pad-md);
  border-bottom: 1px solid var(--border-subtle);
}

.close-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-title);
  transition: all var(--trans-fast);
}

.close-btn:hover {
  background-color: var(--bg-base);
  border-color: var(--border-bold);
  transform: scale(1.05);
}

.slide-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--pad-md);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Browser Mockup Inside Slide panel */
.panel-mockup-wrapper {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-flat);
}

.panel-browser-bar {
  background: rgba(30, 41, 59, 0.1);
  height: 34px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-address-bar {
  background-color: var(--bg-pane);
  height: 20px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-body);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  border: 1px solid var(--border-subtle);
  min-width: 240px;
}

.lock-icon {
  width: 10px;
  height: 10px;
  stroke: var(--accent-green);
}

.panel-screen {
  width: 100%;
  aspect-ratio: 1.55 / 1;
  overflow-y: auto;
}

.panel-screen img {
  width: 100%;
  display: block;
}

/* Content Inside Panel */
.panel-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel-meta-row {
  display: flex;
}

.panel-heading {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 850;
  color: var(--text-title);
  letter-spacing: -1px;
  line-height: 1.15;
}

.panel-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
}

.panel-section h3 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.panel-feature-list {
  list-style: none;
}

.panel-feature-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-body);
}

.panel-feature-list li::before {
  content: "✦";
  position: absolute;
  left: 4px;
  color: var(--accent-indigo);
  font-weight: bold;
}

.tech-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-footer-actions {
  margin-top: 1rem;
  display: flex;
}

.launch-btn {
  background-color: var(--text-title);
  color: var(--bg-base);
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.launch-btn:hover {
  background-color: var(--accent-indigo);
  color: white;
  box-shadow: var(--shadow-neon);
}

.launch-btn svg {
  width: 16px;
  height: 16px;
}

/* No Results Card */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--pad-xl) var(--pad-md);
  background-color: var(--bg-pane);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  color: var(--text-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.no-results svg {
  width: 44px;
  height: 44px;
  stroke: var(--text-muted);
}

/* Editorial Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-pane);
  padding: var(--pad-md) 0;
  margin-top: var(--pad-xl);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--pad-sm);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-left p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-right p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Drag handle hidden by default on desktop */
.panel-handle {
  display: none;
}

/* Mobile Bottom App Nav styling (Hidden on desktop) */
.mobile-nav {
  display: none;
}

/* Responsiveness */
@media (max-width: 1200px) {
  .hero-section h1 { font-size: 3.2rem; }
  .masonry-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .featured-card { grid-column: span 2; }
}

@media (max-width: 900px) {
  .hero-section h1 { font-size: 2.5rem; }
  .masonry-grid { grid-template-columns: 1fr; }
  .featured-card { grid-column: span 1; flex-direction: column; }
  .featured-card .browser-frame { width: 100%; height: auto; aspect-ratio: 1.55 / 1; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .featured-card .card-details { width: 100%; }
}

@media (max-width: 600px) {
  /* Hide heavy graphic background blurs on mobile for performance and safety */
  .aura-glow {
    display: none;
  }

  body {
    padding-bottom: 84px; /* Space for mobile nav bar */
  }

  /* Header adjustments */
  header {
    height: 62px;
  }
  .header-inner {
    height: 62px;
    justify-content: center;
    padding: 0 1rem;
  }
  .header-right {
    display: none; /* Hide top theme switch to avoid double switches */
  }

  /* Hero Section adjustments */
  .hero-section {
    padding: 1.5rem 1rem 0.5rem;
  }
  .hero-section h1 {
    font-size: 2.2rem;
    letter-spacing: -1.2px;
  }

  /* Toolbar styling */
  .showcase-container {
    padding: 1rem;
  }
  .toolbar {
    margin-bottom: 1rem;
  }
  .toolbar-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-bottom: none;
    padding-bottom: 0;
  }
  .search-bar-wrapper {
    max-width: 100%;
  }
  .results-tracker {
    font-size: 0.8rem;
    text-align: right;
    color: var(--text-muted);
  }
  .toolbar-bottom {
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
  }

  /* Masonry Grid & Cards */
  .masonry-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .project-card {
    border-radius: var(--radius-md);
  }
  .card-details {
    padding: 1.25rem;
  }
  .project-card h3 {
    font-size: 1.2rem;
  }
  
  /* Browser Mockup slimmed on mobile */
  .browser-titlebar {
    height: 28px;
  }
  .browser-dots {
    left: 10px;
  }
  .browser-url-input {
    font-size: 0.6rem;
    height: 16px;
    max-width: 180px;
  }
  .browser-screen {
    height: calc(100% - 28px);
  }

  /* Slide-Over Panel morphs to App Bottom Sheet Drawers */
  .slide-modal {
    align-items: flex-end; /* Bottom alignment */
  }
  
  .slide-modal-panel {
    width: 100%;
    height: 85vh;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    transform: translateY(100%); /* Slide up transition */
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.4);
    max-width: 100%;
  }
  
  .slide-modal.active .slide-modal-panel {
    transform: translateY(0); /* Slide up to view */
  }
  
  .panel-handle {
    display: block;
    width: 44px;
    height: 5px;
    background-color: var(--text-muted);
    opacity: 0.4;
    border-radius: var(--radius-full);
    margin: 12px auto 2px;
    flex-shrink: 0;
  }
  
  .slide-modal-header {
    height: 48px;
    padding: 0 1.25rem 10px;
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .slide-modal-body {
    padding: 1.25rem;
    gap: 1.5rem;
  }
  
  .panel-heading {
    font-size: 1.65rem;
  }
  
  .panel-screen {
    aspect-ratio: 1.5 / 1;
  }

  /* Footer adjustments */
  footer {
    margin-top: var(--pad-md);
    padding: var(--pad-sm) 0;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  /* Sticky App Navigation Bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    z-index: 990;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  }
  
  .light-theme .mobile-nav {
    background: rgba(255, 255, 255, 0.94);
  }

  .nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 700;
    gap: 4px;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: color var(--trans-fast), transform var(--trans-fast);
  }
  
  .nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2px;
    transition: transform var(--trans-fast);
  }
  
  .nav-item:active {
    transform: scale(0.9);
  }
  
  .nav-item.active {
    color: var(--accent-indigo);
  }
  
  .nav-item.active svg {
    transform: scale(1.1);
  }
}
