/* ══════════════════════════════════════════════════
   Brian's Smart Home — shared styles
   Palette lives in :root and is sampled from the logo
   (cyan #02d5fd, mint #70f89f, navy #172336). Change the tokens to re-skin.
   ══════════════════════════════════════════════════ */

:root {
  --bg: #060d1a;
  --bg-2: #0a1426;
  --panel: #0e1a30;
  --panel-2: #14233d;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .20);
  --text: #eef4f7;
  --muted: #a9bac5;
  --dim: #8496a2;
  --accent: #02d5fd;
  --accent-ink: #03111f;
  --accent-glow: rgba(2, 213, 253, .28);
  --accent-2: #70f89f;
  --accent-2-glow: rgba(112, 248, 159, .18);
  --radius: 16px;
  --maxw: 1200px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Brian is far-sighted: base text is 18px, nothing readable goes below ~14px. */
html { font-size: 112.5%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--font);
  background:
    radial-gradient(900px 520px at 12% -6%, var(--accent-glow), transparent 62%),
    radial-gradient(760px 480px at 100% 4%, var(--accent-2-glow), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #6fe6ff; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

.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: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--accent-2); color: #03111f; padding: 10px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6, 13, 26, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { height: 48px; width: auto; }
.brand-text { font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.brand-text b { color: var(--accent); font-weight: 800; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .94rem;
  padding: 10px 14px; border-radius: 10px;
}
.site-nav a:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav .btn { margin-left: 8px; color: var(--accent-ink); }
.site-nav .btn:hover { background: #6fe6ff; color: var(--accent-ink); }

.menu-btn {
  display: none; width: 48px; height: 48px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1rem;
  text-decoration: none; border: 2px solid var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow); transition: box-shadow .2s, transform .2s, background .2s;
}
.btn:hover { box-shadow: 0 8px 28px var(--accent-glow); transform: translateY(-1px); background: #6fe6ff; color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(2, 213, 253, .07); box-shadow: none; }
.btn.small { min-height: 44px; padding: 0 18px; font-size: .94rem; }

/* ── HERO ── */
.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: clamp(32px, 5vw, 72px); align-items: center; }

.kicker {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 20px;
  color: var(--accent); font-size: .82rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
}
.kicker::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 14px var(--accent-2); animation: glow 2.6s ease-in-out infinite;
}
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.4rem); line-height: 1.04; letter-spacing: -.025em;
  font-weight: 800; margin-bottom: 24px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(1.1rem, 1.7vw, 1.32rem); color: var(--muted); max-width: 40ch; margin-bottom: 32px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 14px; }

.figure-frame {
  background: #f6f6f2; border-radius: var(--radius); padding: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px var(--line-strong), 0 0 70px var(--accent-glow);
}
.figure-frame img { border-radius: 10px; width: 100%; }
.hero-figure figcaption, .diagram figcaption .note { color: var(--dim); font-size: .85rem; margin-top: 12px; text-align: center; }

/* ── FACT STRIP ── */
.facts { border-block: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.facts ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); }
.facts li { padding: 26px 22px; border-left: 1px solid var(--line); }
.facts li:first-child { border-left: 0; }
.facts strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.facts span { color: var(--muted); font-size: .92rem; }

/* ── SECTIONS ── */
section { padding: 80px 0; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em; font-weight: 800; margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 30px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(2, 213, 253, .45); transform: translateY(-3px); }
.card .num { color: var(--accent-2); font-weight: 800; font-size: .85rem; letter-spacing: .18em; text-transform: uppercase; }
.card h3 { font-size: 1.4rem; line-height: 1.2; letter-spacing: -.01em; }
.card p { color: var(--muted); flex: 1; }
.card .more { font-weight: 800; text-decoration: none; margin-top: 6px; }
.card .more:hover { text-decoration: underline; }

/* ── DIAGRAMS ── */
.diagram { margin: 0; }
.diagram figcaption h3 { font-size: 1.3rem; margin: 20px 0 8px; }
.diagram figcaption p { color: var(--muted); }
.diagram .figure-frame img { cursor: pointer; }
.diagram-link { text-decoration: none; display: block; }

.band { background: var(--bg-2); border-block: 1px solid var(--line); }

/* ── VIDEOS / ABOUT ── */
.callout {
  display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
  background: linear-gradient(135deg, rgba(2, 213, 253, .12), rgba(112, 248, 159, .08));
  border: 1px solid rgba(2, 213, 253, .35); border-radius: var(--radius); padding: 40px;
}
.callout h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; margin-bottom: 10px; letter-spacing: -.02em; }
.callout p { color: var(--muted); font-size: 1.08rem; max-width: 56ch; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 70px); align-items: start; }
.about p { color: var(--muted); font-size: 1.1rem; margin-bottom: 16px; }
.about-logo { width: min(100%, 320px); height: auto; margin: 0 auto 28px; filter: drop-shadow(0 18px 40px rgba(2, 213, 253, .22)); }
.about ul { list-style: none; display: grid; gap: 12px; }
.about li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px;
  color: var(--text); font-weight: 600;
}
.about li span { display: block; color: var(--muted); font-weight: 400; font-size: .95rem; }

/* ── PAGE HEADERS (inner pages) ── */
.page-head { padding: 64px 0 24px; }
.page-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.06; letter-spacing: -.025em; font-weight: 800; margin-bottom: 16px; }
.page-head p { color: var(--muted); font-size: 1.16rem; max-width: 62ch; }
.disclosure { color: var(--dim); font-size: .88rem; margin-top: 16px; }
.disclosure a { color: var(--muted); }

/* ── GEAR ── */
.gear-section { padding: 36px 0 8px; }
.gear-section h2 {
  font-size: 1.5rem; letter-spacing: -.01em; margin-bottom: 22px; display: flex; align-items: center; gap: 14px;
}
.gear-section h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.product {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .2s;
}
.product:hover { border-color: rgba(2, 213, 253, .45); transform: translateY(-3px); }
.product-img { background: #fff; height: 230px; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: hidden; }
.product-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.product-img.icon { background: linear-gradient(135deg, rgba(2, 213, 253, .18), rgba(2, 213, 253, .04)); }
.product-img.icon svg { width: 76px; height: 76px; }
.product-info { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-info h3 { font-size: 1.12rem; line-height: 1.3; }
.product-info p { color: var(--muted); font-size: .96rem; flex: 1; }
.product-info .btn { align-self: flex-start; margin-top: 6px; }

/* ── SETUP PAGE ── */
.setup-block { padding: 56px 0; border-top: 1px solid var(--line); }
.setup-block:first-of-type { border-top: 0; }
.setup-block .split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.setup-block .split.flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
.setup-block .split.flip > :first-child { order: 2; }
.setup-block h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.12; letter-spacing: -.02em; margin-bottom: 14px; }
.setup-block p { color: var(--muted); font-size: 1.08rem; margin-bottom: 14px; }
.setup-block ul { color: var(--muted); padding-left: 1.2em; margin-bottom: 14px; }
.setup-block li { margin-bottom: 6px; }
.map-note { color: var(--dim); font-size: .88rem; margin-top: 10px; text-align: center; }

/* ── FOOTER ── */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 56px 0 40px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h2 { font-size: .85rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { color: var(--muted); font-size: .95rem; max-width: 42ch; }
.footer-bottom { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--dim); font-size: .88rem; }

/* ── LEGAL / 404 PAGES ── */
.prose { max-width: 780px; padding: 56px 0 24px; }
.prose h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.08; margin-bottom: 20px; letter-spacing: -.02em; }
.prose h2 { font-size: 1.4rem; color: var(--accent); margin: 34px 0 10px; }
.prose p, .prose li { color: #d6e0e6; margin-bottom: 12px; }
.prose ul { padding-left: 1.2em; }

/* ── SCROLL REVEAL (only when JS is on) ── */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kicker::before { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .product { transition: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 980px) {
  .hero-grid, .about, .setup-block .split, .setup-block .split.flip { grid-template-columns: 1fr; }
  .setup-block .split.flip > :first-child { order: 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .facts ul { grid-template-columns: repeat(2, 1fr); }
  .facts li:nth-child(3) { border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .callout { grid-template-columns: 1fr; padding: 30px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 14px 24px 22px;
    background: var(--bg); border-bottom: 1px solid var(--line-strong); box-shadow: 0 24px 40px rgba(0, 0, 0, .5);
  }
  body.menu-open .site-nav { display: flex; }
  .site-nav a { padding: 14px 12px; font-size: 1.05rem; }
  .site-nav .btn { margin: 8px 0 0; }
  .hero { padding-top: 40px; }
  section { padding: 56px 0; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .facts li { padding: 20px 16px; }
  .facts strong { font-size: 1.15rem; }
  .brand-text { font-size: 1.02rem; }
}
