:root {
  --brand: #72afb6;
  --brand-dark: #2e4649;
  --ink: #1f2729;
  --muted: #5c6b6e;
  --bg: #ffffff;
  --bg-alt: #f3f7f7;
  --line: #dbe6e6;
  --max: 1040px;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1rem; }
a { color: var(--brand-dark); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem var(--pad);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: inline-flex; }
.nav__links { display: flex; flex-wrap: wrap; gap: clamp(0.75rem, 2vw, 1.75rem); }
.nav__links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav__links a:hover { color: var(--brand-dark); }

/* Sections */
.section { padding: clamp(3.5rem, 9vw, 7rem) var(--pad); }
.section__inner, .hero__inner, .footer__inner { max-width: var(--max); margin: 0 auto; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--brand-dark); color: #eaf2f2; }
.section--dark a { color: #fff; }

h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: inherit; max-width: 64ch; }
.section:not(.section--dark) .lead { color: var(--muted); }

/* Hero */
.hero {
  padding: clamp(4rem, 12vw, 9rem) var(--pad);
  background: linear-gradient(160deg, #eaf3f3 0%, #ffffff 60%);
  text-align: center;
}
.hero__logo { height: 56px; margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); max-width: 18ch; margin-inline: auto; }
.hero p { font-size: clamp(1.1rem, 2.4vw, 1.4rem); color: var(--muted); max-width: 58ch; margin: 1rem auto 2rem; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--brand-dark); transform: translateY(-2px); }

/* Capability cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  border-top: 3px solid var(--brand);
}
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0; }

/* Feature spotlights */
.spotlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.spotlight__text h2 { margin-bottom: 0.75rem; }
.spotlight--flip .spotlight__visual { order: -1; }

.mock {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 26px 54px -26px rgba(16, 25, 26, 0.45);
}

/* Plan-view mock */
.planmock { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.planmock > i { aspect-ratio: 1; border-radius: 6px; background: var(--bg-alt); }
.planmock > i.on { background: var(--brand); }
.planmock > i.dim { background: rgba(114, 175, 182, 0.42); }
.planmock > i.motion { position: relative; }
.planmock > i.motion::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 40%;
  height: 40%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--brand-dark);
  box-shadow: 0 0 0 0 rgba(46, 70, 73, 0.5);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 70, 73, 0.5); }
  100% { box-shadow: 0 0 0 12px rgba(46, 70, 73, 0); }
}
.planmock__legend { display: flex; gap: 1.25rem; margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }
.planmock__legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.planmock__legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--bg-alt); }
.planmock__legend i.on { background: var(--brand); }
.planmock__legend i.dim { background: rgba(114, 175, 182, 0.42); }

/* Energy bar-chart mock */
.barmock { width: 100%; height: auto; }
.barmock__axis { stroke: var(--line); stroke-width: 2; }
.barmock__bars rect { fill: rgba(114, 175, 182, 0.55); }
.barmock__bars .barmock__peak { fill: var(--brand); }

/* Emergency test mock */
.testmock__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.testmock__head > span:first-child { font-weight: 600; }
.testmock .badge {
  background: rgba(25, 135, 84, 0.12);
  color: #198754;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}
.testmock__list { list-style: none; margin: 0; padding: 0; }
.testmock__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.95rem;
}
.testmock__list .tick { color: #198754; font-weight: 700; }
.testmock__list .cross { color: #dc3545; font-weight: 700; }
.testmock__list .is-fail { color: var(--muted); }

@media (max-width: 820px) {
  .spotlight { grid-template-columns: 1fr; }
  .spotlight--flip .spotlight__visual { order: 0; }
}

/* Diagrams */
.diagram { margin-top: 2.5rem; }
.diagram svg { width: 100%; height: auto; }

/* How-it-fits flow */
.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
}
.flow__node {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 190px;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 30px -18px rgba(16, 25, 26, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.flow__node:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -18px rgba(16, 25, 26, 0.5); }
.flow__node strong { display: block; font-size: 1rem; }
.flow__node span { color: var(--muted); font-size: 0.85rem; }
.flow__node--brand {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 20px 44px -16px rgba(114, 175, 182, 0.7);
  transform: scale(1.05);
}
.flow__node--brand:hover { transform: scale(1.05) translateY(-3px); }
.flow__node--brand span { color: rgba(255, 255, 255, 0.82); }
.flow__node--brand .flow__icon { background: rgba(255, 255, 255, 0.18); color: #fff; }
.flow__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(114, 175, 182, 0.14);
  color: var(--brand-dark);
}
.flow__icon svg { width: 24px; height: 24px; }
.flow__group { display: flex; flex-direction: column; gap: 0.65rem; }
.flow__node--sm { min-width: 165px; padding: 0.7rem 1rem; }
.flow__node--sm span { color: var(--ink); font-size: 0.95rem; font-weight: 500; }
.flow__link { flex: none; color: var(--brand); }
.flow__link svg { display: block; width: 56px; height: 26px; overflow: visible; }
.flow__link .ln {
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 6 6;
  animation: flow-dash 0.9s linear infinite;
}
.flow__link .hd { fill: currentColor; }
@keyframes flow-dash { to { stroke-dashoffset: -12; } }

@media (max-width: 720px) {
  .flow { flex-direction: column; }
  .flow__node, .flow__node--brand, .flow__group { width: 100%; max-width: 320px; }
  .flow__node--brand { transform: none; }
  .flow__node--brand:hover { transform: translateY(-3px); }
  .flow__link svg { transform: rotate(90deg); }
}

/* Offline section */
.offline-emblem {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 3rem auto 0;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 22px 50px -18px rgba(114, 175, 182, 0.6);
}
.offline-emblem svg { width: 52px; height: 52px; }
.offline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.offline-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, background 0.2s ease;
}
.offline-card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.1); }
.offline-card strong { display: block; color: #fff; font-size: 1rem; }
.offline-card span { color: rgba(234, 242, 242, 0.72); font-size: 0.85rem; }
.offline-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(114, 175, 182, 0.22);
  color: #bfe0e4;
}
.offline-card__icon svg { width: 24px; height: 24px; }

/* Footer */
.footer { background: #10191a; color: #cdd8d8; padding: clamp(3rem, 7vw, 5rem) var(--pad); }
.footer a { color: #cdd8d8; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__brand { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 0.75rem; }
.footer__contact, .footer__social { list-style: none; padding: 0; margin: 0 0 1rem; }
.footer__contact li, .footer__social li { margin-bottom: 0.35rem; }
.footer__social { display: flex; gap: 1.25rem; }
.footer__legal { font-size: 0.85rem; color: #7d8a8a; margin: 1rem 0 0; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
  .flow__link .ln { animation: none; }
  .planmock > i.motion::after { animation: none; }
}
