/* Pixel Progress website. Colors match lib/app/theme.dart (PixelColors). */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/SpaceGrotesk-Variable.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* App colors */
  --background: #333333;
  --foreground: #f2f2f2;
  --card: #404040;
  --popover: #262626;
  --primary: #73ff00;
  --accent: #70fdff;
  --on-bright: #1a1a1a;
  --muted: #4c4c4c;
  --muted-foreground: #a6a6a6;
  --border: #595959;
  --destructive: #ef4444;

  /* Sampled from the skyline art */
  --night: #0b0a3c;
  --night-2: #14125c;
  --water: #0d2a86;
  --sunset: #ff8a2a;
  --neon-pink: #d23cdc;

  --radius: 4px;
  --gutter: 16px;
  --max: 1120px;
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.pixelated {
  image-rendering: pixelated;
}

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

a:hover {
  color: var(--primary);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--gutter);
  top: var(--gutter);
  z-index: 100;
  background: var(--primary);
  color: var(--on-bright);
  padding: 8px 12px;
}

/* ---------- Type ---------- */

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

h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

.neon {
  color: var(--primary);
  /* A hard pixel drop shadow, like a sprite. */
  text-shadow: 3px 3px 0 var(--on-bright);
}

.neon-blue {
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--on-bright);
}

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

.lede {
  font-size: 1.2rem;
  color: #dcdcf5;
  max-width: 34em;
}

.muted {
  color: var(--muted-foreground);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 10, 60, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(112, 253, 255, 0.12);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

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

.site-nav .nav-link {
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

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

@media (max-width: 720px) {
  .site-nav .nav-link {
    display: none;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--on-bright);
  background: var(--primary);
  color: var(--on-bright);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--on-bright);
  transition: transform 0.08s, box-shadow 0.08s;
}

.btn:hover {
  color: var(--on-bright);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--on-bright);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--on-bright);
}

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.9rem;
  box-shadow: 3px 3px 0 var(--on-bright);
}

.btn-outline {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: none;
}

.btn-outline:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.store-badges a {
  display: block;
  transition: transform 0.12s;
}

.store-badges a:hover {
  transform: translateY(-2px);
}

.store-badges img {
  height: 54px;
  width: auto;
}

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

.hero {
  position: relative;
  overflow: hidden;
  background: var(--night) url('/img/skyline-full.png') center bottom / cover no-repeat;
  image-rendering: pixelated;
  padding: 64px 0 0;
}

/* Fade the sky into the page so the header sits on solid night. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 160px;
  background: linear-gradient(var(--night), transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: 600px;
}

.hero-copy {
  padding-bottom: 120px;
  image-rendering: auto;
}

.hero-copy .lede {
  margin-bottom: 28px;
}

.hero-copy .lede,
.hero-copy .small {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 12px rgba(11, 10, 60, 0.9);
}

.hero-copy .small {
  margin-top: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.hero-phones {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 640px;
  image-rendering: auto;
}

.hero-phones .phone {
  position: absolute;
  bottom: -40px;
}

.hero-phones .phone-front {
  width: 290px;
  z-index: 2;
  transform: translateX(-70px);
}

.hero-phones .phone-back {
  width: 260px;
  z-index: 1;
  transform: translate(110px, -60px) rotate(6deg);
  opacity: 0.95;
}

/* The street of buildings along the bottom of the hero. */
.street {
  position: relative;
  z-index: 1;
  height: 209px;
  margin-top: -120px;
  background: url('/img/near-buildings-bg.png') left bottom / auto 209px repeat-x;
  image-rendering: pixelated;
  pointer-events: none;
}

.street::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 40px;
  background: linear-gradient(transparent, var(--night));
}

@media (max-width: 900px) {
  .hero {
    padding-top: 40px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
    text-align: center;
  }

  .hero-copy {
    padding-bottom: 24px;
  }

  .hero-copy .lede {
    margin-left: auto;
    margin-right: auto;
  }

  .hero .store-badges {
    justify-content: center;
  }

  .hero-phones {
    height: 470px;
  }

  .hero-phones .phone-front {
    width: 220px;
    transform: translateX(-50px);
  }

  .hero-phones .phone-back {
    width: 196px;
    transform: translate(76px, -40px) rotate(6deg);
  }

  .street {
    height: 150px;
    margin-top: -90px;
    background-size: auto 150px;
  }
}

/* ---------- Device frames ---------- */

/* Phone: the screenshot (1320x2868) sits inside a dark bezel. */
.phone {
  position: relative;
  width: 280px;
  padding: 3.6%;
  border-radius: 15% / 7%;
  background: linear-gradient(145deg, #2c2c34, #0d0d10 55%);
  box-shadow:
    inset 0 0 0 2px #45454f,
    inset 0 0 0 5px #0a0a0c,
    0 30px 60px -18px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(0, 0, 0, 0.6);
}

.phone img {
  width: 100%;
  aspect-ratio: 1320 / 2868;
  object-fit: cover;
  border-radius: 12% / 5.6%;
  background: var(--background);
}

/* Dynamic Island, between the clock and the status icons. */
.phone::after {
  content: '';
  position: absolute;
  top: 5.4%;
  left: 50%;
  width: 29%;
  height: 2.6%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050506;
}

/* Foldable: one device whose width changes as it opens, like a book. The
   folded (1398x2034) and open (2853x2007) screens are almost the same height. */
.fold-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.foldable {
  --h: 520px;
  position: relative;
  height: var(--h);
  width: calc(var(--h) * 1398 / 2034 + 24px);
  max-width: 100%;
  padding: 12px;
  border-radius: 34px;
  background: linear-gradient(145deg, #2c2c34, #0d0d10 55%);
  box-shadow:
    inset 0 0 0 2px #45454f,
    inset 0 0 0 5px #0a0a0c,
    0 40px 70px -24px rgba(0, 0, 0, 0.8);
  transition: width 0.7s cubic-bezier(0.6, 0, 0.2, 1);
}

.foldable.is-open {
  width: calc(var(--h) * 2853 / 2007 + 24px);
}

.foldable .screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: var(--background);
}

.foldable .screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  transition: opacity 0.35s;
}

.foldable .screen .open-shot {
  opacity: 0;
}

.foldable.is-open .screen .open-shot {
  opacity: 1;
  transition-delay: 0.3s;
}

.foldable.is-open .screen .folded-shot {
  opacity: 0;
}

/* The crease, shown only when open. */
.foldable .screen::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 18px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07) 45%, rgba(0, 0, 0, 0.22) 55%, transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.foldable.is-open .screen::after {
  opacity: 1;
  transition-delay: 0.5s;
}

.fold-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--popover);
}

.fold-toggle button {
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 9px 18px;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.fold-toggle button[aria-pressed='true'] {
  background: rgba(115, 255, 0, 0.16);
  color: var(--primary);
}

@media (max-width: 1100px) {
  .foldable {
    --h: 420px;
  }
}

@media (max-width: 700px) {
  .foldable {
    --h: min(300px, calc((100vw - 2 * var(--gutter) - 24px) * 2007 / 2853));
    padding: 8px;
    border-radius: 22px;
  }

  .foldable.is-open {
    width: calc(var(--h) * 2853 / 2007 + 16px);
  }

  .foldable:not(.is-open) {
    width: calc(var(--h) * 1398 / 2034 + 16px);
  }

  .foldable .screen {
    border-radius: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .foldable,
  .foldable .screen img,
  .foldable .screen::after {
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 96px 0;
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}

.section-head .lede {
  margin: 0 auto;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}

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

.step {
  position: relative;
  background: rgba(64, 64, 64, 0.9);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  background: var(--primary);
  color: var(--on-bright);
  font-weight: 700;
  font-size: 1.15rem;
  border: 2px solid var(--on-bright);
  box-shadow: 3px 3px 0 var(--on-bright);
}

.step h3 {
  color: var(--primary);
}

.step p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

/* XP bar like the app's Daily Progress card. */
.xp-bar {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  margin-top: 14px;
}

.xp-bar span {
  height: 12px;
  background: var(--muted);
}

.xp-bar span.on {
  background: var(--primary);
}

@media (max-width: 820px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* Feature rows: phone on one side, words on the other. */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 40px 0;
}

.feature + .feature {
  border-top: 1px dashed rgba(112, 253, 255, 0.14);
}

.feature .phone {
  justify-self: center;
}

.feature.flip .feature-media {
  order: 2;
}

.feature h3 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--primary);
  text-shadow: 3px 3px 0 var(--on-bright);
}

.feature ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.feature li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
}

/* A pixel square bullet. */
.feature li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.55em;
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 2px 2px 0 var(--on-bright);
}

@media (max-width: 820px) {
  .feature {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: left;
  }

  .feature.flip .feature-media {
    order: 0;
  }

  .feature .phone {
    width: 240px;
  }
}

.band {
  background:
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 50%, var(--night) 100%);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.mini h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  font-size: 1.1rem;
}

.mini svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--primary);
}

.mini p {
  color: #cfcfcf;
  font-size: 0.97rem;
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Foldables ---------- */

.foldables {
  background:
    radial-gradient(ellipse 60% 50% at 50% 55%, rgba(210, 60, 220, 0.18), transparent 70%),
    var(--night);
  overflow: hidden;
}

.badge-new {
  display: inline-block;
  background: var(--neon-pink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  margin-bottom: 14px;
  box-shadow: 3px 3px 0 var(--on-bright);
}

.fold-points {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 56px;
}

.fold-points .card {
  background: rgba(38, 38, 38, 0.85);
}

.fold-points h3 {
  color: var(--accent);
  font-size: 1.05rem;
}

.fold-points p {
  font-size: 0.95rem;
  color: #cfcfcf;
}

@media (max-width: 960px) {
  .fold-points {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .fold-points {
    grid-template-columns: 1fr;
  }
}

/* ---------- Safety ---------- */

.safety {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  align-items: center;
}

.safety-art {
  display: flex;
  justify-content: center;
}

.safety-art img {
  width: 260px;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 14px;
}

.check-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
}

.check-list li::before {
  content: '';
  width: 22px;
  height: 22px;
  margin-top: 2px;
  background: var(--primary) no-repeat center / 14px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='4'%3E%3Cpath d='M4 12l5 5L20 6'/%3E%3C/svg%3E");
  border: 2px solid var(--on-bright);
}

.check-list strong {
  color: var(--foreground);
}

.check-list span {
  color: #cfcfcf;
}

@media (max-width: 820px) {
  .safety {
    grid-template-columns: 1fr;
  }

  .safety-art img {
    width: 180px;
  }
}

/* ---------- Final call to action ---------- */

.cta {
  position: relative;
  text-align: center;
  padding: 110px 0 0;
  background: linear-gradient(var(--night), var(--night-2));
  overflow: hidden;
}

.cta .store-badges {
  justify-content: center;
  margin-top: 28px;
}

.cta-drone {
  width: 96px;
  margin: 0 auto 24px;
  animation: hover 2.4s ease-in-out infinite;
}

@keyframes hover {
  50% {
    transform: translateY(-10px);
  }
}

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

.cta .skyline-strip {
  height: 124px;
  margin-top: 80px;
  background: url('/img/buildings-bg.png') left bottom / auto 124px repeat-x;
  image-rendering: pixelated;
}

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

.site-footer {
  background: var(--popover);
  border-top: 1px solid var(--border);
  padding: 40px 0 32px;
  font-size: 0.92rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.footer-links a {
  color: var(--foreground);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

.credits {
  margin-top: 28px;
  color: var(--muted-foreground);
  font-size: 0.82rem;
}

.credits a {
  color: var(--muted-foreground);
}

/* ---------- Text pages (privacy, terms, support) ---------- */

.page {
  background:
    url('/img/buildings-bg.png') left bottom / auto 124px repeat-x,
    var(--night);
  image-rendering: pixelated;
  padding: 56px 0 180px;
  min-height: calc(100vh - 64px);
}

.page-card {
  max-width: 780px;
  margin: 0 auto;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 48px);
  image-rendering: auto;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}

.page-card h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--primary);
  text-shadow: 3px 3px 0 var(--on-bright);
}

.page-card h2 {
  font-size: 1.35rem;
  color: var(--accent);
  margin-top: 2em;
}

.page-card h3 {
  font-size: 1.05rem;
  margin-top: 1.4em;
}

.page-card ul,
.page-card ol {
  padding-left: 1.3em;
}

.page-card li {
  margin-bottom: 0.5em;
}

.page-card .updated {
  color: var(--muted-foreground);
  font-size: 0.92rem;
}

.callout {
  background: var(--card);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  margin: 24px 0;
}

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

/* ---------- Forms ---------- */

.form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.field .hint {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--foreground);
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.checkbox {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 0.95rem;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--primary);
}

/* Hidden from people; bots fill it in. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.4em;
  font-weight: 600;
}

.form-status.ok {
  color: var(--primary);
}

.form-status.error {
  color: var(--destructive);
}

.form-done {
  text-align: center;
  padding: 24px 0 8px;
}

.form-done img {
  width: 120px;
  margin: 0 auto 16px;
}
