/*
 * getjboards.com styles. No framework, no build step.
 *
 * Colors are the JBoards design tokens (packages/jboards-client/src/tokens.ts,
 * itself derived from the controller web UI's Tailwind config): brand blue
 * #1a6ef2 at 600, Tailwind gray surfaces, the web's three-corner radial tint on
 * the dark page. When a token changes there, change it here too.
 *
 * Light is the default; dark follows the system setting. There is no theme
 * switch, so the site needs no JavaScript at all.
 */

:root {
  color-scheme: light dark;

  --brand-50: #eff6ff;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #1a6ef2;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  /* Semantic, light (tokens.ts semantic.light). */
  --page: #f9fafb;
  --page-tint: none;
  --card: #ffffff;
  --card-border: #e5e7eb;
  --field: #ffffff;
  --field-border: #d1d5db;
  --fg: #111827;
  --fg-soft: #374151;
  --fg-muted: #6b7280;
  --accent: var(--brand-700);
  --bar: rgba(255, 255, 255, 0.92);

  --btn-primary-bg: var(--brand-600);
  --btn-primary-fg: #ffffff;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-fg: #111827;
  --btn-secondary-border: #d1d5db;

  --st-playing-bg: #f0fdf4;
  --st-playing-fg: #15803d;
  --st-playing-dot: #16a34a;
  --st-effect-bg: #faf5ff;
  --st-effect-fg: #7e22ce;
  --st-effect-dot: #a855f7;
  --st-synced-bg: #f0fdfa;
  --st-synced-fg: #0f766e;
  --st-synced-dot: #14b8a6;
  --st-remote-bg: #eff6ff;
  --st-remote-fg: #1d4ed8;
  --st-remote-dot: #2563eb;

  --warn-bg: #fffbeb;
  --warn-fg: #92400e;
  --warn-border: #fcd34d;
  --danger-fg: #b91c1c;

  --radius-card: 12px;
  --radius-control: 8px;
  --radius-chip: 6px;
  --gutter: 16px;
  --max: 1080px;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #030712;
    --page-tint:
      radial-gradient(120% 60% at 0% 0%, rgba(99, 102, 241, 0.15), transparent 60%),
      radial-gradient(100% 50% at 100% 0%, rgba(59, 130, 246, 0.12), transparent 60%),
      radial-gradient(100% 60% at 100% 100%, rgba(139, 92, 246, 0.1), transparent 60%);
    --card: #111827;
    --card-border: #1f2937;
    --field: #1f2937;
    --field-border: #374151;
    --fg: #f3f4f6;
    --fg-soft: #d1d5db;
    --fg-muted: #9ca3af;
    --accent: var(--brand-400);
    --bar: rgba(17, 24, 39, 0.92);

    --btn-secondary-bg: #1f2937;
    --btn-secondary-fg: #e5e7eb;
    --btn-secondary-border: #374151;

    --st-playing-bg: rgba(20, 83, 45, 0.35);
    --st-playing-fg: #86efac;
    --st-playing-dot: #22c55e;
    --st-effect-bg: rgba(88, 28, 135, 0.35);
    --st-effect-fg: #d8b4fe;
    --st-effect-dot: #a855f7;
    --st-synced-bg: rgba(19, 78, 74, 0.4);
    --st-synced-fg: #5eead4;
    --st-synced-dot: #14b8a6;
    --st-remote-bg: rgba(30, 58, 138, 0.5);
    --st-remote-fg: #bfdbfe;
    --st-remote-dot: #60a5fa;

    --warn-bg: rgba(69, 26, 3, 0.6);
    --warn-fg: #fde68a;
    --warn-border: #b45309;
    --danger-fg: #fca5a5;
  }
}

/* An explicit dark override, for anyone who sets data-theme="dark" on <html>. */
:root[data-theme="dark"] {
  --page: #030712;
  --page-tint:
    radial-gradient(120% 60% at 0% 0%, rgba(99, 102, 241, 0.15), transparent 60%),
    radial-gradient(100% 50% at 100% 0%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(100% 60% at 100% 100%, rgba(139, 92, 246, 0.1), transparent 60%);
  --card: #111827;
  --card-border: #1f2937;
  --field: #1f2937;
  --field-border: #374151;
  --fg: #f3f4f6;
  --fg-soft: #d1d5db;
  --fg-muted: #9ca3af;
  --accent: var(--brand-400);
  --bar: rgba(17, 24, 39, 0.92);
  --btn-secondary-bg: #1f2937;
  --btn-secondary-fg: #e5e7eb;
  --btn-secondary-border: #374151;
  --st-playing-bg: rgba(20, 83, 45, 0.35);
  --st-playing-fg: #86efac;
  --st-playing-dot: #22c55e;
  --st-effect-bg: rgba(88, 28, 135, 0.35);
  --st-effect-fg: #d8b4fe;
  --st-effect-dot: #a855f7;
  --st-synced-bg: rgba(19, 78, 74, 0.4);
  --st-synced-fg: #5eead4;
  --st-synced-dot: #14b8a6;
  --st-remote-bg: rgba(30, 58, 138, 0.5);
  --st-remote-fg: #bfdbfe;
  --st-remote-dot: #60a5fa;
  --warn-bg: rgba(69, 26, 3, 0.6);
  --warn-fg: #fde68a;
  --warn-border: #b45309;
  --danger-fg: #fca5a5;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--page);
  background-image: var(--page-tint);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(30px, 6.5vw, 52px);
  font-weight: 750;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
}

h3 {
  font-size: 19px;
  font-weight: 600;
}

p {
  margin: 0 0 1em;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--field);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.prose {
  max-width: 720px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--card);
  padding: 8px 12px;
  border-radius: var(--radius-control);
  z-index: 20;
}

.skip:focus {
  left: 8px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bar);
  border-bottom: 1px solid var(--card-border);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  flex: none;
}

.logo img {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-chip);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--fg-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--radius-control);
  white-space: nowrap;
}

.nav a:hover {
  background: var(--field);
  color: var(--fg);
}

.nav a[aria-current="page"] {
  color: var(--accent);
}

.nav a.nav-shop {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  margin-left: 4px;
}

.nav a.nav-shop:hover {
  background: var(--brand-700);
}

@media (max-width: 330px) {
  .logo span {
    display: none;
  }
  .nav a {
    padding: 8px 8px;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

.btn-primary:hover {
  background: var(--brand-700);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border-color: var(--btn-secondary-border);
}

.btn-secondary:hover {
  border-color: var(--fg-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 480px) {
  .actions .btn {
    flex: 1 1 100%;
  }
}

.fine {
  color: var(--fg-muted);
  font-size: 14px;
  margin-top: 12px;
}

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 40px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.lede {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--fg-soft);
  max-width: 640px;
}

/*
 * The pixel strip: one row of "LEDs" running a color chase. A single element:
 * a moving rainbow gradient, masked to round dots. No JavaScript, and still
 * when the visitor asks for reduced motion.
 */
.strip {
  margin: 36px 0 0;
  height: 22px;
  border-radius: 999px;
  background-image: linear-gradient(90deg, #ef4444, #f59e0b, #facc15, #22c55e, #14b8a6, #3b82f6, #a855f7, #ef4444);
  background-size: 50% 100%;
  -webkit-mask-image: radial-gradient(circle at center, #000 5px, transparent 6.5px);
  mask-image: radial-gradient(circle at center, #000 5px, transparent 6.5px);
  -webkit-mask-size: 22px 22px;
  mask-size: 22px 22px;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.55));
  animation: chase 6s linear infinite;
}

@keyframes chase {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .strip {
    animation: none;
  }
}

/* ---------- Sections and cards ---------- */

.section {
  padding: 40px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 24px;
}

.section-head p {
  color: var(--fg-soft);
}

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 8px;
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 18px;
}

.card h3 {
  margin-bottom: 6px;
}

.card p {
  color: var(--fg-soft);
  margin: 0;
  font-size: 15px;
}

.card .emoji {
  font-size: 26px;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

/* The noun ladder: effects → sequences → playlists → schedules. */
.ladder {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  counter-reset: step;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ladder li {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px;
  position: relative;
}

.ladder li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.ladder strong {
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}

.ladder span {
  color: var(--fg-soft);
  font-size: 14px;
}

@media (max-width: 760px) {
  .ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .ladder {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- App teaser / phone ---------- */

.split {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
}

@media (max-width: 820px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

.phone {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  background: var(--page);
  border: 1px solid var(--card-border);
  border-radius: 36px;
  padding: 14px;
  box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.35), 0 0 0 6px var(--card);
}

.phone-title {
  font-size: 26px;
  font-weight: 700;
  margin: 10px 4px 12px;
  letter-spacing: -0.02em;
}

.tile {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tile-name {
  font-weight: 600;
  font-size: 15px;
}

.tile-sub {
  color: var(--fg-muted);
  font-size: 13px;
  margin-top: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.pill-playing {
  background: var(--st-playing-bg);
  color: var(--st-playing-fg);
}

.pill-effect {
  background: var(--st-effect-bg);
  color: var(--st-effect-fg);
}

.pill-synced {
  background: var(--st-synced-bg);
  color: var(--st-synced-fg);
}

.pill-remote {
  background: var(--st-remote-bg);
  color: var(--st-remote-fg);
}

.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--field);
  margin-top: 10px;
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  width: 72%;
  background: var(--brand-600);
  border-radius: 999px;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.checks li {
  display: flex;
  gap: 10px;
  color: var(--fg-soft);
}

.checks li::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--brand-600)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 20px 20px no-repeat;
}

.checks strong {
  color: var(--fg);
}

.badge-soon {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--st-remote-bg);
  color: var(--st-remote-fg);
  vertical-align: middle;
  margin-left: 6px;
}

/* ---------- Callouts ---------- */

.notice {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-card);
  padding: 12px 14px;
  font-size: 15px;
  margin: 0 0 24px;
}

.notice strong {
  color: inherit;
}

.callout {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--brand-600);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin: 20px 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- Document pages (privacy, delete, support) ---------- */

.doc {
  padding: 40px 0 56px;
}

.doc h2 {
  margin-top: 1.8em;
  scroll-margin-top: 80px;
}

.doc h3 {
  margin-top: 1.4em;
}

.doc ul,
.doc ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}

.doc li {
  margin-bottom: 0.4em;
  color: var(--fg-soft);
}

.doc p {
  color: var(--fg-soft);
}

.doc strong {
  color: var(--fg);
}

.doc .meta {
  color: var(--fg-muted);
  font-size: 14px;
}

.steps {
  list-style: none;
  counter-reset: s;
  padding: 0 !important;
}

.steps li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.steps li::before {
  content: counter(s);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1em;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  background: var(--card);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  color: var(--fg-soft);
}

th {
  color: var(--fg);
  font-weight: 600;
  background: var(--field);
}

tr:last-child td {
  border-bottom: 0;
}

.toc {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  margin: 0 0 8px;
}

.toc ol {
  margin: 0;
  columns: 2 220px;
  column-gap: 24px;
}

.toc li {
  margin: 0 0 4px;
  break-inside: avoid;
}

/* FAQ: native <details>, no script. */
.faq details {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 44px 14px 16px;
  font-weight: 600;
  position: relative;
  min-height: 48px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--fg-muted);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq .answer {
  padding: 0 16px 14px;
}

.faq .answer > :last-child {
  margin-bottom: 0;
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.contact-card .addr {
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--card-border);
  padding: 28px 0 36px;
  color: var(--fg-muted);
  font-size: 14px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.site-footer a {
  color: var(--fg-soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--fg);
  text-decoration: underline;
}
