/* ==========================================================================
   IBNSULYYMAN DESIGN SYSTEM — GLOBAL TOKENS & ARCHITECTURE
   ========================================================================== */

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

:root {
  /* Surface & Canvas Tokens */
  --bg-canvas: #07090e;
  --bg-canvas-subtle: #0b0f17;
  --bg-surface: #101622;
  --bg-surface-elevated: #161e2e;
  --bg-surface-card: rgba(18, 24, 38, 0.72);
  --bg-surface-hover: rgba(255, 255, 255, 0.04);
  
  /* Text & Foreground */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-faint: #475569;
  --text-inverse: #07090e;

  /* Accent & World Identity */
  --accent-dev: #06b6d4;        /* Cyan 500: Precision & Engineering */
  --accent-dev-glow: rgba(6, 182, 212, 0.16);
  --accent-dev-border: rgba(6, 182, 212, 0.35);

  --accent-design: #f43f5e;     /* Rose 500: Creative Passion & Craft */
  --accent-design-glow: rgba(244, 63, 94, 0.16);
  --accent-design-border: rgba(244, 63, 94, 0.35);

  --accent-gold: #f59e0b;       /* Amber 500: Accents & Badges */
  
  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-bright: rgba(255, 255, 255, 0.28);
  
  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Header & Navigation Heights */
  --nav-height: 72px;

  /* Transition timings */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 1rem;
  overflow-x: hidden;
  position: relative;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.25rem, 5vw, 4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.1rem; font-weight: 600; }
h6 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

/* Code & Monospace Badges */
code, .font-mono {
  font-family: var(--font-mono);
}

/* Selection */
::selection {
  background: rgba(6, 182, 212, 0.28);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Accessibility Focus States */
:focus-visible {
  outline: 2px solid var(--accent-dev);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   GLOBAL NAVIGATION BAR (SHARED ACROSS WORLDS)
   ========================================================================== */

.global-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3rem);
  background: rgba(7, 9, 14, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-normal) ease, border-color var(--duration-normal) ease;
}

.global-nav .brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.global-nav .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #06b6d4, #f43f5e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #ffffff;
}

.global-nav .brand span.accent {
  color: var(--accent-dev);
}

/* Dual World Pill Switcher in Nav */
.world-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.world-pill {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--duration-fast) var(--ease-out-expo);
}

.world-pill:hover {
  color: var(--text-primary);
}

.world-pill.active.dev {
  background: rgba(6, 182, 212, 0.14);
  color: #38bdf8;
  border: 1px solid var(--accent-dev-border);
  box-shadow: 0 0 12px var(--accent-dev-glow);
}

.world-pill.active.design {
  background: rgba(244, 63, 94, 0.14);
  color: #fb7185;
  border: 1px solid var(--accent-design-border);
  box-shadow: 0 0 12px var(--accent-design-glow);
}

.world-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

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

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

.btn-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out-expo);
}

.btn-contact:hover {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  padding: 8px;
  color: var(--text-primary);
}

/* Container widths */
.container-xl {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.container-lg {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* Badges & Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.tag.tag-cyan {
  background: rgba(6, 182, 212, 0.08);
  color: #38bdf8;
  border-color: rgba(6, 182, 212, 0.25);
}

.tag.tag-rose {
  background: rgba(244, 63, 94, 0.08);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.25);
}

.tag.tag-amber {
  background: rgba(245, 158, 11, 0.08);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

/* Section Headings with Micro-Labels */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-dev);
  margin-bottom: 0.75rem;
}

.section-label.design {
  color: var(--accent-design);
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 1px;
  background: currentColor;
}

/* Cards & Surface */
.card-glass {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--duration-normal) var(--ease-out-expo),
              border-color var(--duration-normal) ease,
              box-shadow var(--duration-normal) ease;
}

.card-glass:hover {
  border-color: var(--border-medium);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.5);
}

/* Reduced Motion Override */
@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;
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .global-nav .nav-links-desktop {
    display: none;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .world-switcher .pill-text {
    display: none;
  }
  .world-pill {
    padding: 6px 10px;
  }
}
