/* ==========================================================================
   Encode Nature — design tokens
   Re-theme the whole site by editing this block only. Values mirror the
   product app's theme tokens (eco_ui_react/src/theme/colors.js).
   ========================================================================== */
:root {
  /* Brand */
  --color-primary: #1d4ed8;
  --color-primary-dark: #163fae;
  --color-primary-tint: #eaf0fe;
  --color-accent: #0f9d6e;
  --color-accent-bright: #34d399;
  --color-accent-tint: #e7f6f0;

  /* Surfaces */
  --surface: #ffffff;
  --surface-muted: #f6f8f9;
  --surface-tint: #eef3f6;
  --surface-dark: #07202c;
  --surface-dark-soft: #0d2f3d;

  /* Text */
  --text: #0f2027;
  --text-muted: #4b5f68;
  --text-on-dark: #eef5f7;
  --text-on-dark-muted: #a9c2cc;

  /* Lines */
  --border: #dde5e9;
  --border-dark: rgba(255, 255, 255, 0.14);

  /* Status */
  --color-warning: #d97706;
  --color-danger: #dc2626;

  /* Radii */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-card: 18px;
  --radius-pill: 999px;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Type */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font-body);
  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.06rem);
  --step-1: clamp(1.15rem, 1.1rem + 0.25vw, 1.3rem);
  --step-2: clamp(1.4rem, 1.3rem + 0.5vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.55rem + 0.9vw, 2.4rem);
  --step-4: clamp(2.1rem, 1.7rem + 1.8vw, 3.4rem);

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(7, 32, 44, 0.06), 0 1px 3px rgba(7, 32, 44, 0.08);
  --shadow: 0 4px 12px rgba(7, 32, 44, 0.08), 0 1px 3px rgba(7, 32, 44, 0.06);
  --shadow-lg: 0 18px 40px rgba(7, 32, 44, 0.14);

  /* Layout */
  --content-width: 1200px;
  --prose-width: 42rem;
  --nav-height: 72px;
}

/* ==========================================================================
   Reset and base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--space-4));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 var(--space-4);
}

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

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

img,
svg,
iframe,
video {
  max-width: 100%;
}

img {
  height: auto;
  display: block;
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

li + li {
  margin-top: var(--space-2);
}

strong {
  font-weight: 650;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.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;
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-9);
}

.section--tight {
  padding-block: var(--space-7);
}

.section--muted {
  background: var(--surface-muted);
}

.section--tint {
  background: var(--surface-tint);
}

.section--dark {
  background: var(--surface-dark);
  color: var(--text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--text-on-dark);
}

.section--dark p,
.section--dark li {
  color: var(--text-on-dark-muted);
}

.section--dark a:not(.btn) {
  color: var(--color-accent-bright);
}

.section-header {
  max-width: 48rem;
  margin-bottom: var(--space-7);
}

.section-header--center {
  margin-inline: auto;
  text-align: center;
}

.section-header p {
  font-size: var(--step-1);
  color: var(--text-muted);
  margin-bottom: 0;
}

.section--dark .section-header p {
  color: var(--text-on-dark-muted);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section--dark .eyebrow {
  color: var(--color-accent-bright);
}

.lede {
  font-size: var(--step-1);
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

/* auto-fill, so a single post card keeps a card's width instead of
   stretching across the whole grid */
.grid--posts {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  align-items: start;
}

.split {
  display: grid;
  gap: var(--space-7);
  align-items: center;
  /* minmax(0, …), not 1fr: a wide table inside a column must scroll in its own
     wrapper instead of stretching the page sideways */
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .split--text-first > :first-child {
    order: 0;
  }
  .split--media-first > :first-child {
    order: 1;
  }
}

.prose {
  max-width: var(--prose-width);
}

.prose > * + h2,
.prose > * + h3 {
  margin-top: var(--space-6);
}

.prose img {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  margin-block: var(--space-5);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-tint);
}

.section--dark .btn--primary,
.hero .btn--primary {
  background: var(--color-accent-bright);
  color: #052018;
}

.section--dark .btn--primary:hover,
.hero .btn--primary:hover {
  background: #5ce0ab;
  color: #052018;
}

.section--dark .btn--ghost,
.hero .btn--ghost {
  border-color: var(--border-dark);
  color: var(--text-on-dark);
}

.section--dark .btn--ghost:hover,
.hero .btn--ghost:hover {
  border-color: var(--text-on-dark);
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.06);
}

.btn--large {
  padding: 1rem 2rem;
  font-size: var(--step-1);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  gap: var(--space-3);
}

.text-link .icon {
  width: 1em;
  height: 1em;
}

/* ==========================================================================
   Icons
   ========================================================================== */
.icon {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.icon-badge--accent {
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

.section--dark .icon-badge {
  background: rgba(52, 211, 153, 0.14);
  color: var(--color-accent-bright);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 0 var(--space-5);
  min-height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}

.nav-logo img {
  height: 34px;
  width: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--surface-tint);
  color: var(--color-primary);
}

.nav-link[aria-current="page"] {
  color: var(--color-primary);
}

.nav-link--cta {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  padding-inline: 1.25rem;
}

.nav-link--cta:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* Products dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__toggle {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.nav-dropdown__toggle .icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.18s ease;
}

.nav-dropdown__toggle[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

.nav-dropdown__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: min(92vw, 30rem);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  list-style: none;
  margin: 0;
  /* not display:none — nothing can be animated out of it */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.nav-dropdown__panel[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Bridges the gap between the toggle and the panel, so moving the pointer
   down into the menu doesn't count as leaving it. */
.nav-dropdown__panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.75rem;
  height: 0.75rem;
}

.nav-dropdown__panel a {
  display: block;
  padding: var(--space-3);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}

.nav-dropdown__panel a:hover {
  background: var(--surface-tint);
}

.nav-dropdown__panel strong {
  display: block;
  font-family: var(--font-display);
  color: var(--text);
}

.nav-dropdown__panel span {
  display: block;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  place-items: center;
}

.hamburger .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 3px auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

@media (max-width: 1000px) {
  .hamburger {
    display: grid;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    /* kept in flow and faded, because display cannot be transitioned */
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.22s ease, visibility 0.22s;
    /* The menu is anchored to the sticky bar, so it cannot scroll with the
       page: once the products list is open it is taller than the screen.
       Give it its own scroll, and keep that scroll from passing to the page. */
    max-height: calc(100vh - var(--nav-height));
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-menu[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-link {
    padding: 0.7rem 0.75rem;
  }

  .nav-dropdown__panel {
    position: static;
    width: auto;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 var(--space-3);
    transform: none;
    /* in flow here, so it opens by height rather than by fading */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.26s ease, opacity 0.2s ease, visibility 0.26s;
  }

  /* the script replaces this with the list's real height; the cap is only a
     fallback, so it is set well clear of the longest the list can be */
  .nav-dropdown__panel[data-open="true"] {
    max-height: 48rem;
  }

  .nav-link--cta {
    justify-content: center;
    margin-top: var(--space-2);
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  background: radial-gradient(
      110% 120% at 80% 0%,
      rgba(29, 78, 216, 0.35) 0%,
      transparent 55%
    ),
    var(--surface-dark);
  color: var(--text-on-dark);
  padding-block: var(--space-9);
  overflow: hidden;
}

.hero h1 {
  color: var(--text-on-dark);
}

.hero p {
  color: var(--text-on-dark-muted);
  font-size: var(--step-1);
  max-width: 34rem;
}

.hero--compact {
  padding-block: var(--space-8);
}

.hero__app {
  margin-top: var(--space-8);
}

/* A hero carrying the product window: copy on the left, the window taking the
   whole right side. The window stays whole — it keeps a gutter at the screen
   edge rather than bleeding off it, so it reads as a window and not as a
   cropped picture. The left padding is computed so the copy still lines up
   with every other section on the page. */
.hero--showcase .container {
  max-width: none;
  padding-left: max(
    var(--space-5),
    calc((100% - var(--content-width)) / 2 + var(--space-5))
  );
}

.hero-showcase {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 1100px) {
  .hero--showcase {
    padding-block: var(--space-8);
  }
  .hero--showcase .container {
    /* a clear margin at the screen edge, so the window is plainly whole */
    padding-right: var(--space-7);
  }
  .hero-showcase {
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  }
  .hero-showcase .hero__app {
    margin-top: 0;
  }
  .hero-showcase .appwin__view {
    min-height: 340px;
  }
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-6);
  font-size: var(--step--1);
  color: var(--text-on-dark-muted);
}

.hero__media img {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}

.hero__logos {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.hero__logos img {
  height: 44px;
  width: auto;
  background: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card h3 {
  margin-bottom: var(--space-2);
}

.card p:last-child {
  margin-bottom: 0;
}

.card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--color-primary);
}

.card__footer {
  margin-top: auto;
  padding-top: var(--space-4);
}

.card__meta {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.section--dark .card {
  background: var(--surface-dark-soft);
  border-color: var(--border-dark);
  box-shadow: none;
}

.section--dark .card h3 {
  color: var(--text-on-dark);
}

/* Product card */
.product-card {
  gap: var(--space-2);
}

.product-card__built-for {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
  color: var(--text-muted);
}

.section--dark .product-card__built-for {
  border-color: var(--border-dark);
  color: var(--text-on-dark-muted);
}

/* Numbered steps */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.steps li {
  counter-increment: step;
  margin: 0;
  padding-top: var(--space-5);
  border-top: 2px solid var(--color-primary);
}

.section--dark .steps li {
  border-color: var(--color-accent-bright);
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.section--dark .steps li::before {
  color: var(--color-accent-bright);
}

.steps h3 {
  font-size: var(--step-1);
  margin-bottom: var(--space-2);
}

/* Definition-style feature list */
.deflist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.deflist li {
  margin: 0;
  padding-left: var(--space-6);
  position: relative;
}

.deflist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 3px solid var(--color-accent);
}

.deflist strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

/* Pill list (industries, audiences) */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

.pill-list li {
  margin: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--step--1);
  font-weight: 550;
}

.section--dark .pill-list li {
  background: var(--surface-dark-soft);
  border-color: var(--border-dark);
  color: var(--text-on-dark);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);
}

caption {
  text-align: left;
  padding: var(--space-4) var(--space-5) 0;
  color: var(--text-muted);
  font-size: var(--step--1);
}

th,
td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  font-family: var(--font-display);
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-muted);
}

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

td.is-yes {
  color: var(--color-accent);
  font-weight: 650;
}

/* A table keeps its light surface inside a dark section, so its text has to be
   set back to the dark-on-light colours rather than inheriting the section's. */
.section--dark .table-wrap,
.section--dark .table-wrap th,
.section--dark .table-wrap td,
.section--dark .table-wrap p,
.section--dark .table-wrap li {
  color: var(--text);
}

.section--dark .table-wrap thead th,
.section--dark .table-wrap caption {
  color: var(--text-muted);
}

.section--dark .table-wrap td.is-yes {
  color: var(--color-accent);
}

/* ==========================================================================
   Image compare slider (satellite vs. AI output)
   ========================================================================== */
.compare {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-dark-soft);
  touch-action: pan-y;
}

.compare img {
  width: 100%;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.compare__overlay {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
}

.compare__overlay img {
  height: 100%;
  object-fit: cover;
  object-position: left center;
  position: absolute;
  inset: 0;
  width: auto;
  min-width: 100%;
}

.compare__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(7, 32, 44, 0.25);
  pointer-events: none;
}

.compare__handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
}

.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  appearance: none;
  background: transparent;
}

.compare__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--text-muted);
}

.section--dark .compare__labels {
  color: var(--text-on-dark-muted);
}

/* ==========================================================================
   Video facade — no YouTube iframe (and no third-party cookies) until click
   ========================================================================== */
.video {
  margin: 0;
}

.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  padding: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface-dark-soft);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: block;
}

.video__frame img,
.video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.video__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 32, 44, 0.1) 0%,
    rgba(7, 32, 44, 0.55) 100%
  );
  transition: opacity 0.2s ease;
}

.video__frame[data-playing="true"]::after,
.video__frame[data-playing="true"] .video__play {
  display: none;
}

.video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.video__play .icon {
  width: 2rem;
  height: 2rem;
  fill: currentColor;
  stroke: none;
  margin-left: 4px;
}

.video__frame:hover .video__play {
  transform: translate(-50%, -50%) scale(1.07);
}

.video__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  text-align: center;
  color: var(--text-on-dark);
  background: var(--surface-dark-soft);
  z-index: 1;
}

.video figcaption {
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--text-muted);
}

.section--dark .video figcaption,
.hero .video figcaption {
  color: var(--text-on-dark-muted);
}

/* Video gallery */
.video-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

/* ==========================================================================
   Figures and galleries
   ========================================================================== */
.figure {
  margin: 0;
}

.figure img {
  width: 100%;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

.figure figcaption {
  margin-top: var(--space-3);
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* Illustrative product UI drawn as inline SVG */
.figure--mock .mock {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}

.section--dark .figure figcaption,
.hero .figure figcaption {
  color: var(--text-on-dark-muted);
}


/* ==========================================================================
   App window — a representation of the EncodeSolar workspace
   Palette from the product's own design system.
   ========================================================================== */
.appwin {
  --win-bg: #0b1121;
  --win-panel: #111827;
  --win-card: #1f2937;
  --win-line: rgba(255, 255, 255, 0.08);
  --win-amber: #f59e0b;
  --win-text: #f9fafb;
  --win-dim: #9ca3af;

  border-radius: 16px;
  overflow: hidden;
  background: var(--win-bg);
  border: 1px solid var(--win-line);
  box-shadow: 0 40px 80px rgba(2, 10, 20, 0.55), 0 2px 0 rgba(255, 255, 255, 0.06) inset;
  font-size: 12px;
  line-height: 1.4;
  color: var(--win-text);
  container-type: inline-size;
}

/* the hero sets its own p/li styles; the window must not inherit them */
.appwin p,
.appwin li,
.appwin span,
.appwin strong,
.appwin em,
.appwin small,
.appwin b,
.appwin i {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  max-width: none;
  margin: 0;
}

.appwin__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--win-panel);
  border-bottom: 1px solid var(--win-line);
}

.appwin__dots {
  display: flex;
  gap: 6px;
}

.appwin__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #374151;
}

.appwin__title {
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appwin .appwin__chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #1f2937;
  color: var(--win-dim);
  white-space: nowrap;
}

.appwin__chip b {
  color: var(--win-text);
  font-weight: 650;
}

.appwin__save {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--win-amber);
  color: #231302;
  font-weight: 700;
  white-space: nowrap;
}

.appwin__body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 180px;
  min-height: 0;
}

.appwin__panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--win-panel);
}

.appwin__panel--left {
  border-right: 1px solid var(--win-line);
}

.appwin__panel--right {
  border-left: 1px solid var(--win-line);
}

.appwin .appwin__eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--win-amber);
}

.appwin__card {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--win-card);
  border-left: 3px solid var(--win-amber);
}

.appwin__card strong {
  display: block;
  font-weight: 650;
}

.appwin .appwin__card span {
  color: var(--win-dim);
  font-size: 11px;
}

.appwin__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  border-radius: 10px;
  overflow: hidden;
}

.appwin .appwin__list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 8px 11px;
  background: var(--win-card);
  color: var(--win-dim);
  font-size: 11px;
}

.appwin__list em {
  font-style: normal;
  color: var(--win-text);
  white-space: nowrap;
}

.appwin__btn {
  margin-top: auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--win-amber);
  color: #231302;
  font-weight: 700;
  text-align: center;
}

.appwin__btn--ghost {
  background: transparent;
  border: 1px solid var(--win-amber);
  color: var(--win-amber);
}

.appwin__view {
  position: relative;
  min-height: 300px;
  background: radial-gradient(120% 90% at 50% 0%, #16233c 0%, #0b1121 70%);
}

.appwin__view img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* contain, not cover: the render is the point, so never crop it. The PNG has
     a transparent background, so any slack shows the viewport's own gradient. */
  object-fit: contain;
  object-position: center;
}

.appwin__hud {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.appwin .appwin__tabs {
  flex: none;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(11, 17, 33, 0.78);
  backdrop-filter: blur(6px);
  font-size: 10px;
}

.appwin .appwin__tabs b,
.appwin .appwin__tabs i {
  padding: 4px 10px;
  border-radius: 999px;
  font-style: normal;
}

.appwin__tabs b {
  background: var(--win-amber);
  color: #231302;
  font-weight: 700;
}

.appwin__tabs i {
  color: var(--win-dim);
}

.appwin__sun {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(11, 17, 33, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid var(--win-line);
}

.appwin .appwin__sun-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--win-amber);
  white-space: nowrap;
}

.appwin__track {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #374151;
}

.appwin__track i {
  position: absolute;
  left: 0;
  top: -4px;
  width: 62%;
  height: 3px;
  border-radius: 2px;
  background: var(--win-amber);
  margin-top: 4px;
}

.appwin__track i::after {
  content: "";
  position: absolute;
  right: -5px;
  top: -3.5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}

.appwin__time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.appwin__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.appwin__stats div {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--win-card);
}

.appwin .appwin__stats span {
  display: block;
  font-size: 10px;
  color: var(--win-dim);
}

.appwin .appwin__stats strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.appwin .appwin__stats small {
  font-size: 9px;
  font-weight: 600;
  color: var(--win-dim);
  margin-left: 2px;
}

.appwin__spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
  padding: 8px;
  border-radius: 10px;
  background: var(--win-card);
}

.appwin__spark i {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: #f59e0b;
  opacity: 0.55;
}

.appwin__spark i.is-peak {
  opacity: 1;
}

/* The view tabs are decoration; they go as soon as the sun control needs the
   room, which is well before the panels have to drop. */
@container (max-width: 760px) {
  .appwin .appwin__tabs {
    display: none;
  }
}

/* Narrow carriers: step the window down before dropping anything */
@container (max-width: 900px) and (min-width: 701px) {
  /* the query element styles its descendants, not itself — so the step-down
     goes on the body, not on .appwin */
  .appwin__body {
    font-size: 11px;
    grid-template-columns: 150px minmax(0, 1fr) 170px;
  }
  .appwin__panel {
    padding: 12px;
  }
  /* tighter rows, so values like "1,021,096 kWh" still fit whole */
  .appwin .appwin__list li {
    padding: 7px 9px;
    gap: 6px;
    font-size: 10px;
  }
  .appwin .appwin__stats strong {
    font-size: 14px;
  }
  .appwin__stats div {
    padding: 8px;
  }
}

@container (max-width: 700px) {
  /* Too narrow for three columns, but nothing is dropped: the viewport leads
     and the panels stack underneath it, full width and still readable. */
  .appwin__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .appwin__view {
    order: -1;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .appwin__panel {
    border-right: 0;
    border-left: 0;
    border-top: 1px solid var(--win-line);
  }
  .appwin__btn {
    margin-top: var(--space-1);
  }
  /* the title loses to the chip and the button for space, so drop the chip */
  .appwin .appwin__chip {
    display: none;
  }
}


/* ==========================================================================
   Interactive 3D viewer (EncodeSolar rooftop, Sylva plantation)
   ========================================================================== */
.viewer3d {
  position: relative;
  margin: 0;
}

.viewer3d__stage {
  position: relative;
  aspect-ratio: 16 / 8;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: linear-gradient(180deg, #d7e4ee 0%, #eef1ee 62%, #e4e8e3 100%);
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.section--dark .viewer3d__stage,
.hero .viewer3d__stage {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.viewer3d__poster {
  position: absolute;
  inset: 0;
  display: block;
}

.viewer3d__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.viewer3d.is-live .viewer3d__poster {
  display: none;
}

.viewer3d__canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.viewer3d__stage.is-grabbing .viewer3d__canvas {
  cursor: grabbing;
}

.viewer3d__canvas:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: -3px;
}

.viewer3d__hint,
.viewer3d__ui {
  display: none;
}

.viewer3d.is-live .viewer3d__hint {
  display: block;
  z-index: 2;
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: rgba(7, 32, 44, 0.65);
  color: #fff;
  font-size: var(--step--1);
  margin: 0;
  pointer-events: none;
}

.viewer3d.is-live .viewer3d__ui {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: min(32rem, 100%);
  margin: var(--space-4) auto 0;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section--dark .viewer3d.is-live .viewer3d__ui,
.hero .viewer3d.is-live .viewer3d__ui {
  background: var(--surface-dark-soft);
  border-color: var(--border-dark);
  color: var(--text-on-dark);
}

.viewer3d__title {
  flex: none;
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
  white-space: nowrap;
}

.viewer3d__readout {
  flex: none;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
  min-width: 5.5rem;
  text-align: right;
}

.viewer3d input[type="range"] {
  flex: 1;
  accent-color: var(--color-accent);
  min-width: 6rem;
}

/* ---------------------------------------------- EncodeSolar energy card */
/* What the slider's sun does to the plant. On wide screens it floats in the
   empty sky to the left of the roof (the camera frames the roof beside it);
   narrower, it sits under the scene. Hidden until the scene is live, since
   every figure in it comes from the scene. */
.viewer3d--solar {
  container-type: inline-size;
}

.energy-card {
  display: none;
}

.viewer3d--solar figcaption {
  margin-top: var(--space-4);
}

.viewer3d.is-live .energy-card {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: var(--step--1);
  line-height: 1.4;
}

@container (min-width: 960px) {
  .viewer3d.is-live .energy-card {
    position: absolute;
    z-index: 3;
    top: var(--space-4);
    left: var(--space-4);
    width: 17.5rem;
    margin: 0;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(8px);
  }
}

@container (min-width: 560px) and (max-width: 959.98px) {
  .viewer3d.is-live .energy-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    column-gap: var(--space-5);
  }
  .energy-card__where,
  .energy-card__hero {
    grid-column: 1;
  }
  .energy-card dl {
    grid-column: 2;
    grid-row: 1 / span 3;
  }
  .energy-card__curve {
    grid-column: 1;
  }
}

.energy-card__where {
  margin: 0;
  color: var(--text-muted);
}

.energy-card__hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: var(--space-3);
}

.energy-card__hero span {
  grid-column: 1 / -1;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.energy-card__hero strong {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.energy-card__hero strong small,
.energy-card dd small {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--text-muted);
}

.energy-card__hero > small {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.energy-card dl {
  margin: 0;
  display: grid;
}

.energy-card dl div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: 0.3rem 0;
  border-top: 1px solid var(--border);
}

.energy-card dt {
  color: var(--text-muted);
}

.energy-card dd {
  margin: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.energy-card__curve p {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  color: var(--text-muted);
}

.energy-card__curve b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.energy-card__curve svg {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--space-2) 0 var(--space-1);
  cursor: ew-resize;
  touch-action: none;
  overflow: visible;
}

.energy-curve__base {
  stroke: var(--border);
  stroke-width: 1;
}

.energy-curve__tick {
  font-size: 9px;
  fill: var(--text-muted);
  text-anchor: middle;
}

.energy-curve__free {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.25;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}

.energy-curve__area {
  fill: var(--color-accent);
  opacity: 0.18;
}

.energy-curve__line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.energy-curve__dot {
  fill: var(--color-accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.energy-card .energy-card__key {
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  column-gap: var(--space-2);
  font-size: 0.78rem;
}

.energy-card__key-line,
.energy-card__key-free {
  display: inline-block;
  width: 14px;
  height: 0;
  border-top: 2px solid var(--color-accent);
}

.energy-card__key-free {
  margin-left: var(--space-2);
  border-top: 1.5px dashed var(--text-muted);
}

.energy-card__key-loss {
  margin-left: auto;
}

.viewer3d.is-loading .viewer3d__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: viewer3d-shimmer 1.2s infinite;
}

@keyframes viewer3d-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@media (max-width: 640px) {
  .viewer3d__stage {
    aspect-ratio: 4 / 3;
  }
  /* the control bar has to fit a phone: drop the label, let the slider shrink */
  .viewer3d.is-live .viewer3d__ui {
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
  }
  .viewer3d__title {
    display: none;
  }
  .viewer3d__readout {
    min-width: 4.5rem;
  }
  .viewer3d input[type="range"] {
    min-width: 0;
  }
}

/* --------------------------------------------- Sylva: record, controls, figures */
/* the whole site, never cropped, while the poster stands in for the canvas */
.viewer3d--sylva .viewer3d__poster img {
  object-fit: contain;
}

.tree-card {
  position: absolute;
  z-index: 3;
  top: var(--space-4);
  left: var(--space-4);
  width: min(16rem, calc(100% - 2 * var(--space-4)));
  padding: var(--space-4);
  border-radius: var(--radius);
  background: rgba(7, 32, 44, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-dark);
  box-shadow: var(--shadow-lg);
  color: var(--text-on-dark);
  font-size: var(--step--1);
  line-height: 1.4;
}

.tree-card[hidden] {
  display: none;
}

.tree-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.tree-card__head strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-0);
  color: #fff;
}

.tree-card__head span {
  color: var(--text-on-dark-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.tree-card__close {
  flex: none;
  padding: 0 0.3rem;
  border: 0;
  background: transparent;
  color: var(--text-on-dark-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.tree-card__close:hover {
  color: #fff;
}

.section--dark .tree-card__risk,
.tree-card__risk {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.65rem 0 0.55rem;
  font-size: var(--step--1);
  font-weight: 650;
  color: #fff;
}

.tree-card__dot {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.tree-card dl {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.tree-card dl div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-dark);
}

.tree-card dt {
  color: var(--text-on-dark-muted);
}

.tree-card dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sylva-controls,
.site-stats {
  display: none;
}

.viewer3d.is-live .sylva-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border-dark);
  background: var(--surface-dark-soft);
  color: var(--text-on-dark);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.05);
}

.seg button {
  padding: 0.35rem 0.95rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-on-dark-muted);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button[aria-pressed="true"] {
  background: var(--text-on-dark);
  color: var(--surface-dark);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--text-on-dark-muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend b {
  color: var(--text-on-dark);
  font-variant-numeric: tabular-nums;
}

.legend__swatch {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 3px;
}

.legend__bar {
  width: 7rem;
  height: 0.55rem;
  border-radius: var(--radius-pill);
}

.survey {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  font-size: var(--step--1);
}

.survey__label {
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-bright);
}

.survey input {
  width: 9rem;
  accent-color: var(--color-accent-bright);
}

.survey output {
  min-width: 4.9rem;
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-on-dark);
}

.viewer3d.is-live .site-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
}

.site-stats div {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
}

.site-stats dt {
  font-size: var(--step--1);
  color: var(--text-on-dark-muted);
}

.site-stats dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-on-dark);
}

.site-stats small {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--text-on-dark-muted);
}

.viewer3d--sylva figcaption {
  margin-top: var(--space-4);
  font-size: var(--step--1);
  color: var(--text-on-dark-muted);
}

/* Phones: the record moves out from over the scene to just below it, and the
   controls stack, so nothing covers the trees you are trying to tap. */
@media (max-width: 640px) {
  /* the site is a wide tile: a 4:3 stage would leave bands of empty sky */
  .viewer3d--sylva .viewer3d__stage {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 720px) {
  .tree-card {
    position: static;
    width: auto;
    margin-top: var(--space-3);
  }
  .survey {
    margin-left: 0;
    width: 100%;
  }
  .survey input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

/* ==========================================================================
   Charts
   ========================================================================== */
.chart {
  margin: 0;
}

.chart__svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font-body);
}

.chart__grid line {
  stroke: var(--border);
  stroke-width: 1;
}

.chart__grid text,
.chart__label,
.chart__unit {
  fill: var(--text-muted);
  font-size: 12px;
}

.chart__unit {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chart__axis {
  stroke: var(--text-muted);
  stroke-width: 1.5;
}

.chart__bar rect {
  fill: var(--color-primary);
  transition: fill 0.15s ease;
}

.chart__bar:hover rect {
  fill: var(--color-primary-dark);
}

.chart__bar.is-peak rect {
  fill: var(--color-primary-dark);
}

.chart__value {
  fill: var(--text);
  font-size: 12px;
  font-weight: 650;
}

/* Stat tiles */
.stat-row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  margin-bottom: var(--space-6);
}

.stat {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat__label {
  display: block;
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.stat__value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 650;
  line-height: 1.1;
}

.stat__value small {
  font-size: var(--step-0);
  font-weight: 500;
  color: var(--text-muted);
}

.section--dark .stat {
  background: var(--surface-dark-soft);
  border-color: var(--border-dark);
}

.section--dark .stat__value {
  color: var(--text-on-dark);
}

.section--dark .stat__label {
  color: var(--text-on-dark-muted);
}

.source-note {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-top: var(--space-4);
}

.section--dark .source-note {
  color: var(--text-on-dark-muted);
}

/* ==========================================================================
   Timeline (milestones)
   ========================================================================== */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-6);
}

.timeline li {
  position: relative;
  margin: 0;
  padding-left: var(--space-6);
  border-left: 2px solid var(--border);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 0.4rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px var(--surface);
}

.timeline__period {
  display: block;
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 650;
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

/* ==========================================================================
   Blog
   ========================================================================== */
.post-card {
  overflow: hidden;
  padding: 0;
}

.post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card h3 {
  font-size: var(--step-1);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
}

.tag-row li {
  margin: 0;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-tint);
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-pill);
}

.post-meta {
  font-size: var(--step--1);
  color: var(--text-muted);
}

.post-header {
  max-width: var(--prose-width);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form {
  display: grid;
  gap: var(--space-5);
}

.form__grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label,
.fieldset__legend {
  font-weight: 600;
  font-size: var(--step--1);
}

.field .hint {
  font-size: var(--step--1);
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
  outline: none;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin: 0;
}

legend {
  padding-inline: var(--space-2);
  font-weight: 600;
  font-size: var(--step--1);
}

.checkbox-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}

.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step-0);
  font-weight: 450;
}

.checkbox input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
}

.form__honeypot {
  position: absolute;
  left: -9999px;
}

.form-note {
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* ==========================================================================
   Contact details list
   ========================================================================== */
.contact-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.contact-list li {
  display: flex;
  gap: var(--space-3);
  margin: 0;
}

.contact-list .icon {
  color: var(--color-primary);
  margin-top: 0.2rem;
}

.section--dark .contact-list .icon {
  color: var(--color-accent-bright);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--surface-dark);
  color: var(--text-on-dark-muted);
  padding-block: var(--space-8) var(--space-5);
}

.footer__grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.footer h2 {
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark);
  margin-bottom: var(--space-4);
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.footer li {
  margin: 0;
}

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

.footer a:hover {
  color: var(--color-accent-bright);
  text-decoration: underline;
}

.footer__brand img {
  height: 38px;
  width: auto;
  margin-bottom: var(--space-4);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-dark);
  font-size: var(--step--1);
}

.social-links {
  display: flex;
  gap: var(--space-3);
}

.social-links a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-dark);
  border-radius: 50%;
}

.social-links a:hover {
  border-color: var(--color-accent-bright);
}

/* ==========================================================================
   CTA band
   ========================================================================== */
.cta-band {
  /* The site's own dark surface, one step lighter than the footer below it.
     No coloured stripe: the band belongs to the same family as the hero. */
  background: var(--surface-dark-soft);
  color: var(--text-on-dark);
  text-align: center;
  padding-block: var(--space-8);
}

.cta-band h2 {
  color: var(--text-on-dark);
  max-width: 36rem;
  margin-inline: auto;
}

.cta-band p {
  color: var(--text-on-dark-muted);
  max-width: 40rem;
  margin-inline: auto;
  font-size: var(--step-1);
}

.cta-band .btn-row {
  justify-content: center;
}

.cta-band .btn--primary {
  background: var(--color-accent-bright);
  color: #052018;
}

.cta-band .btn--primary:hover {
  background: #5ce0ab;
  color: #052018;
}

.cta-band .btn--ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.cta-band .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

/* ==========================================================================
   Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .btn:hover {
    transform: none;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  .navbar,
  .footer,
  .cta-band,
  .video__play {
    display: none !important;
  }
  body {
    color: #000;
    background: #fff;
  }
}
