/* ===================== Design tokens ===================== */
:root {
  --bg: #0a0e14;
  --bg-alt: #10151d;
  --surface: #141a24;
  --surface-2: #1a212c;
  --border: #232b38;
  --text: #e8ecf1;
  --muted: #8b96a8;
  --accent: #38e0d8;
  --accent-2: #f5b942;
  --accent-soft: rgba(56, 224, 216, 0.12);
  --accent-2-soft: rgba(245, 185, 66, 0.14);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --border: #e2e5eb;
    --text: #161a20;
    --muted: #5a6472;
    --shadow: 0 20px 60px -25px rgba(20, 30, 50, 0.25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent-text { color: var(--accent); }

/* ===================== Background glow ===================== */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 15% 0%, rgba(56, 224, 216, 0.10), transparent 60%),
    radial-gradient(700px 500px at 90% 20%, rgba(245, 185, 66, 0.08), transparent 60%),
    radial-gradient(900px 600px at 50% 100%, rgba(56, 224, 216, 0.06), transparent 60%);
  pointer-events: none;
}

/* ===================== Header ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 1rem;
  color: var(--text);
}

.brand-mark { font-size: 1.3rem; }

.site-nav { display: flex; gap: 28px; }
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 0.82rem; }
}

/* ===================== Hero ===================== */
.hero {
  position: relative;
  padding: 120px 0 100px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(56, 224, 216, 0.25);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 40px;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #06201e;
  box-shadow: 0 8px 24px -8px rgba(56, 224, 216, 0.5);
}
.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(56, 224, 216, 0.65); }

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

.btn-small { padding: 9px 16px; font-size: 0.85rem; }

.arrow { display: inline-block; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: 14px;
}
.scroll-cue span {
  display: block;
  width: 4px;
  height: 8px;
  margin: 6px auto 0;
  border-radius: 2px;
  background: var(--accent);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 0; transform: translateY(10px); } 100% { opacity: 0; } }

/* ===================== Section shells ===================== */
section { padding: 90px 0; position: relative; }
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 48px;
  font-size: 1.02rem;
}

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

/* ===================== Explore / hotspot photo ===================== */
.explore { padding-top: 40px; }

.photo-stage { }

.photo-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  line-height: 0;
}
.photo-frame img { width: 100%; height: auto; }

.photo-caption {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 16px;
  font-style: italic;
}

.hotspot-layer { position: absolute; inset: 0; }

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(10, 14, 20, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hotspot::before,
.hotspot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
}
.hotspot::after {
  animation: pulse-ring 2.6s ease-out infinite;
}

.hotspot .dot-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px rgba(56, 224, 216, 0.8);
  transition: transform 0.2s ease;
}

.hotspot:hover .dot-core,
.hotspot.active .dot-core { transform: scale(1.3); }

.hotspot.active::before { border-color: var(--accent-2); }
.hotspot.active .dot-core { background: var(--accent-2); box-shadow: 0 0 12px 3px rgba(245, 185, 66, 0.8); }

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.9; }
  80% { transform: scale(2.1); opacity: 0; }
  100% { opacity: 0; }
}

/* tooltip */
.tooltip {
  position: fixed;
  z-index: 200;
  width: min(300px, 82vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.tooltip.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.tooltip-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  display: none;
}

.tooltip-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.tooltip-icon svg { width: 18px; height: 18px; }

.tooltip-title {
  font-size: 1.02rem;
  margin-bottom: 6px;
}
.tooltip-body {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 720px) {
  .tooltip-close { display: block; }
}

/* ===================== Card grid (smart home) ===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.tech-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.tech-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 224, 216, 0.35);
  box-shadow: 0 16px 34px -18px rgba(56, 224, 216, 0.25);
}

.tech-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.tech-icon svg { width: 22px; height: 22px; }

.tech-card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.tech-card p { color: var(--muted); font-size: 0.92rem; margin: 0 0 12px; }
.tech-card a.repo-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.tech-card a.repo-link:hover { text-decoration: underline; }

/* ===================== Dashboard preview ===================== */
.dashboard-preview {
  background: linear-gradient(180deg, transparent, var(--bg-alt) 20%, var(--bg-alt) 80%, transparent);
}
.dashboard-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.dashboard-copy .section-title,
.dashboard-copy .section-sub { text-align: left; margin-left: 0; }

@media (max-width: 860px) {
  .dashboard-inner { grid-template-columns: 1fr; }
}

.mock-dash {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.mock-dash-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.mock-dash-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ef4444; }
.dot.yellow { background: #f5b942; }
.dot.green { background: #38e0d8; }
.mock-dash-title { margin-left: 8px; font-size: 0.8rem; color: var(--muted); font-family: monospace; }

.mock-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.mock-tile {
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mock-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.mock-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }
.mock-value small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.mock-value.ok { color: var(--accent); font-size: 1.15rem; }
.mock-bar { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 4px; }
.mock-bar div { height: 100%; background: var(--accent); border-radius: 3px; }
.mock-dash-footnote {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 10px;
  border-top: 1px solid var(--border);
  opacity: 0.75;
}

/* ===================== Specs ===================== */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}
.spec-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.spec-group h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
}
.spec-group dl { margin: 0; }
.spec-group dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}
.spec-group dl > div:last-child { border-bottom: none; }
.spec-group dt { color: var(--muted); }
.spec-group dd { margin: 0; text-align: right; font-weight: 500; }

.npe-callout {
  background: linear-gradient(135deg, var(--accent-2-soft), transparent);
  border: 1px solid rgba(245, 185, 66, 0.3);
  border-radius: var(--radius);
  padding: 30px 34px;
}
.npe-callout h3 { color: var(--accent-2); font-size: 1.1rem; margin-bottom: 10px; }
.npe-callout p { margin: 0; color: var(--text); opacity: 0.85; max-width: 760px; }

/* ===================== Share ===================== */
.share-inner {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 50px;
  align-items: center;
}
.share-copy .section-title, .share-copy .section-sub { text-align: left; margin-left: 0; }

.share-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  max-width: 420px;
}
.share-link code {
  flex: 1;
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-card {
  background: #fff;
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.qr-card img { width: 180px; height: 180px; }

@media (max-width: 760px) {
  .share-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .share-copy .section-title, .share-copy .section-sub { text-align: center; }
  .share-link { margin: 0 auto; }
}

/* ===================== Footer ===================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
