/* ===================================================
   STRAID - Design System
   Brand Kit: brand_assets/BRAND-KIT.md
   =================================================== */

/* ===== CSS RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv01", "ss03";
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow-x: hidden;
}

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

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

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

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

ul, ol {
  list-style: none;
}

/* ===== CSS VARIABLES — Brand Kit Dark Theme ===== */
:root {
  /* Backgrounds — pure black + neutral gray levels */
  --bg-main:        #000000;
  --bg-panel:       #0A0A0C;
  --bg-elevated:    #111114;
  --bg-float:       #19191D;

  /* Legacy aliases (consumed by existing selectors) */
  --bg-primary:     var(--bg-main);
  --bg-surface-1:   var(--bg-main);
  --bg-surface-2:   var(--bg-panel);
  --bg-surface-3:   var(--bg-elevated);
  --bg-soft:        var(--bg-panel);
  --bg-card:        var(--bg-panel);

  /* Text — neutral (no blue tint on black) */
  --text-h:          #E8E8ED;
  --text-body:       #A0A0AB;
  --text-muted:      rgba(160, 160, 171, 0.6);
  --text-faint:      rgba(160, 160, 171, 0.4);

  /* Legacy aliases */
  --text-primary:    var(--text-h);
  --text-secondary:  var(--text-body);
  --text-tertiary:   var(--text-muted);
  --text-quaternary: var(--text-faint);

  /* Brand colors */
  --brand-blue:       #3391FF;
  --brand-blue-rgb:   51, 145, 255;
  --brand-blue-hover: #5AA8FF;
  --brand-blue-subtle: rgba(51, 145, 255, 0.08);
  --brand-indigo:     #6D6AFF;
  --brand-success:    #00D48A;
  --brand-error:      #E53935;

  /* Legacy aliases */
  --accent:          var(--brand-blue);
  --accent-hover:    var(--brand-blue-hover);
  --accent-subtle:   var(--brand-blue-subtle);
  --accent-rgb:      var(--brand-blue-rgb);
  --link:            var(--brand-blue);
  --accent-light:    var(--brand-blue-subtle);
  --accent-gradient: linear-gradient(135deg, var(--brand-blue), var(--brand-indigo));
  --accent-dark:     var(--bg-main);
  --warm-accent:     #fb923c;

  /* Borders — slightly stronger on pure black */
  --border:          rgba(255, 255, 255, 0.08);
  --border-hover:    rgba(255, 255, 255, 0.12);

  /* Shadows — higher opacity on pure black */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.9), 0 6px 16px rgba(0, 0, 0, 0.5);
  /* Glow effects (subpages/webinar) */
  --glow-blue:  0 0 20px rgba(51, 145, 255, 0.15);
  --glow-cyan:  0 0 20px rgba(51, 145, 255, 0.1);

  /* Spacing — 4px grid */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;

  /* Radius — Brand Kit */
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --content-max:   1140px;
  --homepage-max:  1400px;
  --page-padding:  40px;
  --header-height: 96px;

  /* Z-index */
  --z-sticky:   200;
  --z-fixed:    300;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-h);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h4 { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.005em; line-height: 1.3; }

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

em {
  font-style: normal;
  color: var(--accent);
}

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

/* ===== LAYOUT CONTAINERS ===== */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.container-wide {
  width: 100%;
  max-width: var(--homepage-max);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.container-narrow {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 22px;
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background var(--transition-base), border-color var(--transition-base), opacity var(--transition-base);
}

.btn svg {
  width: 18px;
  height: 18px;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  opacity: 0.85;
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
}

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

.btn-secondary:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
}

/* ===== INTERACTIVE HOVER BUTTON ===== */
.btn-interactive {
  position: relative;
  overflow: hidden;
  border-radius: 9999px;
  border: 1px solid var(--border-hover);
  background: transparent;
  padding: 10px 28px;
  text-align: center;
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-interactive .btn-text {
  display: inline-block;
  transform: translateX(0.25rem);
  transition: transform 300ms ease, opacity 300ms ease;
}

.btn-interactive:hover .btn-text {
  transform: translateX(3rem);
  opacity: 0;
}

.btn-interactive .btn-hover-content {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  height: 100%;
  width: 100%;
  transform: translateX(3rem);
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #ffffff;
  opacity: 0;
  transition: transform 300ms ease, opacity 300ms ease;
}

.btn-interactive:hover .btn-hover-content {
  transform: translateX(-0.25rem);
  opacity: 1;
}

.btn-interactive .btn-dot {
  position: absolute;
  left: 20%;
  top: 40%;
  height: 8px;
  width: 8px;
  border-radius: 8px;
  background: var(--accent);
  opacity: 0;
  transition: left 300ms ease, top 300ms ease, width 300ms ease, height 300ms ease, opacity 300ms ease;
  z-index: 5;
}

.btn-interactive:hover .btn-dot {
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  opacity: 1;
}

.btn-interactive:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .btn-interactive .btn-text,
  .btn-interactive .btn-hover-content {
    transition: none;
  }
  .btn-interactive .btn-dot {
    display: none;
  }
}

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: var(--space-md); }

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group label .required { color: var(--accent); }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base);
  color: var(--text-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; min-height: 100px; }

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-row, .checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.checkbox-row span,
.checkbox-row label,
.checkbox-wrapper label {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.checkbox-row a, .checkbox-wrapper a {
  color: var(--text-tertiary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== ANIMATED CHECKBOX (neon) ===== */
.neon-checkbox {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}

.neon-checkbox input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.neon-checkbox-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.neon-checkbox input[aria-invalid="true"] + .neon-checkbox-box {
  border-color: var(--brand-error);
  background: rgba(229, 57, 53, 0.10);
}

.neon-checkbox-box svg {
  width: 11px;
  height: 11px;
  overflow: visible;
}

.neon-checkbox-box svg path {
  stroke: #000;
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  transition: stroke-dashoffset 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.neon-checkbox-glow {
  position: absolute;
  inset: -3px;
  border-radius: 6px;
  background: var(--brand-success);
  filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.neon-checkbox input:checked + .neon-checkbox-box {
  border-color: var(--brand-success);
  background: var(--brand-success);
}

.neon-checkbox input:checked + .neon-checkbox-box svg path {
  stroke-dashoffset: 0;
}

.neon-checkbox input:checked + .neon-checkbox-box .neon-checkbox-glow {
  opacity: 0.2;
}

.neon-checkbox input:focus-visible + .neon-checkbox-box {
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent);
}

@keyframes checkbox-shake {
  10%, 90%  { transform: translateX(-2px); }
  20%, 80%  { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60%  { transform: translateX(3px); }
  100%      { transform: translateX(0); }
}

.neon-checkbox-box.shake {
  animation: checkbox-shake 0.4s ease;
  box-shadow: 0 0 10px rgba(229, 57, 53, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .neon-checkbox-box {
    transition: border-color 0.15s ease, background 0.15s ease;
  }
  .neon-checkbox-box svg path {
    stroke-dasharray: unset;
    stroke-dashoffset: unset;
    transition: none;
  }
  .neon-checkbox-box.shake {
    animation: none;
  }
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: border-color var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
}

/* ===== TAGS / BADGES ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 11px;
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ===== SECTION STYLES ===== */
section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-3xl);
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--space-lg);
}

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

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ===== NAVIGATION ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

#navbar.scrolled {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

/* ===== LOGO ===== */
.logo { display: flex; align-items: center; }
.logo-img { height: 76px; width: auto; }

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

/* Pill container */
.nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Individual link inside pill */
.nav-pill-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: color var(--transition-base);
}

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

.nav-pill-link.active {
  color: var(--accent);
}

/* ===== TUBELIGHT INDICATOR ===== */
.nav-tubelight {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: var(--radius-full);
  background: rgba(var(--brand-blue-rgb), 0.10);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
  opacity: 0;
}

.nav-tubelight.visible {
  opacity: 1;
}

/* Glow bar above active item */
.tubelight-glow {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 4px;
  background: var(--accent);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  box-shadow: 0 0 8px rgba(var(--brand-blue-rgb), 0.6);
}

/* Wide soft blur layer */
.tubelight-glow::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 20px;
  background: rgba(var(--brand-blue-rgb), 0.25);
  border-radius: var(--radius-full);
  filter: blur(10px);
}

/* Tight concentrated glow */
.tubelight-glow::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 14px;
  background: rgba(var(--brand-blue-rgb), 0.35);
  border-radius: var(--radius-full);
  filter: blur(5px);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

@media (max-width: 968px) {
  .nav-links { display: none; }
  .nav-actions .btn span { display: none; }
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-primary);
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.footer-logo-link { display: flex; align-items: center; }
.footer-logo-img { height: 32px; width: auto; }

.footer-text {
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

.footer-links a:hover { color: var(--text-primary); }

@media (max-width: 768px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-brand { flex-direction: column; }
}

/* ===== UTILITIES ===== */
.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;
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal, .reveal-left, .reveal-right, .reveal-scale {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal { transform: translateY(20px); }
.reveal-left { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }
.reveal-scale { transform: scale(0.97); }

.reveal.active, .reveal-left.active, .reveal-right.active, .reveal-scale.active {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-stagger.active > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.active > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.active > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.active > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.active > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.active > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.active > * { opacity: 1; transform: translateY(0); }

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-surface-1); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

::selection {
  background: rgba(var(--accent-rgb), 0.4);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== REDUCED MOTION ===== */
@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; }
}

/* ===== PAGE HEADER (subpages) ===== */
.page-header {
  padding: calc(var(--header-height) + var(--space-3xl)) 0 var(--space-2xl);
  background: var(--bg-surface-1);
  text-align: center;
}

.page-header-content { max-width: 600px; margin: 0 auto; }
.page-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: var(--space-sm); }
.page-subtitle { color: var(--text-secondary); font-size: 15px; }

.page-content { padding: var(--space-3xl) 0; }
.page-content a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.page-content a:hover { color: var(--text-primary); }
