/* ========================================
   KAIROS ROUTE — Premium Design System
   Inspired by Stitch Proposal #2
   ======================================== */

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

:root {
  --color-bg: #050d1a;
  --color-surface: #0a1626;
  --color-surface-hover: #0d1d30;
  --color-border: #1e2e42;
  --color-primary: #1ED6D3;
  --color-primary-dark: #16b0ad;
  --color-text: #cbd5e1;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  --color-white: #ffffff;
  --color-footer-bg: #030912;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --max-width: 1200px;
  --transition: 200ms ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── A11y: Focus ── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── A11y: Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-tag::before {
    animation: none;
  }
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-primary);
  color: var(--color-bg);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-bg);
  border-radius: var(--radius);
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Background Grid ── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 214, 211, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 214, 211, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

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

/* ── Typography ── */
h1,
h2,
h3,
h4 {
  color: var(--color-white);
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

h4 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
}

h1 span,
h2 span {
  color: var(--color-primary);
  font-weight: 700;
}

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary);
}

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

/* ── Longform content (Legal/Docs) ── */
.prose {
  max-width: 820px;
  margin: 0 auto;
}

.prose .updated {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.prose p {
  margin-bottom: 1rem;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem 1.25rem;
  padding-left: 1.25rem;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin: 0.35rem 0;
}

.prose a {
  color: var(--color-primary);
}

.prose a:hover {
  color: var(--color-primary-dark);
}

/* ========================================
   HEADER — Glass Navigation
   ======================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 13, 26, 0.75);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-logo img {
  height: 40px;
  width: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color var(--transition);
  position: relative;
}

nav a:hover,
nav a.active {
  color: var(--color-primary);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--color-border);
}

.lang-switcher a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-dim);
}

.lang-switcher a.active {
  color: var(--color-primary);
}

.lang-switcher a:hover {
  color: var(--color-primary);
}

/* Hamburger */
.nav-toggle-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 200;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: all 0.3s ease;
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

.nav-toggle-btn.active .hamburger {
  background: transparent;
}

.nav-toggle-btn.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle-btn.active .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ========================================
   HERO
   ======================================== */
main {
  position: relative;
  z-index: 1;
  padding-top: 8rem;
}

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
  position: relative;
}

/* Ambient glow behind hero */
.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 800px;
  background: radial-gradient(circle at center, rgba(30, 214, 211, 0.12) 0%, rgba(5, 13, 26, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 960px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(30, 214, 211, 0.3);
  background: rgba(30, 214, 211, 0.08);
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  font-weight: 300;
  max-width: 640px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 2rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-bg);
  font-weight: 700;
  font-size: 0.9375rem;
  transition: all var(--transition);
  box-shadow: 0 0 20px rgba(30, 214, 211, 0.3);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-bg);
  box-shadow: 0 0 30px rgba(30, 214, 211, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: rgba(10, 22, 38, 0.5);
  color: var(--color-white);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: rgba(30, 214, 211, 0.5);
  background: var(--color-surface);
  color: var(--color-white);
}

.btn-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: var(--color-bg);
  font-weight: 700;
  font-size: 0.9375rem;
  transition: all var(--transition);
  box-shadow: 0 0 16px rgba(30, 214, 211, 0.2);
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-teal:hover {
  background: var(--color-primary-dark);
  color: var(--color-bg);
  box-shadow: 0 0 24px rgba(30, 214, 211, 0.4);
}

/* ========================================
   LABEL BAR
   ======================================== */
.label-bar {
  padding: 1.25rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

.label-bar p {
  font-size: 0.8125rem;
  color: var(--color-text-dim);
  letter-spacing: 0.04em;
  font-weight: 400;
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
  padding: 5rem 0;
}

.section-alt {
  background: rgba(10, 22, 38, 0.3);
}

.section-label {
  display: inline-block;
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

/* ========================================
   GLASS CARDS — Bento Grid
   ======================================== */
.grid-bento {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
      rgba(30, 214, 211, 0.06),
      transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  border-color: rgba(30, 214, 211, 0.4);
}

.card:first-child {
  grid-column: span 1;
}

.card-icon {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(30, 214, 211, 0.08);
  border: 1px solid rgba(30, 214, 211, 0.15);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ========================================
   PRODUCT CARD
   ======================================== */
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  transition: border-color 0.3s ease;
}

.product-card:hover {
  border-color: rgba(30, 214, 211, 0.35);
}

.product-card h2 {
  margin-bottom: 0.75rem;
}

.product-card p {
  color: var(--color-text-muted);
  max-width: 600px;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  background: rgba(30, 214, 211, 0.1);
  border: 1px solid rgba(30, 214, 211, 0.2);
  color: var(--color-primary);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.link-subtle {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.link-subtle:hover {
  color: var(--color-primary);
}

/* ========================================
   PRODUCT HERO (Product Pages)
   ======================================== */
.product-hero {
  text-align: center;
  padding: 4rem 0 3rem;
  position: relative;
}

.product-hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 800px;
  background: radial-gradient(circle at center, rgba(30, 214, 211, 0.12) 0%, rgba(5, 13, 26, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

.product-hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 960px;
}

.product-hero h1 {
  margin-bottom: 0.5rem;
}

.product-hero p {
  color: var(--color-text-muted);
  font-weight: 300;
  font-size: 1.125rem;
  max-width: 640px;
  line-height: 1.7;
}

/* ========================================
   INCLUDED GRID (3×3 Product Modules)
   ======================================== */
.included-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.included-grid .module {
  background: var(--color-surface);
  padding: 2rem;
  transition: background 0.3s ease;
}

.included-grid .module:hover {
  background: var(--color-surface-hover);
}

.included-grid .module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.included-grid .module-header .module-icon {
  color: rgba(30, 214, 211, 0.7);
  font-size: 1.25rem;
}

.included-grid .module-header .module-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.included-grid .module:hover .module-dot {
  opacity: 1;
}

.included-grid .module h3 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.included-grid .module p {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}

/* Section header with counter */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.5rem;
}

.section-header .module-count {
  color: var(--color-text-dim);
  font-size: 0.8125rem;
  font-family: 'Courier New', monospace;
}

/* ========================================
   GRID-3 (Feature Cards)
   ======================================== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ========================================
   FEATURE LIST (fallback for legacy)
   ======================================== */
.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.feature-list li {
  padding: 0.75rem 0 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(30, 46, 66, 0.5);
  color: var(--color-text);
  font-size: 0.9375rem;
  position: relative;
  opacity: 1;
  transform: none;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.1rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* Progressive enhancement: only animate when JS is enabled */
.js .feature-list li {
  opacity: 0;
  transform: translateY(10px);
}

.js .feature-list li.visible {
  opacity: 1;
  transform: none;
  transition: all 0.5s ease;
}

/* ========================================
   CTA URGENCY SECTION
   ======================================== */
.cta-urgency {
  background: var(--color-surface);
  border: 1px solid rgba(30, 214, 211, 0.3);
  border-radius: var(--radius-xl);
  padding: 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative glows */
.cta-urgency::before,
.cta-urgency::after {
  content: '';
  position: absolute;
  width: 256px;
  height: 256px;
  background: rgba(30, 214, 211, 0.08);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.cta-urgency::before {
  top: -80px;
  right: -80px;
}

.cta-urgency::after {
  bottom: -80px;
  left: -80px;
}

.cta-urgency .cta-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.cta-urgency .cta-icon {
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.cta-urgency h2 {
  font-weight: 700;
}

.cta-urgency p {
  color: var(--color-text);
  font-weight: 300;
  font-size: 1.125rem;
  max-width: 640px;
}

.cta-urgency .cta-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-footer-bg);
  padding: 4rem 0 3rem;
  position: relative;
  z-index: 1;
}

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

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

.footer-brand .footer-logo img {
  height: 36px;
  width: auto;
}

.footer-brand p {
  color: var(--color-text-dim);
  font-size: 0.8125rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-nav a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  transition: color var(--transition);
}

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

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-contact a {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

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

.footer-contact p {
  color: var(--color-text-dim);
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* ========================================
   ANIMATIONS
   ======================================== */
.fade-in {
  opacity: 1;
  transform: none;
}

.js .fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .fade-in.visible {
  opacity: 1;
  transform: none;
}

.fade-in-delay-1 {
  transition-delay: 0.1s;
}

.fade-in-delay-2 {
  transition-delay: 0.2s;
}

.fade-in-delay-3 {
  transition-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .js .fade-in,
  .js .feature-list li {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ========================================
   RESPONSIVE — Tablet & Mobile
   ======================================== */
@media (max-width: 992px) {
  .nav-toggle-btn {
    display: block;
  }

  nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 13, 26, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }

  nav.active {
    transform: translateX(0);
  }

  nav a {
    font-size: 1.25rem;
  }

  .lang-switcher {
    padding-left: 0;
    border-left: none;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
  }

  .hero {
    padding: 2rem 0;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

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

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

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

  .product-card {
    flex-direction: column;
    text-align: center;
  }

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

  .section {
    padding: 3rem 0;
  }

  .cta-urgency {
    padding: 2.5rem 1.5rem;
  }

  .cta-urgency .cta-buttons {
    flex-direction: column;
    width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary,
  .btn-teal {
    width: 100%;
    text-align: center;
  }

  .included-grid .module {
    padding: 1.5rem;
  }
}

/* ========================================
   404 PAGE
   ======================================== */
body.page-404 {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.page-404 main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

body.page-404 footer {
  padding: 1.5rem 0;
  text-align: center;
}

body.page-404 footer p {
  color: var(--color-text-dim);
  font-size: 0.75rem;
}
