/* Pixling teaser LP — flat pixel-desktop look.
   Doctrine: no box-shadow, no gradients (DECISIONS 2026-06-13). */

@font-face {
  font-family: "DotGothic16";
  src: url("/assets/fonts/DotGothic16-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --wallpaper: #dfe7ee;
  --wallpaper-floor: #cfd9e3;
  --menubar-bg: rgba(247, 249, 251, 0.78);
  --ink: #22272c;
  --ink-soft: #5a6671;
  --win-bg: #f7f9fb;
  --win-border: #8a97a3;
  --win-edge: #ffffff;
  --titlebar-bg: #e8edf2;
  --dot-1: #b8c1c9;
  --dot-2: #9aa6b0;
  --dot-3: #7d8a95;
  --accent: #2f6f4f;
  --accent-ink: #f3f7f4;
  --input-bg: #ffffff;
  --demo-before-bg: #c4cdd5;
  --demo-after-bg: #2a3138;
  --sweep: #2f6f4f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wallpaper: #1b2026;
    --wallpaper-floor: #14181d;
    --menubar-bg: rgba(27, 32, 38, 0.78);
    --ink: #e3e8ec;
    --ink-soft: #99a4ad;
    --win-bg: #232930;
    --win-border: #0d1014;
    --win-edge: #444f59;
    --titlebar-bg: #2c333b;
    --dot-1: #4a545d;
    --dot-2: #5d6973;
    --dot-3: #717e89;
    --accent: #5fae8a;
    --accent-ink: #10231a;
    --input-bg: #1b2026;
    --demo-before-bg: #3a434c;
    --demo-after-bg: #11151a;
    --sweep: #5fae8a;
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden; /* desktop view never scrolls */
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--wallpaper);
}

h1, .window-titlebar, .menubar {
  font-family: "DotGothic16", system-ui, sans-serif;
  font-weight: 400;
}

/* ---- menubar ---- */

.menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: var(--menubar-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--win-border);
  font-size: 14px;
}

.menubar-logo { letter-spacing: 1px; }

.menubar-spacer { flex: 1; }

.menubar-perch {
  width: 48px;
  height: 28px;
  position: relative;
}

.menubar-item {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: none;
}

.menubar-item:hover { background: var(--titlebar-bg); }

/* ---- desktop ---- */

.desktop {
  position: fixed;
  inset: 28px 0 0 0;
  overflow: hidden;
  background: var(--wallpaper);
}

/* flat 2-tone wallpaper: solid floor band, no gradient */
.desktop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18%;
  background: var(--wallpaper-floor);
}

/* ---- widget (calendar-ish perch) ---- */

.widget-calendar {
  position: absolute;
  left: 4%;
  top: 7%;
  width: 96px;
  height: 96px;
  background: var(--win-bg);
  border: 1px solid var(--win-border);
  outline: 1px solid var(--win-edge);
  border-radius: 6px;
  overflow: hidden;
}

.widget-calendar::before {
  content: "";
  display: block;
  height: 26px;
  background: var(--accent);
}

.widget-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100% - 26px);
  font-family: "DotGothic16", system-ui, sans-serif;
  font-size: 28px;
  color: var(--ink);
}

/* ---- windows ---- */

.window {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  background: var(--win-bg);
  border: 1px solid var(--win-border);
  outline: 1px solid var(--win-edge); /* double border instead of box-shadow */
  border-radius: 6px;
  overflow: hidden;
}

.window-hero { z-index: 10; }

.window-titlebar {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--win-border);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
}

/* traffic lights: the span itself + two pseudo-elements = 3 grey dots */
.traffic {
  position: relative;
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-2);
  margin: 0 22px 0 12px;
}

.traffic::before,
.traffic::after {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.traffic::before { left: -12px; background: var(--dot-1); }
.traffic::after { left: 12px; background: var(--dot-3); }

.window-body {
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.window-body h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.4;
}

.window-body p { margin: 0 0 12px; }

.window-body-txt {
  font-size: 13px;
  color: var(--ink-soft);
}

.window-body-txt p { margin: 0 0 6px; }

/* ---- waitlist form ---- */

.window-body-hero {
  position: relative;
}

#waitlist-form input[type="email"] {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--win-border);
  border-radius: 4px;
  margin-bottom: 8px;
}

#waitlist-form button {
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--win-border);
  border-radius: 4px;
  cursor: pointer;
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}

#waitlist-form button:disabled { opacity: 0.75; cursor: default; }

#waitlist-form button.is-loading .form-submit-label { visibility: hidden; }

.form-submit-spinner,
.form-overlay-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--win-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: form-spin 0.7s linear infinite;
}

#waitlist-form button.is-loading .form-submit-spinner {
  position: absolute;
}

#waitlist-form button.is-loading { position: relative; }

@keyframes form-spin {
  to { transform: rotate(360deg); }
}

.consent {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 8px 0 0;
}

.form-status {
  font-size: 13px;
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.form-status.is-error { color: #b44; }

@media (prefers-color-scheme: dark) {
  .form-status.is-error { color: #f88; }
}

/* ---- waitlist: loading overlay + success body ---- */

.form-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in srgb, var(--win-bg) 90%, transparent);
  backdrop-filter: blur(2px);
}

.form-overlay.is-visible {
  display: flex;
  animation: form-overlay-in 0.2s ease-out;
}

.form-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.form-overlay-panel p {
  margin: 0;
}

.form-overlay-spinner {
  width: 22px;
  height: 22px;
  border-width: 3px;
}

.form-success {
  display: none;
  text-align: center;
}

.form-success.is-visible {
  display: block;
}

.form-success-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  font-size: 22px;
  font-weight: bold;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--win-border);
  border-radius: 4px;
}

.form-success-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.4;
  font-weight: normal;
}

.form-success-body {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}

.form-success-thanks {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}

@keyframes form-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .form-overlay.is-visible { animation: none; }
  .form-submit-spinner,
  .form-overlay-spinner { animation: none; opacity: 0.7; }
}

/* ---- generation demo (before/after sweep) ---- */

.gen-demo {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
  border: 1px solid var(--win-border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--demo-before-bg); /* fallback when demo-before.png is absent */
}

.gen-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* hide the broken-image glyph while demo-before.png is absent (Task 7):
   pseudo-elements render on <img> only when the image fails to load */
.gen-before::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--demo-before-bg);
}

.gen-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--demo-after-bg);
  image-rendering: pixelated;
  clip-path: inset(0 100% 0 0);
  animation: gen-reveal 6s ease-in-out infinite alternate;
}

.gen-sweep {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--sweep);
  animation: gen-sweep 6s ease-in-out infinite alternate;
}

@keyframes gen-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes gen-sweep {
  from { left: 0; }
  to { left: calc(100% - 2px); }
}

.gen-note {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---- community tease (two visitors on a window edge) ---- */

.comm-demo {
  margin-bottom: 12px;
  border: 1px solid var(--win-border);
  border-radius: 4px;
  background: var(--demo-after-bg);
  overflow: hidden;
}

.comm-mini-window {
  overflow: hidden;
}

.comm-mini-window {
  position: relative;
  display: flex;
  flex-direction: column;
}

.comm-mini-titlebar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--win-border);
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
}

.traffic-sm {
  margin: 0 14px 0 8px;
  transform: scale(0.75);
  transform-origin: left center;
}

.comm-mini-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.comm-mini-body {
  height: 56px;
  background: color-mix(in srgb, var(--win-bg) 70%, var(--demo-after-bg));
}

.comm-mini-window .actor {
  z-index: 2;
  pointer-events: none;
}

.comm-detail {
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---- download tease ---- */

.window-download {
  z-index: 5;
}

.window-body-download {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.window-body-download p {
  margin: 0;
}

.download-platform {
  font-family: "DotGothic16", system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
}

.download-button {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  font: inherit;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--win-border);
  border-radius: 4px;
  cursor: default;
}

.download-button:disabled {
  opacity: 0.82;
}

.download-soon {
  align-self: flex-start;
  padding: 2px 7px;
  font-family: "DotGothic16", system-ui, sans-serif;
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
}

.download-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .gen-after {
    animation: none;
    clip-path: inset(0 50% 0 0); /* fixed 50/50 split */
  }
  .gen-sweep {
    animation: none;
    left: calc(50% - 1px);
  }
}

/* ---- sprite actors (canvases created by lp.js) ---- */

.actor {
  position: absolute;
  image-rendering: pixelated;
  z-index: 20;
  pointer-events: auto;
}

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

.desktop-footer {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.desktop-footer a {
  color: inherit;
  margin-right: 10px;
}

/* ---- mobile: stacked cards, page scrolls ---- */

@media (max-width: 768px) {
  html, body {
    height: auto;
    overflow: visible;
  }

  .desktop {
    position: static;
    overflow: visible;
    padding-top: 28px; /* clear the fixed menubar */
  }

  .desktop::before { content: none; }

  .widget-calendar { display: none; }

  .window {
    position: static;
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    margin: 12px;
  }

  .actor { position: fixed; } /* engine switches to viewport-based paths */

  .desktop-footer {
    position: static;
    text-align: center;
    padding: 12px 0 16px;
  }
}
