@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root, html[data-theme="dark"] {
  --bg: #090c10;
  --surface: rgba(18, 24, 34, 0.7);
  --surface-solid: #121822;
  --surface-2: rgba(26, 34, 48, 0.6);
  --border: rgba(255, 107, 43, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #ff7738;
  --primary-container: #ff6b2b;
  --primary-glow: rgba(255, 107, 43, 0.4);
  --tertiary: #38bdf8;
  --tertiary-glow: rgba(56, 189, 248, 0.35);
  --accent-green: #10b981;
  --code-bg: #06090e;
  --code-text: #e2e8f0;
  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 25px rgba(255, 107, 43, 0.05);
}

html[data-theme="light"] {
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-2: #f1f5f9;
  --border: rgba(255, 107, 43, 0.25);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #ea580c;
  --primary-container: #f97316;
  --primary-glow: rgba(249, 115, 22, 0.3);
  --tertiary: #0284c7;
  --tertiary-glow: rgba(2, 132, 199, 0.2);
  --accent-green: #10b981;
  --code-bg: #0f172a;
  --code-text: #f8fafc;
  --card-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
}

html[data-theme="midnight"] {
  --bg: #060814;
  --surface: rgba(15, 19, 44, 0.75);
  --surface-solid: #0f132c;
  --surface-2: rgba(23, 29, 66, 0.6);
  --border: rgba(139, 92, 246, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --text: #f1f5f9;
  --text-muted: #a5b4fc;
  --primary: #a78bfa;
  --primary-container: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --tertiary: #38bdf8;
  --tertiary-glow: rgba(56, 189, 248, 0.3);
  --accent-green: #10b981;
  --code-bg: #050711;
  --code-text: #e0e7ff;
  --card-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(139, 92, 246, 0.1);
}

html[data-theme="matrix"] {
  --bg: #040705;
  --surface: rgba(10, 20, 14, 0.75);
  --surface-solid: #0a140e;
  --surface-2: rgba(16, 32, 22, 0.6);
  --border: rgba(16, 185, 129, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text: #ecfdf5;
  --text-muted: #6ee7b7;
  --primary: #34d399;
  --primary-container: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.4);
  --tertiary: #06b6d4;
  --tertiary-glow: rgba(6, 182, 212, 0.3);
  --accent-green: #10b981;
  --code-bg: #020403;
  --code-text: #a7f3d0;
  --card-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: var(--primary-container); color: #fff; }

/* Custom Glowing Cyber Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(9, 12, 16, 0.95); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-container), var(--tertiary));
  border-radius: 999px;
  border: 2px solid rgba(9, 12, 16, 0.8);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff8f5c, #38bdf8);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Neon Top Scroll Progress Indicator */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #ff4500, #ff7738, #38bdf8, #10b981);
  z-index: 9999;
  box-shadow: 0 0 14px rgba(255, 107, 43, 0.8), 0 0 24px rgba(56, 189, 248, 0.6);
  transition: width 0.1s ease-out;
  pointer-events: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" on, "cv01" on;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { -webkit-tap-highlight-color: transparent; color: inherit; text-decoration: none; }
code { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Custom Ambient Animated Glow Background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(750px circle at 10% 0%, var(--primary-glow), transparent 70%),
    radial-gradient(650px circle at 90% 20%, var(--tertiary-glow), transparent 70%),
    radial-gradient(800px circle at 50% 90%, rgba(16, 185, 129, 0.08), transparent 70%);
}

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Ultra-Glassy Transparent Top Header with Cyber Glow */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(9, 12, 16, 0.45);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 4px 6px;
  border-radius: 14px;
}
.header-brand:hover {
  transform: translateY(-2px) scale(1.02);
}
.header-brand:active {
  transform: scale(0.96);
}

/* Rotating Tiranga (Indian Tricolor) Animated Avatar Icon */
.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background: transparent;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(255, 107, 43, 0.45);
}

/* Rotating Tiranga Glow Border */
.brand-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 2.5px;
  background: conic-gradient(
    #ff9933 0deg,
    #ffffff 90deg,
    #138808 180deg,
    #000080 270deg,
    #ff9933 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateTiranga 3.5s linear infinite;
  box-shadow: 0 0 16px rgba(255, 153, 51, 0.6);
}

@keyframes rotateTiranga {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.brand-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid rgba(9, 12, 16, 0.9);
}

/* Futuristic Metallic Gradient Typography with Auto-Slide Collapse */
.brand-text-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  max-width: 260px;
  opacity: 1;
  transform: translateX(0);
  transition: max-width 0.9s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), margin 0.8s ease;
  animation: autoCollapseText 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.5s forwards;
}

/* Hover over brand expands text back smoothly */
.header-brand:hover .brand-text-wrap {
  max-width: 260px !important;
  opacity: 1 !important;
  transform: translateX(0) !important;
  margin-left: 0 !important;
}

@keyframes autoCollapseText {
  0% {
    max-width: 260px;
    opacity: 1;
    transform: translateX(0);
    margin-left: 0;
  }
  100% {
    max-width: 0;
    opacity: 0;
    transform: translateX(-20px);
    margin-left: -12px;
  }
}

.brand-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(135deg, #ffffff 30%, #ffd0b5 70%, #ff8f5c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 107, 43, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Futuristic Cyber Pulse Badge */
.brand-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
}
.brand-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: badgeDotPulse 1.8s infinite;
}
@keyframes badgeDotPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #34d399; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Glassy Navigation Tabs with Fluid Gliding Active Pill */
.header-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}
.header-nav a {
  position: relative;
  z-index: 2;
  color: var(--text-muted);
  font-size: 13.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 8px 18px;
  border-radius: 10px;
  transition: color .25s ease, transform .2s ease;
  font-weight: 600;
  border: 1px solid transparent;
  user-select: none;
}
.header-nav a:hover {
  color: #fff;
  transform: translateY(-1px);
}
.header-nav a:active {
  transform: scale(0.93);
}
.header-nav a.active {
  color: #ff8f5c;
  font-weight: 700;
}

/* Sliding active pill glider */
.nav-glider {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  background: rgba(255, 107, 43, 0.15);
  border: 1px solid rgba(255, 107, 43, 0.45);
  box-shadow: 0 0 18px rgba(255, 107, 43, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  z-index: 1;
  pointer-events: none;
  transition: all .35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

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

.theme-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.theme-icon-btn:hover {
  background: rgba(255, 107, 43, 0.2);
  border-color: var(--primary);
  color: #fff;
  transform: scale(1.08) rotate(8deg);
  box-shadow: 0 0 18px var(--primary-glow);
}
.theme-icon-btn:active {
  transform: scale(0.88) rotate(-15deg);
}

main.page {
  flex: 1;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }
  .header-nav {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .header-nav::-webkit-scrollbar { display: none; }
  main.page { padding: 24px 16px 60px; }
}

/* 3D Spring Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(32px) scale(0.96);
  transition: opacity .7s cubic-bezier(0.16, 1, 0.3, 1), transform .7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp .85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeInUp {
  from { opacity:0; transform: translateY(28px) scale(0.97);}
  to { opacity:1; transform: translateY(0) scale(1);}
}

/* Hero Section */
.hero { padding: 25px 0 45px; text-align: left; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.badge-pill.hot {
  background: rgba(255, 107, 43, 0.12);
  border-color: rgba(255, 107, 43, 0.3);
  color: var(--primary);
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  line-height: 1.2;
}

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 720px;
  margin: 0 0 28px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 35px; }

.btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff7738, #e05316);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(255, 107, 43, 0.4), inset 0 1px 1px rgba(255,255,255,0.3);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  user-select: none;
}
.btn-glow:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 34px rgba(255, 107, 43, 0.65);
}
.btn-glow:active {
  transform: translateY(1px) scale(0.95);
  box-shadow: 0 4px 14px rgba(255, 107, 43, 0.4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 107, 43, 0.2);
}
.btn-outline:active {
  transform: translateY(1px) scale(0.95);
}

.stats-row { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border-subtle); }
.stat .num { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 800; color: var(--primary); }
.stat .lbl { font-size: 11.5px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .05em; }

.skills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  transition: all .25s ease;
}
.skill-chip .icon { width: 14px; height: 14px; color: var(--primary); }
.skill-chip.highlight { background: rgba(255, 107, 43, 0.15); border-color: rgba(255, 107, 43, 0.35); color: var(--primary); font-weight: 700; }
.skill-chip:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 8px 20px rgba(0,0,0,0.3); }

/* Card Grids */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; margin: 40px 0; }
.card {
  grid-column: span 12;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--card-shadow);
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.8), 0 0 25px var(--primary-glow);
  border-color: var(--border);
}
@media (min-width: 800px) {
  .card.span8 { grid-column: span 8; }
  .card.span4 { grid-column: span 4; }
  .card.span6 { grid-column: span 6; }
}
.card h2, .card h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; }
.card p { color: var(--text-muted); line-height: 1.7; font-size: 14.5px; margin: 0; }

.bar-row { margin-bottom: 16px; }
.bar-row .label-row { display: flex; justify-content: space-between; font-size: 12px; font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; color: var(--text-muted); }
.bar { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--primary-container), var(--tertiary)); width: 0; transition: width 1.4s cubic-bezier(.65,0,.35,1); border-radius: 999px; }

.dev-card { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.dev-card .emoji { font-size: 46px; animation: floatY 4s ease-in-out infinite; display: flex; color: var(--primary); }
@keyframes floatY { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-8px);} }
.dev-card a { color: var(--tertiary); font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 600; margin-right: 16px; transition: color .2s; }
.dev-card a:hover { color: var(--primary); }

.terminal {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 16px;
  padding: 26px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 2px 14px rgba(0,0,0,0.7);
}
.terminal .accent1 { color: var(--primary); font-weight: 700; }
.terminal .accent2 { color: var(--tertiary); }

.projects-teaser { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.mini-project {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  transition: all .25s ease;
}
.mini-project:hover { transform: translateX(6px); border-color: var(--primary); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.mini-project .mp-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255, 107, 43, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.mini-project .mp-text { flex: 1; min-width: 0; }
.mini-project .mp-text b { display: block; font-size: 14px; }
.mini-project .mp-text span { font-size: 12.5px; color: var(--text-muted); }

/* API Reference & Docs Page */
.limit-banner {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.limit-banner a { color: var(--primary); font-weight: 700; }

.toc { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 35px; }
.toc a {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: 'JetBrains Mono', monospace;
  transition: all .25s ease;
}
.toc a:hover { background: var(--primary-container); color: #fff; border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 18px var(--primary-glow); }

.api-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--card-shadow);
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.api-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.8), 0 0 25px var(--primary-glow);
  border-color: var(--border);
}

.api-card-header h3 { margin: 8px 0 6px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; letter-spacing: -0.01em; font-size: 20px; }
.api-desc { color: var(--text-muted); font-size: 14px; margin: 0 0 16px; line-height: 1.6; }
.method-badge {
  background: var(--primary-container);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  margin-right: 8px;
}
.api-path { font-family: 'JetBrains Mono', monospace; color: var(--tertiary); font-size: 13px; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
  scrollbar-width: thin;
}
table { width: 100%; min-width: 440px; border-collapse: collapse; margin: 0; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.req { color: #e11d48; font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: 11px; }

.code-block { margin-top: 14px; width: 100%; }
.lang-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: -1px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.lang-tabs::-webkit-scrollbar { display: none; }
.lang-tab {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 6px 11px;
  font-size: 11.5px;
  border-radius: 6px 6px 0 0;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.lang-tab.active { background: var(--code-bg); color: var(--code-text); border-color: var(--code-bg); }
.lang-tab:hover:not(.active) { background: var(--border); }

.copy-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  transition: background .2s, color .2s;
}
.copy-btn:hover { background: var(--primary-container); color: #fff; border-color: transparent; }

.code-pane {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px;
  border-radius: 0 8px 8px 8px;
  overflow-x: auto;
  font-size: 12px;
  margin: 0;
  display: none;
  -webkit-overflow-scrolling: touch;
}
.code-pane.active { display: block; }

.sample-response { margin-top: 14px; }
.sample-response summary { cursor: pointer; color: var(--text-muted); font-size: 12.5px; font-family: 'JetBrains Mono', monospace; }
.sample-response pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 12px;
  border-radius: 8px;
  font-size: 11.5px;
  overflow-x: auto;
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
}

/* Playground */
.playground { margin-top: 24px; border-top: 1px dashed var(--border-subtle); padding-top: 20px; }
.playground h4 {
  margin: 0 0 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--tertiary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.playground-inputs { display: flex; flex-wrap: wrap; gap: 10px; }
.pg-input {
  flex: 1;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  transition: all .2s ease;
}
.pg-input:focus {
  border-color: var(--primary);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 14px var(--primary-glow);
}
.run-btn {
  background: linear-gradient(135deg, var(--primary-container), #e05316);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 18px var(--primary-glow);
  transition: all .2s ease;
}
.run-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 43, 0.55);
}
.run-btn:active { transform: translateY(0); }
.playground-output {
  margin-top: 14px;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 18px;
  border-radius: 12px;
  font-size: 12.5px;
  overflow-x: auto;
  min-height: 48px;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.6);
}

/* Projects Page */
.projects-list { display: flex; flex-direction: column; gap: 24px; margin-top: 30px; }
.project-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 30px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  box-shadow: var(--card-shadow);
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover {
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.8), 0 0 25px var(--primary-glow);
  border-color: var(--border);
  transform: translateY(-4px);
}

.project-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  flex-shrink: 0;
  background: rgba(255, 107, 43, 0.14);
  border: 1px solid rgba(255, 107, 43, 0.25);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 20px var(--primary-glow);
}
.project-body { flex: 1; min-width: 220px; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.project-top h3 { margin: 0; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; letter-spacing: -0.02em; font-size: 20px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-weight: 700;
}
html[data-theme="dark"] .status-pill,
html[data-theme="midnight"] .status-pill,
html[data-theme="matrix"] .status-pill { color: #4ade80; }

.project-tagline { color: var(--text); font-weight: 600; font-size: 14.5px; margin: 8px 0 6px; }
.project-desc { color: var(--text-muted); line-height: 1.65; font-size: 14px; margin: 0 0 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.tag-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.project-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.project-url { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-muted); }

.more-card {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 26px;
  text-align: center;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin-top: 26px;
}
.more-card a { color: var(--primary-container); font-weight: 700; }

/* Cloud Embed Page */
.cloud-frame-wrap { position: fixed; inset: 0; width: 100vw; height: 100vh; overflow: hidden; background: var(--surface); }
.cloud-frame { width: 100%; height: 100%; border: none; }
.back-fab {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  font-family: 'JetBrains Mono', monospace;
  transition: transform .2s;
}
.back-fab:hover { transform: scale(1.08); }
.cloud-fallback {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  text-align: center;
  padding: 24px 30px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.cloud-fallback.show { display: block; }
.cloud-fallback a { color: var(--primary-container); font-weight: 700; }

/* Swagger UI Crisp Native Styling */
#swagger-ui-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 20px 60px;
}
.swagger-ui .topbar { display: none !important; }
.swagger-ui .information-container { padding: 20px 0; }
.swagger-ui .info .title {
  color: var(--text) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-weight: 800 !important;
  font-size: 32px !important;
}
.swagger-ui .info p, .swagger-ui .info li, .swagger-ui .info a {
  color: var(--text-muted) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}
.swagger-ui .scheme-container {
  background: var(--surface) !important;
  box-shadow: none !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  margin-bottom: 24px !important;
}
.swagger-ui .opblock-tag {
  color: var(--text) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  border-bottom: 1px solid var(--border) !important;
}
.swagger-ui .opblock {
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: var(--card-shadow) !important;
  margin: 0 0 16px !important;
}
.swagger-ui .opblock .opblock-summary {
  padding: 10px 16px !important;
}
.swagger-ui .opblock .opblock-summary-path {
  color: var(--text) !important;
  font-family: 'JetBrains Mono', monospace !important;
}
.swagger-ui .opblock .opblock-summary-description {
  color: var(--text-muted) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}
.swagger-ui .opblock-body {
  background: var(--surface-2) !important;
  padding: 16px !important;
}
.swagger-ui .opblock-description-wrapper p, .swagger-ui .opblock-external-docs-wrapper p, .swagger-ui .opblock-title_normal p {
  color: var(--text-muted) !important;
}
.swagger-ui table thead tr th, .swagger-ui table thead tr td {
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--border) !important;
}
.swagger-ui .tab li button.tablinks {
  color: var(--text-muted) !important;
  font-family: 'JetBrains Mono', monospace !important;
}
.swagger-ui .tab li.active button.tablinks {
  color: var(--primary) !important;
  font-weight: bold !important;
}
.swagger-ui section.models {
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  background: var(--surface) !important;
}
.swagger-ui section.models h4 {
  color: var(--text) !important;
}
.swagger-ui select, .swagger-ui input[type=text] {
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
}
.swagger-ui .btn.execute {
  background-color: var(--primary-container) !important;
  border-color: var(--primary-container) !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-family: 'JetBrains Mono', monospace !important;
}
.swagger-ui .btn.try-out__btn {
  border-radius: 6px !important;
  font-family: 'JetBrains Mono', monospace !important;
}

/* Admin Panel Styles */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}
.admin-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.admin-badge.active { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.admin-badge.inactive { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; font-family: 'JetBrains Mono', monospace; color: var(--text-muted); }
.form-control {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  transition: border-color .2s;
}
.form-control:focus { border-color: var(--primary-container); outline: none; }
textarea.form-control { min-height: 90px; resize: vertical; }

.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .15s, opacity .2s;
}
.btn-admin:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background: var(--primary-container); color: #fff; }
.btn-danger { background: #e11d48; color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  margin-top: auto;
}
footer a { color: var(--tertiary); transition: color .2s; }
footer a:hover { color: var(--primary); }

/* ============ COMPREHENSIVE MOBILE RESPONSIVENESS ============ */
@media (max-width: 768px) {
  .main-header {
    padding: 10px 14px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .main-header::-webkit-scrollbar { display: none !important; }
  .header-brand {
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  .brand-icon {
    width: 36px !important;
    height: 36px !important;
  }
  .brand-text {
    font-size: 16px !important;
  }
  .brand-badge {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }
  .header-nav {
    order: unset !important;
    width: auto !important;
    display: inline-flex !important;
    flex-shrink: 0 !important;
    padding: 3px 4px !important;
    gap: 2px !important;
  }
  .header-nav a {
    padding: 6px 10px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
  .header-right {
    flex-shrink: 0 !important;
  }
  .theme-icon-btn {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px !important;
  }
  main.page {
    padding: 20px 12px 60px !important;
  }
  .card, .api-card, .storage-bar-card, .dropzone, .project-card {
    padding: 18px 14px !important;
    border-radius: 16px !important;
    margin-bottom: 18px !important;
  }
  .api-card-header h3 {
    font-size: 17px !important;
  }
  .api-path {
    font-size: 12px !important;
    word-break: break-all;
    display: inline-block;
  }
  .code-pane {
    padding: 12px 10px !important;
    font-size: 11.5px !important;
  }
  .playground-inputs {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .pg-input {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .run-btn {
    width: 100% !important;
    padding: 11px !important;
    justify-content: center !important;
  }
  .hero h1 {
    font-size: 26px !important;
  }
  .btn-row {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .btn-glow, .btn-outline {
    width: 100% !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .stats-row {
    gap: 12px !important;
    justify-content: space-between !important;
  }
  .stat {
    flex: 1 1 42% !important;
  }
  .dev-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
  }
  footer {
    padding: 20px 12px;
    font-size: 11.5px;
  }
}

@media (max-width: 480px) {
  .brand-text {
    font-size: 15px !important;
  }
  .brand-badge {
    display: none !important;
  }
  .hero h1 {
    font-size: 23px !important;
  }
}
