/* pctv.pro — project home page.
 *
 * The design tokens below are LIFTED FROM the hiot frontend
 * (src/frontend/src/index.css) so the two surfaces are one product rather
 * than two that resemble each other. Same ramps, same accent, same 3px
 * radius, same Rajdhani/JetBrains-Mono pairing, same dotted-grid page.
 *
 * ⚠ They are a COPY, not an import: this site is deliberately independent of
 * the frontend build, so publishing a pctv release never requires deploying
 * the app. That independence is the whole reason it is a standalone site —
 * the cost is that a token change in the app does not reach here by itself.
 *
 * One deliberate difference: the app defaults to light and switches on an
 * explicit `data-theme="dark"` set by its theme control. A static page has no
 * such control, so it follows the reader's system preference instead.
 */

/* ── Design tokens — light (mirrors :root in the frontend) ───────────────── */
:root {
  color-scheme: light;

  --bg: #f8fafc;
  --bg-grid: rgba(15, 23, 42, 0.045);
  --surface: #eef2f7;
  --card: #ffffff;
  --card-hover: #f5f8fd;
  --border: #e7ecf3;
  --border-muted: #f1f4f8;

  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --selection-bg: #c4b5fd;
  --selection-text: #1e1b4b;

  --accent: #7c3aed;
  --accent-dim: rgba(124, 58, 237, 0.12);
  --accent-glow: rgba(124, 58, 237, 0.22);
  --accent-border: rgba(124, 58, 237, 0.35);
  --accent-contrast: #ffffff;

  --orange: #ea580c;
  --orange-dim: rgba(234, 88, 12, 0.1);

  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sans: 'Rajdhani', system-ui, sans-serif;

  --radius: 3px;
  --radius-lg: 6px;
  --transition: 150ms ease;

  --page-max: 1120px;
  --page-gutter: 24px;
}

/* ── Design tokens — dark (mirrors :root[data-theme='dark']) ─────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #09090b;
    --bg-grid: rgba(255, 255, 255, 0.025);
    --surface: #131316;
    --card: #0d0d0d;
    --card-hover: #141414;
    --border: #151515;
    --border-muted: #101010;

    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-dim: #8b8b95;

    --selection-bg: #a78bfa;
    --selection-text: #09090b;

    --accent: #a78bfa;
    --accent-dim: rgba(167, 139, 250, 0.14);
    --accent-glow: rgba(167, 139, 250, 0.26);
    --accent-border: rgba(167, 139, 250, 0.35);
    --accent-contrast: #09090b;

    --orange: #fb923c;
    --orange-dim: rgba(251, 146, 60, 0.12);
  }
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
  text-shadow: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Keyboard users must be able to see where they are — the app relies on the
   same accent ring. */
a:focus-visible,
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 20px var(--page-gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.brand-word {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text);
  font-weight: 600;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav-link {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}

.site-nav-link:hover {
  color: var(--text);
}

@media (max-width: 720px) {
  .site-nav {
    align-items: flex-start;
    gap: 16px;
  }
  .site-nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 16px;
  }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 14px;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

.btn:hover {
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 13px 26px;
  font-size: 15px;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  box-shadow: none;
  background: var(--accent-dim);
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover {
    transform: none;
  }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 90px var(--page-gutter) 70px;
  text-align: center;
  background: radial-gradient(60% 60% at 50% 0%, var(--accent-dim), transparent 70%);
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}

.accent {
  color: var(--accent);
}

.hero-sub {
  font-size: clamp(16px, 2.3vw, 19px);
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 34px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── Sections ────────────────────────────────────────────────────────────── */
.section {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px var(--page-gutter) 70px;
}

.section-tight {
  padding-bottom: 40px;
}

.section-title {
  text-align: center;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  margin: 0 0 20px;
}

.section-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 44px;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.section-title:last-of-type {
  margin-bottom: 44px;
}

/* ── Feature cards ───────────────────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition:
    border-color var(--transition),
    transform var(--transition);
}

.feature:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .feature:hover {
    transform: none;
  }
}

.feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
}

.feature-body {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* ── Hardware panels ─────────────────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.panel-kicker {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.panel-body {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* ── Repository status pill ──────────────────────────────────────────────────
   Orange, matching `.device-unlinked-badge` in the app: a state to act on,
   not a fault. The page must not imply these URLs work yet — they do not. */
.repo-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--orange-dim);
  color: var(--orange);
  margin-bottom: 14px;
}

/* ── Code ────────────────────────────────────────────────────────────────── */
.code {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius);
  overflow-x: auto;
}

.code code {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  /* pre-wrap, not pre: these lines are commands a reader needs to READ in
     full. In a ~280px card `pre` silently clipped the apt source line at
     "…/apt s" with the suite and component off-screen behind a scrollbar
     nobody would think to drag. Wrapping at spaces keeps it legible. */
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 56px var(--page-gutter) 28px;
  border-top: 1px solid var(--border);
}

.footer-main {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 32px;
}

.footer-note {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}

.footer-bar {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--border-muted);
}

.footer-build {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
