/* ==========================================================================
   MUHAMMAD ARSLAN ASGHAR PERSONAL BRAND PLATFORM
   CORE PRODUCTION DESIGN SYSTEM STYLESHEET (FOSS / WCAG 2.2 AA)
   ========================================================================== */

:root {
  /* Base Typography */
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', "SFMono-Regular", Consolas, monospace;

  /* Layout & Spacing */
  --container-max: 1280px;
  --header-height: 72px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Animation Timings */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* Light Theme Tokens (Warm Ivory & Carbon) */
[data-theme="light"], :root:not([data-theme="dark"]) {
  --bg-base: #F5F3EF;
  --bg-surface: #FFFFFF;
  --bg-elevated: #ECE8E0;
  --bg-glass: rgba(245, 243, 239, 0.9);
  --text-primary: #12161A;
  --text-secondary: #4E5562;
  --text-muted: #7E8694;
  --border-subtle: #DCD6CC;
  --border-strong: #CBC4B7;
  --border-focus: #2563EB;
  --accent-steel: #2A5A72;
  --accent-teal: #1F6B75;
  --accent-petrol: #165664;
  --accent-cobalt: #2563EB;
  --accent-brass: #A88653;
  --accent-brass-tint: rgba(168, 134, 83, 0.12);
  --accent-success: #059669;
  --accent-warning: #D97706;
  --accent-error: #DC2626;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.08);
  --canvas-opacity: 0.65;
}

/* Dark Theme Tokens (Near-Black Navy & Warm Off-White) */
[data-theme="dark"] {
  --bg-base: #090C10;
  --bg-surface: #0E131A;
  --bg-elevated: #141B24;
  --bg-glass: rgba(9, 12, 16, 0.88);
  --text-primary: #F4F6F8;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #38BDF8;
  --accent-steel: #2E5B70;
  --accent-teal: #337A88;
  --accent-petrol: #3B8296;
  --accent-cobalt: #38BDF8;
  --accent-brass: #C5A880;
  --accent-brass-tint: rgba(197, 168, 128, 0.14);
  --accent-success: #10B981;
  --accent-warning: #F59E0B;
  --accent-error: #EF4444;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.65);
  --canvas-opacity: 0.8;
}

/* High Contrast Mode Tokens */
[data-contrast="high"] {
  --border-subtle: #888E96 !important;
  --border-strong: #FFFFFF !important;
  --text-secondary: var(--text-primary) !important;
}

/* Base Reset & Accessibility Foundation */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-base);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Skip to Content Accessible Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent-steel);
  color: #FFFFFF !important;
  padding: 12px 20px;
  z-index: 10000;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--duration-fast) ease;
}

.skip-link:focus {
  top: 20px;
  outline: 3px solid var(--accent-brass);
}

/* Focus Visible Indicator (WCAG 2.2 AA) */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Headings & Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.65rem); }
h4 { font-size: 1.1rem; font-weight: 700; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

/* Global Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

@media (min-width: 1024px) {
  .container {
    padding-left: 48px;
    padding-right: 48px;
  }
}

/* ==========================================================================
   NAVIGATION COMPONENT
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 500;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--duration-normal) ease;
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-monogram-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.monogram-badge {
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1.5px solid var(--accent-brass);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 10px rgba(197, 168, 128, 0.15);
  transition: transform var(--duration-fast) var(--ease-out-expo), border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  flex-shrink: 0;
}

.monogram-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.brand-monogram-lockup:hover .monogram-badge {
  transform: scale(1.06);
  border-color: var(--accent-steel);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 14px rgba(56, 189, 248, 0.25);
}

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

.brand-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-menu {
  display: none;
  align-items: center;
  gap: 28px;
  list-style: none;
}

@media (min-width: 960px) {
  .nav-menu {
    display: flex;
  }
}

.nav-item-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0;
  white-space: nowrap;
  position: relative;
  transition: color var(--duration-fast) ease;
}

.nav-item-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-brass);
  transition: width 0.25s ease;
}

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

.nav-item-link:hover::after, .nav-item-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

/* Command Palette Trigger Button */
.cmd-k-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.cmd-k-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-muted);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-brass);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

@media (min-width: 960px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* Mobile Full-Screen Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-base);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 32px;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav-link-item {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.mobile-nav-link {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-brass);
}

/* ==========================================================================
   3-TIER PREMIUM BUTTON SYSTEM
   ========================================================================== */

/* 1. Primary CTA (Book a Call) */
.btn-primary, .btn-cta {
  height: 54px;
  padding: 0 26px;
  background: linear-gradient(135deg, #1C394A 0%, #2A546C 100%);
  color: #FFFFFF !important;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(10, 20, 30, 0.4);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.btn-primary::before, .btn-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.6s ease;
}

.btn-primary:hover, .btn-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 24px rgba(10, 20, 30, 0.55);
}

.btn-primary:hover::before, .btn-cta:hover::before {
  left: 200%;
}

.btn-primary:hover svg, .btn-cta:hover svg {
  transform: translateX(6px);
}

.btn-primary:active, .btn-cta:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary svg, .btn-cta svg {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. Secondary CTA (Explore Selected Work) */
.btn-secondary {
  height: 54px;
  padding: 0 24px;
  background: transparent;
  color: var(--text-primary) !important;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: var(--bg-elevated);
  z-index: -1;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.btn-secondary:hover::after {
  width: 100%;
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* 3. Tertiary Action / Text Link with Circular Icon */
.btn-tertiary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s ease;
}

.btn-tertiary-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-tertiary:hover {
  color: var(--text-primary);
}

.btn-tertiary:hover .btn-tertiary-icon {
  border-color: var(--accent-brass);
  background: var(--accent-brass-tint);
  transform: scale(1.08);
}

/* ==========================================================================
   CARDS, PILLS & COMPONENTS
   ========================================================================== */
.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.pulse-dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
}

.card-elevated {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-normal) var(--ease-out-expo);
}

.card-elevated:hover {
  border-color: var(--accent-petrol);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Evidence Verification Badge */
.evidence-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-success);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
}

/* ==========================================================================
   FOOTER & ACCESSIBILITY CONTROLS
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding-top: 60px;
  padding-bottom: 40px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.footer-link {
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
}

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

.footer-bottom-bar {
  border-top: 1px solid var(--border-subtle);
  padding-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* On-Site Accessibility Bar */
.a11y-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.a11y-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.a11y-btn:hover, .a11y-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ==========================================================================
   CINEMATIC HERO STAGE & SCROLL INTERACTIVITY
   ========================================================================== */
.hero-stage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

@media (min-width: 992px) {
  .hero-stage-grid {
    grid-template-columns: 58% 36%;
    justify-content: space-between;
    gap: 64px;
    align-items: center;
  }
}

.hero-portrait-wrapper {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
}

.hero-portrait-glow {
  position: absolute;
  width: 105%;
  height: 105%;
  background: radial-gradient(circle, rgba(51, 122, 136, 0.14) 0%, rgba(197, 168, 128, 0.08) 50%, transparent 70%);
  border-radius: 50%;
  filter: blur(36px);
  pointer-events: none;
  z-index: 1;
}

.hero-portrait-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: clamp(380px, 31vw, 540px);
  aspect-ratio: 4 / 5;
  max-height: 68vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.15) inset;
  background: var(--bg-surface);
  transform: translateY(0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
}

.hero-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  filter: contrast(103%) saturate(100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-portrait-frame:hover img {
  transform: scale(1.03);
}

.hero-portrait-floating-badge {
  position: absolute;
  bottom: 22px;
  left: 22px;
  right: 22px;
  background: rgba(9, 12, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
}

/* ==========================================================================
   PREMIUM CARD INTERACTION SYSTEM
   ========================================================================== */
.card-elevated, .project-card, .service-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
  will-change: transform;
}

.card-elevated:hover, .project-card:hover, .service-card:hover,
.card-elevated:focus-within, .project-card:focus-within, .service-card:focus-within {
  transform: translateY(-5px) rotate(0.3deg);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(56, 189, 248, 0.04);
}

/* Connected Section Transitions */
.section-chapter {
  position: relative;
  transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

/* Smooth Scroll Reveal & Merge */
.scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Subtle Section Merge Divider */
.section-merge-divider {
  height: 80px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-elevated) 100%);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .atlas-canvas-bg {
    display: none !important;
  }

  .atlas-reduced-motion-fallback {
    display: block !important;
  }
}

[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

[data-motion="reduced"] .atlas-canvas-bg {
  display: none !important;
}

[data-motion="reduced"] .atlas-reduced-motion-fallback {
  display: block !important;
}
