:root {
  --bg-primary: #000000;
  --bg-secondary: #0A0A0A;
  --bg-card: #111111;
  --text-primary: #FFFFFF;
  --text-muted: #B8B8B8;
  --border-subtle: rgba(255, 255, 255, 0.10);
  --turquoise-primary: #40E0D0;
  --turquoise-hover: #20C9B9;
  --turquoise-glow: rgba(64, 224, 208, 0.25);

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-ui: 'Manrope', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --topbar-height: 70px;
}

[data-theme="light"] {
  --bg-primary: #F8F9FA;
  --bg-secondary: #FFFFFF;
  --bg-card: #EEEEEE;
  --text-primary: #000000;
  --text-muted: #555555;
  --border-subtle: rgba(0, 0, 0, 0.12);
  --turquoise-primary: #1AAE9F;
  --turquoise-hover: #129688;
  --turquoise-glow: rgba(26, 174, 159, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary);
  font-family: var(--font-body);
  padding-top: var(--topbar-height);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Override Bootstrap containers */
.bg-secondary-subtle,
.bg-body-secondary,
.bg-light {
  background-color: var(--bg-secondary) !important;
}

.max-width-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-6 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.border-y-subtle {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

a {
  text-decoration: none;
  color: inherit;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 16px);
  overflow-x: clip;
}

body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary);
  font-family: var(--font-body);
  padding-top: var(--topbar-height);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: clip;
  overflow-y: auto;
  min-height: 100%;
}

.hero-section {
  padding-top: 3rem;
  padding-bottom: 3rem;
  min-height: calc(100svh - var(--topbar-height));
  display: flex;
  align-items: center;
}

.hero-animated-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  color: var(--text-primary);
  transition: opacity 0.3s ease;
}

#skills,
#services,
#partners,
#blog {
  scroll-margin-top: calc(var(--topbar-height) + 16px);
}

.error-404-main {
  min-height: calc(100svh - var(--topbar-height) - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.25rem;
}

.error-404-panel {
  width: min(100%, 640px);
  text-align: center;
}

.error-404-kicker {
  margin: 0;
  font-family: var(--font-code);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--turquoise-primary);
}

.error-404-code {
  margin: 0.15rem 0 0.4rem;
  font-family: var(--font-heading);
  font-size: clamp(5.5rem, 18vw, 8.5rem);
  line-height: 0.9;
  color: var(--text-primary);
}

.error-404-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 0.75rem;
}

.error-404-copy {
  color: var(--text-muted);
  margin: 0 auto 1.75rem;
  max-width: 28rem;
}

.error-404-copy code {
  font-family: var(--font-code);
  color: var(--turquoise-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

.error-404-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.error-404-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
}

[data-theme="light"] {
  --bg-primary: #F5F6F8;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-primary: #111111;
  --text-muted: #5F6368;
  --border-subtle: rgba(17, 17, 17, 0.10);
  --turquoise-primary: #1AAE9F;
  --turquoise-hover: #129688;
  --turquoise-glow: rgba(26, 174, 159, 0.18);
}

[data-theme="light"] .abir-topbar {
  background: rgba(255, 255, 255, 0.86);
  border-bottom-color: rgba(17, 17, 17, 0.08);
}

[data-theme="light"] .abir-topbar.scrolled {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(17, 17, 17, 0.12);
}

[data-theme="light"] .search-field-btn,
[data-theme="light"] .kbd-shortcut {
  background: #F3F4F6;
}

[data-theme="light"] .cta-secondary {
  background: #FFFFFF;
  color: #111111;
  border-color: rgba(17, 17, 17, 0.12);
}

[data-theme="light"] .code-window {
  background: #ffffff;
  border-color: rgba(17, 17, 17, 0.12);
  box-shadow: 0 18px 40px rgba(17, 17, 17, 0.08);
}

[data-theme="light"] .code-window-header,
[data-theme="light"] .code-window-footer,
[data-theme="light"] .tab-list {
  background: #f3f4f6;
  border-color: rgba(17, 17, 17, 0.08);
  color: #555555;
}

[data-theme="light"] .code-window-title { color: #111111; }

[data-theme="light"] .code-tab { color: #555555; }
[data-theme="light"] .code-tab:hover,
[data-theme="light"] .code-tab.active {
  color: #1AAE9F;
  background: rgba(26, 174, 159, 0.08);
}

[data-theme="light"] .code-copy-btn {
  border-color: rgba(17, 17, 17, 0.14);
  color: #555555;
  background: #ffffff;
}

[data-theme="light"] .code-window-body,
[data-theme="light"] .code-pre {
  background: #ffffff;
}

[data-theme="light"] .code-gutter {
  color: #8a9099;
  border-right-color: rgba(17, 17, 17, 0.08);
}

[data-theme="light"] .code-window-body code,
[data-theme="light"] #codeViewer {
  color: #111111;
}

[data-theme="light"] .tok-key { color: #0369a1; }
[data-theme="light"] .tok-str { color: #15803d; }
[data-theme="light"] .tok-num { color: #b45309; }
[data-theme="light"] .tok-com { color: #6b7280; }
[data-theme="light"] .tok-fn { color: #6d28d9; }
[data-theme="light"] .tok-tag { color: #1AAE9F; }
[data-theme="light"] .tok-attr { color: #1d4ed8; }

[data-theme="light"] .window-controls .control {
  background: #c5c9d1;
}

[data-theme="light"] .abir-footer,
[data-theme="light"] .service-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .skill-chip {
  background: #FFFFFF;
}

/* Light mode: favicon.png is white on transparent, so force a dark mark */
[data-theme="light"] .logo-mark,
[data-theme="light"] .footer-artwork-image {
  filter: brightness(0);
}

.hero-intro {
  position: relative;
  isolation: isolate;
  overflow: visible;
  min-height: 320px;
  padding: 2.5rem 1.5rem;
}

.hero-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 30%, rgba(15, 118, 110, 0.72) 0 70px, rgba(15, 118, 110, 0.28) 92px, transparent 120px),
    radial-gradient(circle at 48% 74%, rgba(64, 224, 208, 0.62) 0 78px, rgba(64, 224, 208, 0.22) 104px, transparent 132px),
    radial-gradient(circle at 78% 28%, rgba(37, 99, 235, 0.62) 0 64px, rgba(37, 99, 235, 0.2) 88px, transparent 116px);
  filter: blur(10px);
}

[data-theme="light"] .hero-intro::before {
  background:
    radial-gradient(circle at 22% 30%, rgba(153, 246, 228, 0.95) 0 70px, rgba(153, 246, 228, 0.4) 92px, transparent 120px),
    radial-gradient(circle at 48% 74%, rgba(94, 234, 212, 0.9) 0 78px, rgba(94, 234, 212, 0.35) 104px, transparent 132px),
    radial-gradient(circle at 78% 28%, rgba(191, 219, 254, 0.95) 0 64px, rgba(191, 219, 254, 0.4) 88px, transparent 116px);
}

.hero-animated-title,
.hero-description,
.hero-ctas {
  position: relative;
  z-index: 1;
}