/* ==========================================================================
   Abbosjon Portfolio - 100% Pure Standalone Modern Dark Theme CSS
   Nol tashqi bog'liqlik (No external CDN required, works 100% offline & fast)
   ========================================================================== */

:root {
  --bg-color: #090d16;
  --bg-secondary: #0f172a;
  --card-bg: #111827;
  --card-hover: #172033;
  --card-border: #1f293d;
  --card-border-hover: rgba(16, 185, 129, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-soft: rgba(16, 185, 129, 0.12);
  --primary-subtle: rgba(16, 185, 129, 0.15);
  --primary-border: rgba(16, 185, 129, 0.35);
  --primary-bg-glow: rgba(16, 185, 129, 0.08);
  --accent-cyan: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --accent-border: rgba(56, 189, 248, 0.32);
  --accent-bg-glow: rgba(56, 189, 248, 0.07);
  --accent-teal: #14b8a6;
  --accent-purple: #a855f7;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 5. Scroll Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  box-shadow: 0 0 10px var(--primary);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* 1. Cursor Glow Follower */
.cursor-glow {
  position: fixed;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 99;
  transition: transform 0.1s ease-out, background 0.3s ease;
  mix-blend-mode: screen;
}

@media (max-width: 768px) {
  .cursor-glow {
    display: none;
    /* Mobilda kursor shart emas */
  }
}

/* 3. Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 4. Border Beam Animation */
.border-beam-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  z-index: 1;
}

.border-beam-box::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg 300deg, var(--primary) 340deg, var(--accent-cyan) 360deg);
  animation: rotateBeam 4s linear infinite;
  z-index: -2;
}

.border-beam-box::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  background: var(--card-bg);
  border-radius: inherit;
  z-index: -1;
}

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

/* 2. 3D Tilt Card */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.15s ease-out, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* 6. Theme Accent Color Switcher */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #111827;
  border: 1px solid var(--card-border);
  border-radius: 9999px;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-dot:hover {
  transform: scale(1.2);
}

.color-dot.active {
  border-color: #fff;
  transform: scale(1.15);
}

.dot-green {
  background-color: #10b981;
}

.dot-cyan {
  background-color: #06b6d4;
}

.dot-purple {
  background-color: #a855f7;
}

.dot-amber {
  background-color: #f59e0b;
}

/* 9 & 10. Sound & Lofi Controls */
.nav-tool-btn {
  background: #111827;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.nav-tool-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.nav-tool-btn.active {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

/* Audio wave animation on active lofi */
.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.wave-bar {
  width: 2px;
  background: var(--primary);
  border-radius: 1px;
  animation: waveAnim 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1) {
  height: 6px;
  animation-delay: 0.1s;
}

.wave-bar:nth-child(2) {
  height: 12px;
  animation-delay: 0.3s;
}

.wave-bar:nth-child(3) {
  height: 8px;
  animation-delay: 0.2s;
}

@keyframes waveAnim {
  0% {
    height: 3px;
  }

  100% {
    height: 14px;
  }
}

/* 25. FAQ Section */
.faq-grid {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--card-border-hover);
}

.faq-heading {
  margin: 0;
}

.faq-header {
  width: 100%;
  background: transparent;
  background-color: transparent;
  border: none;
  appearance: none;
  -webkit-appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.faq-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  transition: var(--transition);
}

.faq-item.open .faq-question {
  color: var(--primary);
}

.faq-toggle-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: transform 0.3s ease, background 0.3s ease;
}

.faq-item.open .faq-toggle-icon {
  transform: rotate(180deg);
  background: var(--primary);
  color: #090d16;
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 24px;
}

.faq-item.open .faq-body {
  max-height: 600px;
  padding-bottom: 22px;
}

.faq-answer {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

/* 23. Matrix Canvas Overlay */
.matrix-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
}

.matrix-overlay.active {
  display: block;
}

.matrix-close-btn {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10000;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}

.matrix-close-btn:hover {
  background: var(--primary);
  color: #090d16;
}

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

.toast {
  background: #111827;
  border: 1px solid var(--primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.3s ease-out;
}

.toast.error {
  border-color: #f87171;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

img, video, canvas {
  max-width: 100%;
  height: auto;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip;
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

/* Background Ambient Glows */
.glow-bg-1 {
  position: fixed;
  top: -100px;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-bg-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.glow-bg-2 {
  position: fixed;
  bottom: -100px;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-bg-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.header .container {
  max-width: 1380px;
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
  height: 74px;
  display: flex;
  align-items: center;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #090d16;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-code {
  font-family: var(--font-mono);
  color: var(--primary);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 1;
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.2;
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--primary);
  color: #090d16;
}

.mobile-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 4px;
}

.mobile-lang-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.nav-terminal-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 4px 9px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  color: var(--primary);
  white-space: nowrap;
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-cta-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent-teal));
  color: #090d16;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-cta-btn:hover {
  box-shadow: 0 4px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 74px;
  left: 0;
  width: 100%;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 20px 24px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  padding: 8px 0;
}

.mobile-menu a:hover {
  color: var(--primary);
}

/* Sections Base */
section {
  scroll-margin-top: 86px;
}

#hero {
  scroll-margin-top: 140px;
  padding-top: 50px;
}

main {
  padding-top: 100px;
  padding-bottom: 80px;
}

.section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.section-title {
  font-size: clamp(1.65rem, 3.8vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-top: 8px;
}

/* Hero Section */
.hero-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 0 60px;
  margin-top: 35px;
}

.hero-content {
  flex: 1.1;
  padding-top: 15px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 24px;
  box-shadow: 0 0 15px var(--primary-glow);
}

.ping-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
}

.hero-title {
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--text-main);
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-subtitle {
  font-size: 1.35rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 18px;
  min-height: 36px;
}

.typing-cursor {
  color: var(--primary);
  animation: blink 0.9s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.hero-bio {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-teal));
  color: #090d16;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--primary-glow);
}

.btn-outline {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--card-hover);
  transform: translateY(-2px);
}

.btn-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Code Card in Hero */
.hero-code {
  flex: 0.9;
  max-width: 470px;
  width: 100%;
  margin-top: 25px;
  /* Sarlavha va status nishoni bilan to'liq simmetrik */
}

.code-window {
  background: #111827;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.window-header {
  background: #0f172a;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  position: relative;
  z-index: 3;
}

.window-dots {
  display: flex;
  gap: 7px;
}

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

.dot-red {
  background: #ef4444;
}

.dot-yellow {
  background: #f59e0b;
}

.dot-green {
  background: #10b981;
}

.window-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.copy-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
}

.copy-code-btn:hover {
  color: var(--primary);
  border-color: var(--primary-border);
}

.copy-code-btn.copied {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.code-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-indent-1 {
  padding-left: 20px;
}

.code-indent-2 {
  padding-left: 40px;
}

.kw {
  color: #c084fc;
}

/* keyword */
.cls {
  color: #facc15;
}

/* class */
.prop {
  color: #60a5fa;
}

/* property */
.str {
  color: #34d399;
}

/* string */
.comment {
  color: #64748b;
}

/* comment */

/* Stats Counter Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 30px 0 60px;
}

.stat-item {
  text-align: center;
  padding: 10px;
}

.stat-num {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.stat-num.green {
  color: var(--primary);
}

.stat-num.cyan {
  color: var(--accent-cyan);
}

.stat-num.teal {
  color: var(--accent-teal);
}

.stat-num.purple {
  color: var(--accent-purple);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-text p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-text strong {
  color: var(--text-main);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.badge-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

.about-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feature-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: var(--transition);
}

.feature-box:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-3px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.icon-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
}

.icon-cyan {
  background: var(--accent-soft);
  color: var(--accent-cyan);
}

.icon-teal {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent-teal);
}

.icon-purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.feature-box h3,
.feature-box h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.feature-box p {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.skill-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-4px);
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.skill-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-muted);
}

.skill-check {
  color: var(--primary);
  font-weight: bold;
}

/* Projects Filter & Grid */
.filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-main);
  border-color: #334155;
}

.filter-btn.active {
  background: var(--primary);
  color: #090d16;
  border-color: var(--primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -10px var(--primary-soft);
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
}

.project-badge.cyan {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent-cyan);
}

.project-badge.purple {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--accent-purple);
}

.project-badge.teal {
  background: rgba(20, 184, 166, 0.1);
  border-color: rgba(20, 184, 166, 0.3);
  color: var(--accent-teal);
}

.project-links {
  display: flex;
  gap: 12px;
}

.project-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: var(--transition);
}

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

.project-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.project-card-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.project-detail-btn:hover {
  background: var(--primary);
  color: #090d16;
  transform: translateY(-1px);
}

/* Case Study Modal Body */
.case-modal-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
  padding: 22px 24px;
}

.case-badge-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.case-block {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.case-block h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 6px;
}

.case-block p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.case-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-main);
  font-size: 0.88rem;
  line-height: 1.5;
}

.case-stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-stack-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-hover);
  border: 1px solid var(--card-border);
  color: var(--accent-cyan);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 32px 26px;
  transition: var(--transition);
}

.service-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-4px);
}

.service-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Certificates Section */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cert-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.cert-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -10px var(--primary-subtle);
}

.cert-img-container {
  position: relative;
  width: 100%;
  height: 200px;
  background: #0b0f19;
  border: none;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  color: inherit;
  display: block;
  font: inherit;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}

.cert-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}

.cert-card:hover .cert-img {
  transform: scale(1.05);
}

.cert-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(9, 13, 22, 0.6);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: var(--transition);
}

.cert-card:hover .cert-overlay {
  opacity: 1;
}

.cert-action-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.cert-action-btn:hover {
  background: var(--primary);
  color: #090d16;
  border-color: var(--primary);
}

.cert-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.cert-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.cert-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.cert-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 8px;
}

.cert-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.cert-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cert-verify-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cert-verify-link:hover {
  text-decoration: underline;
}

/* Modal for Image Preview */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 14, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  padding: 14px 20px;
  background: #0d121f;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 16px;
  background: #070a12;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 75vh;
  overflow: auto;
}

.modal-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-footer {
  padding: 12px 20px;
  background: #0d121f;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Terminal Section */
.terminal-container {
  max-width: 780px;
  margin: 0 auto;
  background: #0b0f19;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-header {
  background: #111625;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
}

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

.terminal-user-badge {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.terminal-os {
  font-size: 0.75rem;
  color: var(--primary);
}

.terminal-body {
  padding: 20px;
  height: 280px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.terminal-line-user {
  color: var(--text-muted);
  margin-bottom: 4px;
}

.prompt-prefix {
  color: var(--primary);
  font-weight: 700;
}

.terminal-output {
  color: var(--accent-cyan);
  white-space: pre-line;
  padding-left: 10px;
  border-left: 2px solid var(--accent-border);
  margin: 6px 0 14px 4px;
}

.terminal-error {
  color: #f87171;
  padding-left: 10px;
  margin: 6px 0 14px;
}

.terminal-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: #0d121f;
  border-top: 1px solid var(--card-border);
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
}

.contact-direct {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-channel {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  transition: var(--transition);
}

.contact-channel:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.contact-channel-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.contact-channel > div:not(.contact-channel-icon) {
  min-width: 0;
}

.contact-sub {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.contact-main {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  overflow-wrap: anywhere;
}

.contact-form-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-color);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

textarea.form-control {
  resize: none;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.service-chip {
  appearance: none;
  background: var(--bg-color);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 13px;
  cursor: pointer;
  transition: var(--transition);
}

.service-chip:hover {
  border-color: var(--primary-border);
  color: var(--text-main);
}

.service-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.turnstile-wrap {
  margin-bottom: 16px;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
}

/* Floating Back-to-Top Button */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--primary-border);
  background: rgba(17, 24, 39, 0.92);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 990;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  color: #090d16;
  transform: translateY(-2px);
}

.form-status {
  margin-top: 12px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  text-align: center;
}

.form-status.success {
  color: var(--primary);
}

.form-status.error {
  color: #f87171;
}

.form-status.info {
  color: var(--accent-cyan);
}

/* Footer */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 32px 0;
  background: rgba(17, 24, 39, 0.4);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MUKAMMAL RESPONSIVE MEDIA QUERIES (Barcha Qurilmalar Uchun)
   320px ultra-kichik telefondan 4K/8K ulkan doska va monitorlargacha
   ========================================================================== */

/* 1. ULKAN TAQDIMOT DOSKALARI VA 4K/8K DEVOR MONITORLARI (min-width: 2560px) */
@media (min-width: 2560px) {
  html {
    font-size: 21px; /* 4K doskalarda barcha matn va elementlar proporsional ravishda o'qilishi uchun */
  }

  .container {
    max-width: 1900px;
    padding: 0 48px;
  }

  .header .container {
    max-width: 2100px;
  }

  .hero-wrapper {
    gap: 90px;
    padding: 80px 0 100px;
  }

  .hero-code {
    max-width: 680px;
  }

  .stats-grid {
    padding: 44px 50px;
    gap: 36px;
  }

  .projects-grid,
  .cert-grid,
  .services-grid {
    gap: 36px;
  }

  .terminal-container {
    max-width: 1100px;
  }

  .terminal-body {
    height: 380px;
  }
}

/* 2. KATTA 2K / WQHD VA ULTRAWIDE MONITORLAR (min-width: 1800px and max-width: 2559px) */
@media (min-width: 1800px) and (max-width: 2559px) {
  html {
    font-size: 17.5px;
  }

  .container {
    max-width: 1540px;
    padding: 0 40px;
  }

  .header .container {
    max-width: 1680px;
  }

  .hero-wrapper {
    gap: 60px;
    padding: 60px 0 80px;
  }

  .hero-code {
    max-width: 540px;
  }

  .stats-grid {
    padding: 36px 40px;
    gap: 28px;
  }

  .terminal-container {
    max-width: 900px;
  }
}

/* 3. KENG NOUTBUKLAR VA STANDART KATTA EKRANLAR (min-width: 1360px and max-width: 1799px) */
@media (min-width: 1360px) and (max-width: 1799px) {
  .container {
    max-width: 1280px;
  }

  .header .container {
    max-width: 1400px;
  }
}

/* 4. KICHIK NOUTBUKLAR VA IXCHAM DESKTOP (max-width: 1180px) */
@media (max-width: 1180px) {
  .nav-links {
    gap: 10px;
  }

  .nav-link {
    font-size: 0.81rem;
  }

  .nav-cta-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .container {
    padding: 0 20px;
  }
}

/* 5. PLANSHET LANDSHAFT VA MOBIL MENYU CHEGARASI (max-width: 1120px) */
@media (max-width: 1120px) {
  .nav-links,
  .nav-cta-btn,
  .nav-right-group .lang-switcher {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* 6. PLANSHETLAR VA IPADLAR (max-width: 1024px) */
@media (max-width: 1024px) {
  .hero-wrapper {
    gap: 32px;
  }

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

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

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

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

  .about-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

/* 7. KATTA SMARTFONLAR VA PLANSHET PORTRET (max-width: 768px) */
@media (max-width: 768px) {
  .header {
    height: 68px;
  }

  main {
    padding-top: 80px;
    padding-bottom: 50px;
  }

  .section {
    padding: 42px 0;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .hero-wrapper {
    flex-direction: column-reverse;
    text-align: center;
    padding: 20px 0 40px;
    gap: 32px;
    min-height: auto;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
  }

  .status-badge {
    margin-bottom: 16px;
    max-width: 100%;
    text-align: center;
  }

  .hero-bio {
    margin: 0 auto 24px;
    font-size: 0.98rem;
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
    width: 100%;
  }

  .hero-code {
    max-width: 100%;
    margin-top: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 22px 18px;
    gap: 16px;
    margin-bottom: 50px;
  }

  .skills-grid,
  .projects-grid,
  .cert-grid,
  .services-grid,
  .contact-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-form-box {
    padding: 24px 18px;
  }

  .footer-content {
    flex-direction: column;
    gap: 14px;
    text-align: center;
  }
}

/* 8. STANDART SMARTFONLAR (max-width: 640px) */
@media (max-width: 640px) {
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 calc(50% - 10px);
    min-width: 140px;
    justify-content: center;
    padding: 12px 14px;
    font-size: 0.88rem;
    text-align: center;
  }

  .hero-actions .btn-icon {
    flex-shrink: 0;
  }

  .about-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* 9. IXCHAM SMARTFONLAR (max-width: 480px, masalan iPhone 12/13/14/15/16, Galaxy S) */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .brand-logo {
    gap: 8px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .brand-code {
    font-size: 1rem;
  }

  .nav-right-group {
    gap: 8px;
  }

  .nav-tool-btn {
    width: 34px;
    height: 34px;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    min-height: 48px;
  }

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

  .code-body {
    padding: 14px 12px;
    font-size: 0.74rem;
    line-height: 1.6;
  }

  .code-indent-2 {
    padding-left: 16px;
  }

  .code-indent-1 {
    padding-left: 10px;
  }

  .stats-grid {
    padding: 18px 12px;
    gap: 12px;
  }

  .stat-num {
    font-size: 1.8rem;
  }

  .stat-label {
    font-size: 0.74rem;
  }

  .filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    width: 100%;
    gap: 8px;
    justify-content: flex-start;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 0.78rem;
  }

  .faq-header {
    padding: 16px 14px;
  }

  .faq-question {
    font-size: 0.95rem;
  }

  .faq-body {
    padding: 0 14px;
  }

  .faq-item.open .faq-body {
    max-height: 600px;
    padding-bottom: 16px;
  }

  .terminal-body {
    height: 240px;
    padding: 14px;
    font-size: 0.78rem;
  }

  .terminal-header {
    padding: 10px 14px;
  }

  .terminal-form {
    padding: 10px 14px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-content {
    max-height: 92vh;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 10px;
  }

  .modal-footer {
    padding: 10px 14px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
  }

  .toast-container {
    right: 16px;
    left: 16px;
    bottom: 68px;
  }
}

/* 10. ULTRA-KICHIK SMARTFONLAR (max-width: 360px, Galaxy Fold buklangan holat, iPhone SE 1st gen, 320px) */
@media (max-width: 360px) {
  .container {
    padding: 0 10px;
  }

  .brand-code {
    display: none; /* 320px ekranlarda faqat chiroyli [A] logosi qoladi, navbar sig'ishi kafolatlanadi */
  }

  .color-dot {
    width: 14px;
    height: 14px;
  }

  .theme-picker {
    gap: 3px;
    padding: 3px 5px;
  }

  .nav-right-group {
    gap: 5px;
  }

  .nav-tool-btn {
    width: 30px;
    height: 30px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 16px 10px;
  }

  .status-badge {
    font-size: 0.72rem;
    padding: 6px 10px;
  }

  .code-body {
    font-size: 0.68rem;
    padding: 10px 8px;
  }

  .code-indent-2 {
    padding-left: 12px;
  }

  .code-indent-1 {
    padding-left: 8px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 0.82rem;
  }
}

/* 11. LANDSHAFT MOBIL REJIM (max-height: 520px and orientation: landscape) */
@media (max-height: 520px) and (orientation: landscape) {
  .hero-wrapper {
    min-height: auto;
    padding: 20px 0 30px;
  }

  .mobile-menu {
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 12px 20px;
    gap: 8px;
  }

  .mobile-menu a {
    padding: 6px 0;
    font-size: 0.9rem;
  }

  .modal-content {
    max-height: 95vh;
  }

  .modal-body .modal-img {
    max-height: 55vh;
  }
}

/* 12. SENSORLI EKRANLAR (Touchscreen / Tablets / Mobile) UCHUN TOZA TEGINISH */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .btn-icon,
  .nav-tool-btn,
  .filter-btn,
  .contact-channel,
  .faq-header {
    -webkit-tap-highlight-color: transparent;
  }

  .btn:active,
  .btn-icon:active,
  .nav-tool-btn:active {
    transform: scale(0.96);
  }

  .cert-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(9, 13, 22, 0.72) 0%, transparent 55%);
    align-items: flex-end;
    justify-content: flex-end;
    padding: 10px;
  }
}

/* Keyboard focus accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .typing-cursor,
  .ping-dot,
  .border-beam-box::before,
  .wave-bar {
    animation: none !important;
  }
}