/* ==========================================================================
   CEEZAER DESIGN SYSTEM — system.css
   --------------------------------------------------------------------------
   One shared layer loaded by every page AFTER its family stylesheet.
   Harmonizes the three legacy themes (dji-preview.css, css/styles.css,
   assets/css/style.css) into a single premium, aerospace-grade aesthetic.

   Contents
     1. Design tokens
     2. Legacy-variable harmonization (palette unification)
     3. Base refinements (type, selection, scrollbar, focus, a11y)
     4. Buttons — unified CTA language
     5. Headers / navigation (incl. mobile nav for legacy pages)
     6. Cards, tiles & icon treatment
     7. Sections, heroes & typography rhythm
     8. Tables, steps, FAQ, testimonials, CTA banners
     9. Forms
    10. Pricing & product cards (portal / products)
    11. Footer
    12. Motion system (czr-reveal, scroll states, micro-interactions)
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* Color */
  --czr-bg: #000000;
  --czr-bg-elev: #0b0d12;
  --czr-surface: rgba(255, 255, 255, 0.03);
  --czr-surface-hover: rgba(255, 255, 255, 0.055);
  --czr-text: #f5f7fa;
  --czr-text-soft: rgba(255, 255, 255, 0.72);
  --czr-text-muted: rgba(255, 255, 255, 0.48);
  --czr-border: rgba(255, 255, 255, 0.08);
  --czr-border-strong: rgba(255, 255, 255, 0.18);

  /* Brand — single accent hue, gradient reserved for key moments */
  --czr-accent: #2e9fff;
  --czr-accent-hover: #5cb5ff;
  --czr-cyan: #00c6ff;
  --czr-grad: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
  --czr-grad-btn: linear-gradient(135deg, #00a9ec 0%, #0064e0 100%);
  --czr-accent-glow: rgba(0, 140, 255, 0.28);

  /* Type */
  --czr-font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont,
              "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --czr-track-tight: -0.025em;
  --czr-track-wide: 0.16em;

  /* Radius scale */
  --czr-r-sm: 8px;
  --czr-r-md: 12px;
  --czr-r-lg: 16px;
  --czr-r-xl: 24px;
  --czr-r-pill: 999px;

  /* Shadows */
  --czr-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --czr-shadow-2: 0 2px 4px rgba(0, 0, 0, 0.4), 0 20px 60px rgba(0, 0, 0, 0.5);
  --czr-shadow-glow: 0 8px 28px var(--czr-accent-glow);

  /* Motion */
  --czr-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --czr-fast: 0.2s var(--czr-ease);
  --czr-base: 0.45s var(--czr-ease);
  --czr-slow: 0.8s var(--czr-ease);
}

/* ---------- 2. Legacy-variable harmonization ---------- */
/* dji-preview.css (homepage) */
:root {
  --c-accent: var(--czr-accent);
  --c-accent-hover: var(--czr-accent-hover);
  --c-link: var(--czr-accent);
  --c-bg-alt: var(--czr-bg-elev);
  --c-border: var(--czr-border);
  --c-border-strong: var(--czr-border-strong);
}
/* assets/css/style.css (legacy family) — keep brand cyan for gradient text,
   route interactive blue through the unified accent */
:root {
  --brand: var(--czr-accent);
  --brand2: #0072ff;
  --card: var(--czr-bg-elev);
  --border: var(--czr-border);
  --radius: var(--czr-r-lg);
}
/* css/styles.css (core family) */
:root {
  --color-bg-elevated: var(--czr-bg-elev);
  --color-bg-card: var(--czr-surface);
  --color-bg-card-hover: var(--czr-surface-hover);
  --color-border: var(--czr-border);
  --color-border-hover: var(--czr-border-strong);
}

/* ---------- 3. Base refinements ---------- */
body {
  font-family: var(--czr-font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(0, 160, 255, 0.35);
  color: #fff;
}

/* Thin, quiet scrollbar (WebKit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 3px solid #000;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }

/* Accessible, consistent focus ring */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--czr-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Balanced headline wrapping where supported */
h1, h2, h3, .section-title, .dji-section-title { text-wrap: balance; }

/* Refined display type across families:
   soften the legacy 900-weight / -2px tracking into a precise,
   aerospace-grade headline voice */
h1 { letter-spacing: var(--czr-track-tight); font-weight: 800; line-height: 1.06; }
h2 { letter-spacing: -0.02em; font-weight: 750; }
h3 { letter-spacing: -0.01em; }

/* Section eyebrow labels — one voice everywhere */
.section-label, .dji-eyebrow, .dji-card-eyebrow {
  letter-spacing: var(--czr-track-wide);
  font-weight: 600;
  color: var(--czr-accent);
}

/* Paragraph color unification */
p { color: var(--czr-text-soft); }
.section-sub, .hero-sub, .dji-lead { color: var(--czr-text-soft); }

/* ---------- 4. Buttons — unified CTA language ---------- */
/* Primary: brand-gradient pill (identical on all three families) */
.btn-primary, .dji-btn-primary {
  background: var(--czr-grad-btn);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: var(--czr-r-pill);
  box-shadow: 0 4px 18px rgba(0, 120, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform var(--czr-fast), box-shadow var(--czr-fast), filter var(--czr-fast);
}
.btn-primary:hover, .dji-btn-primary:hover {
  background: var(--czr-grad-btn);
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px var(--czr-accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:active, .dji-btn-primary:active,
.btn-secondary:active, .dji-btn-ghost:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.08s;
}

/* Secondary / ghost: quiet outline, brightens on hover */
.btn-secondary, .btn-outline, .dji-btn-ghost {
  border-radius: var(--czr-r-pill);
  border: 1px solid var(--czr-border-strong);
  color: var(--czr-text);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--czr-fast), background var(--czr-fast), transform var(--czr-fast);
}
.btn-secondary:hover, .btn-outline:hover, .dji-btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

/* Legacy stray accents (teal .btn-primary override in styles.css) are
   neutralized by the rules above; keep uppercase tracking from family A */

/* ---------- 5. Headers / navigation ---------- */
/* Legacy family header (.site-nav) — glassy, precise */
.site-nav {
  position: sticky;
  top: 0;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--czr-border);
  transition: background var(--czr-fast), padding var(--czr-fast), box-shadow var(--czr-fast);
}
.site-nav.czr-scrolled,
.dji-header.czr-scrolled,
.site-header.czr-scrolled {
  background: rgba(4, 6, 10, 0.92);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.site-nav .nav-links a { transition: color var(--czr-fast); }
.nav-cta {
  border-radius: var(--czr-r-pill) !important;
  transition: background var(--czr-fast), transform var(--czr-fast), box-shadow var(--czr-fast);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15); }

/* Mobile nav for legacy pages (injected by motion.js — legacy CSS simply
   hid all navigation under 768px) */
.czr-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 42px;
  height: 42px;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.czr-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform var(--czr-fast), opacity var(--czr-fast);
}
.site-nav.czr-open .czr-nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav.czr-open .czr-nav-toggle span:nth-child(2) { opacity: 0; }
.site-nav.czr-open .czr-nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .czr-nav-toggle { display: flex; }
  .site-nav { position: sticky; }
  .site-nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(4, 6, 10, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--czr-border);
    padding: 0.5rem 1.5rem 1.25rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  }
  .site-nav.czr-open .nav-links { display: flex; }
  .site-nav .nav-links a {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 1rem;
    width: 100%;
  }
  .site-nav .nav-links .nav-cta {
    margin-top: 0.9rem;
    text-align: center;
    padding: 12px 18px;
    border-bottom: 0;
  }
}

/* ---------- 6. Cards, tiles & icon treatment ---------- */
/* Shared card surface: glass, 16px radius, lift + border-light on hover */
.card, .blog-card, .testimonial, .step, .related-link,
.service-card, .dji-card, .dji-tile {
  border-radius: var(--czr-r-lg);
  border: 1px solid var(--czr-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  transition: transform var(--czr-base), border-color var(--czr-fast), box-shadow var(--czr-base), background var(--czr-fast);
}
.card:hover, .blog-card:hover, .step:hover,
.service-card:hover, a.service-card:hover, .dji-card:hover, .dji-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(120, 190, 255, 0.28);
  box-shadow: var(--czr-shadow-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
}
.related-link:hover {
  border-color: rgba(120, 190, 255, 0.28);
  background: rgba(46, 159, 255, 0.07);
}

/* Icon treatment: contain legacy emoji in a precise glass tile so
   iconography reads intentional and consistent */
.card-icon, .service-icon, .product-icon, .dji-tile-icon {
  color: var(--czr-accent);
}
.service-icon svg, .dji-tile-icon svg { width: 26px; height: 26px; }
.dji-tile-icon {
  background: radial-gradient(120% 120% at 30% 20%, rgba(46, 159, 255, 0.16), rgba(255, 255, 255, 0.03) 70%);
  border: 1px solid rgba(120, 190, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.card-icon, .service-icon, .product-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  border-radius: 14px;
  background: radial-gradient(120% 120% at 30% 20%, rgba(46, 159, 255, 0.16), rgba(255, 255, 255, 0.03) 70%);
  border: 1px solid rgba(120, 190, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 1.1rem;
}

/* Blog-card gradient placeholders → subtle engineered texture */
.blog-card-img, .feature-visual {
  background-image:
    linear-gradient(rgba(120, 190, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 190, 255, 0.05) 1px, transparent 1px),
    radial-gradient(80% 90% at 50% 0%, rgba(0, 120, 255, 0.18), transparent 70%),
    linear-gradient(135deg, #0a1420, #050a14);
  background-size: 28px 28px, 28px 28px, 100% 100%, 100% 100%;
  border-bottom: 1px solid var(--czr-border);
}
.feature-visual { border-bottom: 0; border: 1px solid var(--czr-border); border-radius: var(--czr-r-lg); }

/* ---------- 7. Sections, heroes & typography rhythm ---------- */
/* Legacy hero: replace the diamond-tile texture with a quiet horizon glow */
.hero::before {
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(0, 150, 255, 0.14), transparent 70%);
}
.hero .hero-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--czr-border);
  color: var(--czr-text-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero h1 span,
.step-num {
  background: var(--czr-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Section chrome: hairline dividers instead of hard blocks */
.stats-row { border-color: var(--czr-border); }
.stat-num { letter-spacing: -0.02em; }

/* ---------- 8. Tables, steps, FAQ, testimonials, CTA banners ---------- */
.compare-table th { color: var(--czr-text-muted); }
.compare-table th, .compare-table td { border-bottom: 1px solid var(--czr-border); }
.compare-table tr:hover td { background: rgba(120, 190, 255, 0.04); }
.highlight-col { background: rgba(46, 159, 255, 0.05); }

.faq-item { border-bottom: 1px solid var(--czr-border); }
.faq-q { transition: color var(--czr-fast); }
.faq-q:hover { color: var(--czr-accent-hover); }
details.faq-item summary { cursor: pointer; transition: color var(--czr-fast); }
details.faq-item summary:hover { color: var(--czr-accent-hover); }

.stars { color: #ffcf40; }
.avatar { background: var(--czr-grad); }

.cta-banner, .article-cta {
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(0, 130, 255, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(120, 190, 255, 0.16);
  border-radius: var(--czr-r-xl);
  box-shadow: var(--czr-shadow-1);
}

/* ---------- 9. Forms ---------- */
input, select, textarea {
  accent-color: var(--czr-accent);
}
.dji-form input:focus, .dji-form select:focus, .dji-form textarea:focus,
.inquiry-form input:focus, .inquiry-form select:focus, .inquiry-form textarea:focus {
  border-color: var(--czr-accent);
  box-shadow: 0 0 0 3px rgba(46, 159, 255, 0.18);
}
.dji-form-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border-radius: var(--czr-r-xl);
  box-shadow: var(--czr-shadow-1);
}

/* ---------- 10. Pricing & product cards (portal / products) ---------- */
body .pricing-card, body .product-card {
  border-radius: 20px;
  border: 1px solid var(--czr-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  transition: transform var(--czr-base), border-color var(--czr-fast), box-shadow var(--czr-base);
}
body .pricing-card:hover, body .product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--czr-shadow-2);
  border-color: rgba(120, 190, 255, 0.28);
}
body .pricing-card.popular, body .product-card.featured {
  border-color: rgba(46, 159, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(46, 159, 255, 0.25), 0 24px 64px rgba(0, 80, 200, 0.18);
}
body .btn-subscribe, body .btn-buy {
  border-radius: var(--czr-r-pill);
  transition: transform var(--czr-fast), box-shadow var(--czr-fast), filter var(--czr-fast);
}
body .btn-subscribe:hover, body .btn-buy:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: var(--czr-shadow-glow);
}

/* ---------- 10b. Repairs & harmonization of legacy components ---------- */
/* .stats-grid was never defined in the legacy stylesheet — blog stat
   sections rendered as unstyled inline runs. Give them a proper band. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.stats-grid .stat-item { display: flex; flex-direction: column; gap: 0.4rem; }
/* .stats-row is a centered flex band; when it wraps a stats-grid the flex
   item must be allowed to shrink or the grid overflows on small screens */
.stats-row > .container { flex: 1 1 100%; min-width: 0; max-width: 100%; }
.stats-grid .stat-num {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  background: var(--czr-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stats-grid .stat-label {
  font-size: 0.85rem;
  color: var(--czr-text-muted);
  line-height: 1.55;
  max-width: 34ch;
}

/* Retire the stray teal accent (#36a9ae) from the core family */
.header-cta {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}
.header-cta:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}
.form-submit-btn {
  background: var(--czr-grad-btn);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 18px rgba(0, 120, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.form-submit-btn:hover {
  background: var(--czr-grad-btn);
  filter: brightness(1.12);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 32px var(--czr-accent-glow);
}
.inquiry-form input:focus,
.inquiry-form select:focus,
.inquiry-form textarea:focus {
  border-color: var(--czr-accent);
  background: rgba(46, 159, 255, 0.05);
}
.flexible-check input { accent-color: var(--czr-accent); }

/* Full-bleed hero legibility: graded scrim instead of flat wash */
.hero-image-overlay {
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.25) 35%,
    rgba(0, 0, 0, 0.35) 65%,
    rgba(0, 0, 0, 0.72) 100%);
}

/* ---------- 11. Footer ---------- */
footer, .site-footer, .dji-footer { border-top: 1px solid var(--czr-border); }
.footer-col a, .dji-footer-col a { transition: color var(--czr-fast); }

/* Hero video: hidden behind the poster until it is actually playing */
.dji-hero-video { opacity: 0; transition: opacity 1.2s var(--czr-ease); }
.dji-hero-video.is-playing { opacity: 1; }

/* ---------- 12. Motion system ---------- */
/* Scroll reveals — applied by js/motion.js via the czr- namespace only.
   Gated on html.czr-motion so content is always visible without JS,
   and inert under prefers-reduced-motion. */
html.czr-motion .czr-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s var(--czr-ease),
    transform 0.8s var(--czr-ease);
  transition-delay: var(--czr-d, 0ms);
}
html.czr-motion .czr-reveal.czr-in {
  opacity: 1;
  transform: none;
}

/* Image reveal: gentle scale-settle for media inside revealed elements */
html.czr-motion .czr-reveal img,
html.czr-motion .czr-reveal .dji-card-media {
  transition: transform 1.1s var(--czr-ease);
  transition-delay: var(--czr-d, 0ms);
}
html.czr-motion .czr-reveal:not(.czr-in) img,
html.czr-motion .czr-reveal:not(.czr-in) .dji-card-media {
  transform: scale(1.04);
}

/* Card link affordance */
.dji-card-link, .card--link { transition: color var(--czr-fast); }

@media (prefers-reduced-motion: reduce) {
  html.czr-motion .czr-reveal,
  html.czr-motion .czr-reveal img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
