/* ErzoLab – shared styles for all pages */
:root {
  --bg: #fbfbfd; --bg-alt: #f5f5f7; --fg: #1d1d1f; --muted: #6e6e73; --card: #ffffff;
  --line: #d2d2d7; --accent: #0071e3; --brand: #ec771c; --tile: #f5f5f7;
  --radius: 22px; --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --bg-alt: #0d0d0f; --fg: #f5f5f7; --muted: #a1a1a6; --card: #1c1c1e;
          --line: #38383a; --accent: #2997ff; --tile: #1c1c1e; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Navigation ---- */
nav.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
nav.top .in { max-width: var(--max); margin: 0 auto; padding: 0 20px; height: 52px;
  display: flex; align-items: center; gap: 24px; font-size: 14px; }
nav.top .brand { font-weight: 600; font-size: 17px; color: var(--fg); margin-right: auto; }
nav.top .brand span { color: var(--brand); }
nav.top a { color: var(--fg); opacity: .8; }
nav.top a:hover { opacity: 1; text-decoration: none; }
nav.top .cta { background: var(--accent); color: #fff; opacity: 1; padding: 5px 14px; border-radius: 980px; }
@media (max-width: 640px) { nav.top .hide-s { display: none; } }

/* ---- Layout ---- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
section { padding: 88px 0; }
section.alt { background: var(--bg-alt); }
.center { text-align: center; }
.eyebrow { color: var(--brand); font-weight: 600; letter-spacing: .02em; margin: 0 0 10px; }
h1 { font-size: clamp(44px, 8vw, 80px); line-height: 1.04; letter-spacing: -.025em; margin: 0 0 16px; }
h2 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 16px; }
h3 { font-size: 21px; line-height: 1.25; margin: 0 0 8px; }
.lead { font-size: clamp(19px, 2.4vw, 24px); color: var(--muted); margin: 0 auto 32px; max-width: 36em; }
.muted { color: var(--muted); }

/* ---- Hero ---- */
.hero { padding: 72px 0 40px; text-align: center; overflow: hidden; }
.hero img { width: min(1100px, 100%); margin: 8px auto 0; }
/* Soft fade at the bottom of renders, so the shadow has no hard edge */
.fade { -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent); mask-image: linear-gradient(to bottom, #000 75%, transparent); }
.actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.button, esp-web-install-button button {
  display: inline-block; appearance: none; border: 0; border-radius: 980px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 500; padding: 12px 24px;
}
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.button:hover { text-decoration: none; filter: brightness(1.08); }

/* ---- Cards & grids ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.card p { margin: 0 0 12px; color: var(--muted); }
.card p:last-child { margin-bottom: 0; }
a.card { display: block; color: inherit; transition: transform .25s, border-color .25s; }
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.tile { background: #ffffff; border-radius: var(--radius); overflow: hidden; }
.icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); margin-bottom: 16px; }
.icon svg { width: 22px; height: 22px; }

/* ---- Big numbers ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 40px 0 0; padding: 0; list-style: none; }
.stats li { border-top: 1px solid var(--line); padding-top: 14px; }
.stats b { display: block; font-size: 34px; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: 15px; }

/* ---- Colour gallery ---- */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 40px; }
.swatch { background: #ffffff; border-radius: var(--radius); padding: 18px 18px 22px; color: #1d1d1f; }
.swatch img { margin: 0 auto 8px; }
.swatch .name { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); display: inline-block; }

/* ---- Steps ---- */
.steps { counter-reset: s; }
.steps .card { position: relative; padding-top: 64px; }
.steps .card::before { counter-increment: s; content: counter(s); position: absolute; top: 24px; left: 28px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--fg); color: var(--bg);
  display: grid; place-items: center; font-weight: 600; font-size: 15px; }

/* ---- Home Assistant mock card ---- */
.ha { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px;
  max-width: 420px; margin: 0 auto; box-shadow: 0 20px 50px rgba(0,0,0,.08); font-size: 15px; }
.ha .t { font-weight: 600; margin-bottom: 8px; }
.ha .row { gap: 16px; display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); }
.ha .row:first-of-type { border-top: 0; }
.ha .k { display: flex; align-items: center; gap: 12px; }
.ha .k i { width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent); display: grid; place-items: center; font-style: normal; font-size: 14px; }
.ha .v { color: var(--muted); }
.toggle { width: 36px; height: 20px; border-radius: 10px; background: var(--accent); position: relative; }
.toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }

/* ---- Specs table ---- */
table.specs { width: 100%; border-collapse: collapse; font-size: 16px; }
table.specs th, table.specs td { text-align: left; padding: 14px 0; border-top: 1px solid var(--line); vertical-align: top; }
table.specs th { width: 34%; font-weight: 600; padding-right: 20px; }
table.specs td { color: var(--muted); }

.version { font-size: 14px; color: var(--muted); margin-top: 12px; }
footer { color: var(--muted); font-size: 13px; padding: 40px 20px; border-top: 1px solid var(--line); }
footer .wrap { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

/* Hide fallback messages until the install button script has loaded */
esp-web-install-button:not(:defined) [slot="unsupported"],
esp-web-install-button:not(:defined) [slot="not-allowed"] { display: none; }
@media (prefers-color-scheme: dark) { .hero img.fade, img.fade { filter: brightness(.96); } }
