/* The homepage stylesheet. Shares the console's design language (see the
   frontend submodule's app.css): all-mono, warm paper surfaces, hairline
   borders, blue accent, light mode primary with a dark scheme. The Geist
   Mono file ships with the console bundle under /console/fonts/; the stack
   below falls back to system monospace when it is absent. */
@font-face {
  font-family: "Geist Mono";
  src: url("console/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --mono: "Geist Mono", "SF Mono", ui-monospace, "Cascadia Mono", Menlo,
    Consolas, monospace;

  --paper: #fbfbf9;
  --surface: #ffffff;
  --surface-2: #f6f6f3;
  --ink: #16171a;
  --ink-2: #5c5f66;
  --ink-3: #9a9da4;
  --line: #e9e8e3;
  --line-2: #f0efea;

  --accent: #3b6ef5;
  --accent-ink: #2a55cc;
  --accent-soft: #eef2fe;
  --accent-line: #d6e0fd;

  --add: #1f8a5b;
  --del: #c0453b;
  --del-bg: #fcefed;
  --del-line: #f2d4cf;

  --radius: 9px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 23, 26, 0.04),
    0 6px 22px -10px rgba(20, 23, 26, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16181d;
    --surface: #1c1f26;
    --surface-2: #23272f;
    --ink: #e9ebf0;
    --ink-2: #a3a8b4;
    --ink-3: #6f7480;
    --line: #2c313b;
    --line-2: #262b33;

    --accent: #5b8cff;
    --accent-ink: #9db8ff;
    --accent-soft: #1e2740;
    --accent-line: #2f3e63;

    --add: #3fd089;
    --del: #ff8a80;
    --del-bg: #2a1b1b;
    --del-line: #4a2f2f;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 22px -10px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- top bar ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.login {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- shared bits ---- */

.muted {
  color: var(--ink-3);
}

.error {
  color: var(--del);
}

.small {
  font-size: 12px;
}

.link {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
}

.link:hover {
  border-bottom-color: var(--accent-ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
}

.btn-small {
  padding: 5px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 24px 0;
  padding: 10px 14px;
  border: 1px solid var(--del-line);
  border-radius: var(--radius);
  background: var(--del-bg);
  color: var(--del);
}

/* ---- layout ---- */

.content {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

section {
  margin-top: 56px;
}

h2 {
  font-size: 18px;
  margin: 0 0 18px;
}

/* ---- hero ---- */

.hero {
  margin-top: 72px;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-ink);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.hero-sub {
  margin: 0 0 26px;
  color: var(--ink-2);
  max-width: 60ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- cards ---- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}

.download-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
}

.download-card:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.download .small {
  margin-top: 14px;
}

/* ---- dashboard ---- */

.dash h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty p {
  color: var(--ink-2);
}

.steps {
  margin: 0;
  padding-left: 22px;
  color: var(--ink-2);
}

.steps li {
  margin: 6px 0;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.device-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.device-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.device-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.dot.online {
  background: var(--add);
}

.dot.offline {
  background: var(--ink-3);
  opacity: 0.5;
}

.device-meta {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-card .btn {
  margin-top: 6px;
  align-self: flex-start;
}

/* ---- footer ---- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  gap: 18px;
}

@media (max-width: 560px) {
  .topbar {
    padding: 12px 16px;
  }

  .content {
    padding: 0 16px 40px;
  }

  .hero {
    margin-top: 48px;
  }

  .login {
    display: none;
  }
}
