/* PulsIoT — marketing site
 *
 * Palette is taken from the product itself (client/src/index.css): brand
 * hsl(207 90% 47%) light / hsl(207 90% 54%) dark, so the site and the app read as
 * one product rather than two.
 *
 * No build step and no framework on purpose: a marketing page that needs npm to
 * change a headline does not get its headlines changed.
 */

:root {
  --brand: hsl(207 90% 47%);
  --brand-strong: hsl(207 90% 40%);
  --brand-soft: hsl(207 90% 96%);

  --ink: hsl(215 32% 14%);
  --ink-muted: hsl(215 16% 42%);
  --bg: hsl(0 0% 100%);
  --bg-elev: hsl(210 30% 98%);
  --line: hsl(214 25% 89%);

  --ok: hsl(151 62% 34%);
  --warn: hsl(38 92% 45%);
  --crit: hsl(0 72% 48%);

  --radius: 14px;
  --shadow: 0 1px 2px hsl(215 25% 12% / 0.06), 0 8px 24px hsl(215 25% 12% / 0.06);
  --maxw: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: hsl(207 90% 54%);
    --brand-strong: hsl(207 90% 47%);
    --brand-soft: hsl(213 30% 16%);

    --ink: hsl(210 30% 96%);
    --ink-muted: hsl(214 15% 65%);
    --bg: hsl(220 24% 9%);
    --bg-elev: hsl(220 20% 13%);
    --line: hsl(220 16% 22%);

    --shadow: 0 1px 2px hsl(0 0% 0% / 0.4), 0 8px 24px hsl(0 0% 0% / 0.3);
  }
}
:root[data-theme="dark"] {
  --brand: hsl(207 90% 54%);
  --brand-strong: hsl(207 90% 47%);
  --brand-soft: hsl(213 30% 16%);
  --ink: hsl(210 30% 96%);
  --ink-muted: hsl(214 15% 65%);
  --bg: hsl(220 24% 9%);
  --bg-elev: hsl(220 20% 13%);
  --line: hsl(220 16% 22%);
  --shadow: 0 1px 2px hsl(0 0% 0% / 0.4), 0 8px 24px hsl(0 0% 0% / 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
p  { margin: 0 0 1em; }
a  { color: var(--brand); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
/* The header is sticky at 64px, so an anchor jump parks the section heading directly
   underneath it. scroll-margin-top offsets the landing point instead of adding real
   space, so nothing shifts for a visitor who never uses the nav. */
.section, #top, [id] { scroll-margin-top: 84px; }
.section--tint { background: var(--bg-elev); border-block: 1px solid var(--line); }
.lede { font-size: 1.14rem; color: var(--ink-muted); max-width: 62ch; }
.eyebrow {
  font-size: .76rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand); margin-bottom: .6rem;
}

/* ── header ───────────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.brand svg { width: 26px; height: 26px; }
.nav__links { display: flex; gap: 24px; margin-left: auto; }
.nav__links a { color: var(--ink-muted); text-decoration: none; font-size: .94rem; font-weight: 550; }
.nav__links a:hover { color: var(--ink); }

/* Language switcher. Both languages are always visible rather than hidden behind a
   dropdown: on a bilingual island the reader should see their language immediately,
   not go looking for it. */
.lang { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.lang a {
  font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-decoration: none;
  color: var(--ink-muted); padding: 4px 9px; border-radius: 7px; line-height: 1.4;
}
.lang a:hover { color: var(--ink); }
.lang a.is-active { background: var(--brand); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-weight: 650; font-size: .95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-strong); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ── hero ─────────────────────────────────────────────────────────────── */
/* padding-block, not the padding shorthand: .hero is also .wrap, and a shorthand
   here resets .wrap's horizontal padding to 0. On desktop the max-width centring
   hides that; on mobile the text sits flush against the screen edge. */
.hero { padding-block: 92px 76px; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero__note { font-size: .88rem; color: var(--ink-muted); margin-top: 16px; }

/* Live-looking product panel, built from markup rather than a screenshot so it
   stays sharp and themes correctly. Values are illustrative. */
.panel {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel__bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.panel__title { font-size: .82rem; color: var(--ink-muted); margin-left: 6px; }
.panel__body { padding: 18px; display: grid; gap: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px;
}
.stat__label { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted); font-weight: 650; }
.stat__value { font-size: 1.34rem; font-weight: 750; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat__value--ok { color: var(--ok); }
.stat__value--crit { color: var(--crit); }

.rows { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px;
  font-size: .87rem;
}
.row__name { font-weight: 600; }
.row__temp { font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.pill { font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.pill--ok   { background: color-mix(in srgb, var(--ok) 14%, transparent);   color: var(--ok); }
.pill--warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill--crit { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit); }

/* ── generic grids ────────────────────────────────────────────────────── */
.grid { display: grid; gap: 22px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card__icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 14px;
}
.card__icon svg { width: 20px; height: 20px; }
.card p { color: var(--ink-muted); font-size: .95rem; margin: 0; }

/* ── how it works ─────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 40px; }
.step { position: relative; padding: 0 20px; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 19px; right: -12px; width: 24px; height: 2px;
  background: var(--line);
}
.step__num {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 750; margin-bottom: 14px;
}
.step h3 { margin-bottom: .35em; }
.step p { color: var(--ink-muted); font-size: .92rem; }

/* ── compliance list ──────────────────────────────────────────────────── */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.checks svg { width: 20px; height: 20px; color: var(--ok); margin-top: 2px; }
.checks strong { display: block; }
.checks span { color: var(--ink-muted); font-size: .93rem; }

/* ── cta ──────────────────────────────────────────────────────────────── */
.cta { text-align: center; }
.cta .hero__cta { justify-content: center; }

/* ── book a demo form ─────────────────────────────────────────────────── */
.demo { max-width: 720px; margin: 34px auto 0; text-align: left; }
.demo__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.demo label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--ink); }
.demo__wide { grid-column: 1 / -1; }
.demo__opt { font-weight: 500; color: var(--ink-muted); }
.demo input, .demo select, .demo textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%;
  min-height: 44px;
}
.demo textarea { resize: vertical; }
.demo input:focus, .demo select:focus, .demo textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.demo__submit { margin-top: 20px; width: 100%; padding-block: 13px; font-size: 1rem; }
.demo__note { margin-top: 12px; text-align: center; color: var(--ink-muted); font-size: .9rem; }
/* The honeypot: invisible to people, filled in by bots, which Netlify then discards. */
.demo__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── thank-you page ───────────────────────────────────────────────────── */
.thanks { text-align: center; padding-block: 110px 90px; }
.thanks .hero__cta { justify-content: center; }

/* ── footer ───────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--ink-muted); font-size: .9rem; }
.foot { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.foot__spacer { margin-left: auto; }
footer a { color: var(--ink-muted); text-decoration: none; }
footer a:hover { color: var(--brand); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero__grid, .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; gap: 28px 0; }
  .step:not(:last-child)::after { display: none; }
  .nav__links { display: none; }
  /* .lang deliberately stays: hiding the language toggle on phones would strand
     exactly the readers most likely to need it. */

  /* .nav__links carried the margin-left:auto that pushed the toggle and CTA to the
     right. Hiding it takes that auto margin with it, so brand + toggle + CTA pack
     left and the CTA runs off the viewport — measured 26px of horizontal overflow at
     375px in English, 54px at 360px in Spanish, where the label is longer. Move the
     auto margin to .brand and tighten the row. */
  .brand { margin-right: auto; }
  .demo__grid { grid-template-columns: 1fr; }
  .nav { gap: 12px; }
  .nav .btn--primary { padding: 11px 14px; font-size: .9rem; }
  .section { padding: 62px 0; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  header .wrap.nav { padding-inline: 16px; }
  .nav { gap: 10px; }
  .nav .btn--primary { padding: 11px 13px; font-size: .88rem; }
}

/* Below ~380px the Spanish CTA ("Solicite un piloto") is still about 32px wider than
   the English one and needs a further step down. Vertical padding stays at 11px
   throughout so the button holds ~45px — above the 44px touch-target floor — rather
   than shrinking to fit. */
@media (max-width: 380px) {
  header .wrap.nav { padding-inline: 12px; }
  .nav { gap: 8px; }
  .lang a { padding: 5px 7px; font-size: .74rem; }
  .nav .btn--primary { padding: 11px 11px; font-size: .82rem; }

  /* Drop the wordmark to just the logo mark. At 320px the Spanish CTA is 164px on
     its own; brand text + toggle + CTA cannot all fit, and shrinking the button
     further would take it under the 44px touch target. The mark stays a link to the
     top, so nothing is lost but the repeated word — and the page title carries the
     name anyway. */
  .brand { font-size: 0; }
  .brand svg { width: 24px; height: 24px; }
}

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