/* ══════════════════════════════════════════════
   LAYOUT STRATEGY
══════════════════════════════════════════════ */
.section {
  padding-block: var(--sp-mobile-section);
  position: relative;
  z-index: var(--z-base);
}

.section-header {
  margin-bottom: var(--sp-12);
  max-width: 600px;
}
.section-header.text-center {
  margin-inline: auto;
  text-align: center;
}

/* ══════════════════════════════════════════════
   TYPOGRAPHY HELPERS
══════════════════════════════════════════════ */
.title { font-size: var(--fs-4xl); margin-bottom: var(--sp-4); }
.title--display { font-size: var(--fs-display); line-height: 1; letter-spacing: -0.03em; }
.desc { color: var(--clr-text-muted); font-size: var(--fs-lg); line-height: var(--lh-relaxed); max-width: 45ch; }
.desc.mx-auto { margin-inline: auto; }

.text-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-4);
}
.label::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--clr-accent-primary);
  box-shadow: 0 0 10px var(--clr-accent-primary);
}

/* ══════════════════════════════════════════════
   FLOATING NAVBAR
══════════════════════════════════════════════ */
.navbar-wrapper {
  position: fixed;
  top: var(--sp-6);
  left: 0; right: 0;
  z-index: var(--z-sticky);
  pointer-events: none;
  display: flex;
  justify-content: center;
  padding-inline: var(--sp-4);
}

.navbar {
  pointer-events: auto;
  background: rgba(5, 5, 10, 0.55);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-full);
  padding: 6px 8px 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 1120px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.4),
    0 1px 0 rgba(255,255,255,0.06) inset;
  transition: box-shadow 0.4s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Dark mode navbar overrides via body classes if required, or contextual nesting */
.mode-dark .navbar {
  background: rgba(10, 10, 10, 0.6);
  border-color: var(--glass-border-light);
}
.mode-dark .navbar__link { color: var(--clr-text); }
.mode-dark .navbar__link:hover { color: var(--clr-white); }

.navbar__brand {
  font-family: var(--ff-head);
  font-size: var(--fs-lg);
  font-weight: var(--fw-extrabold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 44px;
  text-decoration: none;
  color: var(--clr-white);
  flex-shrink: 0;
}

/* Nav menu — desktop link row */
.navbar__menu {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  flex: 1;          /* take available space between brand and actions */
  justify-content: center;
  /* Removal of overflow:hidden to allow premium shadows on the pill */
}

.navbar__link {
  padding: 8px 16px; /* Slightly more padding for luxury feel */
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  border-radius: var(--r-full);
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
  text-decoration: none !important;
  white-space: nowrap;
}
.navbar__link:hover { color: var(--clr-white); }
.navbar__link.active { 
  color: var(--clr-white); 
  border: none !important;
}

/* Magnetic Floating Pill — EXPERT LEVEL UPGRADE */
.navbar__pill {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 10px 25px -5px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.1); 
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--r-full);
  z-index: 1;
  pointer-events: none;
  transition: 
    width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translate(0px, 0px) scale(0.9);
  left: 0;
  top: 0;
  transform-origin: center;
}

/* Actions: search + CTA + mobile toggle */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0; /* never let it shrink or wrap */
}

/* Search button */
.navbar__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.45);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.navbar__search-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

/* Physical key badge */
.navbar__kbd {
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 5px;
  color: rgba(255,255,255,0.55);
}

/* Mobile Hamburger & Drawer (hidden desktop) */
.navbar__toggle { display: none; padding: var(--sp-2); }
.navbar__drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 990;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.navbar__drawer-overlay.active { opacity: 1; pointer-events: auto; }

.navbar__drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(80vw, 400px);
  background: var(--clr-bg);
  z-index: 999;
  padding: var(--sp-10) var(--sp-6);
  transform: translateX(100%);
  transition: transform var(--t-spring);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  border-left: 1px solid var(--clr-border);
}
.navbar__drawer.active { transform: translateX(0); }

/* Mobile hamburger (hidden by default) */
.navbar__toggle {
  display: none;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  transition: background 0.2s;
}
.navbar__toggle:hover { background: rgba(255,255,255,0.07); }

@media (max-width: 1024px) {
  .navbar__menu { display: none; }
  .navbar__toggle { display: flex; align-items: center; }
  .navbar__cta-btn { display: none; }
  .navbar { padding-right: 8px; }
}

@media (max-width: 480px) {
  .navbar__kbd { display: none; }
  .navbar__search-btn { padding: 8px; }
}

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--ff-sans);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: var(--clr-white);
  text-decoration: none;
  box-shadow: 
    0 10px 25px -5px rgba(37, 99, 235, 0.4),
    0 8px 10px -6px rgba(37, 99, 235, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.2); /* Top inner highlight */
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 20px 35px -8px rgba(37, 99, 235, 0.5),
    0 0 20px rgba(37, 99, 235, 0.3); /* Ambient Blue Glow */
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.btn-primary:hover::before { left: 100%; }

/* ELITE: Luminous Pulse Button */
.btn-luminous {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  color: var(--clr-white);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: var(--r-full);
  box-shadow: 
    0 4px 15px rgba(37, 99, 235, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  position: relative;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.btn-luminous:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 12px 30px rgba(37, 99, 235, 0.5),
    0 0 20px rgba(59, 130, 246, 0.4);
}

.btn-luminous::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, transparent 100%);
  opacity: 0.3;
}

.btn-luminous:active {
  transform: scale(0.96);
}

.btn-outline {
  background: transparent;
  color: var(--clr-heading);
  border: 1px solid var(--clr-border);
}
.btn-outline:hover {
  background: var(--clr-surface);
  border-color: var(--clr-text-muted);
}
.mode-dark .btn-outline { color: var(--clr-white); }
.mode-dark .btn-outline:hover { background: rgba(255,255,255,0.05); }

/* ══════════════════════════════════════════════
   BENTO GRID SYSTEM
══════════════════════════════════════════════ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--sp-4);
  grid-auto-rows: minmax(280px, auto);
}

.bento-item {
  position: relative;
  border-radius: var(--r-xl);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  padding: var(--sp-8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-spring), box-shadow var(--t-base);
  box-shadow: var(--shadow-sm);
  /* 3D Depth Setup */
  transform-style: preserve-3d;
  perspective: 1000px;
}

.mode-dark .bento-item {
  background: var(--clr-bg-alt);
}

.bento-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-border-glow);
}

/* Base Spans */
.col-span-12 { grid-column: span 12; }
.col-span-8 { grid-column: span 8; }
.col-span-6 { grid-column: span 6; }
.col-span-4 { grid-column: span 4; }

@media (max-width: 1024px) {
  .col-span-8 { grid-column: span 12; }
  .col-span-4 { grid-column: span 6; }
}
@media (max-width: 768px) {
  .col-span-6, .col-span-4 { grid-column: span 12; }
}

/* ══════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════ */
.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  margin-bottom: var(--sp-2);
  color: var(--clr-heading);
}
.form-control {
  width: 100%;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  color: var(--clr-text);
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  transition: all var(--t-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--clr-accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ══════════════════════════════════════════════
   ELITE FORMS (Premium Tech Aesthetic)
   ══════════════════════════════════════════════ */
.luxury-form-group {
  margin-bottom: var(--sp-6);
  position: relative;
}

.luxury-form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-gray-500);
  margin-bottom: var(--sp-3);
  transition: color var(--t-fast);
}

.luxury-form-control {
  width: 100%;
  background: var(--clr-gray-50);
  border: 1px solid var(--clr-gray-200);
  padding: 14px 18px;
  border-radius: 14px;
  color: var(--clr-gray-900);
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.luxury-form-control:hover {
  border-color: var(--clr-gray-400);
  background: #fff;
}

.luxury-form-control:focus {
  outline: none;
  background: #fff;
  border-color: var(--clr-accent-primary);
  box-shadow: 
    0 0 0 4px rgba(59, 130, 246, 0.1),
    0 8px 20px -5px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

/* Custom Select Dropdown */
select.luxury-form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px;
  padding-right: 48px;
}

.luxury-form-group:focus-within .luxury-form-label {
  color: var(--clr-accent-primary);
}

/* Footer layout rules */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-8);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   CASE STUDY EDITORIAL TYPOGRAPHY & CARDS
══════════════════════════════════════════════ */
.article-body h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--clr-heading);
  letter-spacing: -0.02em;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--clr-heading);
}

.article-body p { margin-bottom: 1.5rem; }

.article-body ul, .article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-body li { margin-bottom: 0.5rem; }

.article-body pre {
  background: var(--clr-bg-alt);
  padding: 1.5rem;
  border-radius: var(--r-xl);
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--clr-border);
}

.article-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  color: var(--clr-accent-violet);
}

.article-body blockquote {
  border-left: 4px solid var(--clr-accent-primary);
  padding: 1.5rem;
  margin: 2rem 0;
  background: rgba(16,185,129,0.03);
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  color: var(--clr-text);
  font-style: italic;
  font-size: 1.125rem;
}

/* Base Link Reset for Related Cards */
.related-case-card {
  display: flex;
  flex-direction: column;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-8);
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), border-color 0.2s ease, box-shadow 0.4s ease;
}

.related-case-card:hover {
  transform: translateY(-4px);
  border-color: var(--clr-border-hover);
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.2);
}
