/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --ink: #0D1321;
  --panel: #131B2C;
  --panel-2: #182337;
  --line: #26314A;
  --text: #EDF1F7;
  --muted: #8891A6;
  --signal: #4CC9B0;
  --signal-dim: #2E8577;
  --danger: #E2665A;
  --danger-dim: #4A2622;
  --success: #4CC9B0;

  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', var(--sans);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 4px;
  --max-width: 880px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--text); max-width: 62ch; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

code, .mono { font-family: var(--mono); }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

/* ==========================================================================
   Layout shell
   ========================================================================== */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header .page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover { text-decoration: none; color: var(--signal); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.95rem;
}

.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-links .btn,
.nav-links .btn:visited,
.nav-links .btn:hover,
.nav-links .btn:focus,
.nav-links .btn:active {
  color: var(--ink);
}

.nav-links form { margin: 0; }
.nav-links .link-button {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
}
.nav-links .link-button:hover { color: var(--text); }

.site-main { padding: 48px 0 80px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn,
.btn:visited,
.btn:focus,
.btn:active {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 10px 18px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease;
}

.btn:hover { background: #5fd6be; text-decoration: none; color: var(--ink); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--panel-2); color: var(--text); border-color: var(--muted); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #ef7a6e; color: #fff; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Forms
   ========================================================================== */
form p { margin-bottom: 16px; }

label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  max-width: 360px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--signal);
  outline: none;
}

.helptext { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
ul.errorlist { color: var(--danger); font-size: 0.85rem; margin: 4px 0; padding-left: 1.2em; }

/* ==========================================================================
   Messages
   ========================================================================== */
.messages { list-style: none; padding: 0; margin: 0 0 24px; }
.messages li {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.messages .success { background: rgba(76, 201, 176, 0.1); border-color: var(--signal-dim); color: var(--signal); }
.messages .error { background: rgba(226, 102, 90, 0.1); border-color: var(--danger); color: #f0a49c; }
.messages .warning { background: rgba(226, 180, 90, 0.1); border-color: #b8862e; color: #e2c07a; }

/* ==========================================================================
   Tables (device list)
   ========================================================================== */
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 500; font-size: 0.82rem; }
td .mono { color: var(--muted); }

/* ==========================================================================
   Landing page — hero
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 32px 0 64px;
}

.hero h1 { max-width: 14ch; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.tunnel-diagram { width: 100%; height: auto; }

/* ==========================================================================
   Landing page — sections
   ========================================================================== */
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section > .eyebrow-free-heading { margin-bottom: 8px; }
.section .section-lede { color: var(--muted); max-width: 56ch; margin-bottom: 32px; }

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.compare-col h3 { margin-bottom: 12px; }
.compare-col ul { list-style: none; padding: 0; margin: 0; }
.compare-col li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--text);
}
.compare-col.dont li { color: var(--muted); }
.compare-col.dont li::before { content: "— "; color: var(--danger); }
.compare-col.do li::before { content: "— "; color: var(--signal); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { border-top: 2px solid var(--signal); padding-top: 16px; }
.step .step-num { font-family: var(--mono); color: var(--signal); font-size: 0.85rem; }
.step h3 { margin-top: 8px; }
.step p { color: var(--muted); font-size: 0.92rem; }

.pricing-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.pricing-box .pricing-copy p { margin-bottom: 4px; color: var(--muted); }

/* ==========================================================================
   Dashboard-specific
   ========================================================================== */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.download-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0 32px;
  font-size: 0.9rem;
  color: var(--muted);
}
.download-note .btn { margin-right: 12px; margin-bottom: 8px; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .pricing-box { flex-direction: column; align-items: flex-start; }
}
