/* =============================================
   Strux CMS — Marketing Site Design System
   Colors extracted from packages/admin/app/globals.css
   ============================================= */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Core palette — dark mode first (matches CMS admin) */
  --bg: hsl(222.2, 84%, 4.9%);
  --bg-soft: hsl(217.2, 32.6%, 8%);
  --bg-card: hsl(217.2, 32.6%, 10%);
  --bg-card-hover: hsl(217.2, 32.6%, 13%);
  --fg: hsl(210, 40%, 98%);
  --fg-muted: hsl(215, 20.2%, 65.1%);
  --fg-faint: hsl(215, 15%, 45%);
  --border: hsl(217.2, 32.6%, 17.5%);
  --border-soft: hsl(217.2, 25%, 14%);

  /* Accent — electric blue gradient */
  --accent: hsl(210, 100%, 55%);
  --accent-soft: hsla(210, 100%, 55%, 0.12);
  --accent-glow: hsla(210, 100%, 55%, 0.2);
  --gradient: linear-gradient(135deg, hsl(210, 100%, 55%) 0%, hsl(250, 80%, 65%) 100%);
  --gradient-text: linear-gradient(135deg, hsl(210, 100%, 70%) 0%, hsl(250, 80%, 75%) 100%);

  /* Primary — from CMS */
  --primary: hsl(222.2, 47.4%, 11.2%);
  --primary-fg: hsl(210, 40%, 98%);

  /* Destructive */
  --destructive: hsl(0, 62.8%, 30.6%);

  /* Layout */
  --radius: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --max-w: 1200px;
  --nav-h: 64px;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

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

/* --- Container --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: hsla(222.2, 84%, 4.9%, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.nav.scrolled {
  background: hsla(222.2, 84%, 4.9%, 0.95);
  box-shadow: 0 1px 20px hsla(0, 0%, 0%, 0.3);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: var(--radius);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.nav-link:hover {
  color: var(--fg);
  background: var(--accent-soft);
}

.nav-link--github {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.5rem;
  border-radius: 50%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--fg);
  border-radius: 1px;
  transition: transform var(--duration) var(--ease);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow), 0 1px 3px hsla(0, 0%, 0%, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 40px var(--accent-glow), 0 4px 12px hsla(0, 0%, 0%, 0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--fg-muted);
}

.btn-ghost:hover {
  border-color: var(--fg-faint);
  color: var(--fg);
  background: hsla(210, 40%, 98%, 0.04);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 4rem) 0 6rem;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  from { opacity: 0.5; transform: translateX(-50%) scale(1); }
  to { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}

.hero-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 50%, black, transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 2rem;
  animation: fade-up 0.6s var(--ease) both;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: hsl(142, 76%, 50%);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fade-up 0.6s var(--ease) 0.1s both;
}

.hero-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 640px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
  animation: fade-up 0.6s var(--ease) 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 4rem;
  animation: fade-up 0.6s var(--ease) 0.3s both;
}

.hero-install {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.install-code {
  padding: 0.625rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--fg-muted);
  user-select: all;
}

.install-prompt {
  color: var(--accent);
  margin-right: 0.5rem;
}

.install-copy {
  padding: 0.625rem 0.75rem;
  color: var(--fg-faint);
  border-left: 1px solid var(--border);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.install-copy:hover {
  color: var(--fg);
  background: var(--accent-soft);
}

.install-copy.copied {
  color: hsl(142, 76%, 50%);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  animation: fade-up 0.6s var(--ease) 0.4s both;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Sections --- */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 100px;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Features --- */
.features {
  padding: 6rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.feature-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px hsla(0, 0%, 0%, 0.2);
}

.feature-card--highlight {
  border-color: hsla(210, 100%, 55%, 0.2);
  background: linear-gradient(135deg, hsla(210, 100%, 55%, 0.06) 0%, var(--bg-card) 80%);
}

.feature-card--highlight:hover {
  border-color: hsla(210, 100%, 55%, 0.35);
  box-shadow: 0 8px 30px hsla(210, 100%, 55%, 0.08);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

/* --- Code Section --- */
.code-section {
  padding: 6rem 0;
}

.code-tabs {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 0.5rem;
}

.code-tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fg-faint);
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  margin-bottom: -1px;
}

.code-tab:hover {
  color: var(--fg-muted);
}

.code-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.code-panel {
  display: none;
}

.code-panel.active {
  display: block;
}

.code-header {
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-copy-btn {
  color: var(--fg-faint);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
  padding: 0.25rem;
  border-radius: var(--radius);
}

.code-copy-btn:hover {
  color: var(--fg);
  background: var(--accent-soft);
}

.code-copy-btn.copied {
  color: hsl(142, 76%, 50%);
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-faint);
}

.code-block {
  padding: 1.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--fg-muted);
}

.hl-key { color: hsl(210, 100%, 70%); }
.hl-str { color: hsl(142, 60%, 60%); }
.hl-bool { color: hsl(30, 90%, 65%); }
.hl-num { color: hsl(30, 90%, 65%); }
.hl-comment { color: var(--fg-faint); font-style: italic; }

/* --- Architecture --- */
.architecture {
  padding: 6rem 0;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.arch-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}

.arch-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  margin-bottom: 1.25rem;
}

.arch-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.arch-chip {
  padding: 0.375rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid hsla(210, 100%, 55%, 0.15);
}

.arch-metrics {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.metric-val {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-lbl {
  font-size: 0.8125rem;
  color: var(--fg-faint);
}

.arch-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.arch-flow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.arch-node {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.arch-arrow {
  color: var(--accent);
  font-size: 1.25rem;
}

/* --- CTA --- */
.cta {
  padding: 6rem 0;
}

.cta-card {
  position: relative;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  position: relative;
}

.cta-subtitle {
  font-size: 1.125rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
  position: relative;
}

.cta-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 4rem 0 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--fg-faint);
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-col h4 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--fg-muted);
  padding: 0.25rem 0;
  transition: color var(--duration) var(--ease);
}

.footer-col a:hover {
  color: var(--fg);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: var(--fg-faint);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 2rem 2rem;
    gap: 1rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
    box-shadow: -10px 0 30px hsla(0, 0%, 0%, 0.5);
  }

  .nav-links--open {
    right: 0 !important;
  }

  .nav-link {
    width: 100%;
    font-size: 1.125rem;
    padding: 1rem;
  }

  .nav-link--github {
    margin-left: 0;
    margin-top: 1rem;
    padding: 1rem;
    width: auto;
    border-radius: var(--radius);
  }

  .nav-toggle {
    display: flex;
    z-index: 101;
    position: relative;
  }

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

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
  }

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

  .hero {
    padding: calc(var(--nav-h) + 2rem) 0 4rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1.25rem;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .features-grid,
  .arch-grid {
    grid-template-columns: 1fr;
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .arch-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-faint);
}

/* --- Selection --- */
::selection {
  background: var(--accent-soft);
  color: var(--fg);
}
