/* ============================================================
   Ketchup — app.spencer.st
   Single landing page. Tokens live in colors_and_type.css.
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

em { font-style: normal; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s-4);
}

:focus-visible {
  outline: 2px solid var(--cta-fill);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ── Hero ──────────────────────────────────────────────────── */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 50%;
}

/* Neutral, so the photo keeps its own colour; this only buys contrast. */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.38) 34%,
    rgba(0,0,0,0.78) 78%,
    rgba(0,0,0,0.94) 100%);
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-10);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--s-8) var(--s-4) var(--s-6);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-h3);
  letter-spacing: var(--ls-tight);
  color: var(--fg-on-dark);
}

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

/* Copy block — takes the slack so the footer sits at the bottom. */
.hero-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  max-width: 13ch;
  font-size: clamp(46px, 8.4vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--fg-on-dark);
  text-wrap: balance;
}

.hero h1 em {
  color: var(--golden-hour);
}

.hero-sub {
  max-width: 46ch;
  margin: var(--s-6) 0 0;
  max-width: 40ch;
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-snug);
  color: var(--fg-on-dark-2);
}

/* CTA */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  margin-top: var(--s-8);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: 16px var(--s-6);
  border-radius: var(--r-pill);
  background: var(--cta-fill);
  color: var(--p-ink);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: var(--ls-snug);
  box-shadow: var(--shadow-pop);
  transition: transform 160ms ease, background-color 160ms ease;
}

.cta i { font-size: 20px; }

.cta:hover {
  background: var(--p-lemon-soft);
  transform: translateY(-1px);
}

.cta:active { transform: translateY(0); }

.cta-meta {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
}

/* Footer inside the hero, so the first screen is the whole story. */
.hero-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255,255,255,0.16);
  font-size: var(--t-body-sm);
  letter-spacing: var(--ls-snug);
  color: rgba(255,255,255,0.58);
}

.hero-foot a { transition: color 140ms ease; }
.hero-foot a:hover { color: var(--golden-hour); }

/* ── Screens ───────────────────────────────────────────────── */

.screens {
  padding: clamp(72px, 12vw, 140px) 0 clamp(80px, 13vw, 160px);
  background: var(--bg-dark);
}

.screens-h {
  margin: 0 0 clamp(40px, 6vw, 72px);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--fg-on-dark);
  text-wrap: balance;
}

.screens-h em {
  color: var(--golden-hour);
}

.screens-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 3vw, 40px);
}

/* The screenshots are device mockups on transparency, so the frame and the
   rounded corners come from the image. PNG keeps the alpha; flattening them to
   JPEG fills the surround with a solid colour and shows as a block. */
.phone {
  position: relative;
  margin: 0;
  aspect-ratio: 1080 / 2198;
}

.phone img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Follows the handset silhouette, unlike a box-shadow. */
  filter: drop-shadow(0 24px 40px rgba(0,0,0,0.55));
}

/* Until real screenshots land, show a calm placeholder rather than a broken icon. */
.phone.is-empty img { display: none; }

.phone.is-empty::after {
  content: "Screenshot";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: clamp(20px, 3vw, 34px);
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  background: var(--grad-haze);
  background-blend-mode: overlay;
  opacity: 0.5;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 760px) {
  .hero-inner {
    gap: var(--s-8);
    padding: var(--s-6) var(--s-4) var(--s-5);
  }

  .hero-copy { max-width: none; }

  .cta { width: 100%; justify-content: center; }
  .cta-row { gap: var(--s-3); }
  .cta-meta { width: 100%; text-align: center; }

  .hero-foot { gap: var(--s-4); }

  /* Three phones side by side stop reading below ~760px. */
  .screens-row {
    grid-template-columns: repeat(3, 68vw);
    gap: var(--s-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* Let the row bleed to the viewport edges inside the padded wrap. */
    margin: 0 calc(-1 * var(--s-4));
    padding: 0 var(--s-4) var(--s-4);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .screens-row::-webkit-scrollbar { display: none; }

  .phone { scroll-snap-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}

/* ── Page footer (used by the legal pages) ─────────────────── */

footer {
  border-top: 1px solid rgba(255,255,255,0.12);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-6) var(--s-4);
  font-size: var(--t-body-sm);
  letter-spacing: var(--ls-snug);
  color: rgba(255,255,255,0.52);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
}

.foot-links a { transition: color 140ms ease; }
.foot-links a:hover { color: var(--golden-hour); }

/* ── Language switcher ─────────────────────────────────────── */

.lang {
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: var(--r-pill);
  font-size: var(--t-meta);
  letter-spacing: 0.04em;
  opacity: 0.7;
  transition: opacity 140ms ease, color 140ms ease;
}

.lang:hover { opacity: 1; color: var(--golden-hour); }

body.legal .lang:hover { color: var(--accent); }
