:root {
  /* Base surfaces */
  --bg: #0b1020;
  --panel: #0f172a;
  --text: #e6ecff;
  --muted: #97a3c0;
  --card: #0f172a;
  --border: #1e293b;

  /* Brand palette (following primary, secondary, tertiary, accent) */
  --primary: #10b981;
  --secondary: #60a5fa;
  --tertiary: #f59e0b;
  --tiertiary: var(--tertiary);
  --accent: var(--secondary);

  /* Back-compat aliases (prefer primary/secondary/tertiary/accent going forward) */
  --brand: var(--primary);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: 'Montserrat', Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  white-space: nowrap
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(160%) blur(10px);
  background: rgba(11, 16, 32, 0.6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none
}

.logo {
  height: clamp(28px, 5.2vw, 48px);
  width: auto;
}

.site-nav {
  display: flex;
  gap: 18px;
  align-items: center
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: .9
}

.site-nav a:hover {
  opacity: 1
}

.hero {
  padding: 96px 0 56px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* avoid horizontal scroll from full-bleed canvas */
  /* Decorative glows scoped to hero to avoid bleeding between sections */
  background:
    radial-gradient(1200px 600px at 70% -20%, color-mix(in oklab, var(--secondary) 15%, transparent), transparent 60%),
    radial-gradient(900px 500px at 10% -10%, color-mix(in oklab, var(--primary) 12%, transparent), transparent 60%);
}

.hero h1 {
  font-size: clamp(28px, 4.4vw, 48px);
  line-height: 1.12;
  margin: 0 0 16px
}

h2 {
  font-size: clamp(20px, 3.2vw, 32px);
  line-height: 1.28;
  margin: 0 0 10px;
}

/* Section anchor link (#) beside headings */
h2 {
  position: relative;
}

.section-anchor {
  margin-left: 10px;
  color: var(--muted);
  text-decoration: none;
  opacity: .8;
}

.section-anchor:hover {
  opacity: 1;
  color: var(--text);
}

/* Ensure anchor targets don't hide under sticky header */
section[id] {
  scroll-margin-top: 80px;
  /* header height + some spacing */
}

.lead {
  font-size: clamp(16px, 2.2vw, 20px);
  color: var(--muted);
  max-width: 60ch
}

/* Background canvas behind hero */
.hero-canvas {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  z-index: -1;
  opacity: .75;
  filter: blur(.2px)
}

.waitlist {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center
}

.waitlist input {
  flex: 1 1 280px;
  min-width: 240px;
  background: var(--panel);
  color: var(--text);

  /* Make inputs less tall on phones */
  .waitlist input {
    padding: 10px 12px;
    font-size: 15px;
    line-height: 1.2;
    border-radius: 8px;
  }

  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

.form-note {
  width: 100%;
  margin: 2px 2px 0 2px;
  font-size: 12px;
  color: var(--muted)
}

.section {
  padding: 56px 0
}

.section.alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 40%)
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px
}

.card p {
  margin: 0;
  color: var(--muted)
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: center
}

.two-col.start {
  align-items: start
}

.two-col.center {
  align-items: center
}

.illustration {
  background: color-mix(in oklab, var(--secondary) 6%, transparent);
  border: 1px dashed color-mix(in oklab, var(--secondary) 25%, transparent);
  border-radius: 16px;
  padding: 10px
}

.illustration.clear {
  background: transparent;
  border-color: transparent
}

.illustration img,
.illustration video {
  width: 100%;
  height: auto;
  border-radius: 10px
}

/* Keep Plotly graphs readable: enforce a minimum width and allow horizontal scroll inside figure wrappers */
.illustration {
  overflow-x: auto;
}

.illustration>#contextPeak,
.illustration>#aggPower,
.illustration>#aggTemp,
.illustration .js-plotly-plot {
  min-width: 550px;
}

/* Rounded corners for all Plotly figures */
.js-plotly-plot {
  border-radius: 16px;
  overflow: hidden; /* clip SVG/canvas to rounded corners */
  margin: 8px; /* space around the plot within its container */
}

/* If inside an illustration panel, match the panel's radius */
.illustration .js-plotly-plot {
  border-radius: inherit; /* use the same 16px as the parent .illustration */
  margin: 10px; /* harmonize spacing inside panels */
}

/* Align captions with the start of the Plotly figure area */
.illustration figcaption {
  margin-left: 10px;
  margin-right: 10px;
}

.figure-controls {
  padding: 5px;
}

/* Glass panel to improve hero text legibility over animated background */
.hero-glass {
  background: rgba(11, 16, 32, 0.35);
  /* more transparent */
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: clamp(16px, 2.2vw, 24px);
  box-shadow: none;
}

.cta {
  padding: 64px 0
}

.text-center {
  text-align: center;
}

.waitlist.center {
  justify-content: center
}

.mt-12 {
  margin-top: 12px
}

.mt-14 {
  margin-top: 14px
}

/* Pill label used in hero */
.pill {
  display: inline-block;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  text-align: center;
  margin-bottom: clamp(8px, 1.6vw, 16px);
}

/* Contact form controls inside cards */
.card input[type="text"],
.card input[type="email"],
.card textarea {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
}

.card input[type="text"],
.card input[type="email"] {
  margin: .35rem 0 .7rem
}

.card textarea {
  margin: .35rem 0 .9rem
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 36px;
  background: rgba(0, 0, 0, .1)
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between
}

.brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.brand-text {
  font-weight: 700;
  font-size: clamp(18px, 3.6vw, 28px);
}

.muted {
  color: var(--muted)
}

.footer-nav {
  display: flex;
  gap: 18px
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none
}

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

.figures-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.btn,
.btn-small {
  appearance: none;
  border: 1px solid color-mix(in oklab, var(--primary) 35%, #000);
  cursor: pointer;
  background: var(--primary);
  color: #04120d;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: none;
  transition: background-color .2s ease, filter .2s ease;
}

.btn {
  padding: 14px 18px;
  font-size: 16px
}

.btn-small {
  padding: 10px 12px;
  font-size: 14px
}

.btn:hover {
  filter: brightness(1.05) saturate(110%);
}

.btn:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--primary) 65%, white);
  outline-offset: 2px;
}

.thanks {
  background: color-mix(in oklab, var(--primary) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, transparent);
  padding: 14px 16px;
  border-radius: 10px
}

.brand-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 28px;
}

.brand-stack>span {
  display: block;
}

.brand-stack .copyright {
  font-size: inherit;
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr
  }

  .two-col {
    grid-template-columns: 1fr
  }

  .site-header {
    padding: 10px 14px
  }

  /* Hide the decorative illustration in the Solution section on small screens */
  #solution .two-col>.illustration {
    display: none;
  }
}

/* Additional small-screen refinements */
@media (max-width: 720px) {
  .site-header {
    gap: 8px;
    flex-wrap: wrap;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 4px;
  }

  .site-nav a {
    flex: 0 0 auto;
    font-size: 14px;
    padding: 6px 8px;
  }

  .hero {
    padding: 72px 0 40px;
  }

  .container {
    padding: 0 16px;
  }

  .waitlist {
    flex-direction: column;
    align-items: stretch;
  }

  .waitlist input,
  .waitlist .btn {
    min-width: 0;
    width: 100%;
    flex: 0 0 auto;
    /* prevent 280px flex-basis from becoming height in column layout */
  }

  /* Place the animated graph under the hero content on phones */
  .hero {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* tighten spacing between content and graph */
  }

  .hero>.container {
    order: 1;
  }

  .hero-canvas {
    position: static;
    order: 2;
    width: 100%;
    height: clamp(200px, 34vh, 320px);
    left: auto;
    transform: none;
    z-index: 0;
    opacity: .9;
  }

  /* Hide empty desktop-only placeholder */
  .illustration.clear {
    display: none;
  }

  .two-col>.illustration {
    margin-top: 8px;
  }

  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-nav {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* Make sliders use the secondary blue */
input[type="range"] {
  accent-color: var(--secondary);
}