/* Pixel landing page.
   Colors match the app (app/static/overlay.html): buddy blue #3380ff, dark panel greys, green/red accents.
   Pixel edges come from hard offset box-shadows and crisp-edged SVG sprites, never blurred scaling. */

:root {
  --bg: #161918;
  --bg-raised: #1f2321;
  --surface: #252a27;
  --border: #3a403c;
  --text: #eceeed;
  --muted: #adb5b2;
  --dim: #6b736f;
  --buddy: #3380ff;
  --buddy-light: #4d90ff;
  --green: #3ecf8e;
  --red: #ff6b6b;
  --shadow-ink: #0b0d0c;

  --pixel-font: "Press Start 2P", ui-monospace, Consolas, monospace;
  --body-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Faint pixel grid across the whole page */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 16px 16px;
  overflow-x: hidden;
}

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

code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 2px 6px;
  border: 2px solid var(--border);
}

/* ---------- Top bar ---------- */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(22, 25, 24, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand-sprite { display: inline-block; width: 22px; height: 22px; }
.brand-sprite svg { width: 100%; height: 100%; display: block; }

.brand-name {
  font-family: var(--pixel-font);
  font-size: 13px;
  letter-spacing: 1px;
}

.top-links { display: flex; gap: 20px; flex-wrap: wrap; }
.top-links a {
  color: var(--muted);
  font-size: 14px;
}
.top-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- Layout ---------- */

main { padding: 0 16px; }

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 88px 0 24px;
}

.pixel-heading {
  font-family: var(--pixel-font);
  font-size: clamp(18px, 3vw, 26px);
  font-weight: normal;
  line-height: 1.4;
  margin: 0 0 32px;
  text-shadow: 3px 3px 0 var(--shadow-ink);
}

.section-lede {
  color: var(--muted);
  max-width: 620px;
  margin: -16px 0 32px;
}

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

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-block;
  font-family: var(--pixel-font);
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 16px 20px;
  color: var(--text);
  background: var(--surface);
  border: 3px solid var(--border);
  box-shadow: 5px 5px 0 var(--shadow-ink);
  transition: transform 0.08s steps(2), box-shadow 0.08s steps(2), background 0.15s;
}
.btn:hover { text-decoration: none; transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--shadow-ink); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--shadow-ink); }

.btn-primary {
  background: var(--buddy);
  border-color: #6aa3ff;
  color: #fff;
}
.btn-primary:hover { background: var(--buddy-light); }

.btn-ghost:hover { background: var(--bg-raised); }

.btn:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }

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

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 0 40px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-raised);
  border: 2px solid var(--border);
}
.dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 0 0 0 2px var(--shadow-ink);
  animation: blink 1.2s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }

.pixel-title {
  font-family: var(--pixel-font);
  font-weight: normal;
  font-size: clamp(22px, 3.6vw, 38px);
  line-height: 1.35;
  margin: 0 0 24px;
  text-shadow: 4px 4px 0 var(--shadow-ink);
}
.accent { color: var(--buddy-light); }

.lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 540px;
  margin: 0;
}

kbd {
  display: inline-block;
  font-family: var(--pixel-font);
  font-size: 10px;
  line-height: 1;
  padding: 7px 8px 6px;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom-width: 5px;
  box-shadow: 0 2px 0 var(--shadow-ink);
  vertical-align: 2px;
}

.fineprint {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--dim);
  max-width: 520px;
}

/* ---------- Hero mock window + animated buddy ---------- */

.hero-copy, .hero-stage { min-width: 0; }
.hero-stage { position: relative; }

.mock-window {
  position: relative;
  background: var(--bg-raised);
  border: 3px solid var(--border);
  box-shadow: 10px 10px 0 var(--shadow-ink);
  min-height: 340px;
}

.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 3px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.mock-dots { display: inline-flex; gap: 6px; }
.mock-dots i { width: 10px; height: 10px; background: var(--dim); display: block; }
.mock-dots i:nth-child(1) { background: var(--red); }
.mock-dots i:nth-child(2) { background: #e8b64c; }
.mock-dots i:nth-child(3) { background: var(--green); }

/* Extra space on top leaves room for the buddy to hover above a button without covering the title bar. */
.mock-body { padding: 64px 22px 22px; }

.mock-toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.mock-button {
  font-family: var(--body-font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 10px 18px;
  box-shadow: 3px 3px 0 var(--shadow-ink);
}

.mock-lines { display: grid; gap: 12px; }
.mock-lines span {
  display: block;
  height: 10px;
  background: var(--surface);
  width: 100%;
}
.mock-lines span.short { width: 62%; }

.buddy {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  transform: translate(60px, 60px);
  transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.2, 1);
  z-index: 2;
  pointer-events: none;
}

.buddy-sprite {
  width: 36px;
  height: 36px;
  transform: rotate(var(--buddy-rotation, 0deg));
  transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.2, 1);
  filter: drop-shadow(3px 3px 0 var(--shadow-ink));
}
.buddy-sprite svg { width: 100%; height: 100%; display: block; }

.buddy-bubble {
  position: absolute;
  left: 46px;
  top: -10px;
  min-width: 120px;
  max-width: 230px;
  padding: 8px 12px;
  font-family: var(--pixel-font);
  font-size: 9px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--buddy);
  box-shadow: 4px 4px 0 var(--shadow-ink);
  opacity: 0;
  transition: opacity 0.2s steps(2);
  white-space: nowrap;
}
.buddy-bubble.visible { opacity: 1; }

/* ---------- Strip ---------- */

.strip {
  max-width: 1080px;
  margin: 24px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 16px;
  font-family: var(--pixel-font);
  font-size: 10px;
  color: var(--muted);
  background: var(--bg-raised);
  border-top: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
}

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

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.card {
  background: var(--bg-raised);
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 var(--shadow-ink);
  padding: 24px;
  transition: transform 0.12s steps(2), box-shadow 0.12s steps(2), border-color 0.2s;
}
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--shadow-ink);
  border-color: var(--buddy);
}

.card-icon {
  display: inline-block;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
}
.card-icon svg { width: 100%; height: 100%; display: block; }

.card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Steps ---------- */

.steps, .setup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.steps li {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: var(--bg-raised);
  border: 3px solid var(--border);
  padding: 22px 24px;
  box-shadow: 5px 5px 0 var(--shadow-ink);
}

.step-num {
  flex-shrink: 0;
  font-family: var(--pixel-font);
  font-size: 18px;
  color: var(--buddy-light);
  padding: 10px 12px;
  background: var(--shadow-ink);
  border: 2px solid var(--buddy);
}

.steps h3, .setup-list h3 {
  margin: 2px 0 6px;
  font-size: 18px;
  font-weight: 600;
}
.steps p, .setup-list p {
  margin: 0;
  color: var(--muted);
}

.setup-list li {
  background: var(--bg-raised);
  border: 3px solid var(--border);
  padding: 22px 24px;
  box-shadow: 5px 5px 0 var(--shadow-ink);
  counter-increment: setup;
  position: relative;
  padding-left: 64px;
}
.setup-list { counter-reset: setup; }
.setup-list li::before {
  content: counter(setup);
  position: absolute;
  left: 22px;
  top: 24px;
  font-family: var(--pixel-font);
  font-size: 16px;
  color: var(--green);
}

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

.footer {
  margin-top: 96px;
  border-top: 3px solid var(--border);
  background: var(--bg-raised);
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 16px 48px;
  color: var(--muted);
  font-size: 14px;
}
.footer p { margin: 0 0 6px; }
.footer-small { color: var(--dim); font-size: 13px; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hero {
    /* minmax(0, 1fr) lets the column shrink to the phone width instead of growing to fit the widest child. */
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    padding-top: 40px;
  }
  .hero-stage { order: 2; }
  .mock-window { box-shadow: 6px 6px 0 var(--shadow-ink); }
  .top-links a:not(:last-child) { display: none; }
}

@media (max-width: 480px) {
  .top-bar { padding: 12px 16px; }
  .pixel-title { font-size: 20px; }
  .lede { font-size: 16px; }
  .btn { width: 100%; text-align: center; }
  .cta-row { flex-direction: column; }
  .buddy-bubble { max-width: 170px; white-space: normal; }
  .section { padding-top: 64px; }
}

/* ---------- Pixel sprites (generic) ---------- */

[data-sprite] svg { width: 100%; height: 100%; display: block; }

/* ---------- Name tag (hero) ---------- */

.nametag {
  position: absolute;
  top: -26px;
  left: -14px;
  z-index: 3;
  transform: rotate(-4deg);
  background: var(--text);
  color: var(--shadow-ink);
  padding: 12px 18px 14px;
  border: 3px solid var(--shadow-ink);
  box-shadow: 5px 5px 0 var(--shadow-ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nametag span:first-child {
  font-size: 12px;
  color: #4a524e;
  font-weight: 500;
}
.nametag strong {
  font-family: var(--pixel-font);
  font-weight: normal;
  font-size: 22px;
  color: var(--buddy);
  text-shadow: 3px 3px 0 var(--shadow-ink);
}
.nametag-pin {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--red);
  border: 2px solid var(--shadow-ink);
}

/* ---------- Floating stickers (hero) ---------- */

.sticker {
  position: absolute;
  z-index: 3;
  display: block;
  filter: drop-shadow(3px 3px 0 var(--shadow-ink));
  animation: bob 2.4s steps(4) infinite;
  pointer-events: none;
}
.sticker svg { width: 100%; height: 100%; }
.sticker-heart { width: 44px; height: 40px; right: -18px; top: 10%; }
.sticker-sparkle { width: 36px; height: 36px; right: 14%; bottom: 14%; animation-delay: -1s; }
.sticker-mail { width: 46px; height: 36px; left: -16px; bottom: 6%; animation-delay: -0.5s; }
.sticker-coffee { width: 40px; height: 40px; right: 6%; top: -18px; animation-delay: -1.6s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- Dither dividers ---------- */

.dither {
  height: 28px;
  margin-top: 72px;
  background: repeating-conic-gradient(var(--border) 0 25%, transparent 0 50%) 0 0 / 8px 8px;
  opacity: 0.55;
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}

/* ---------- Sticker sheet ---------- */

.sticker-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 26px;
}

.sticker-card {
  margin: 0;
  background: var(--text);
  color: var(--shadow-ink);
  padding: 22px 16px 14px;
  border: 3px solid var(--shadow-ink);
  box-shadow: 6px 6px 0 var(--shadow-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.12s steps(2);
}
.sticker-card:hover { transform: rotate(0deg) scale(1.04); }
.sticker-card.tilt-left { transform: rotate(-3deg); }
.sticker-card.tilt-right { transform: rotate(2.5deg); }

.sticker-card > span {
  display: block;
  width: 64px;
  height: 64px;
}
.sticker-card figcaption {
  font-family: var(--pixel-font);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- Feature cards with window chrome ---------- */

.card { padding: 0; }
.card-chrome {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 3px solid var(--border);
}
.card-chrome i { width: 9px; height: 9px; background: var(--dim); display: block; }
.card-chrome i:nth-child(1) { background: var(--red); }
.card-chrome i:nth-child(2) { background: #e8b64c; }
.card-chrome i:nth-child(3) { background: var(--green); }
.card-body { padding: 24px; }

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

.footer-inner { position: relative; }
.footer-wordmark {
  font-family: var(--pixel-font);
  font-size: clamp(44px, 12vw, 128px);
  line-height: 1;
  color: var(--buddy);
  text-shadow: 6px 6px 0 var(--shadow-ink);
  margin: 0 0 28px;
  user-select: none;
}

/* Respect users who turn off motion: the buddy stays put instead of flying around. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
