/* ==========================================================================
   PuzL Labs — puzllabs.com
   Design system: Space Grotesk (display) + IBM Plex Sans/Mono (body/spec)
   Palette: ink navy / glacier mist / current teal / signal red (LED semantic)
   ========================================================================== */

:root {
  --ink: #10222e;
  --ink-2: #415863;
  --paper: #ffffff;
  --mist: #edf4f6;
  --mist-2: #e0ecef;
  --current: #17707f;
  --current-dark: #0e5460;
  --alert: #d6453d;
  --line: #c9d8dd;
  --shadow: 0 10px 30px rgba(16, 34, 46, 0.12);

  --display: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --body: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --caption: "Times New Roman", Times, serif;

  --maxw: 1140px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.35rem); font-weight: 700; }
h3 { font-size: 1.22rem; font-weight: 600; }
p  { margin: 0 0 1em; color: var(--ink-2); }
p strong { color: var(--ink); }

a { color: var(--current); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--current); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-mist { background: var(--mist); }
.section-ink { background: var(--ink); color: #dfeaee; }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink p { color: #b9ccd4; }

/* Spec eyebrow — mono label, the hardware spec-sheet voice */
.eyebrow {
  font-family: var(--mono);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--current);
  margin: 0 0 0.9rem;
  display: block;
}
.section-ink .eyebrow { color: #6fc2cf; }

/* Signature: the sensing line — a thin cable line ending in a pulsing LED dot */
.sense-line {
  display: flex; align-items: center; gap: 0;
  height: 10px; margin: 0 0 1.4rem; max-width: 190px;
}
.sense-line::before { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.sense-line::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--alert); margin-left: -2px;
  animation: led 2.4s ease-in-out infinite;
}
@keyframes led {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 69, 61, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(214, 69, 61, 0); }
}

/* ------------------------------ Header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: #000;
  border-bottom: 1px solid #1c1c1e;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 0.8rem var(--pad);
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: 1.9rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  font-family: var(--display); font-weight: 500; font-size: 0.98rem;
  color: #c9ced2; padding: 0.35rem 0;
}
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a[aria-current="page"] { color: #fff; border-bottom: 2px solid var(--alert); }
.nav-links .nav-cta {
  background: var(--current); color: #fff; padding: 0.55rem 1.25rem;
  border-radius: 999px; border: none;
}
.nav-links .nav-cta:hover { background: var(--current-dark); }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 0.5rem; margin: -0.5rem;
}
.nav-toggle svg { width: 26px; height: 26px; stroke: #fff; }

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #000; border-bottom: 1px solid #1c1c1e;
    display: none; padding: 0.5rem 0 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 0 var(--pad); }
  .nav-links a { display: block; padding: 0.8rem 0; font-size: 1.08rem; }
  .nav-links a[aria-current="page"] { border-bottom: none; color: #fff; }
  .nav-links .nav-cta { text-align: center; margin-top: 0.6rem; }
}

/* ------------------------------ Buttons ------------------------------ */
.btn {
  display: inline-block; font-family: var(--display); font-weight: 600;
  font-size: 1.02rem; padding: 0.8rem 1.7rem; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--current); color: #fff; }
.btn-primary:hover { background: var(--current-dark); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--current); color: var(--current); }
.section-ink .btn-ghost { border-color: #4a6b78; color: #fff; }
.section-ink .btn-ghost:hover { border-color: #6fc2cf; color: #6fc2cf; }
.btn-row { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* ------------------------------ Hero ------------------------------ */
.hero-splash {
  position: relative; color: #fff;
  background: url("../images/hero-house.jpg") 58% 88% / cover no-repeat;
  padding: clamp(4.5rem, 9vw, 7rem) 0 clamp(10rem, 22vw, 15rem);
}
.hero-splash::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8, 16, 22, 0.62) 0%, rgba(8, 16, 22, 0.38) 55%, rgba(8, 16, 22, 0.55) 100%);
}
.hero-splash .wrap { position: relative; text-align: left; }
.hero-logo {
  width: clamp(230px, 30vw, 380px); height: auto; display: block;
  margin: 0 0 1.6rem; filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.35));
}
.hero-splash h1 { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); font-size: clamp(2.3rem, 6vw, 4rem); max-width: 680px; }
.hero-splash .lede { color: #eef4f6; font-size: clamp(1.05rem, 2.2vw, 1.25rem); max-width: 560px; margin: 0 0 2rem; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); }
.hero-splash .btn-ghost { border-color: rgba(255, 255, 255, 0.65); color: #fff; }
.hero-splash .btn-ghost:hover { border-color: #fff; color: #fff; }
.hero-splash .spec-strip { color: #d7e2e6; max-width: 560px; }
.hero-splash .spec-strip b { color: #fff; }
.hero-splash .sense-line::before { background: rgba(255, 255, 255, 0.45); }

.hero { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-copy .lede { font-size: 1.2rem; margin-bottom: 1.8rem; }
.hero-img {
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.spec-strip {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin-top: 2rem;
  font-family: var(--mono); font-size: 0.82rem; color: var(--ink-2);
}
.spec-strip b { color: var(--ink); font-weight: 600; }
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-img { order: -1; }
}

/* ------------------------------ Stats ------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2.4rem; }
.stat {
  border-top: 2px solid var(--line); padding-top: 1rem;
}
.stat .num { font-family: var(--display); font-weight: 700; font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--ink); }
.stat .lbl { font-size: 0.95rem; color: var(--ink-2); margin-top: 0.2rem; }
.section-ink .stat { border-top-color: #35505c; }
.section-ink .stat .num { color: #fff; }
.section-ink .stat .lbl { color: #b9ccd4; }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------ Cards / grids ------------------------------ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.7rem; box-shadow: 0 2px 8px rgba(16, 34, 46, 0.04);
}
.card .icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--mist);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.card .icon svg { width: 24px; height: 24px; stroke: var(--current); }

.rounded-img { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
figure { margin: 0; }
figcaption {
  font-family: var(--caption); font-size: 0.92rem; font-style: italic; color: var(--ink-2);
  padding-top: 0.7rem;
}

/* ------------------------------ Steps ------------------------------ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; counter-reset: step; }
.step { counter-increment: step; border-top: 2px solid var(--line); padding-top: 1.1rem; position: relative; }
.step::before {
  content: "0" counter(step);
  font-family: var(--mono); font-size: 0.8rem; color: var(--alert);
  display: block; margin-bottom: 0.5rem;
}
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

/* ------------------------------ House cutaway ------------------------------ */
.cutaway-wrap { position: relative; max-width: 900px; margin: 2.5rem auto 0; }
.cutaway-svg { width: 100%; height: auto; display: block; }

.hotspot {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: var(--alert);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.85), 0 3px 10px rgba(16, 34, 46, 0.3);
  animation: led 2.4s ease-in-out infinite;
}
.hotspot::after {
  content: "+"; color: #fff; font-family: var(--display); font-weight: 700;
  font-size: 1.15rem; line-height: 1; position: absolute; inset: 0;
  display: grid; place-items: center;
}
.hotspot[aria-expanded="true"] { background: var(--current); animation: none; }
.hotspot[aria-expanded="true"]::after { content: "×"; }

.hotspot-pop {
  position: absolute; z-index: 30; width: min(300px, 78vw);
  background: #fff; border-radius: 14px; box-shadow: 0 18px 44px rgba(16, 34, 46, 0.28);
  overflow: hidden; display: none;
}
.hotspot-pop.show { display: block; }
.hotspot-pop, .callout-pop { text-align: left; }
@media (max-width: 640px) {
  .hotspot-pop {
    position: fixed; left: 50% !important; top: auto !important;
    bottom: 1rem; transform: translateX(-50%);
    width: min(320px, 88vw);
  }
  .hotspot-pop img { height: 136px; }
}
.hotspot-pop img { width: 100%; height: 168px; object-fit: cover; }
.hotspot-pop .pop-body { padding: 0.9rem 1.1rem 1.1rem; }
.hotspot-pop h4 { font-family: var(--display); font-size: 1.02rem; margin: 0 0 0.3rem; }
.hotspot-pop p { font-size: 0.9rem; margin: 0; line-height: 1.5; }

/* ------------------------------ Callout diagram (Technology) ------------------------------ */
.callout-stage {
  position: relative; max-width: 980px; margin: 2.5rem auto 0;
}
.callout-product {
  width: min(460px, 72%); margin: 0 auto; display: block;
  border-radius: 16px; box-shadow: var(--shadow);
}
.callouts {
  list-style: none; margin: 0; padding: 0;
}
.callout-btn {
  font-family: var(--display); font-weight: 500; font-size: 0.92rem;
  background: #fff; color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 0.5rem 1.05rem 0.5rem 0.85rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(16, 34, 46, 0.07);
  white-space: nowrap;
}
.callout-btn::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--alert); flex: none;
}
.callout-btn:hover, .callout-btn[aria-expanded="true"] {
  border-color: var(--current); color: var(--current);
}
.callout-pop {
  position: absolute; z-index: 30; width: min(320px, 84vw);
  background: var(--ink); color: #dfeaee; border-radius: 14px;
  box-shadow: 0 18px 44px rgba(16, 34, 46, 0.35);
  padding: 1.1rem 1.25rem; display: none;
}
.callout-pop.show { display: block; }
.callout-pop h4 { font-family: var(--display); font-size: 1rem; margin: 0 0 0.4rem; color: #fff; }
.callout-pop p, .callout-pop ul { font-size: 0.9rem; margin: 0; line-height: 1.55; color: #b9ccd4; }
.callout-pop ul { padding-left: 1.1rem; }

@media (min-width: 861px) {
  .callout-stage { padding-bottom: 96px; }
  .callouts li { position: absolute; }
  .callouts li.co-b { top: auto; bottom: 0; }
  /* leader lines from side chips toward the product */
  .callouts .co-l::after, .callouts .co-r::after {
    content: ""; position: absolute; top: 50%; height: 1.5px;
    background: var(--line); pointer-events: none;
  }
  .callouts .co-l::after { left: 100%; width: 88px; }
  .callouts .co-r::after { right: 100%; width: 44px; }
}
@media (max-width: 860px) {
  .callout-stage { display: flex; flex-direction: column; gap: 1.5rem; }
  .callouts { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
  .callout-pop { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); }
}

/* ------------------------------ FAQ accordion ------------------------------ */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
  border-bottom: 1px solid var(--line); padding: 0.35rem 0;
}
.faq summary {
  font-family: var(--display); font-weight: 600; font-size: 1.08rem;
  padding: 0.9rem 2.2rem 0.9rem 0; cursor: pointer; list-style: none;
  position: relative; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.2rem; top: 50%;
  transform: translateY(-50%);
  font-weight: 500; color: var(--current); font-size: 1.4rem;
}
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 0 1.2rem; }
.faq .faq-a p:last-child { margin-bottom: 0; }
.short-answer { font-family: var(--mono); font-size: 0.8rem; color: var(--alert); letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 0.4rem; }

/* ------------------------------ App section ------------------------------ */
.app-screens { display: flex; gap: 1.4rem; justify-content: center; align-items: flex-start; }
.app-screens img {
  width: min(220px, 28vw); border-radius: 22px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.app-screens img:nth-child(2) { margin-top: 2rem; }
@media (max-width: 640px) {
  .app-screens { flex-wrap: wrap; }
  .app-screens img { width: min(240px, 70vw); margin: 0 !important; }
}

/* ------------------------------ Buy page ------------------------------ */
.product-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: clamp(1.5rem, 4vw, 3rem); box-shadow: var(--shadow);
}
.price { font-family: var(--display); font-size: 2.1rem; font-weight: 700; margin: 0.4rem 0 1.2rem; }
.price .unit { font-family: var(--mono); font-size: 0.85rem; font-weight: 400; color: var(--ink-2); }
.buylist { list-style: none; padding: 0; margin: 0 0 1.6rem; }
.buylist li { padding: 0.32rem 0 0.32rem 1.7rem; position: relative; color: var(--ink-2); }
.buylist li::before {
  content: ""; position: absolute; left: 0; top: 0.72em; width: 9px; height: 9px;
  border-radius: 50%; background: var(--current);
}
@media (max-width: 800px) { .product-card { grid-template-columns: 1fr; } }

/* ------------------------------ Footer ------------------------------ */
.site-footer {
  background: var(--ink); color: #b9ccd4; padding: 3rem 0 2rem;
  font-size: 0.95rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { font-family: var(--display); color: #fff; font-size: 1rem; margin: 0 0 0.8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.4rem 0; }
.site-footer a { color: #b9ccd4; }
.site-footer a:hover { color: #fff; }
.footer-note {
  border-top: 1px solid #2a4450; margin-top: 2.4rem; padding-top: 1.4rem;
  font-family: var(--mono); font-size: 0.75rem; color: #7d97a2;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.social a { display: inline-flex; align-items: center; gap: 0.5rem; }
.social svg { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* ------------------------------ Reveal on scroll (subtle) ------------------------------ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ------------------------------ Page hero (interior pages) ------------------------------ */
.page-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.page-hero p { max-width: 640px; font-size: 1.15rem; }

.center { text-align: center; }
.center .sense-line, .center .eyebrow { margin-left: auto; margin-right: auto; }
.center .sense-line { justify-content: center; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* ------------------------------ Gallery ------------------------------ */
.gallery-grid { columns: 3; column-gap: 1.6rem; }
.gallery-grid figure {
  break-inside: avoid; margin: 0 0 1.6rem;
}
.gallery-grid img {
  width: 100%; height: auto; display: block; border-radius: 12px;
  box-shadow: 0 8px 26px rgba(16, 34, 46, 0.12);
}
@media (max-width: 980px) { .gallery-grid { columns: 2; } }
@media (max-width: 600px) { .gallery-grid { columns: 1; } }

/* Availability */
.avail {
  font-family: var(--mono); font-size: 0.9rem; color: var(--current);
  font-weight: 500; margin: -0.6rem 0 1.2rem;
}
.product-card { position: relative; }

/* App screenshot strip */
.app-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; max-width: 1060px; }
.app-strip img {
  width: 100%; height: auto; display: block; border-radius: 14px;
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(16, 34, 46, 0.12);
}
@media (max-width: 980px) { .app-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .app-strip { grid-template-columns: repeat(2, 1fr); } }
