/* PxlDash — landing page.
   Tokens mirror docs/design-system.md in the pxldash repo (Night theme):
   warm light emitted from a dark grid. Colour arrives as small bright things
   on quiet warm-neutral surfaces, never as a wash. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  /* Surfaces */
  --page: #0c0a09;
  --surface: #14110f;
  --raised: #1c1815;
  --field: #262019;
  --logo-ink: #0b0d10;

  /* Ink */
  --fg: #f5efe6;
  --muted: color-mix(in oklab, var(--fg) 62%, transparent);
  --faint: color-mix(in oklab, var(--fg) 38%, transparent);
  --border: color-mix(in oklab, var(--fg) 11%, transparent);
  --border-strong: color-mix(in oklab, var(--fg) 19%, transparent);

  /* Brand ramp — these are the logo */
  --cream: #fff7e6;
  --amber: #ffc061;
  --coral: #ff9184;
  --pink: #e585cb;

  --accent: var(--amber);
  --accent-ink: #241703;

  /* Module hues */
  --mod-flights: #ffc061;
  --mod-cfb: #ff9184;
  --mod-countdown: #ffacbe;
  --mod-markets: #e585cb;
  --mod-calendar: #c9b8ff;
  --mod-weather: #8fc9ff;
  --mod-transit: #6fd8c4;
  --mod-home: #a8de84;

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-input: 4px;
  --r-button: 8px;
  --r-card: 12px;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --wrap: 1120px;
  --gutter: 16px;
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

img,
canvas {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-input);
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}

/* ── type ─────────────────────────────────────────────── */

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}

h2 {
  font-size: clamp(28px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.lede {
  font-size: clamp(18px, 1.8vw, 20px);
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}

.body {
  color: var(--muted);
  max-width: 38em;
  text-wrap: pretty;
}

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

/* ── buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-button);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background-color 120ms var(--ease),
    border-color 120ms var(--ease),
    color 120ms var(--ease);
}

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

.btn-primary:hover {
  background: color-mix(in oklab, var(--accent) 88%, var(--cream));
}

.btn-primary:active {
  background: color-mix(in oklab, var(--accent) 88%, black);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--fg);
}

.btn-ghost:hover {
  background: color-mix(in oklab, var(--fg) 6%, transparent);
}

.btn-ghost:active {
  background: color-mix(in oklab, var(--fg) 10%, transparent);
}

/* ── nav ──────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  border-radius: 7px;
}

.brand-sm {
  font-size: 15px;
}

.brand-sm img {
  border-radius: 5px;
}

.nav-links {
  display: none;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: var(--r-button);
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  transition: color 120ms var(--ease), background-color 120ms var(--ease);
}

.nav-links a:hover {
  color: var(--fg);
  background: color-mix(in oklab, var(--fg) 6%, transparent);
}

.nav .btn {
  margin-left: auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

@media (min-width: 820px) {
  .nav-links {
    display: flex;
  }

  .nav .btn {
    margin-left: 8px;
  }
}

/* ── hero ─────────────────────────────────────────────── */

.hero {
  position: relative;
  display: grid;
  gap: 48px;
  padding-top: clamp(48px, 9vw, 112px);
  padding-bottom: clamp(48px, 7vw, 96px);
}

.hero-copy {
  display: grid;
  gap: 22px;
  justify-items: start;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 6px;
}

/* The one gradient allowed: a single bloom behind the hero panel, read as
   light emitted from the pixels (the design system's takeover bloom). */
.panel-hero {
  position: relative;
}

.panel-hero::before {
  content: "";
  position: absolute;
  inset: -18% -10% -10%;
  z-index: -1;
  background: radial-gradient(
    closest-side,
    color-mix(in oklab, var(--amber) 16%, transparent),
    transparent
  );
  pointer-events: none;
}

@media (min-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 56px;
  }
}

/* ── LED panel ────────────────────────────────────────── */

.panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bezel {
  background: var(--logo-ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 3.5%;
}

.panel:not(.panel-hero) .bezel {
  padding: 4%;
  border-color: var(--border);
}

.bezel canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  border-radius: 2px;
}

.panel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--faint);
}

.panel-hero .panel-label {
  color: var(--muted);
}

/* Rotation pills: one per board, the current one fills over its dwell. */
.pills {
  display: flex;
  gap: 6px;
}

.pill {
  position: relative;
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--field);
  overflow: hidden;
}

.pill.done {
  background: color-mix(in oklab, var(--accent) 45%, var(--field));
}

.pill.on::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: left;
  animation: dwell var(--dwell, 6s) linear forwards;
}

@keyframes dwell {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* ── sections ─────────────────────────────────────────── */

.section {
  position: relative;
  display: grid;
  gap: 40px;
  padding-block: clamp(56px, 8vw, 104px);
  scroll-margin-top: 40px;
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--border);
}

.section-head {
  display: grid;
  gap: 16px;
}

/* Galleries */
.gallery {
  display: grid;
  gap: 24px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 560px) {
  .gallery {
    gap: 28px 20px;
  }
}

@media (min-width: 1000px) {
  .gallery-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── module glyphs ────────────────────────────────────── */

/* A glyph is a 3×3 pixel pattern, one dot per LED — never an icon. */
.glyph {
  --size: 4px;
  display: inline-grid;
  grid-template-columns: repeat(3, var(--size));
  gap: calc(var(--size) / 2);
  flex-shrink: 0;
}

.glyph i {
  width: var(--size);
  height: var(--size);
  background: var(--mod);
  border-radius: 1px;
}

.glyph i.off {
  opacity: 0.22;
}

.glyph-tile {
  --size: 6px;
  padding: 9px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--mod) 12%, transparent);
}

.modules {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  .modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.module {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 16px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.module p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  padding-top: 2px;
}

.module .state {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mod);
  padding-top: 3px;
}

.module.soon {
  background: transparent;
}

.module.soon h3 {
  color: var(--muted);
}

.module.soon .state {
  color: var(--faint);
}

/* ── closing + footer ─────────────────────────────────── */

.closing {
  justify-items: center;
  text-align: center;
  gap: 20px;
}

.closing .body {
  max-width: 32em;
}

.footer {
  border-top: 1px solid var(--border);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 28px;
  font-size: 14px;
}
