/* HA NOVA landing — cosmos night, cyan = local/client, amber = server/safe */

:root {
  --bg-0: #0A0E1A;
  --bg-1: #0D1525;
  --bg-2: #0A1628;
  --ink: #E8EDF2;
  --ink-soft: #B8CCE0;
  --cyan: #18BCF2;
  --amber: #FFB347;
  --hairline: rgba(184, 204, 224, 0.16);
  --panel: rgba(13, 21, 37, 0.6);
  --measure: 62ch;
  --ease-rise: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink-soft);
  background: var(--bg-2) linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 45%, var(--bg-2) 100%);
  font-family: -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Sparse star dots, fixed so they hold still while the page scrolls */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 9%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 32%, rgba(255, 255, 255, 0.2) 50%, transparent 51%),
    radial-gradient(1px 1px at 31% 61%, rgba(255, 255, 255, 0.25) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 47%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 84%, rgba(255, 255, 255, 0.25) 50%, transparent 51%),
    radial-gradient(1px 1px at 67% 76%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 42% 93%, rgba(255, 255, 255, 0.2) 50%, transparent 51%),
    radial-gradient(1px 1px at 23% 5%, rgba(255, 255, 255, 0.2) 50%, transparent 51%),
    radial-gradient(1px 1px at 96% 88%, rgba(255, 255, 255, 0.25) 50%, transparent 51%);
  animation: breathe 7s ease-in-out infinite alternate;
}

@keyframes breathe {
  from { opacity: 0.75; }
  to   { opacity: 1; }
}

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

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

h2 {
  font-size: clamp(1.875rem, 1.3rem + 2.4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
}

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

/* ---------- Hero ---------- */

.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) 1.5rem 0;
  text-align: center;
}

.hero-star {
  width: clamp(96px, 13vw, 148px);
  height: auto;
  margin: 0 auto;
  animation: rise 1s var(--ease-rise) both;
}

.hero-brand {
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  padding-left: 0.34em; /* optically recenter the tracked wordmark */
  text-transform: uppercase;
  animation: rise 1s var(--ease-rise) 0.08s both;
}

.hero-tagline {
  margin: 1.1rem 0 0;
  font-size: clamp(1.75rem, 0.9rem + 4vw, 3.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  animation: rise 1s var(--ease-rise) 0.16s both;
}

.hero-sub {
  max-width: 46ch;
  margin: 1.75rem auto 0;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  animation: rise 1s var(--ease-rise) 0.26s both;
}

.hero-ctas {
  margin: 2.5rem 0 0;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: rise 1s var(--ease-rise) 0.36s both;
}

@keyframes rise {
  from { opacity: 0.001; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.16s ease-out;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--cyan);
  color: #05121D;
}

.btn-primary:hover {
  background: #4FCDF6;
}

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

.btn-ghost:hover {
  border-color: var(--ink-soft);
}

.btn:focus-visible,
.copy:focus-visible,
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- Sections ---------- */

.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(5rem, 13vh, 8.5rem) 1.5rem 0;
  scroll-margin-top: 2rem;
}

.section-lead {
  max-width: var(--measure);
  margin: 1.1rem 0 2.5rem;
  font-size: 1.125rem;
}

/* ---------- Authored neon scenes ---------- */

.scene {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.scene .d {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene .c { stroke: var(--cyan); filter: drop-shadow(0 0 5px rgba(24, 188, 242, 0.4)); }
.scene .a { stroke: var(--amber); filter: drop-shadow(0 0 5px rgba(255, 179, 71, 0.4)); }
.scene .n { stroke: rgba(184, 204, 224, 0.5); }
.scene .dim { opacity: 0.75; }

.scene text {
  font-family: -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
  stroke: none;
}

.t-label { font-size: 17px; font-weight: 600; fill: var(--ink); }
.t-cyan { fill: var(--cyan); }
.t-amber { fill: var(--amber); }
.t-btn { font-size: 12px; font-weight: 600; fill: var(--cyan); }
.t-code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 22px; font-weight: 600; fill: var(--amber); letter-spacing: 0.1em; }
.t-code-sm { font-size: 14px; }

.cursor {
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.figure {
  margin: 2.5rem 0 0;
  padding: 0;
}

.figure figcaption {
  margin-top: 1rem;
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

.versus {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
}

/* ---------- Scroll reveal & line drawing ---------- */

.js [data-reveal] {
  opacity: 0.001;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-rise), transform 0.7s var(--ease-rise);
}

.js [data-reveal].inview {
  opacity: 1;
  transform: none;
}

.js [data-reveal] .d[pathLength] {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1s ease-out 0.25s;
}

.js [data-reveal].inview .d[pathLength] {
  stroke-dashoffset: 0;
}

.js [data-reveal] .d.slow[pathLength] {
  transition-duration: 1.4s;
  transition-delay: 0.75s;
}

/* gentle stagger inside groups */
.js .steps li:nth-child(2),
.js .says-row:nth-child(3),
.js .rules li:nth-child(2) { transition-delay: 0.08s; }
.js .steps li:nth-child(3),
.js .says-row:nth-child(4),
.js .rules li:nth-child(3) { transition-delay: 0.16s; }
.js .says-row:nth-child(5),
.js .rules li:nth-child(4) { transition-delay: 0.24s; }
.js .says-row:nth-child(6) { transition-delay: 0.32s; }

/* Pairing steps */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin: 2.5rem 0 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  border-top: 1px solid var(--hairline);
  padding-top: 1.5rem;
}

.steps .scene {
  margin-bottom: 1.25rem;
}

.steps li::before {
  content: counter(step);
  display: block;
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.9rem;
}

.steps strong {
  color: var(--ink);
  display: block;
  margin-bottom: 0.2rem;
}

/* You say → what happens */

.says {
  border-top: 1px solid var(--hairline);
}

.says-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2.5rem;
  padding: 1rem 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.says-you { color: var(--cyan); }
.says-nova { color: var(--amber); }

.says-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 2.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--hairline);
}

.says-quote {
  margin: 0;
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.says-result {
  margin: 0;
}

/* Safety workflow */

.section-safety {
  max-width: 760px;
}

.workflow {
  list-style: none;
  counter-reset: wf;
  margin: 3rem 0 0;
  padding: 0;
  position: relative;
}

.workflow::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.7), rgba(255, 179, 71, 0.15));
  transform-origin: top;
}

/* the amber thread draws itself down as the chain reveals */
.js .workflow::before {
  transform: scaleY(0);
  transition: transform 1.6s var(--ease-rise) 0.2s;
}

.js .workflow.inview::before {
  transform: scaleY(1);
}

.workflow li {
  counter-increment: wf;
  position: relative;
  padding: 0 0 2.5rem 4rem;
}

.workflow li:last-child { padding-bottom: 0; }

.workflow li::before {
  content: counter(wf);
  position: absolute;
  left: 0;
  top: -2px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 1px solid rgba(255, 179, 71, 0.55);
  background: var(--bg-1);
  color: var(--amber);
  font-weight: 700;
  font-size: 0.9375rem;
  display: grid;
  place-items: center;
}

.js .workflow li:nth-child(2) { transition-delay: 0.12s; }
.js .workflow li:nth-child(3) { transition-delay: 0.24s; }
.js .workflow li:nth-child(4) { transition-delay: 0.36s; }
.js .workflow li:nth-child(5) { transition-delay: 0.48s; }
.js .workflow li:nth-child(6) { transition-delay: 0.6s; }
.js .workflow li:nth-child(7) { transition-delay: 0.72s; }

.workflow h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.workflow p {
  margin: 0.35rem 0 0;
  max-width: 52ch;
}

.workflow code {
  color: var(--amber);
  background: rgba(255, 179, 71, 0.1);
  border: 1px solid rgba(255, 179, 71, 0.3);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}

.rules-title {
  margin-top: 4rem;
  font-size: 1.25rem;
}

.rules {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 2.5rem;
}

.rules li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  border-top: 1px solid var(--hairline);
  padding-top: 1.1rem;
}

.rules svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 0.15rem;
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rules p { margin: 0; }

.note {
  margin: 1.75rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* Cloud / Beta */

.beta {
  display: inline-block;
  vertical-align: 0.35em;
  margin-left: 0.6rem;
  padding: 0.15rem 0.65rem;
  border: 1px solid rgba(255, 179, 71, 0.55);
  border-radius: 999px;
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Install */

.install {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin: 2.5rem 0 0;
}

.install-label {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
}

.codebar {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.codebar pre {
  margin: 0;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.codebar pre:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.codebar code {
  color: var(--ink);
  font-size: 0.9375rem;
  white-space: pre;
}

.copy {
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid var(--hairline);
  background: transparent;
  color: var(--cyan);
  font: 600 0.9375rem/1 -apple-system, 'Helvetica Neue', 'Segoe UI', sans-serif;
  padding: 0 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.16s ease-out;
  min-width: 6em;
}

.copy:hover {
  background: rgba(24, 188, 242, 0.12);
}

.copy:active {
  transform: scale(0.97);
}

.copy.copied {
  color: var(--amber);
}

.clients-label {
  margin: 3rem 0 0.75rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
}

.clients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.clients li {
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.9375rem;
}

.preview {
  color: var(--cyan);
  font-size: 0.8125rem;
  margin-left: 0.3rem;
}

/* ---------- Footer ---------- */

.footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(5rem, 13vh, 8rem) 1.5rem 3rem;
}

.footer-links {
  margin: 0;
  border-top: 1px solid var(--hairline);
  padding-top: 2rem;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--ink-soft);
}

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

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .rules { grid-template-columns: 1fr; gap: 1.25rem; }

  .versus {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 26rem;
    margin-inline: auto;
  }
}

@media (max-width: 720px) {
  .says-head { display: none; }

  .says-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.25rem 0;
  }

  .says-quote::before {
    content: "You say";
    display: block;
    color: var(--cyan);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
  }

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

  .steps .scene {
    max-width: 17rem;
  }

  .workflow li { padding-left: 3.25rem; }

  .btn { width: 100%; max-width: 20rem; text-align: center; }

  .scene-wide .t-label { font-size: 28px; }
  .scene-wide .t-code-sm { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .hero-star, .hero-brand, .hero-tagline, .hero-sub, .hero-ctas { animation: none; }

  body::before { animation: none; }

  .cursor { animation: none; }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js [data-reveal] .d[pathLength] {
    stroke-dashoffset: 0;
    transition: none;
  }

  .js .workflow::before {
    transform: none;
    transition: none;
  }
}
