/* Pyra marketing site — "warm guardian". Vanilla CSS, no framework. */

/* ---- Self-hosted Watch faces (SIL OFL), vendored in assets/fonts/ — never a CDN ---- */
@font-face {
  font-family: "Fraunces"; src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* Watch palette (light) */
  --bg: #EAE5DC;
  --surface: #FBF9F4;
  --surface-2: #F2EDE5;
  --ink: #25262A;
  --muted: #63646A;
  --faint: #6C665B;
  --coral: #D9542C;        /* brand hue — outline, mark, decorative */
  --coral-ink: #AB3F21;    /* coral TEXT (WCAG AA on warm grounds) */
  --coral-btn: #BE4A22;    /* filled CTA bg (white text, AA) */
  --coral-dark: #A23E1A;   /* CTA hover */
  --line: rgba(37, 38, 42, 0.13);
  /* semantic text (on light) */
  --ok: #3E7C5A;
  --ochre: #8A5E12;
  --alarm: #A81E12;
  /* signal colours for the dark camera scene (bright, on dark) */
  --sig-calm: #6FB98E;   /* NORMAL */
  --sig-amber: #D6A54A;  /* SUSPECTED */
  --sig-red: #F0553C;    /* CONFIRMED */
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --shadow: 0 10px 30px -12px rgba(50, 42, 34, 0.20);
  --shadow-sm: 0 4px 14px -8px rgba(50, 42, 34, 0.22);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.4em; font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
a { color: inherit; }

section { padding: clamp(3.5rem, 8vw, 6.5rem) 1.5rem; }
.section-label {
  font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--coral-ink); font-weight: 700; margin: 0 0 0.5rem;
}
.section-lead { font-size: 1.15rem; color: var(--muted); max-width: 42ch; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; font-weight: 700; font-size: 1rem; text-decoration: none;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--coral-btn); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--coral-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--coral); color: var(--coral-ink); }
.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.92rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---- Accessibility ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; z-index: 100;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(234, 229, 220, 0.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; text-decoration: none; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.wordmark-mark { display: inline-flex; width: 26px; height: 26px; color: var(--ink); }
.wordmark-mark svg { width: 100%; height: 100%; }
.footer-brand .wordmark-mark { width: 22px; height: 22px; }
.nav { display: flex; align-items: center; gap: clamp(0.6rem, 2vw, 1.4rem); flex-wrap: nowrap; }
.nav > a { text-decoration: none; color: var(--muted); font-size: 0.95rem; font-weight: 600; white-space: nowrap; }
/* Longer Romanian labels must never wrap or push the CTA off-screen. Below the breakpoint the two
   secondary text links collapse, leaving the wordmark, language toggle and Book-a-demo button. */
@media (max-width: 820px) {
  .nav > a:not(.btn) { display: none; }
}
.nav > a:hover { color: var(--ink); }
.nav .btn-primary { color: #fff; }
.lang-toggle {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 0.35rem 0.7rem; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; font-family: inherit; letter-spacing: 0.03em;
}
.lang-toggle:hover { border-color: var(--coral); color: var(--coral-ink); }
.lang-sep { opacity: 0.5; margin: 0 0.15em; }
/* active language emphasised by JS via [data-lang] on <html> */
html[lang="en"] .lang-en, html[lang="ro"] .lang-ro { color: var(--coral-ink); }

/* ---- Hero ---- */
.hero {
  display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  max-width: var(--maxw); margin: 0 auto; grid-template-columns: 1fr;
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}
.eyebrow { color: var(--coral-ink); font-weight: 700; letter-spacing: 0.04em; font-size: 0.9rem; margin: 0 0 0.6rem; }
.hero .lead { font-size: 1.25rem; color: var(--muted); max-width: 40ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.6rem 0 1rem; }
.hero-trust { font-size: 0.9rem; color: var(--faint); }

/* camera frame (hero + reused visual language) */
.cam-frame, .scene {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #3c4147, #22262b); box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
}
.cam-room, .scene-room {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,240,220,0.10), transparent 60%),
    linear-gradient(180deg, #444a51 0%, #2a2f34 70%, #23272c 100%);
  display: flex; align-items: flex-end; padding: 1rem;
}
.cam-chip, .scene-chip {
  position: absolute; top: 0.8rem; left: 0.8rem; z-index: 3;
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.16);
  color: #e9edf0; font-size: 0.72rem; letter-spacing: 0.12em; font-weight: 700;
  padding: 0.28rem 0.6rem; border-radius: 6px; backdrop-filter: blur(2px);
}
.cam-caption, .scene .scene-caption { color: #cfd5da; font-size: 0.75rem; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--sig-calm); box-shadow: 0 0 0 3px rgba(111,174,134,0.25); }
.dot--calm { background: var(--sig-calm); }

/* ---- Stakes ---- */
.stakes { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stakes-inner { max-width: var(--maxw); margin: 0 auto; }
.stakes h2 { max-width: 18ch; }

/* ---- Story (scroll-driven) ---- */
.story { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2rem; grid-template-columns: 1fr; }
.story-sticky { position: sticky; top: 84px; align-self: start; }
.scene-room { overflow: hidden; }
.scene-flame {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%) scale(0.2);
  width: 46%; height: 55%; opacity: 0; transition: opacity 0.5s ease, transform 0.6s ease;
  background: radial-gradient(50% 60% at 50% 80%, #ffd24a 0%, #ff8a1e 38%, #e23b2e 68%, rgba(226,59,46,0) 78%);
  filter: blur(2px); border-radius: 50% 50% 45% 45%;
}
.scene-box {
  position: absolute; left: 30%; bottom: 6%; width: 40%; height: 60%;
  border: 2px solid var(--sig-amber); border-radius: 4px; opacity: 0; transform: scale(1.08);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.06);
}
.scene-alert {
  position: absolute; right: 0.8rem; bottom: 0.8rem; z-index: 4; max-width: 62%;
  background: var(--surface-2); color: var(--ink); border-radius: var(--radius-sm);
  border: 1px solid var(--line); box-shadow: var(--shadow); padding: 0.7rem 0.9rem;
  opacity: 0; transform: translateY(12px); transition: opacity 0.4s ease, transform 0.4s ease;
}
.scene-alert-title { margin: 0 0 0.15rem; font-weight: 800; font-size: 0.95rem; }
.scene-alert-meta { margin: 0 0 0.2rem; font-size: 0.78rem; color: var(--muted); }
.scene-alert-ev { margin: 0; font-size: 0.74rem; color: var(--faint); }

/* state machine — classes toggled by story.js */
.scene.is-suspected .scene-flame { opacity: 0.7; transform: translateX(-50%) scale(0.7); }
.scene.is-suspected .scene-box { opacity: 1; transform: scale(1); }
.scene.is-suspected .dot { background: var(--sig-amber); box-shadow: 0 0 0 3px rgba(240,160,32,0.3); }
.scene.is-confirmed .scene-flame { opacity: 1; transform: translateX(-50%) scale(1); }
.scene.is-confirmed .scene-box { opacity: 1; transform: scale(1); border-color: var(--sig-red); }
.scene.is-confirmed .dot { background: var(--sig-red); box-shadow: 0 0 0 3px rgba(226,59,46,0.32); }
.scene.is-confirmed .scene-alert { opacity: 1; transform: translateY(0); }

.story-steps { display: grid; gap: 1.25rem; }
.story-step {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; transition: border-color 0.25s ease, background 0.25s ease;
}
.story-step[data-state="suspected"] { border-left-color: var(--sig-amber); }
.story-step[data-state="confirmed"] { border-left-color: var(--sig-red); }
.story-step h3 { margin-bottom: 0.25rem; }
.story-step p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---- How it works ---- */
.how { max-width: var(--maxw); margin: 0 auto; }
.steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border-radius: 999px; background: var(--coral-btn); color: #fff; font-family: var(--font-display); font-weight: 600; margin-bottom: 0.7rem;
}
.step p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---- Why trust it ---- */
.why { max-width: var(--maxw); margin: 0 auto; }
.why-grid, .fit-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; margin-top: 2rem; }
.why-card, .fit-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
}
.why-card h3, .fit-card h3 { color: var(--ink); }
.why-card p, .fit-card p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---- Fit ---- */
.fit { max-width: var(--maxw); margin: 0 auto; }
.fit-note { margin-top: 1.5rem; color: var(--faint); font-size: 0.95rem; }

/* ---- Live demo section ---- */
.book { background: var(--surface); border-top: 1px solid var(--line); }
.book-inner { max-width: var(--maxw); margin: 0 auto; }

/* ---- Footer ---- */
.site-footer { background: var(--bg); border-top: 1px solid var(--line); padding: 2.5rem 1.5rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; color: var(--faint); }
.footer-brand { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); margin-bottom: 0.5rem; }
.footer-note { max-width: 52ch; margin: 0 auto 0.6rem; font-size: 0.9rem; }
.footer-legal { font-size: 0.82rem; }

/* ---- Responsive ---- */
@media (min-width: 760px) {
  .why-grid, .fit-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 920px) {
  .hero { grid-template-columns: 1.05fr 0.95fr; }
  .story { grid-template-columns: 0.95fr 1.05fr; align-items: start; }
  .story-steps { padding-top: 1rem; }
}

/* ---- Reduced motion: no scroll animation; show the confirmed end-state legibly ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .scene-flame, .scene-box, .scene-alert { transition: none; }
  .scene.is-normal .scene-flame { opacity: 0.85; transform: translateX(-50%) scale(0.9); }
  .scene.is-normal .scene-box { opacity: 1; transform: scale(1); }
  .scene.is-normal .scene-alert { opacity: 1; transform: none; }
}

/* ---- Live demo grid ---- */
.live-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-top: 2rem; }
.live-fallback { grid-column: 1 / -1; text-align: center; color: var(--faint); padding: 2.5rem 1rem; }
.live-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.live-frame { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(160deg, #2b2622, #22262b); }
.live-snap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.live-boxes { position: absolute; inset: 0; pointer-events: none; }
.det-box { position: absolute; border: 2px solid; box-sizing: border-box; border-radius: 2px; }
.det-box--fire { border-color: var(--sig-red); }
.det-box--smoke { border-color: var(--sig-amber); }
.det-box--unknown { border-color: #bbb; }
.det-box__label { position: absolute; top: 0; left: 0; font: 600 10px/1.3 var(--font-mono); padding: 1px 5px; border-radius: 0 0 3px 0; white-space: nowrap; color: #fff; }
.det-box--fire .det-box__label { background: var(--sig-red); }
.det-box--smoke .det-box__label { background: var(--sig-amber); color: #201c18; }
.det-box--unknown .det-box__label { background: #888; }
.live-chip { position: absolute; top: .6rem; right: .6rem; font: 700 .68rem/1 var(--font); letter-spacing: .08em; padding: .32rem .6rem; border-radius: 999px; }
.live-chip--normal { background: #E5EDE5; color: var(--ok); }
.live-chip--suspected { background: #F0E7D2; color: var(--ochre); }
.live-chip--confirmed { background: var(--alarm); color: #fff; }
.live-chip--cleared { background: #ece7df; color: var(--muted); }
.live-cap { padding: .6rem .8rem; font-size: .82rem; color: var(--muted); font-weight: 600; }
@media (max-width: 640px) { .live-grid { grid-template-columns: 1fr; } }

/* Hero preview: a live snapshot of the calm demo camera (falls back to the static scene). */
.hero-snap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hero-snap:not([src]) { display: none; }
.cam-frame--calm .cam-caption { position: relative; z-index: 2; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
