/* PurityFlow: dashboard industrial, biru air, minim gimmick */
:root{
  --blue-900: #0c3a5c;
  --blue-700: #0e6ba8;
  --blue-600: #0284c7;
  --blue-500: #0ea5e9;
  --blue-100: #e0f2fe;
  --ink: #0b2033;
  --muted: #52697d;
  --line: #d7e6ef;
  --bg: #f3f9fc;
  --panel: #ffffff;
  --good: #16a34a;
  --ok: #0891b2;
  --fair: #d97706;
  --bad: #ea580c;
  --warn: #dc2626;
  --radius: 10px;
  --shadow: 0 4px 14px rgba(12,58,92,.08);
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.container{ max-width: 1120px; margin: 0 auto; padding: 0 20px; }

a{ color: var(--blue-700); }

/* ===== TOPBAR ===== */
.topbar{
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(6px);
  position: sticky; top:0; z-index:20;
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 20px; max-width:1120px; margin:0 auto; gap:16px; flex-wrap:wrap;
}
.brand-mark{ display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; }
.brand-mark .logo-dot{
  width:32px; height:32px; border-radius:9px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
  display:grid; place-items:center; color:#fff; font-weight:800; font-size:14px;
}
.brand-mark .name{ font-weight:800; font-size:16px; letter-spacing:.2px; }
.brand-mark .name small{ display:block; font-weight:500; font-size:11px; color:var(--muted); letter-spacing:.4px; text-transform:uppercase; }
.back-link{ font-size:13.5px; color: var(--muted); text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.back-link:hover{ color: var(--blue-700); }

/* ===== HERO ===== */
.hero{
  padding: 64px 0 52px;
  display:grid; grid-template-columns: 1.1fr .9fr; gap:48px; align-items:center;
  background-image: radial-gradient(circle, rgba(2,132,199,.12) 1px, transparent 1px);
  background-size: 22px 22px;
}
.hero .eyebrow{ text-transform:uppercase; letter-spacing:.12em; font-size:12px; font-weight:700; color: var(--blue-700); margin:0 0 10px; }
.hero h1{ margin:0 0 10px; font-size: clamp(28px, 4vw, 42px); line-height:1.15; letter-spacing:-.01em; }
.hero p.lead{ margin:0 0 22px; color: var(--muted); font-size: 17px; max-width: 62ch; }
.hero-tags{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:22px; }
.tag{
  font-size:12.5px; font-weight:600; padding:5px 10px; border-radius:999px;
  border:1px solid var(--line); background:#fff; color: var(--blue-900);
}
.hero-cta-row{ display:flex; flex-wrap:wrap; gap:10px; }
.hero-cta-row .btn{ text-decoration:none; }

/* ===== HERO DEVICE MOCKUP ===== */
.hero-device{ display:flex; flex-direction:column; align-items:center; gap:14px; }
.device-panel{
  width:100%; max-width:340px;
  background: linear-gradient(180deg, #16324d, var(--blue-900));
  border-radius: 20px;
  padding: 18px 18px 20px;
  box-shadow: 0 24px 48px rgba(11,32,51,.32), inset 0 1px 0 rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
}
.device-topline{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.device-chip{
  font-family: var(--mono); font-size:11px; font-weight:700; color:#bfe0ff;
  background: rgba(255,255,255,.08); padding:3px 8px; border-radius:6px; letter-spacing:.05em;
}
.device-leds{ display:flex; gap:6px; }
.led{ width:8px; height:8px; border-radius:50%; display:inline-block; }
.led-ok{ background:#22c55e; box-shadow:0 0 6px rgba(34,197,94,.8); }
.led-info{ background:#38bdf8; box-shadow:0 0 6px rgba(56,189,248,.8); }
.device-screen{
  background:#0a1c2e; border-radius:8px; padding:12px 14px; margin-bottom:16px;
  font-family: var(--mono); color:#8fd6ff; font-size:12.5px; line-height:1.8;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.4);
}
.device-screen-line{ white-space:pre; }
.device-screen-line.dim{ color:#2f5470; }
.device-controls{ display:flex; align-items:center; justify-content:space-between; }
.device-knob{
  width:46px; height:46px; border-radius:50%;
  background: radial-gradient(circle at 35% 30%, #cfe4f5, #7fa8c9 60%, #4f7495);
  box-shadow: 0 3px 6px rgba(0,0,0,.4), inset 0 -2px 3px rgba(0,0,0,.25);
  position:relative;
}
.device-knob span{
  position:absolute; top:6px; left:50%; width:3px; height:12px;
  background:#33526e; transform:translateX(-50%); border-radius:2px;
}
.device-buttons{ display:flex; gap:8px; }
.device-btn{
  font-size:11px; font-weight:700; color:#dbeafe; background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14); padding:6px 12px; border-radius:7px;
}
.device-caption{ font-size:12.5px; color: var(--muted); text-align:center; max-width:280px; }

@media (max-width: 860px){
  .hero{ grid-template-columns: 1fr; }
  .hero-device{ order:-1; }
}

/* ===== SECTION ===== */
.section{ padding: 44px 0; border-top: 1px solid var(--line); }
.section-head{ margin-bottom: 22px; max-width: 68ch; }
.section-head .kicker{ text-transform:uppercase; letter-spacing:.1em; font-size:11.5px; font-weight:700; color: var(--blue-700); margin:0 0 6px; }
.section-head h2{ margin:0 0 8px; font-size: clamp(20px,2.4vw,26px); }
.section-head p{ margin:0; color: var(--muted); font-size:15px; }

.grid-3{ display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.grid-2{ display:grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap:16px; }

.panel{
  background: var(--panel); border:1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.panel h3{ margin:0 0 8px; font-size:15.5px; }
.panel p{ margin:0; color: var(--muted); font-size:14px; }
.panel .icon-chip{
  width:36px;height:36px;border-radius:9px; display:grid; place-items:center;
  background: var(--blue-100); color: var(--blue-700); margin-bottom:10px;
}
.panel .icon-chip svg{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

.checklist{ list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.checklist li{ display:flex; gap:10px; align-items:flex-start; color: var(--ink); font-size:14.5px; }
.checklist li svg{ flex-shrink:0; margin-top:2px; width:16px; height:16px; fill:none; stroke: var(--blue-600); stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }

/* ===== DASHBOARD DEMO ===== */
.demo{
  background: var(--blue-900);
  border-radius: 16px;
  padding: 4px;
  box-shadow: 0 20px 40px rgba(11,32,51,.25);
}
.demo-inner{ background: var(--panel); border-radius: 13px; overflow:hidden; }
.demo-tabs{
  display:flex; gap:2px; padding: 10px 10px 0; background: #f3f8fb; overflow-x:auto;
}
.demo-tab{
  appearance:none; border:none; background:transparent; cursor:pointer;
  padding: 10px 14px; font: inherit; font-weight:600; font-size:13.5px; color: var(--muted);
  border-radius: 8px 8px 0 0; white-space:nowrap;
}
.demo-tab.active{ background: var(--panel); color: var(--blue-900); }
.demo-body{ padding: 22px; }
.demo-panel{ display:none; }
.demo-panel.active{ display:block; }

.status-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.status-badge{
  display:inline-flex; align-items:center; gap:7px; font-weight:700; font-size:13px;
  padding:6px 12px; border-radius:999px; background: var(--blue-100); color: var(--blue-900);
}
.status-badge .dot{ width:7px; height:7px; border-radius:50%; background: var(--blue-600); }
.status-badge.filling{ background:#fef3c7; color:#92400e; }
.status-badge.filling .dot{ background:#d97706; animation: pulse 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce){ .status-badge.filling .dot{ animation:none; } }
@keyframes pulse{ 0%,100%{ opacity:1 } 50%{ opacity:.35 } }

.readout-grid{ display:grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:18px; }
.readout{ background:#f8fbfd; border:1px solid var(--line); border-radius:10px; padding:14px 16px; }
.readout .label{ font-size:11.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:700; margin-bottom:6px; }
.readout .value{ font-family: var(--mono); font-size:26px; font-weight:700; color: var(--blue-900); }
.readout .value small{ font-size:14px; font-weight:600; color: var(--muted); margin-left:4px; }
.readout .quality{ display:inline-block; margin-top:6px; font-size:12.5px; font-weight:700; padding:3px 9px; border-radius:999px; }

.progress-track{ height:8px; border-radius:999px; background: var(--blue-100); overflow:hidden; }
.progress-fill{ height:100%; background: linear-gradient(90deg, var(--blue-600), var(--blue-500)); border-radius:999px; transition: width .3s ease; }

.lcd{
  background: #0b2033; border-radius: 10px; padding: 16px 18px;
  font-family: var(--mono); color:#8fd6ff; font-size:14px; line-height:1.7;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35);
}
.lcd .lcd-line{ white-space:pre; }
.lcd .lcd-dim{ color:#3f6a86; }

.btn-row{ display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; }
.btn{
  appearance:none; border:1px solid var(--line); background:#fff; color: var(--ink);
  font: inherit; font-weight:700; font-size:14px; padding:10px 16px; border-radius:9px;
  cursor:pointer; display:inline-flex; align-items:center; gap:8px;
  transition: transform .12s ease, background-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; }
.btn.primary{ background: var(--blue-600); border-color: transparent; color:#fff; }
.btn.danger{ background:#fff; border-color:#fecaca; color:#b91c1c; }
.btn.hold{ position:relative; overflow:hidden; }
.btn.hold .hold-fill{ position:absolute; inset:0; background: rgba(2,132,199,.18); width:0%; }

.log-list{ list-style:none; margin:0; padding:0; display:grid; gap:8px; max-height:220px; overflow:auto; }
.log-list li{ display:flex; justify-content:space-between; gap:12px; font-size:13.5px; padding:8px 10px; background:#f8fbfd; border:1px solid var(--line); border-radius:8px; }
.log-list li .t{ color:var(--muted); font-family: var(--mono); font-size:12.5px; }

.field-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); }
.field-row:last-of-type{ border-bottom:none; }
.field-row .field-label{ font-weight:700; font-size:14.5px; }
.field-row .field-hint{ margin:2px 0 0; font-size:12.5px; color:var(--muted); }
.stepper{ display:flex; align-items:center; gap:10px; }
.stepper button{
  width:32px; height:32px; border-radius:8px; border:1px solid var(--line); background:#fff;
  font-size:18px; font-weight:700; cursor:pointer; color: var(--blue-700);
}
.stepper .val{ min-width:64px; text-align:center; font-family: var(--mono); font-weight:700; font-size:15px; }

.chart-wrap{ background:#f8fbfd; border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:16px; }
canvas{ max-width:100%; }

table.quality-table{ width:100%; border-collapse:collapse; font-size:14px; }
table.quality-table th, table.quality-table td{ text-align:left; padding:9px 12px; border-bottom:1px solid var(--line); }
table.quality-table th{ color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.06em; }
.q-swatch{ display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:8px; }

.endpoint{
  font-family: var(--mono); font-size:13.5px; background:#0b2033; color:#8fd6ff;
  padding:12px 14px; border-radius:8px; overflow-x:auto; white-space:nowrap;
}

.site-footer{ padding: 30px 0 50px; color: var(--muted); font-size:13.5px; border-top:1px solid var(--line); text-align:center; }

@media (max-width: 620px){
  .field-row{ flex-direction:column; align-items:flex-start; gap:8px; }
}
