/* Theme variables */
:root {
  --bg: #050507;
  --surface: #0b0b10;
  --surface-2: #111117;
  --text: #e6e6f0;
  --muted: #b4b4c7;
  --border: #1e1e27;
  --accent: #22d3ee; /* cyan */
  --primary-200: #d1c4e9;
  --primary-300: #b794f6;
  --primary-400: #a855f7;
  --primary-500: #9d5bd6;
  --primary-600: #8b4fc9; /* vibrant pinkish purple for brand */
  --header-height: 64px;
  --terminal-height: 260px; /* stabilize terminal to prevent layout jolt */
}

/* Base reset (minimal) */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
hr { border: 0; height: 1px; background: var(--border); }

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Layout helpers (container without extra markup) */
header nav,
main > section,
footer { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }

/* Links */
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary-300); }
a:focus-visible { outline: 2px solid var(--primary-400); outline-offset: 2px; border-radius: 6px; }

/* Buttons */
.button,
button,
input[type="submit"],
input[type="button"] {
  appearance: none;
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid color-mix(in lch, var(--primary-600), black 30%);
  background: linear-gradient(180deg, var(--primary-400), var(--primary-600));
  color: white;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px color-mix(in lch, var(--primary-600), black 35%) inset,
    0 6px 18px -6px color-mix(in lch, var(--primary-400), black 40%);
  transition: transform 120ms ease, box-shadow 200ms ease, filter 120ms ease;
}
.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover { filter: brightness(1.05); }
.button:active,
button:active,
input[type="submit"]:active,
input[type="button"]:active { transform: translateY(1px); }
.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible { outline: 3px solid var(--primary-300); outline-offset: 2px; }

/* Inputs */
input[type="email"],
input[type="text"],
input[type="search"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in lch, var(--primary-500), var(--border) 70%);
  background: var(--surface);
  color: var(--text);
  caret-color: var(--primary-300);
  box-shadow: 0 1px 0 0 rgba(0,0,0,0.5) inset;
}
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 1px; }
input::placeholder { color: #8c8ca3; }
input:focus-visible { outline: 3px solid var(--primary-500); outline-offset: 1px; }

/* Header and nav */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  backdrop-filter: saturate(150%) blur(10px);
  background: linear-gradient(180deg, rgba(5,5,7,1), rgba(5,5,7,1));
  border-bottom: 1px solid var(--border);
}
/* Offset main content to account for fixed header height (use padding to avoid margin collapse) */
main { padding-top: var(--header-height); }
header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-height);
  padding-top: 0;
  padding-bottom: 0;
}
header nav .logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
header nav .logo img { height: calc(var(--header-height) * 0.8); width: auto; filter: drop-shadow(0 0 8px color-mix(in lch, var(--primary-400), transparent 70%)); }
header nav .logo span {
  font-size: 36px;
  line-height: 1;
  color: var(--text);
}
header nav ul { display: flex; align-items: center; gap: 18px; }
header nav ul a { color: var(--muted); font-weight: 500; }
header nav ul a:hover { color: var(--text); }

/* Gradient text styling */
.gradient-text {
  background: linear-gradient(90deg, var(--primary-300), var(--primary-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px color-mix(in lch, var(--primary-600), transparent 70%);
}

/* Main sections */
main > section { padding-top: 56px; padding-bottom: 56px; }
main > section + section { border-top: 1px solid var(--border); }

/* Hero */
#hero { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
#hero > div { display: grid; gap: 24px; }
#hero h1 {
    font-weight: 700; font-size: 3rem; line-height: 1.1; letter-spacing: -0.02em;
    margin: 0;
}
#hero .subtext { color: var(--muted); font-size: 18px; margin: 0; }
#hero form { display: grid; gap: 4px; max-width: 480px; }
#hero .input-button-row { display: flex; gap: 10px; align-items: end; }
#hero .input-button-row input[type="email"] { flex: 1; min-width: 200px; }
#hero form .disclaimer { margin: 0; font-size: 12px; color: #9a9ab3; }
#hero form .disclaimer a { color: var(--primary-300); text-decoration: underline; }
/* Mirror CTA inline status styling in hero */
#hero .cta-message { margin: 6px 0 0 0; font-size: 14px; color: var(--muted); min-height: 18px; }
#hero .cta-message[data-kind="success"] { color: #90e39a; }
#hero .cta-message[data-kind="error"] { color: #ffb4b4; }
/* When hero status is empty, don't reserve space so disclaimer sits closer */
#hero .cta-message:empty { display: none; }

#hero aside figure { margin: 0; }
#hero .terminal {
  border-radius: 14px;
  background:
    radial-gradient(100% 100% at 0% 0%, color-mix(in lch, var(--primary-600), transparent 87%) 0%, transparent 45%),
    linear-gradient(135deg,
      color-mix(in lch, var(--primary-600), transparent 87%) 0%,
      color-mix(in lch, var(--primary-400), transparent 94%) 100%),
    var(--surface);
  border: 1px solid color-mix(in lch, var(--primary-500), var(--border) 70%);
  box-shadow:
    0 0 0 1px color-mix(in lch, var(--primary-600), transparent 80%) inset,
    0 12px 40px -8px rgba(157, 91, 214, 0.35),
    0 6px 24px -10px rgba(34, 211, 238, 0.25);
  overflow: hidden;
  /* Fix height and let inner content scroll to avoid Safari scroll anchoring jumps */
  height: var(--terminal-height);
  display: grid;
  grid-template-rows: auto 1fr; /* header, then scrollable body */
  overflow-anchor: none;
}
#hero .terminal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 34px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg,
    color-mix(in lch, var(--surface), white 8%) 0%,
    color-mix(in lch, var(--surface), black 2%) 100%);
}
#hero .terminal-controls {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  gap: 8px;
}
#hero .terminal-title { color: var(--muted); font-size: 12px; }
#hero .control {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35) inset;
}
#hero .control-close { background: #ff5f57; }
#hero .control-minimize { background: #febc2e; }
#hero .control-zoom { background: #28c840; }
#hero pre {
  margin: 0;
  padding: 18px;
  background: transparent;
  color: #d7d7ee;
  overflow: auto;
  /* Allow grid child to shrink and scroll correctly in Safari */
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
#hero code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 14px; }

/* Features */
#features h2 {
    font-weight: 700; font-size: 3rem; line-height: 1.1; letter-spacing: -0.02em;
    margin: 0 0 24px 0;
}
#features article { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; padding: 12px 0; }
#features .feature-content h3 { font-size: 24px; margin: 0 0 12px 0; }
#features .feature-content ul { list-style-type: disc; padding-left: 20px; margin: 0; color: var(--muted); }
#features .feature-content li { font-size: 18px; line-height: 1.5; margin-bottom: 8px; }
#features .feature-media { display: flex; justify-content: center; align-items: center; justify-self: center; width: clamp(220px, 40vw, 480px); aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: transparent; border: 0; }
#features .feature-media img { width: 100%; height: 100%; object-fit: contain; display: block; -webkit-mask-image: radial-gradient(closest-side, rgba(0,0,0,1) 82%, rgba(0,0,0,0) 98%); mask-image: radial-gradient(closest-side, rgba(0,0,0,1) 82%, rgba(0,0,0,0) 98%); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }

/* FAQ */
#faq h2 {
    font-weight: 700; font-size: 3rem; line-height: 1.1; letter-spacing: -0.02em;
    margin: 0 0 16px 0;
}
#faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
#faq details + details { margin-top: 10px; }
#faq summary { cursor: pointer; font-weight: 600; }
#faq details > div { margin-top: 8px; color: var(--muted); }
#faq details > div ul { list-style-type: disc; padding-left: 20px; margin: 8px 0; }
#faq details > div li { margin-bottom: 8px; line-height: 1.5; }

/* CTA */
#cta {
  scroll-margin-top: calc(var(--header-height) + 12px);
  display: grid;
  gap: 16px;
  /* Make this section a full-bleed gradient strip */
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 24px;
  padding-right: 24px;
  background:
    radial-gradient(100% 100% at 0% 0%, color-mix(in lch, var(--primary-600), transparent 87%) 0%, transparent 45%),
    linear-gradient(135deg,
      color-mix(in lch, var(--primary-600), transparent 87%) 0%,
      color-mix(in lch, var(--primary-400), transparent 94%) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  /* Gradientless interior */
  background: var(--surface);
  border: 1px solid color-mix(in lch, var(--primary-500), var(--border) 70%);
  border-radius: 16px;
  padding: 48px;
  box-shadow:
    0 4px 24px -8px color-mix(in lch, var(--primary-600), transparent 75%),
    0 0 0 1px color-mix(in lch, var(--primary-500), transparent 60%) inset;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
#cta h2 { font-size: 26px; margin: 0 0 24px 0; }
#cta form { display: grid; gap: 4px; max-width: 420px; }
#cta .input-button-row { display: flex; gap: 10px; align-items: end; }
#cta .input-button-row input[type="email"] { flex: 1; min-width: 200px; }
#cta .subtext { margin: -12px 0 12px 0; color: var(--muted); }
#cta .cta-message { margin: 6px 0 0 0; font-size: 14px; color: var(--muted); min-height: 18px; }
#cta .cta-message[data-kind="success"] { color: #90e39a; }
#cta .cta-message[data-kind="error"] { color: #ffb4b4; }

/* Feather the edges of the CTA image (gaze.png) into the background */
.cta-image img {
  -webkit-mask-image: radial-gradient(closest-side, rgba(0,0,0,1) calc(100% - 20px), rgba(0,0,0,0) 100%);
  mask-image: radial-gradient(closest-side, rgba(0,0,0,1) calc(100% - 20px), rgba(0,0,0,0) 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Footer */
footer {
  padding-top: 40px;
  padding-bottom: 60px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 24px;
  padding-right: 24px;
}
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}
footer .logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
footer .logo img { height: calc(var(--header-height) * 0.8); width: auto; filter: drop-shadow(0 0 8px color-mix(in lch, var(--primary-400), transparent 70%)); }
footer .logo span {
  font-size: 36px;
  line-height: 1;
  color: var(--text);
}
footer nav ul { display: flex; gap: 14px; color: var(--muted); }
footer nav a { color: var(--muted); }
footer nav a:hover { color: var(--text); }
.copyright-bar {
  margin-top: 20px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
}
.copyright-bar p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Responsive */
@media (min-width: 900px) {
  #hero { grid-template-columns: 1.1fr 0.9fr; gap: 40px; }
  #features article { grid-template-columns: 1fr 1fr; gap: 24px; }
  #features article:nth-of-type(even) .feature-media { order: 2; }
}

@media (max-width: 899px) {
  .cta-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px;
  }
  .cta-image img {
    max-height: 200px;
  }
  /* On small screens, always stack feature image above text */
  #features .feature-media { order: 1; }
  #features .feature-content { order: 2; }
}

/* Nice focus ring for interactive elements in dark mode */
:where(a, button, input, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* Subtle separators for sections on black background */
main > section:first-of-type { border-top: none; }

/* Input attention pulse (used when clicking Install) */
@keyframes inputPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in lch, var(--primary-400), transparent 100%), 0 0 0 0 color-mix(in lch, var(--primary-600), transparent 100%);
    background: var(--surface);
    border-color: color-mix(in lch, var(--primary-500), var(--border) 70%);
  }
  20% {
    transform: scale(1.02);
    box-shadow: 0 0 0 8px color-mix(in lch, var(--primary-400), transparent 40%), 0 12px 36px -6px color-mix(in lch, var(--primary-600), transparent 40%);
    background: color-mix(in lch, var(--surface), white 6%);
    border-color: color-mix(in lch, var(--primary-500), var(--border) 20%);
  }
  55% {
    transform: scale(1.01);
    box-shadow: 0 0 0 6px color-mix(in lch, var(--primary-400), transparent 55%), 0 8px 24px -8px color-mix(in lch, var(--primary-600), transparent 55%);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 color-mix(in lch, var(--primary-400), transparent 100%), 0 0 0 0 color-mix(in lch, var(--primary-600), transparent 100%);
    background: var(--surface);
    border-color: color-mix(in lch, var(--primary-500), var(--border) 70%);
  }
}
.input-attention {
  animation: inputPulse 1200ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, box-shadow, background-color, border-color;
}

/* Dust Motes Animation */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(30px, -30px) rotate(90deg);
  }
  50% {
    transform: translate(-20px, -60px) rotate(180deg);
  }
  75% {
    transform: translate(-40px, -30px) rotate(270deg);
  }
}

@keyframes float-reverse {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-30px, 30px) rotate(-90deg);
  }
  50% {
    transform: translate(20px, 60px) rotate(-180deg);
  }
  75% {
    transform: translate(40px, 30px) rotate(-270deg);
  }
}

.dust-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.dust-particle {
  position: absolute;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.05) 80%, transparent 100%);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
}

.dust-particle:nth-child(2n) {
  animation: float-reverse 25s ease-in-out infinite;
}

.dust-particle:nth-child(3n) {
  animation-delay: -5s;
}

.dust-particle:nth-child(4n) {
  animation-delay: -10s;
}

.dust-particle:nth-child(5n) {
  animation-delay: -15s;
}

/* Generate dust particles */
.dust-particle:nth-child(1) { width: 8px; height: 8px; top: 10%; left: 10%; }
.dust-particle:nth-child(2) { width: 6px; height: 6px; top: 20%; left: 80%; }
.dust-particle:nth-child(3) { width: 10px; height: 10px; top: 30%; left: 20%; }
.dust-particle:nth-child(4) { width: 7px; height: 7px; top: 40%; left: 70%; }
.dust-particle:nth-child(5) { width: 5px; height: 5px; top: 50%; left: 30%; }
.dust-particle:nth-child(6) { width: 9px; height: 9px; top: 60%; left: 90%; }
.dust-particle:nth-child(7) { width: 4px; height: 4px; top: 70%; left: 40%; }
.dust-particle:nth-child(8) { width: 12px; height: 12px; top: 80%; left: 60%; }
.dust-particle:nth-child(9) { width: 6px; height: 6px; top: 15%; left: 50%; }
.dust-particle:nth-child(10) { width: 8px; height: 8px; top: 85%; left: 25%; }
.dust-particle:nth-child(11) { width: 7px; height: 7px; top: 35%; left: 85%; }
.dust-particle:nth-child(12) { width: 5px; height: 5px; top: 55%; left: 15%; }
.dust-particle:nth-child(13) { width: 11px; height: 11px; top: 75%; left: 75%; }
.dust-particle:nth-child(14) { width: 9px; height: 9px; top: 25%; left: 35%; }
.dust-particle:nth-child(15) { width: 6px; height: 6px; top: 65%; left: 55%; }
.dust-particle:nth-child(16) { width: 8px; height: 8px; top: 45%; left: 95%; }
.dust-particle:nth-child(17) { width: 7px; height: 7px; top: 5%; left: 65%; }
.dust-particle:nth-child(18) { width: 10px; height: 10px; top: 95%; left: 45%; }
.dust-particle:nth-child(19) { width: 5px; height: 5px; top: 12%; left: 88%; }
.dust-particle:nth-child(20) { width: 9px; height: 9px; top: 88%; left: 12%; }
.dust-particle:nth-child(21) { width: 6px; height: 6px; top: 8%; left: 75%; }
.dust-particle:nth-child(22) { width: 8px; height: 8px; top: 18%; left: 15%; }
.dust-particle:nth-child(23) { width: 5px; height: 5px; top: 28%; left: 65%; }
.dust-particle:nth-child(24) { width: 9px; height: 9px; top: 38%; left: 5%; }
.dust-particle:nth-child(25) { width: 7px; height: 7px; top: 48%; left: 85%; }
.dust-particle:nth-child(26) { width: 10px; height: 10px; top: 58%; left: 35%; }
.dust-particle:nth-child(27) { width: 4px; height: 4px; top: 68%; left: 95%; }
.dust-particle:nth-child(28) { width: 11px; height: 11px; top: 78%; left: 45%; }
.dust-particle:nth-child(29) { width: 6px; height: 6px; top: 88%; left: 75%; }
.dust-particle:nth-child(30) { width: 8px; height: 8px; top: 3%; left: 25%; }
.dust-particle:nth-child(31) { width: 7px; height: 7px; top: 13%; left: 55%; }
.dust-particle:nth-child(32) { width: 9px; height: 9px; top: 23%; left: 95%; }
.dust-particle:nth-child(33) { width: 5px; height: 5px; top: 33%; left: 15%; }
.dust-particle:nth-child(34) { width: 10px; height: 10px; top: 43%; left: 65%; }
.dust-particle:nth-child(35) { width: 6px; height: 6px; top: 53%; left: 5%; }
.dust-particle:nth-child(36) { width: 8px; height: 8px; top: 63%; left: 75%; }
.dust-particle:nth-child(37) { width: 7px; height: 7px; top: 73%; left: 25%; }
.dust-particle:nth-child(38) { width: 9px; height: 9px; top: 83%; left: 85%; }
.dust-particle:nth-child(39) { width: 5px; height: 5px; top: 93%; left: 35%; }
.dust-particle:nth-child(40) { width: 11px; height: 11px; top: 6%; left: 45%; }

/* Ensure dust motes never appear over interactive or key UI */
.terminal,
.button,
button,
input[type="submit"],
input[type="button"],
input[type="email"],
input[type="text"],
input[type="search"],
input[type="password"] {
  position: relative;
  z-index: 1;
}


