/* ═══════════════════════════════════════════════
   LOGITONIX — DESIGN SYSTEM v3
   Antimatter-Inspired Dark Theme
   Palette: Near-Black + Electric Blue (#4f8ef7)
   Fonts: Cabinet Grotesk (display) + Satoshi (body)
═══════════════════════════════════════════════ */

/* ─── Design Tokens ──────────────────────────── */
:root {
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-surface-2: #181818;
  --color-surface-offset: #1e1e1e;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.16);
  --color-text: #f0efed;
  --color-text-muted: #7a7876;
  --color-text-faint: #3f3e3c;
  --color-primary: #4f8ef7;
  --color-primary-dark: #3a6fd4;
  --color-primary-glow: rgba(79, 142, 247, 0.15);
  --color-primary-bg: rgba(79, 142, 247, 0.06);
  --color-success: #34d399;
  --color-error: #f87171;
  --font-display: 'Cabinet Grotesk', sans-serif;
  --font-body: 'Satoshi', sans-serif;
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-hero: clamp(2.25rem, 1rem + 4.5vw, 5rem);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(79, 142, 247, 0.12);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.2s var(--ease);
  --transition-slow: 0.4s var(--ease);
  --transition-spring: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --navbar-height: 72px;
  --container-max: 1200px;
  --container-pad: clamp(1.25rem, 5vw, 2rem);
}

/* ─── Light Mode ─────────────────────────────── */
[data-theme="light"] {
  --color-bg: #f5f5f3;
  --color-surface: #ffffff;
  --color-surface-2: #f0efed;
  --color-surface-offset: #e8e7e4;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-border-hover: rgba(0, 0, 0, 0.16);
  --color-text: #1a1918;
  --color-text-muted: #5a5856;
  --color-text-faint: #9a9896;
  --color-primary-glow: rgba(79, 142, 247, 0.1);
  --color-primary-bg: rgba(79, 142, 247, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px rgba(79, 142, 247, 0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: dark
}

[data-theme="light"] {
  color-scheme: light
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden
}

img,
video {
  max-width: 100%;
  display: block
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer
}

ul {
  list-style: none
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

.sr-only:focus {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  width: auto;
  height: auto;
  padding: var(--space-4) var(--space-6);
  clip: auto;
  white-space: normal;
  z-index: 10000;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600
}

@media(prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important
  }

  html {
    scroll-behavior: auto
  }
}

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

.section {
  padding-block: var(--space-24);
  position: relative
}

.section--surface {
  background: var(--color-surface)
}

.section--surface-2 {
  background: var(--color-surface-2)
}

.section--offset {
  background: var(--color-surface-offset)
}

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

h1 {
  font-size: var(--text-hero);
  font-weight: 800
}

h2 {
  font-size: var(--text-2xl)
}

h3 {
  font-size: var(--text-xl)
}

h4 {
  font-size: var(--text-lg)
}

.section-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4)
}

.section-title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  font-weight: 700;
  letter-spacing: -0.03em
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 58ch;
  line-height: 1.7
}

.section-header {
  margin-bottom: var(--space-16)
}

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all 0.3s var(--ease-spring);
  white-space: nowrap;
  cursor: pointer;
  position: relative
}

.btn--primary {
  background: var(--color-primary);
  color: #fff
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 142, 247, 0.3)
}

.btn--ghost {
  border: 1px solid var(--color-border-hover);
  color: var(--color-text);
  background: transparent
}

.btn--ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg)
}

.btn--lg {
  padding: 0.9rem 2.25rem;
  font-size: var(--text-base)
}

.btn--sm {
  padding: 0.5rem 1.2rem;
  font-size: var(--text-xs)
}

.btn svg,
.btn i {
  font-size: 0.85em;
  transition: transform 0.3s var(--ease-spring)
}

.btn:hover svg,
.btn:hover i {
  transform: translateX(3px)
}

/* Animated gradient CTA */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false
}

.btn--glow {
  --angle: 0deg;
  background: var(--color-surface);
  color: var(--color-text);
  border: none;
  padding: 0.9rem 2.25rem;
  font-size: var(--text-sm);
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md)
}

.btn--glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  background: conic-gradient(from var(--angle), var(--color-primary), #a78bfa, #f472b6, #fb923c, var(--color-primary));
  z-index: -2;
  animation: gradientSpin 3s linear infinite
}

.btn--glow::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  border-radius: calc(var(--radius-md) - 0.5px);
  background: var(--color-surface);
  z-index: -1;
  transition: background 0.3s var(--ease)
}

.btn--glow:hover::after {
  background: var(--color-surface-2)
}

.btn--glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(79, 142, 247, 0.2)
}

/* ─── Navbar ─────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), backdrop-filter 0.3s var(--ease), border-color 0.3s var(--ease)
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--color-border)
}

[data-theme="light"] .navbar {
  background: rgba(245, 245, 243, 0.6)
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(245, 245, 243, 0.9);
  border-bottom-color: rgba(0, 0, 0, 0.06)
}

.navbar__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-8)
}

.navbar__logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  letter-spacing: -0.02em
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px
}

.logo-mark svg {
  width: 100%;
  height: 100%
}

.logo-text {
  color: var(--color-text)
}

.logo-accent {
  color: var(--color-primary)
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto
}

.nav-link {
  position: relative;
  padding: 0.45rem 0.85rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.3s var(--ease)
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s var(--ease-spring), left 0.3s var(--ease-spring)
}

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

.nav-link:hover::after {
  width: 60%;
  left: 20%
}

.nav-link.active {
  color: var(--color-primary)
}

.nav-link.active::after {
  width: 60%;
  left: 20%
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: var(--space-4);
  flex-shrink: 0
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition)
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-primary-bg)
}

.theme-toggle svg {
  width: 20px;
  height: 20px
}

.theme-toggle .icon-sun {
  display: none
}

.theme-toggle .icon-moon {
  display: block
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none
}

/* ─── Hamburger ──────────────────────────────── */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: var(--radius-full);
  transition: transform 0.3s var(--ease-spring), opacity 0.2s var(--ease);
  transform-origin: center
}

.navbar__hamburger.open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px)
}

.navbar__hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0
}

.navbar__hamburger.open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px)
}

/* ─── Mobile Menu ────────────────────────────── */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--color-bg);
  padding: var(--space-8) var(--container-pad);
  gap: var(--space-2);
  z-index: 999;
  overflow-y: auto
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: var(--text-lg);
  min-height: 44px;
  transition: color var(--transition), background var(--transition)
}

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

.mobile-menu .btn {
  margin-top: var(--space-4);
  align-self: flex-start
}

/* ─── Footer ─────────────────────────────────── */
.footer {
  position: relative;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  overflow: hidden
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-12);
  padding-block: var(--space-16)
}

.footer__logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em
}

.footer__tagline {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-2)
}

.footer__about {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
  line-height: 1.75
}

.footer__socials {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6)
}

.social-link {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition)
}

.social-link:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-bg)
}

.social-link img {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  transition: opacity var(--transition)
}

.social-link:hover img {
  opacity: 1
}

.footer__heading {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.08em
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-3)
}

.footer__link {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition), padding-left var(--transition)
}

.footer__link:hover {
  color: var(--color-primary);
  padding-left: 4px
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-3)
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition)
}

.footer__contact-item svg {
  color: var(--color-primary);
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px
}

a.footer__contact-item:hover {
  color: var(--color-primary)
}

.footer__bottom {
  border-top: 1px solid var(--color-border)
}

.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-6)
}

.footer__copy {
  font-size: var(--text-sm);
  color: var(--color-text-faint)
}

.footer__legal {
  display: flex;
  align-items: center;
  gap: var(--space-4)
}

.footer__link--sm {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
  transition: color var(--transition)
}

.footer__link--sm:hover {
  color: var(--color-primary)
}

/* ─── Cursor Glow ────────────────────────────── */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at center, rgba(79, 142, 247, 0.06) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
  will-change: transform
}

#cursor-glow.active {
  opacity: 1
}

[data-theme="light"] #cursor-glow {
  background: radial-gradient(circle at center, rgba(79, 142, 247, 0.04) 0%, transparent 70%)
}

/* ─── Responsive ─────────────────────────────── */
@media(max-width:1024px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8)
  }
}

@media(max-width:768px) {
  .navbar__inner {
    justify-content: space-between;
    width: 100%
  }

  .navbar__links {
    display: none
  }

  .navbar__actions .btn--glow {
    display: none
  }

  .navbar__actions .theme-toggle {
    display: none
  }

  .navbar__actions {
    margin-left: auto;
    gap: 0;
    flex: 0 0 auto;
    justify-content: flex-end
  }

  .navbar__hamburger {
    display: flex
  }

  /* Dropdown mobile menu */
  .mobile-menu {
    display: flex;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    height: auto;
    bottom: auto;
    flex-direction: column;
    align-items: flex-start;
    background: #0a0a0a;
    padding: var(--space-4) var(--container-pad) var(--space-8);
    gap: var(--space-2);
    z-index: 999;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-1rem);
    opacity: 0;
    transition: transform 0.3s var(--ease-spring), opacity 0.3s var(--ease);
    pointer-events: none;
  }

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

  .mobile-nav-link {
    font-size: var(--text-xl);
    padding: 0.75rem 0;
    width: 100%;
    text-align: left;
  }

  .mobile-menu .btn {
    margin-top: var(--space-4);
    align-self: stretch;
    justify-content: center;
    padding: 1rem;
    font-size: var(--text-base);
  }

  .footer__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8)
  }

  .footer__bottom-inner {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center
  }

  .section {
    padding-block: var(--space-16)
  }
}