/* ============================================================
   LYTICS — Global Design System
   Inspired by altur.io, adapted for Lytics brand
   ============================================================ */

/* --- VARIABLES --- */
:root {
  /* Background */
  --background: #fdfdfd;
  --background-highlight: #fff;
  --background-secondary: #f6f6f6;
  --background-dark: #062A47;
  --background-dark-deep: #131D4B;

  /* Foreground */
  --foreground: #262626;
  --foreground-hover: #1a1a1a;
  --foreground-secondary: #767676;
  --foreground-tertiary: #b3b3b3;
  --foreground-dark: #fff;
  --foreground-secondary-dark: #afafaf;

  /* Primary (Lytics turquesa) */
  --primary: #0AC6C6;
  --primary-hover: #09b3b3;
  --primary-light: #e6fafa;
  --primary-dark: #062A47;

  /* Secondary accents */
  --blue: #0075A5;
  --blue-mid: #0F8FAF;
  --green: #03E5BF;
  --navy: #062A47;
  --navy-deep: #131D4B;

  /* Borders */
  --border: #eaeaea;
  --border-hover: #cacaca;

  /* Pale */
  --pale: #f5f5f5;
  --pale-light: #fafafa;

  /* Typography */
  --font-heading: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --container-max: 1200px;
  --container-narrow: 800px;
  --section-padding: 120px;
  --section-padding-mobile: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.3s;
}

/* --- RESET --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--foreground);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- CONTAINER --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.15;
}

.h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
}

.h5 {
  font-size: 1.1rem;
  font-weight: 600;
}

.h6 {
  font-size: 0.875rem;
  font-weight: 600;
}

.text-secondary {
  color: var(--foreground-secondary);
}

.text-center {
  text-align: center;
}

.subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 400;
  color: var(--foreground-secondary);
  line-height: 1.6;
}

/* --- TAG (small label above titles) --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--pale);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground-secondary);
  margin-bottom: 20px;
}

.tag--primary {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.btn--primary {
  background: var(--foreground);
  color: var(--background);
}

.btn--primary:hover {
  background: var(--foreground-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn--secondary {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  border-color: var(--foreground);
}

.btn--accent {
  background: var(--primary);
  color: var(--background-dark);
}

.btn--accent:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(10, 198, 198, 0.3);
}

/* --- NAVIGATION --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(253, 253, 253, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  transition: all var(--duration) var(--ease);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo img {
  height: 32px;
  width: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__link {
  font-size: 15px;
  font-weight: 500;
  color: var(--foreground);
  opacity: 0.8;
  transition: opacity var(--duration) var(--ease);
}

.nav__link:hover {
  opacity: 1;
}

.nav__link--active {
  opacity: 1;
  color: var(--primary);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--foreground);
  border-radius: 2px;
  transition: all var(--duration) var(--ease);
}

/* --- DROPDOWN --- */
.nav__dropdown {
  position: relative;
}

.nav__dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--foreground);
  opacity: 0.8;
  cursor: pointer;
  transition: opacity var(--duration) var(--ease);
}

.nav__dropdown-trigger:hover { opacity: 1; }

.nav__dropdown-trigger svg {
  width: 12px;
  height: 12px;
  transition: transform var(--duration) var(--ease);
}

.nav__dropdown.active .nav__dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav__dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: var(--background-highlight);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration) var(--ease), visibility var(--duration) var(--ease);
  z-index: 1001;
}

.nav__dropdown.active .nav__dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.nav__dropdown-item {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  border-radius: var(--radius-sm);
  transition: background var(--duration) var(--ease);
}

.nav__dropdown-item:hover {
  background: var(--pale);
  color: var(--primary);
}

/* --- SECTIONS --- */
.section {
  padding: var(--section-padding) 0;
}

.section--dark {
  background: var(--background-dark);
  color: var(--foreground-dark);
}

.section--dark .subtitle {
  color: var(--foreground-secondary-dark);
}

.section--pale {
  background: var(--pale-light);
}

.section__header {
  margin-bottom: 64px;
}

.section__header--center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section__header .subtitle {
  max-width: 600px;
  margin-top: 16px;
}

/* --- CARDS (altur.io style) --- */
.card {
  background: var(--background-highlight);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
}

.card__graphic {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  background: var(--pale-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card__graphic svg {
  width: 100%;
  height: 100%;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--foreground);
}

.card__text {
  font-size: 0.95rem;
  color: var(--foreground-secondary);
  line-height: 1.6;
}

/* --- GRID --- */
.grid {
  display: grid;
  gap: 24px;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --- HERO --- */
.hero {
  padding: 160px 0 100px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__title {
  max-width: 900px;
  width: 100%;
}

.hero__subtitle {
  max-width: 640px;
  margin-top: 24px;
  width: 100%;
}

.hero__cta {
  margin-top: 40px;
}

/* --- FOOTER --- */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__logo img {
  height: 28px;
  opacity: 0.6;
}

.footer__links {
  display: flex;
  gap: 24px;
}

.footer__link {
  font-size: 14px;
  color: var(--foreground-secondary);
}

.footer__link:hover {
  color: var(--foreground);
}

.footer__copy {
  font-size: 13px;
  color: var(--foreground-tertiary);
}

/* --- ANIMATIONS --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 0.6s; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 0.7s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- SVG ANIMATIONS --- */
@keyframes dash {
  to { stroke-dashoffset: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.svg-animate-dash {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dash 2s var(--ease) forwards;
}

.svg-animate-pulse {
  animation: pulse 3s ease-in-out infinite;
}

.svg-animate-float {
  animation: float 4s ease-in-out infinite;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 80px;
  }

  .container { padding: 0 20px; }

  .nav__links { display: none; }
  .nav__actions { display: none; }
  .nav__menu-btn { display: flex; }

  .nav__links.active {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 999;
    overflow-y: auto;
    padding: 80px 24px;
  }

  .nav__links.active .nav__link {
    font-size: 1.1rem;
  }

  .nav__links.active .nav__dropdown {
    width: 100%;
    text-align: center;
  }

  .nav__links.active .nav__dropdown-trigger {
    font-size: 1.1rem;
    justify-content: center;
  }

  .nav__links.active .nav__dropdown-menu {
    position: static;
    transform: none;
    min-width: auto;
    box-shadow: none;
    border: none;
    background: var(--pale-light);
    margin-top: 8px;
  }

  .hero { padding: 120px 0 64px; }
  .h1 { font-size: 1.75rem; word-wrap: break-word; overflow-wrap: break-word; }
  .h2 { font-size: 1.5rem; }
  .subtitle { font-size: 0.9rem; max-width: 100%; }
  .hero__title, .hero__subtitle { max-width: 100%; padding: 0; }

  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }

  /* Card graphics: prevent overflow */
  .card__graphic { height: 160px; }
  .card__graphic svg { max-height: 160px; }

  /* Contact grid */
  .contact-grid { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* Footer: stack columns on mobile */
  .footer { padding: 48px 0 24px !important; }
  .footer [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Hero CTA buttons stack */
  .hero__cta { flex-direction: column; align-items: center; }
  .hero__cta .btn { width: 100%; max-width: 280px; }

  /* Section headers */
  .section__header .subtitle { max-width: 100%; }

  /* SVG containers */
  [style*="padding: 48px 32px"],
  [style*="padding:48px 32px"] {
    padding: 32px 16px !important;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 100px 0 48px; }
  .h1 { font-size: 1.5rem; }
  .h2 { font-size: 1.3rem; }
  .tag { font-size: 11px; padding: 5px 10px; }
  .card { padding: 24px 16px; }
  .card__graphic { height: 140px; }
  .btn { font-size: 14px; padding: 12px 20px; }
}
