:root {
  /* Palette mirrors the app's VantaTheme (Color.kt / Gradients.kt) */
  --bg-color: #0E1116;          /* Void  — app background */
  --bg-grad-top: #151B25;       /* AppBackgroundGradient stops */
  --bg-grad-mid: #0E1116;
  --bg-grad-bot: #0A0C10;
  --bg-secondary: #161A21;      /* Carbon — raised surfaces */
  --bg-tertiary: #1C212A;       /* Graphite — cards */
  --card-top: #232A37;          /* CardGradient stops */
  --card-mid: #1A2029;
  --card-bot: #141922;
  --stroke: #2A303B;            /* Gunmetal — strokes/dividers */
  --hairline: #3A424F;          /* Steel */
  --text-primary: #E7EBF0;      /* Chalk */
  --text-secondary: #8B95A3;    /* Mist */
  --text-tertiary: #5A6472;

  --accent: #3B8CFF;            /* Signal — Termius blue */
  --accent-bright: #62A8FF;
  --accent-violet: #7A5DF6;
  --accent-soft: rgba(59, 140, 255, 0.5);
  --accent-glow: rgba(59, 140, 255, 0.12);

  /* Signature blue → indigo → violet brand sweep */
  --brand-gradient: linear-gradient(110deg, #7CC0FF 0%, #6D8DFF 50%, #9A7BFF 100%);
  --accent-gradient: linear-gradient(120deg, #62A8FF 0%, #5A7BFF 50%, #7A5DF6 100%);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-color);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  /* Deep-space vertical depth, same as AppBackgroundGradient */
  background-image: linear-gradient(180deg, var(--bg-grad-top) 0%, var(--bg-grad-mid) 45%, var(--bg-grad-bot) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Faint engineering grid behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(139, 149, 163, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 149, 163, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 75%);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb {
  background: var(--stroke);
  border-radius: 100px;
  border: 2px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover { background: var(--hairline); }
::selection { background: rgba(59, 140, 255, 0.28); color: #fff; }

/* Scroll progress bar (injected by script.js) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 10000;
  background: var(--accent-gradient);
  box-shadow: 0 0 12px var(--accent-soft);
  transition: width 0.1s linear;
}

/* High-end grain overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 24px 0;
  background: rgba(14, 17, 22, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.4s ease, border-color 0.4s ease;
}

/* Compact state once the page is scrolled */
header.scrolled {
  padding: 14px 0;
  background: rgba(14, 17, 22, 0.8);
  border-color: var(--stroke);
}

/* Glowing blue hairline along the header base — app's BottomBarHairline */
header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 140, 255, 0.45), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

header.scrolled::after { opacity: 1; }

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo span {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 500;
  transition: filter 0.4s ease;
}

.logo:hover span {
  filter: drop-shadow(0 0 10px var(--accent-soft));
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  position: relative;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Animated underline */
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

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

/* Hero Section */
.hero {
  padding: 200px 0 120px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Drifting aurora glows — blue/violet to match the app accent */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  filter: blur(20px);
  will-change: transform;
}

.hero::before {
  top: -15%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(122, 93, 246, 0.14) 0%, rgba(0,0,0,0) 62%);
  animation: heroPulse 9s ease-in-out infinite;
}

.hero::after {
  top: 8%;
  right: -5%;
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(59, 140, 255, 0.20) 0%, rgba(0,0,0,0) 65%);
  animation: auroraDrift 14s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.08); }
}

@keyframes auroraDrift {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33%  { transform: translate(-80px, 60px) scale(1.15); opacity: 0.9; }
  66%  { transform: translate(40px, -40px) scale(0.95); opacity: 0.7; }
  100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 80px;
  justify-content: space-between;
}

.hero-text {
  flex: 1;
  max-width: 550px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(59, 140, 255, 0.06);
  border: 1px solid rgba(59, 140, 255, 0.2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Live status dot on the badge */
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: livePulse 2.4s ease-out infinite;
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(59,140,255,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(59,140,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,140,255,0); }
}

.hero-text h1 {
  font-size: 4.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #9aa4b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em;
}

/* Brand-gradient accent for wordmarks / highlighted phrases */
.accent-text {
  background: var(--brand-gradient);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
  to { background-position: -250% center; }
}

.hero-text p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-weight: 400;
  line-height: 1.7;
}

.cta-group {
  display: flex;
  gap: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}

/* Shine sweep */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:hover::before { left: 140%; }

/* Primary — the app's blue→violet AccentGradient with a blue glow */
.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(59, 140, 255, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(59, 140, 255, 0.42);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary::before {
  background: linear-gradient(120deg, transparent, rgba(59,140,255,0.2), transparent);
}

.btn-secondary:hover {
  background: rgba(59, 140, 255, 0.08);
  border-color: var(--accent-soft);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(59, 140, 255, 0.14);
}

/* Terminal Mockup in Hero */
.hero-visual {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  position: relative;
}

.mockup-container {
  width: 100%;
  max-width: 400px;
  position: relative;
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8), 0 0 0 1px var(--border-subtle);
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  animation: floatY 6s ease-in-out infinite;
}

.mockup-container:hover {
  transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
  animation-play-state: paused;
}

@keyframes floatY {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -14px; }
}

.mockup-image {
  width: 100%;
  height: auto;
  border-radius: 24px;
  display: block;
}

/* Terminal Animation Overlay */
.terminal-overlay {
  position: absolute;
  bottom: -20px;
  left: -60px;
  background: rgba(22, 26, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  width: 320px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  animation: floatY 6s ease-in-out infinite;
  animation-delay: -3s;
}

.terminal-header {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.dot.red { background: #FF5C5C; }      /* Ember */
.dot.yellow { background: #E9B44C; }   /* Amber */
.dot.green { background: #2DD4BF; }    /* teal host accent */

.typewriter-text {
  display: inline-block;
  border-right: 2px solid var(--accent);
  animation: blink-caret .75s step-end infinite;
}

/* Features Section */
.features {
  padding: 160px 0;
  position: relative;
}

.features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.section-header {
  text-align: center;
  margin-bottom: 100px;
}

.section-header h2 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #9aa4b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  /* App CardGradient — a faint top-to-bottom sheen */
  background: linear-gradient(180deg, var(--card-top) 0%, var(--card-mid) 50%, var(--card-bot) 100%);
  border: 1px solid var(--stroke);
  padding: 48px 40px;
  border-radius: 16px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.5s ease, box-shadow 0.5s ease;
  position: relative;
  overflow: hidden;
}

/* Cursor-tracking spotlight (--mx/--my set by script.js) */
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 0%),
    var(--accent-glow),
    transparent 60%
  );
}

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

/* CardRimGradient — the classic premium-glass top rim */
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), transparent 55%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.5s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 140, 255, 0.35);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(59, 140, 255, 0.08);
}

.feature-card:hover::after {
  background: linear-gradient(180deg, rgba(59,140,255,0.5), transparent 70%);
}

.feature-icon {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  letter-spacing: 0.05em;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.feature-card:hover .feature-icon {
  color: var(--accent-bright);
  text-shadow: 0 0 14px var(--accent-soft);
}

.feature-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.feature-card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-bright);
  background: rgba(59, 140, 255, 0.1);
  padding: 1px 6px;
  border-radius: 5px;
}

/* Content Sections (Privacy) */
.content-section {
  padding: 160px 0;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  background: linear-gradient(180deg, #ffffff 0%, #9aa4b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.prose h2 {
  font-size: 1.6rem;
  margin-top: 64px;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-weight: 600;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
}

.prose h3 {
  font-size: 1.2rem;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.prose p {
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
}

.prose ul {
  margin-bottom: 32px;
  padding-left: 24px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.prose li {
  margin-bottom: 12px;
}

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

/* Footer */
footer {
  padding: 80px 0 40px;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 60px;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 40px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* Animations */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent) }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 60px;
  }

  .hero-text {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .terminal-overlay {
    left: 50%;
    transform: translateX(-50%);
    bottom: -30px;
  }
}

@media (max-width: 768px) {
  .hero-text h1 {
    font-size: 3rem;
  }

  .nav-links {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: 48px;
  }

  .feature-card {
    padding: 32px 24px;
  }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .accent-text { background-position: 0 center; }
}
