/* ============================================================
   SAFIVIO · Coming-soon site — shared design system
   Same field-instrument language as the "How it works" page:
   cool slate, brand blue (--brand) + synced green (--sync).
   Loaded by index.html and contact.html. how-it-works.html
   ships its own self-contained stylesheet (how-it-works.css).
   ============================================================ */

:root {
  /* dark (default) */
  --bg: #0d1017;
  --bg-2: #12161f;
  --surface: #161c27;
  --surface-2: #1e2533;
  --line: rgba(226, 232, 240, 0.11);
  --line-2: rgba(226, 232, 240, 0.052);
  --text: #e8ecf3;
  --muted: #98a3b4;
  --faint: #626d80;
  --brand: #4f8cff;           /* blue-500 — field / offline */
  --brand-ink: #ffffff;
  --brand-soft: rgba(79, 140, 255, 0.15);
  --sync: #46d07f;            /* green — cloud / online */
  --sync-soft: rgba(70, 208, 127, 0.14);
  --good: #46d07f;
  --danger: #f2795a;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --wrap: 1180px;
  --r: 14px;
  --ease: cubic-bezier(0.4, 0, 0.15, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fb;
    --bg-2: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f1f4f9;
    --line: rgba(15, 23, 42, 0.12);
    --line-2: rgba(15, 23, 42, 0.06);
    --text: #0f172a;
    --muted: #55617a;
    --faint: #8a93a6;
    --brand: #2563eb;
    --brand-ink: #ffffff;
    --brand-soft: rgba(37, 99, 235, 0.10);
    --sync: #16a34a;
    --sync-soft: rgba(22, 163, 74, 0.11);
    --good: #16a34a;
    --danger: #dc5b39;
  }
}
/* explicit toggle wins over the media query in both directions */
:root[data-theme="dark"] {
  --bg:#0d1017;--bg-2:#12161f;--surface:#161c27;--surface-2:#1e2533;
  --line:rgba(226,232,240,.11);--line-2:rgba(226,232,240,.052);--text:#e8ecf3;
  --muted:#98a3b4;--faint:#626d80;--brand:#4f8cff;--brand-ink:#fff;
  --brand-soft:rgba(79,140,255,.15);--sync:#46d07f;--sync-soft:rgba(70,208,127,.14);
  --good:#46d07f;--danger:#f2795a;
}
:root[data-theme="light"] {
  --bg:#f6f8fb;--bg-2:#eef1f6;--surface:#fff;--surface-2:#f1f4f9;
  --line:rgba(15,23,42,.12);--line-2:rgba(15,23,42,.06);--text:#0f172a;
  --muted:#55617a;--faint:#8a93a6;--brand:#2563eb;--brand-ink:#fff;
  --brand-soft:rgba(37,99,235,.10);--sync:#16a34a;--sync-soft:rgba(22,163,74,.11);
  --good:#16a34a;--danger:#dc5b39;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 17px;
  letter-spacing: -0.005em;
  min-height: 100vh;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: -13px -13px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.66rem; color: var(--faint); font-weight: 500; }
a { color: inherit; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 60; backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line-2); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 650; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.logo { width: 30px; height: 32px; display: block; flex: none; }
.logo .lg-shield { fill: var(--brand); }
.logo .lg-check { fill: none; stroke: #fff; stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.logo .lg-pulse { fill: none; stroke: var(--sync); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-links { display: flex; gap: 26px; font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.nav-links a { text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 760px) { .nav-links { display: none; } }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.btn { font-family: var(--sans); font-size: 0.9rem; font-weight: 600; border-radius: 9px; padding: 9px 16px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.1s, filter 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 650; }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--brand); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.icon-btn { width: 38px; height: 38px; padding: 0; justify-content: center; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 72px 0 30px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 34px; } }
.badge-soon { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.62rem; font-weight: 600; color: var(--sync); background: var(--sync-soft); border: 1px solid color-mix(in srgb, var(--sync) 40%, transparent); border-radius: 999px; padding: 6px 13px; margin-bottom: 24px; }
.badge-soon .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sync); box-shadow: 0 0 0 0 color-mix(in srgb, var(--sync) 70%, transparent); animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sync) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.4rem); line-height: 1.0; letter-spacing: -0.04em; font-weight: 720; margin: 0 0 20px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.24rem); color: var(--muted); max-width: 54ch; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

/* hero device mock (a stylised inspection) */
.mock { width: 100%; max-width: 380px; margin: 0 auto; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; box-shadow: 0 30px 70px -30px rgba(0,0,0,0.55), inset 0 0 0 1px var(--line-2); }
.mock-bar { height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line-2); background: var(--bg-2); font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.1em; color: var(--faint); }
.mock-bar .synced { display: inline-flex; align-items: center; gap: 6px; color: var(--sync); }
.mock-bar .synced::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sync); }
.mock-body { padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; background: var(--bg-2); font-size: 0.88rem; }
.mock-row.pass { background: var(--sync-soft); border-color: transparent; }
.mock-row.fail { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: transparent; }
.tag { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.08em; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }
.tag.pass { background: var(--good); color: #fff; }
.tag.fail { background: var(--danger); color: #fff; }
.mock-note { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 9px 11px; }

/* offline/online ribbon */
.ribbon { margin-top: 46px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 18px 22px; }
.ribbon-end { display: flex; align-items: center; gap: 12px; }
.ribbon-end.online { justify-content: flex-end; text-align: right; }
.node { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); }
.node.onsite { background: var(--brand-soft); color: var(--brand); }
.node.cloud { background: var(--sync-soft); color: var(--sync); }
.ribbon-lbl { font-weight: 640; font-size: 0.95rem; }
.ribbon-sub { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.wire { position: relative; height: 2px; background: var(--line); border-radius: 2px; min-width: 60px; overflow: hidden; }
.wire::before, .wire::after { content: ""; position: absolute; top: 0; height: 100%; width: 34%; background: linear-gradient(90deg, transparent, var(--brand), transparent); animation: flow 2.6s linear infinite; }
.wire::after { background: linear-gradient(90deg, transparent, var(--sync), transparent); animation: flowb 2.6s linear infinite; animation-delay: 1.3s; }
@keyframes flow { from { left: -34%; } to { left: 100%; } }
@keyframes flowb { from { left: 100%; } to { left: -34%; } }
@media (max-width: 560px) { .ribbon { grid-template-columns: 1fr; gap: 14px; text-align: left; } .ribbon-end.online { justify-content: flex-start; text-align: left; } .wire { display: none; } }

/* ---------- section heads + slabs ---------- */
.section-head { margin: 6px 0 30px; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -0.03em; margin: 10px 0 0; font-weight: 680; text-wrap: balance; }
.section-head.center { text-align: center; }
.slab { padding: 56px 0; border-top: 1px solid var(--line-2); }

.grid-feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fcard { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 22px; transition: border-color 0.2s, transform 0.2s; }
.fcard:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); transform: translateY(-2px); }
.fico { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 14px; }
.fcard h4 { margin: 0 0 8px; font-size: 1.05rem; letter-spacing: -0.01em; font-weight: 640; }
.fcard p { margin: 0; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

.aud-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.acard { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 28px; }
.acard h4 { margin: 0 0 8px; font-size: 1.28rem; letter-spacing: -0.02em; font-weight: 680; }
.acard > p { color: var(--muted); margin: 0 0 16px; }
.acard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.acard li { display: flex; gap: 10px; font-size: 0.93rem; }
.acard li::before { content: "✓"; color: var(--sync); font-weight: 700; flex: none; }

/* origin steps (3-up) */
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.scard { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 22px; }
.scard .n { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-weight: 700; display: grid; place-items: center; margin-bottom: 14px; }
.scard h4 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 640; }
.scard p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }
.flowstrip { margin-top: 26px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.flowstrip .chip { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; }
.flowstrip .chip.sync { color: var(--sync); border-color: color-mix(in srgb, var(--sync) 40%, transparent); background: var(--sync-soft); }
.flowstrip .arw { color: var(--faint); }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 17px 42px 17px 0; font-weight: 600; font-size: 1.01rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-family: var(--mono); color: var(--faint); font-size: 1.35rem; transition: transform 0.25s var(--ease); }
.faq details[open] summary { color: var(--brand); }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--brand); }
.faq details p { margin: -4px 0 18px; color: var(--muted); max-width: 66ch; line-height: 1.62; font-size: 0.96rem; }

@media (max-width: 900px) { .grid-feat, .steps3 { grid-template-columns: 1fr 1fr; } .aud-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-feat, .steps3 { grid-template-columns: 1fr; } }

/* ---------- notify / waitlist ---------- */
.notify { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 40px; max-width: 720px; margin: 0 auto; text-align: center; position: relative; overflow: hidden; }
.notify::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--brand), var(--sync), transparent); }
.notify h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.03em; margin: 0 0 10px; font-weight: 700; }
.notify p { color: var(--muted); margin: 0 auto 22px; max-width: 46ch; }
.inline-form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; flex-wrap: wrap; }
.inline-form input[type="email"] { flex: 1; min-width: 200px; }
.form-note { margin-top: 14px; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

/* ---------- form fields ---------- */
.field { display: block; margin-bottom: 16px; text-align: left; }
.field > span { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 7px; }
.field .opt { color: var(--faint); font-weight: 400; }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; font-family: var(--sans); font-size: 0.95rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 120px; }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* form status banners */
.status { border-radius: 12px; padding: 14px 16px; font-size: 0.92rem; margin: 0 0 4px; }
.status.ok { background: var(--sync-soft); border: 1px solid color-mix(in srgb, var(--sync) 35%, transparent); color: var(--sync); }
.status.err { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.sent-card { border: 1px solid color-mix(in srgb, var(--sync) 35%, transparent); background: var(--sync-soft); border-radius: 16px; padding: 34px; text-align: center; }
.sent-card .big { font-size: 2rem; margin-bottom: 6px; }
.sent-card h3 { margin: 0 0 8px; color: var(--text); }
.sent-card p { margin: 0; color: var(--muted); }

/* ---------- page hero (contact) ---------- */
.phead { padding: 66px 0 10px; text-align: center; }
.phead h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); letter-spacing: -0.035em; margin: 0 0 14px; font-weight: 720; }
.phead p { color: var(--muted); font-size: 1.1rem; max-width: 52ch; margin: 0 auto; }
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding: 40px 0 20px; align-items: start; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; gap: 24px; } }
.aside h3 { font-size: 0.98rem; margin: 0 0 6px; }
.aside p, .aside ul { color: var(--muted); font-size: 0.93rem; }
.aside ul { padding-left: 18px; margin: 6px 0 0; }
.aside .block { margin-bottom: 22px; }

/* ---------- cta ---------- */
.cta { padding: 84px 0 40px; text-align: center; }
.cta h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); letter-spacing: -0.035em; line-height: 1.02; margin: 0 auto 16px; max-width: 18ch; text-wrap: balance; font-weight: 700; }
.cta p { color: var(--muted); max-width: 48ch; margin: 0 auto 28px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line-2); padding: 34px 0 48px; margin-top: 40px; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot .mono { color: var(--faint); }
.foot-links { display: flex; gap: 20px; font-size: 0.88rem; color: var(--muted); }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--text); }

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