@font-face {
  font-family: "LazyDog";
  src: url("fonts/LazyDog.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --ink: #14110F;
  --muted: #6F6A64;
  --accent: #FB6415;
  --accent-lip: #D94F0A;
  --accent-tint: #FFE9DC;
  --surface-lip: #E6E1DA;
  --correct: #22A06B;
  --error: #E5484D;
  --apple-bg: #000000;
  --apple-fg: #FFFFFF;

  --radius: 16px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;

  --font-ui: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --font-body: ui-serif, "New York", Georgia, serif;
  --font-head: "LazyDog", var(--font-ui);

  --control-h: 54px;
  --lip: 4px;
  --press: 80ms ease-out;
  --release: 220ms cubic-bezier(.3, 1.6, .5, 1);
  --globe: min(520px, 110vw);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0D0C;
    --surface: #1A1715;
    --ink: #F6F1EB;
    --muted: #A39C94;
    --accent-tint: #3A2316;
    --surface-lip: #2A2623;
    /* Apple's guidelines: white button on dark backgrounds */
    --apple-bg: #FFFFFF;
    --apple-fg: #000000;
  }
}

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

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

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-tint); }

html[lang="sv"] [lang="en"],
html:not([lang="sv"]) [lang="sv"],
.no-apple .apple-block { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Wordmark */
.top { padding-top: 14px; text-align: center; }

.wordmark {
  margin: 0;
  padding-left: 5px; /* balances the trailing letter-spacing */
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 5px;
  opacity: .6;
}

/* Column */
.col {
  width: 100%;
  max-width: calc(420px + 2 * var(--s4));
  margin: 0 auto;
  padding: max(var(--s5), calc(14svh - 26px)) var(--s4) 0;
}

/* Headline */
/* The visible headline is LazyDog baked into SVG outlines (tools/outline-headline.mjs), so the
   h1 text stays in the UI font and the browser never has to download LazyDog to paint it. */
.hl {
  display: flex;
  justify-content: center;
  margin: 0;
  font-size: 56px;
  font-weight: 400;
}

.hl-art {
  display: block;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.hl-art path {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.js .hl-art path {
  fill-opacity: 0;
  /* pathLength=1: one dash, a gap longer than the path, start just past it so round caps stay hidden */
  stroke-dasharray: 1 2;
  stroke-dashoffset: 1.01;
}

.js .hl-art.filled path {
  fill-opacity: 1;
  transition: fill-opacity .6s ease;
}

.sub {
  margin: var(--s4) 0 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
}

/* Signup */
.signup { margin-top: var(--s6); }

.field {
  display: flex;
  height: var(--control-h);
  background: var(--surface);
  border: 2px solid var(--surface-lip);
  border-radius: var(--radius);
  transition: border-color 120ms ease-out;
}

.field:focus-within { border-color: var(--accent); }
.field.invalid { border-color: var(--error); }

.cc {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  width: 84px;
  padding-left: var(--s4);
  border-right: 1px solid var(--surface-lip);
  margin: var(--s3) 0;
  font-size: 17px;
}

.cc-value { min-width: 3ch; font-variant-numeric: tabular-nums; }
.cc-chevron { color: var(--muted); flex: none; }

.cc select {
  position: absolute;
  inset: calc(-1 * var(--s3)) 0;
  width: 100%;
  opacity: 0;
  font-size: 17px;
  cursor: pointer;
}

.field input {
  flex: 1;
  min-width: 0;
  padding: 0 var(--s4) 0 var(--s3);
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: 17px var(--font-ui);
}

.field input::placeholder { color: var(--muted); opacity: 1; }

.msg {
  margin: var(--s2) var(--s1) 0;
  font-size: 14px;
  line-height: 20px;
}

/* The chunky button */
.chunky,
.apple {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--control-h);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.chunky {
  margin: var(--s3) 0 var(--lip);
  background: var(--accent);
  box-shadow: 0 var(--lip) 0 var(--accent-lip);
  color: #FFFFFF;
  font: 700 19px/1 var(--font-ui);
  letter-spacing: .8px;
  text-transform: uppercase;
  transition: transform var(--release), box-shadow var(--release);
}

.chunky:active:not(:disabled, .busy) {
  transform: translateY(var(--lip));
  box-shadow: 0 0 0 var(--accent-lip);
  transition: transform var(--press), box-shadow var(--press);
}

.chunky:disabled {
  background: var(--surface-lip);
  box-shadow: 0 var(--lip) 0 var(--surface-lip);
  color: var(--muted);
  cursor: default;
}

.chunky:focus-visible,
.apple:focus-visible,
.foot a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.chunky:focus-visible { outline-offset: calc(var(--lip) + 3px); }

.label {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

.spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 2.5px solid color-mix(in srgb, currentColor 35%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.busy { cursor: progress; }
.busy .label { display: none; }
.busy .spinner { display: block; }

@keyframes spin { to { transform: rotate(1turn); } }

.divider {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: var(--s4) 0;
  color: var(--muted);
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--surface-lip);
}

.apple {
  background: var(--apple-bg);
  color: var(--apple-fg);
  font: 600 17px/1 system-ui, -apple-system, sans-serif;
}

/* Success */
.done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  text-wrap: balance;
}

.done:focus { outline: none; }
.done svg { flex: none; color: var(--correct); }

/* Social proof */
.count {
  margin: var(--s5) 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.count strong { color: var(--ink); font-weight: 700; }

/* Logo gallery: every name visible at once. Tiles stay white in both themes because the logos
   are made for white. 3 columns on phones, 6 from 720px. */
.seen {
  width: 100%;
  max-width: calc(960px + 2 * var(--s4));
  margin: var(--s6) auto 0;
  padding: 0 var(--s4);
}

.seen-title {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-align: center;
  text-wrap: balance;
}

.seen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s2);
  margin: var(--s4) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .seen-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s3); }
}

.seen-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: 104px;
  padding: 0 var(--s2);
  background: #FFFFFF;
  border: 1px solid var(--surface-lip);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 17, 15, .04), 0 8px 24px -14px rgba(20, 17, 15, .16);
}

.seen-tile img { max-width: 100%; height: 36px; width: auto; object-fit: contain; }
.seen-tile img.mark { width: 36px; border-radius: 10px; }
/* SpaceX's Simple Icons glyph is a thin wordmark in a square box: draw the box larger, same row height. */
.seen-tile img.glyph-wide { height: 64px; margin: -14px 0; }

.seen-name {
  color: #14110F; /* light-theme ink: the tile is white in both themes */
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* Globe */
.globe {
  position: relative;
  flex: 1 0 140px;
  margin-top: var(--s6);
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}

.globe canvas {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--globe);
  height: var(--globe);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .6s ease-out;
}

.globe canvas.on { opacity: 1; }

/* Footer */
.foot {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: var(--s1);
  padding: 0 var(--s4) max(var(--s2), env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s2);
  color: inherit;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .js .hl-art path { fill-opacity: 1; stroke-dashoffset: 0; }
  .spinner { animation-duration: 1.6s; }
  .globe canvas { transition: none; }
}
