/* ═══════════════════════════════════════════════════
   Global Styles - Layout, Typography, Utilities
   ═══════════════════════════════════════════════════ */

/* ── Layout ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--space-5xl) 0;
  position: relative;
}

/* ── Text Utilities ───────────────────────────── */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-left { text-align: left; }

/* ── Section Headers ──────────────────────────── */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-4xl);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: var(--fs-4xl);
  margin-bottom: var(--space-lg);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  line-height: var(--lh-loose);
}

.section-cta {
  text-align: center;
  margin-top: var(--space-3xl);
}

/* ── Preloader ────────────────────────────────── */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-preloader);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
}

/* Admin-uploaded logo image inside the preloader (sits above the wordmark) */
.preloader-logo-img {
  display: block;
  margin: 0 auto var(--space-md);
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.25);
  animation: preloaderLogoPulse 1.6s ease-in-out infinite;
}

@keyframes preloaderLogoPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.preloader .logo-text {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.preloader .logo-accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.preloader-bar {
  width: 200px;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  margin-top: var(--space-lg);
  overflow: hidden;
}

.preloader-bar-fill {
  width: 0;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  animation: preloaderFill 1.5s ease forwards;
}

@keyframes preloaderFill {
  to { width: 100%; }
}

/* ── Status Banner ────────────────────────────── */
.status-banner {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--accent));
  background-size: 200% 100%;
  animation: gradientShift 8s ease infinite;
  padding: var(--space-sm) 0;
  position: relative;
  z-index: var(--z-navbar);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.status-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  font-size: var(--fs-sm);
  color: white;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.status-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 12px;
  border-radius: var(--radius-full);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  transition: background var(--transition-fast);
}

.status-cta:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── Navbar ────────────────────────────────────── */
.navbar {
  position: fixed;
  top: var(--banner-height);
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: var(--z-navbar);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: var(--shadow-lg);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: var(--z-navbar);
}

.logo-wordmark {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

.nav-icon {
  width: 16px;
  height: 16px;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* (Removed: .nav-track icon button.) Track lives in
   siteData.navigation.items now, so it renders inline on desktop and
   inside the mobile menu — no duplicate icon button needed. */

/* ── Mobile Toggle ────────────────────────────── */
/* The hamburger button shown on phones/tablets. Uses a 44x44 tap target
   (Apple/Material guideline) and a subtle glass background so it reads
   as a pressable affordance against the navbar. */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  z-index: var(--z-navbar);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.mobile-toggle:hover,
.mobile-toggle:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.mobile-toggle:active {
  transform: scale(0.95);
}

.mobile-toggle.active {
  background: rgba(108, 92, 231, 0.12);
  border-color: var(--primary);
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 16px;
  pointer-events: none;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), opacity var(--transition-base), background var(--transition-fast);
  transform-origin: center;
}

.mobile-toggle.active .hamburger-line {
  background: var(--primary-light);
}

.mobile-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Menu (Dropdown Panel) ─────────────── */
/* Anchored to the top-right under the navbar — NOT a full-screen overlay.
   Lives outside <header.navbar> so it can escape the navbar stacking
   context. Tight 260px max width to read as a proper dropdown rather
   than a near-fullscreen sheet. */
.mobile-menu {
  position: fixed;
  top: calc(var(--banner-height) + var(--navbar-height) + 6px);
  right: 12px;
  width: 260px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - var(--banner-height) - var(--navbar-height) - 24px);
  z-index: 9000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: var(--space-sm);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px) scale(0.96);
  transform-origin: top right;
  transition: opacity 180ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 180ms;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Faint backdrop behind the dropdown — subtle dimming so the menu reads
   as a focused popover without covering the page. */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 8999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms, visibility 180ms;
}

.mobile-menu-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.mobile-nav-link i,
.mobile-nav-link svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.mobile-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.mobile-nav-link:hover i,
.mobile-nav-link:hover svg {
  color: var(--primary-light);
}

.mobile-nav-link.active {
  color: var(--text-primary);
  background: rgba(108, 92, 231, 0.12);
  border-color: rgba(108, 92, 231, 0.35);
}

.mobile-nav-link.active i,
.mobile-nav-link.active svg {
  color: var(--primary-light);
}

.mobile-nav-footer {
  margin-top: 2px;
  padding: var(--space-sm) var(--space-xs) var(--space-xs);
  border-top: 1px solid var(--border-color);
}

.mobile-social {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.mobile-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.mobile-social a svg,
.mobile-social a i {
  width: 14px;
  height: 14px;
  color: inherit;
}

.mobile-social a:hover {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.mobile-social a {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

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

/* ── Page Hero (inner pages) ──────────────────── */
.page-hero {
  padding: calc(var(--navbar-height) + var(--banner-height) + var(--space-5xl)) 0 var(--space-4xl);
  text-align: center;
  position: relative;
  background: radial-gradient(ellipse at top, rgba(108, 92, 231, 0.08) 0%, transparent 60%);
  overflow: hidden;
}

/* Optional hero background media (admin-uploaded image OR video).
   Sits absolutely behind .page-hero-content with a dark gradient overlay
   so the title + subtitle stay readable. */
.page-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page-hero-media img,
.page-hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-hero-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(10, 10, 15, 0.75) 0%,
    rgba(10, 10, 15, 0.55) 50%,
    rgba(10, 10, 15, 0.85) 100%);
}

.page-hero > .container {
  position: relative;
  z-index: 1;
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-lg);
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-left: var(--space-sm);
  color: var(--text-tertiary);
}

.breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary-light);
}

.page-title {
  font-size: var(--fs-5xl);
  margin-bottom: var(--space-lg);
}

.page-subtitle {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
  line-height: var(--lh-loose);
}

/* ── Footer ───────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-5xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-3xl);
  margin-bottom: var(--space-4xl);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.footer-description {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: var(--lh-loose);
  margin-bottom: var(--space-xl);
}

.footer-social {
  display: flex;
  gap: var(--space-md);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.social-link svg,
.social-link i {
  width: 18px;
  height: 18px;
  color: inherit;
}

.social-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.footer-heading {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-links a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-light);
  padding-left: var(--space-sm);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-bottom-links a {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover {
  color: var(--text-primary);
}

.footer-bottom-links .divider {
  color: var(--text-tertiary);
}

/* ── Back to Top ──────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-sticky);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-glow);
}

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

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-strong);
}

/* ── Newsletter ───────────────────────────────── */
.newsletter-section {
  padding: var(--space-4xl) 0;
}

.newsletter-card {
  padding: var(--space-4xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
  color: white;
}

.newsletter-title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-md);
}

.newsletter-text {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto var(--space-xl);
}

.newsletter-form .input-group {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: var(--space-sm);
}

/* Wrapper around the email input so the mail icon stays vertically centered
   ON THE INPUT — not the whole flex group. On mobile the group flips to
   `flex-direction: column`, which would otherwise put the icon between the
   input and the Subscribe button. */
.newsletter-form .input-field {
  position: relative;
  flex: 1;
  display: block;
}

.newsletter-form .input-group input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  padding-left: 44px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  transition: border-color var(--transition-fast);
}

.newsletter-form .input-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.newsletter-form .input-field .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.newsletter-disclaimer {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-md);
}

/* ── Custom Cursor ────────────────────────────── */
.cursor, .cursor-follower {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-cursor);
  border-radius: 50%;
  mix-blend-mode: difference;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor, .cursor-follower {
    display: block;
  }
}

.cursor {
  width: 8px;
  height: 8px;
  background: white;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
}

.cursor-follower {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border 0.3s;
}

.cursor.hover {
  width: 16px;
  height: 16px;
  background: var(--primary);
}

.cursor-follower.hover {
  width: 50px;
  height: 50px;
  border-color: var(--primary);
}

/* ── Media protection (CSS layer) ────────────────────────
   Stops casual save attempts: long-press save dialog on iOS/Android,
   text-selection of media, and the "drag image to desktop" workflow.
   JS layer (media-protection.js) handles right-click + keyboard
   shortcuts. DevTools always wins — these are deterrents, not locks. */
img, video, picture, canvas {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  user-drag: none;
}
/* Allow text selection on input fields + content the visitor is meant
   to copy (blog post bodies, code examples) — opt-in via .selectable */
input, textarea, [contenteditable="true"], .selectable, .selectable * {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
