:root {
  color-scheme: dark;

  /* Base palette */
  --bg-0: #06070a;
  --bg-1: #0a0c11;
  --text: #eef2ee;
  --muted: #9aa3a0;

  /* Accents */
  --green: #8bd6b4;
  --gold: #f1c76d;
  --coral: #ff7b6e;
  --blue: #72b8ff;

  /* Liquid glass tokens */
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-line: rgba(255, 255, 255, 0.14);
  --glass-blur: 22px;
  --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.20) inset,
    0 -1px 0 rgba(255, 255, 255, 0.05) inset;
  --radius: 18px;

  /* Cursor-tracked light source for specular highlights */
  --mx: 50%;
  --my: 12%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient aurora behind the fixed canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(40rem 40rem at 18% 12%, rgba(114, 184, 255, 0.18), transparent 60%),
    radial-gradient(46rem 46rem at 82% 78%, rgba(139, 214, 180, 0.16), transparent 60%),
    radial-gradient(36rem 36rem at 60% 30%, rgba(241, 199, 109, 0.10), transparent 60%),
    var(--bg-0);
  animation: drift 24s ease-in-out infinite alternate;
}

/* Subtle film grain via repeating gradient */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.6) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -2%, 0) scale(1.05); }
}

button,
select,
input {
  font: inherit;
}

/* ---------- Liquid glass primitive ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}

/* Specular sheen that follows the cursor */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    22rem 22rem at var(--mx) var(--my),
    rgba(255, 255, 255, 0.22),
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0.9;
  transition: background-position 0.2s ease;
  mix-blend-mode: screen;
}

/* Top inner highlight edge */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 22%);
  opacity: 0.5;
}

/* ---------- Fixed 3D canvas ---------- */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: clamp(0.6rem, 2vw, 1.1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(1100px, calc(100% - 1.6rem));
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.7rem 0.6rem 1.1rem;
  border-radius: 999px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--green);
  background: radial-gradient(circle at 35% 35%, var(--blue), transparent 70%);
  box-shadow: 0 0 12px rgba(114, 184, 255, 0.6);
}

.nav-links {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-cta {
  text-decoration: none;
  color: #06120d;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), #b8f0d6);
  box-shadow: 0 6px 20px rgba(139, 214, 180, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(139, 214, 180, 0.5);
}

/* ---------- Layout / sections ---------- */
main {
  position: relative;
  z-index: 10;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem clamp(1.2rem, 6vw, 6rem) 4rem;
  max-width: 60rem;
}

/* Legibility scrim behind hero text (sits over the canvas, under text) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, rgba(6, 7, 10, 0.6) 0%, rgba(6, 7, 10, 0.18) 42%, transparent 70%);
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(3rem, 11vw, 8rem);
  line-height: 0.86;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.lede {
  margin: 1.4rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  color: #06120d;
  background: linear-gradient(135deg, var(--green), #b8f0d6);
  box-shadow: 0 10px 30px rgba(139, 214, 180, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(139, 214, 180, 0.5);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-line);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.scroll-cue {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-cue span {
  width: 1.4rem;
  height: 2.2rem;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  position: relative;
}

.scroll-cue span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0.4rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: var(--green);
  transform: translateX(-50%);
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
  0%, 100% { opacity: 0.3; transform: translate(-50%, 0); }
  50% { opacity: 1; transform: translate(-50%, 1rem); }
}

/* ---------- Console (live controls) ---------- */
.console {
  position: fixed;
  right: clamp(1rem, 2.4vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: min(21rem, calc(100vw - 2rem));
  max-height: min(88vh, 44rem);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 1.2rem;
  overflow: auto;
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  visibility: hidden;
}

.console.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.console.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) scale(1.02);
}

.hidden {
  display: none !important;
}

/* ---------- Persistent console toggle (⤢) ---------- */
#toggleConsoleBtn {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 40;
}

.console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.console h2 {
  font-size: 1.4rem;
}

.icon-button {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.icon-button[aria-pressed="true"] {
  border-color: rgba(139, 214, 180, 0.85);
  color: var(--green);
  background: rgba(139, 214, 180, 0.12);
}

.field {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

select,
input[type="range"],
button {
  width: 100%;
}

select,
.ghost-button {
  min-height: 2.5rem;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 0.8rem;
  cursor: pointer;
}

select:focus-visible,
.ghost-button:focus-visible,
input[type="range"]:focus-visible,
.btn:focus-visible,
.nav-cta:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

input[type="range"] {
  accent-color: var(--green);
  height: 1.6rem;
}

.toggles {
  display: grid;
  gap: 0.7rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--green);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.metric {
  min-height: 4.4rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.metric span em {
  display: inline;
  font-weight: normal;
  opacity: 0.7;
  font-size: 0.68rem;
  margin-left: 0.3rem;
}

.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0.8rem currentColor;
  flex: none;
}

.dot.live { background: var(--green); color: var(--green); }
.dot.fallback { background: var(--coral); color: var(--coral); }

.tooltip {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.console-head-actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Focus / immersive mode ---------- */
body.focus-mode {
  overflow: hidden;
  height: 100vh;
}

body.focus-mode .nav,
body.focus-mode .hero,
body.focus-mode .section,
body.focus-mode .footer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

body.focus-mode .console {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

body.focus-mode #focusToggle {
  border-color: rgba(139, 214, 180, 0.85);
  color: var(--green);
  background: rgba(139, 214, 180, 0.12);
}

/* ---------- Console mode (front-end hidden, console shown) ---------- */
body.console-mode .nav,
body.console-mode .hero,
body.console-mode .section,
body.console-mode .footer {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

/* ---------- Content sections ---------- */
.section {
  position: relative;
  z-index: 10;
  padding: clamp(4rem, 10vw, 8rem) clamp(1.2rem, 6vw, 6rem);
}

.section-inner {
  max-width: 64rem;
  margin: 0 auto;
}

.section-inner.center {
  text-align: center;
  max-width: 46rem;
}

.section-title {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 1.2rem;
}

.section-body {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.65;
  max-width: 46rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}

.card {
  padding: 1.4rem;
  border-radius: var(--radius);
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.feature-list {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.98rem;
}

.pip {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0.8rem var(--green);
  flex: none;
}

.table-wrap {
  margin-top: 2.2rem;
  padding: 0.6rem;
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--glass-line);
}

.data-table th {
  color: var(--green);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--muted);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 10;
  margin: 2rem clamp(1.2rem, 6vw, 6rem) 2rem;
  padding: 1.6rem 1.8rem;
  border-radius: var(--radius);
  text-align: center;
}

.footer p {
  margin: 0.2rem 0;
}

.footer .muted {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Loading veil ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #0c1014, #06070a);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.veil.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.veil-core {
  text-align: center;
  color: var(--muted);
}

.veil-orb {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  border: 2px solid rgba(139, 214, 180, 0.3);
  border-top-color: var(--green);
  box-shadow: 0 0 30px rgba(139, 214, 180, 0.4);
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Utility / a11y ---------- */
.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;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--green);
  color: #06120d;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;
}

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

.noscript {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 60;
  padding: 1rem;
  text-align: center;
  color: var(--text);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .console {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    transform: none;
    max-height: 56vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .hero { padding-bottom: 60vh; }
}

@media (max-width: 560px) {
  .nav { padding-left: 1rem; }
  .nav-cta { padding: 0.5rem 0.85rem; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before,
  .scroll-cue span::after,
  .veil-orb { animation: none; }
  .glass::before { transition: none; }
  .btn,
  .nav-cta,
  .nav-links a { transition: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Standalone legal pages (e.g. privacy policy) */
.legal {
  max-width: 44rem;
  margin: 12vh auto 4rem;
  padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
  line-height: 1.65;
}
.legal h1 {
  margin-top: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.legal a {
  color: var(--accent, #8bd6b4);
  text-underline-offset: 3px;
}

/* Cloudflare Turnstile — console gate + footer indicator */
.turnstile-gate {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.turnstile-gate[hidden] {
  display: none;
}
.turnstile-indicator.is-active {
  color: var(--accent, #8bd6b4);
}
.turnstile-indicator.is-inactive {
  color: #e08a8a;
}
