/* ============================================================
   PODMOD DESIGN SYSTEM
   Foundation layer: reset, custom properties, typography,
   spacing scale, animation keyframes, and utility classes.
   Every other CSS file in the project reads from these tokens.
   ============================================================ */

/* ----- CSS Reset (modern, minimal) ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navbar-height) + 8px);
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  line-height: 1.15;
}

p {
  overflow-wrap: break-word;
}

/* ----- Custom Properties (Design Tokens) ----- */
:root {
  /* Brand palette — the only color carried from the old design */
  --brand: #5B3AFF;
  --brand-hover: #491CFF;
  --brand-light: #7C5EFF;
  --brand-glow: rgba(91, 58, 255, 0.4);
  --brand-subtle: rgba(91, 58, 255, 0.08);
  --brand-surface: rgba(91, 58, 255, 0.12);

  /* Surfaces (dark-mode-first) */
  --bg-primary: #06060B;
  --bg-secondary: #0D0D14;
  --bg-elevated: #13131D;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);

  /* Text */
  --text-primary: #F0F0F5;
  --text-secondary: #8A8A9A;
  --text-muted: #55556A;
  --text-on-brand: #FFFFFF;

  /* Semantic accents */
  --accent-warm: #F5A623;
  --accent-success: #22C55E;
  --accent-danger: #EF4444;

  /* Borders & dividers */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-brand: rgba(91, 58, 255, 0.3);

  /* Shadows & glows */
  --glow-brand: 0 0 60px rgba(91, 58, 255, 0.15);
  --glow-brand-strong: 0 0 120px rgba(91, 58, 255, 0.25);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.4);

  /* Typography — font families */
  --font-display: 'Syne', sans-serif;
  --font-hero: 'Lexend', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Typography — size scale (bold but controlled) */
  --text-xs: 0.75rem;     /* 12px — fine print */
  --text-sm: 0.875rem;    /* 14px — captions, labels */
  --text-base: 1.0625rem; /* 17px — body */
  --text-lg: 1.25rem;     /* 20px — lead text */
  --text-xl: 1.5rem;      /* 24px — small headings */
  --text-2xl: clamp(1.35rem, 2.5vw, 1.75rem); /* section sub-headings */
  --text-3xl: clamp(1.5rem, 3vw, 2.25rem);    /* section headings */
  --text-4xl: clamp(1.75rem, 4vw, 2.75rem);   /* page headings */
  --text-hero: clamp(2.25rem, 5vw, 3.75rem);  /* hero headline */

  /* Spacing scale */
  --space-xs: 0.25rem;  /* 4px */
  --space-sm: 0.5rem;   /* 8px */
  --space-md: 1rem;     /* 16px */
  --space-lg: 1.5rem;   /* 24px */
  --space-xl: 2rem;     /* 32px */
  --space-2xl: 3rem;    /* 48px */
  --space-3xl: 4rem;    /* 64px */
  --space-4xl: 6rem;    /* 96px */
  --space-section: clamp(5rem, 12vh, 10rem); /* between major sections */

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-wide: 1400px;
  --navbar-height: 72px;
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* ----- Base Typography ----- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-hero); font-weight: 500; }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

strong { color: var(--text-primary); font-weight: 600; }

small { font-size: var(--text-sm); color: var(--text-muted); }

/* Monospace labels/badges */
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ----- Layout Containers ----- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

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

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

/* ----- Section Spacing ----- */
.section {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
  position: relative;
  overflow: hidden;
}

.section--alt {
  background-color: var(--bg-secondary);
}

/* ----- Animation Keyframes ----- */

/* Fade up — primary entrance animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in (no translate) */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Gentle float — product screenshots */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Slow orbit — background gradient orbs */
@keyframes orbDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(60px, -40px) scale(1.1); }
  66%  { transform: translate(-30px, 30px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes orbDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-50px, 50px) scale(1.05); }
  66%  { transform: translate(40px, -20px) scale(0.9); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes orbDrift3 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, 60px) scale(1.08); }
  66%  { transform: translate(-60px, -30px) scale(0.92); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Shine sweep for CTA buttons */
@keyframes shineSweep {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(200%) skewX(-15deg); }
}

/* Pulse for live indicators */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* Rotate for loading states */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----- Scroll-Triggered Animation Classes -----
   Elements start invisible; JS adds .is-visible when
   they enter the viewport via IntersectionObserver. */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children — apply to parent container.
   All children become visible when the parent gets .is-visible;
   the first 8 get an incremental delay for a cascade effect,
   children 9+ appear together after the cascade finishes. */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 560ms;
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 560ms; }

/* ----- Utility Classes ----- */

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Flex helpers */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }
.gap-xl      { gap: var(--space-xl); }
.gap-2xl     { gap: var(--space-2xl); }

/* Grid helpers */
.grid        { display: grid; }

/* Visually hidden (accessible) */
.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;
}

/* Brand color highlight for text */
.highlight {
  color: var(--brand);
  position: relative;
}

.highlight--glow {
  color: var(--brand);
  text-shadow: 0 0 40px var(--brand-glow);
}

/* Eyebrow/label text */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-light);
}

/* Section header pattern */
.section-header {
  max-width: 700px;
  margin-bottom: var(--space-3xl);
}

.section-header.text-center {
  margin-left: auto;
  margin-right: auto;
}

.section-header .eyebrow {
  margin-bottom: var(--space-md);
  display: block;
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

.section-header p {
  font-size: var(--text-lg);
  max-width: 560px;
}

.section-header.text-center p {
  margin-left: auto;
  margin-right: auto;
}

/* ----- Responsive Breakpoints -----
   Mobile-first: base styles are mobile,
   then scale up with min-width queries. */

@media (max-width: 768px) {
  :root {
    --navbar-height: 64px;
    --space-section: clamp(3rem, 8vh, 5rem);
  }

  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  h1 { font-size: clamp(1.85rem, 6vw, 2.75rem); }
  h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
}

/* Use dynamic viewport height where supported to avoid
   address-bar-related layout jumps on mobile Safari/Chrome */
@supports (height: 1dvh) {
  :root {
    --space-section: clamp(5rem, 12dvh, 10rem);
  }

  @media (max-width: 768px) {
    :root {
      --space-section: clamp(3rem, 8dvh, 5rem);
    }
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }
}

/* ----- Reduced Motion -----
   Respects user OS setting to minimize animations
   for accessibility and vestibular disorder support. */
@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;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}
