/*
 * Bowo pre-launch pages. Brand direction 2d "Pin Knot"
 * (docs/design_handoff_bowo_logo_2d): graphite on cream, near-monochrome,
 * with pink spent on the knot dot and the one primary button. Tokens match
 * src/theme.ts so the site and the app read as one brand.
 *
 * No inline styles anywhere: the Worker serves a default-src 'none' CSP with
 * style-src 'self', so every rule has to live in this file.
 */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/outfit-latin-variable.woff2') format('woff2-variations');
}

:root {
  --pink: #d3405c;
  --pink-text: #b23349;
  --graphite: #1c1c1a;
  --cream: #faf8f5;
  --cream-deep: #f3efe9;
  --blush: #efd9d6;

  --bg: var(--cream);
  --surface: #ffffff;
  --text: var(--graphite);
  --text-muted: #6f6a63;
  --border: #e9e4dd;
  --field: #ffffff;
  --shadow: 0 18px 44px rgba(28, 28, 26, 0.07);

  --wm: 34px; /* notional wordmark font size; the lockup scales off it */
  --radius: 14px;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
}

/*
 * Reversed lockup per the handoff: cream loops, dot PUNCHED through the mask
 * (never a background-coloured circle painted on top). The pink dot is spent
 * on the primary button instead, so the accent still appears exactly once.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1c1c1a;
    --text: var(--cream);
    --text-muted: #a8a29a;
    --border: #2e2d2a;
    --field: #232321;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 20px 24px;
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 6vw, 44px);
}

/* Lockup: mark height = 0.95 x wordmark size, gap = 0.4 x mark height. */
.lockup {
  display: flex;
  align-items: center;
  gap: calc(var(--wm) * 0.38);
  margin-bottom: 26px;
  color: var(--text);
}

.mark {
  height: calc(var(--wm) * 0.95);
  width: auto;
}

/* Glyph box is ~0.724 x the notional font size (master box 72.4 at 100). */
.wordmark {
  height: calc(var(--wm) * 0.724);
  width: auto;
}

.knot-punch {
  fill: #ffffff; /* opaque mask = nothing punched, the colour version */
}

.knot-dot {
  fill: var(--pink);
}

@media (prefers-color-scheme: dark) {
  .knot-punch {
    fill: #000000; /* punches the knot out of the loops */
  }

  .knot-dot {
    display: none;
  }
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pink-text);
}

@media (prefers-color-scheme: dark) {
  .eyebrow {
    color: var(--blush);
  }
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 6.4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.lede {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 16.5px;
}

.points {
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.points li {
  position: relative;
  padding-left: 20px;
  font-size: 15.5px;
  color: var(--text);
}

/* The knot dot, reused as the bullet. It is the system accent. */
.points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
}

.signup {
  border-top: 1px solid var(--border);
  padding-top: 26px;
}

.signup h2,
.thanks h2 {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  flex: 1 1 0;
  min-width: 0;
}

.field-row {
  display: flex;
  gap: 12px;
}

@media (max-width: 460px) {
  .field-row {
    flex-direction: column;
    gap: 0;
  }
}

label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.optional {
  font-weight: 400;
  color: var(--text-muted);
}

input[type='email'],
input[type='text'] {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* below 16px iOS zooms the page on focus */
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

input:focus-visible {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(211, 64, 92, 0.18);
}

input[aria-invalid='true'] {
  border-color: #b03a2e;
}

/* The honeypot. Off-screen rather than display:none, which some bots skip. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button {
  width: 100%;
  margin-top: 4px;
  padding: 14px 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  background: var(--pink);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  opacity: 0.92;
}

button:active {
  transform: translateY(1px);
}

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

button[disabled] {
  opacity: 0.6;
  cursor: default;
}

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.error {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: #b03a2e;
  background: #f4dfd9;
  border-radius: 10px;
}

@media (prefers-color-scheme: dark) {
  .error {
    background: #3a2320;
    color: #f0b3a8;
  }
}

.thanks {
  border-top: 1px solid var(--border);
  padding-top: 26px;
}

.thanks p {
  margin: 0;
  color: var(--text-muted);
}

.thanks:focus {
  outline: none;
}

.foot {
  max-width: 560px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.foot p {
  margin: 0;
}

/* QR page */
.qr-card {
  text-align: center;
}

.qr-card .lockup {
  justify-content: center;
}

.qr-frame {
  margin: 8px auto 18px;
  padding: 18px;
  width: min(320px, 78vw);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated; /* keep module edges crisp when scaled up */
}

.qr-target {
  display: inline-block;
  margin: 0 0 22px;
  padding: 7px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--cream-deep);
  border-radius: 999px;
  word-break: break-all;
}

@media (prefers-color-scheme: dark) {
  .qr-target {
    background: var(--field);
  }
}

.qr-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.qr-actions a,
.qr-actions button {
  width: auto;
  margin: 0;
  padding: 11px 16px;
  font-size: 15px;
  text-decoration: none;
  border-radius: var(--radius);
}

.qr-actions .secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .page {
    padding: 0;
  }

  .card {
    border: none;
    box-shadow: none;
  }

  .qr-actions,
  .foot,
  .print-hide {
    display: none;
  }
}
