/* Snapline — purchase pages.
 *
 * The page is a screen with a capture selection on it. The backdrop is dimmed
 * the way macOS dims everything outside a screenshot selection; the offer sits
 * in the one undimmed rectangle, inside a marquee with corner handles and a
 * live dimension readout. That device is the product's own most recognizable
 * artifact, it is doing the layout's actual work — framing the one thing on
 * the page — and it is the only place any boldness is spent. Everything
 * around it stays quiet.
 */

:root {
  /* Outside the selection: the dimmed screen. Cool slate rather than black —
     macOS dims, it does not black out. */
  --dim: #191c22;
  --dim-raised: #21252d;
  --edge: #2f343e;

  /* Inside the selection: undimmed. */
  --clear: #fcfcfd;
  --ink: #15171c;
  --ink-soft: #5b6270;
  --rule: #e4e6ea;

  /* The selection itself. macOS system blue, because that is what a selection
     is drawn in on this platform. */
  --marquee: #0a84ff;
  --marquee-ink: #6db4ff;

  --display: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step: 8px;
  --measure: 62ch;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--dim);
  color: #c9ced8;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* ── The menu bar ──────────────────────────────────────────────────────────
   Not decoration: Snapline has no Dock icon and lives up here, which is the
   first thing anyone has to understand about it. It doubles as the header. */

.menubar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 30px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.045);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  color: #8a919e;
  backdrop-filter: blur(12px);
}

.menubar__mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: #e6e9ef;
  letter-spacing: -0.01em;
}

.menubar__glyph {
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  position: relative;
}

.menubar__glyph::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.55;
}

.menubar__spacer { margin-left: auto; }

.menubar__note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #767d8a;
}

/* ── The selection ─────────────────────────────────────────────────────────
   `selection` is the positioning context for the handles and the readout;
   `selection__pane` is the undimmed rectangle that holds the offer. */

.stage {
  display: flex;
  justify-content: center;
  padding: clamp(40px, 9vh, 88px) 20px clamp(20px, 4vh, 36px);
}

/* Sized to the measure of the copy inside it rather than to the viewport: a
   selection dragged wider than its content reads as a mistake, and this one is
   the page's whole device. */
.selection {
  position: relative;
  width: min(600px, 100%);
}

.selection__pane {
  position: relative;
  background: var(--clear);
  color: var(--ink);
  border: 1px solid var(--marquee);
  padding: clamp(28px, 5vw, 56px);
  clip-path: inset(0);
}

/* The drag: the selection opens from its centre once, on load. Nothing else
   on the page moves. */
@media (prefers-reduced-motion: no-preference) {
  .selection__pane {
    animation: drag-open 460ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
  }
  .selection__handle,
  .selection__readout {
    animation: settle 200ms ease-out 380ms both;
  }
}

@keyframes drag-open {
  from { clip-path: inset(46% 46% 46% 46%); }
  to   { clip-path: inset(0); }
}

@keyframes settle {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Eight, not four — a macOS selection carries handles at the corners *and*
   the edge midpoints, and the eight together are what make the rectangle read
   as a selection at a glance rather than as a card with a blue border. */
.selection__handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--marquee);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.25);
}

.selection__handle--tl { top: -5px; left: -5px; }
.selection__handle--tr { top: -5px; right: -5px; }
.selection__handle--bl { bottom: -5px; left: -5px; }
.selection__handle--br { bottom: -5px; right: -5px; }
.selection__handle--tm { top: -5px; left: 50%; margin-left: -5px; }
.selection__handle--bm { bottom: -5px; left: 50%; margin-left: -5px; }
.selection__handle--ml { left: -5px; top: 50%; margin-top: -5px; }
.selection__handle--mr { right: -5px; top: 50%; margin-top: -5px; }

/* The dimension HUD, where macOS puts it: just outside the corner you dragged
   to. It reads the pane's real rendered size, so it is true at every width. */
.selection__readout {
  position: absolute;
  right: 0;
  bottom: -30px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--marquee-ink);
  font-variant-numeric: tabular-nums;
}

/* ── The offer ─────────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 calc(var(--step) * 2);
}

.headline {
  font-size: clamp(2.1rem, 5.6vw, 3.1rem);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.035em;
  line-height: 1.04;
  margin: 0 0 calc(var(--step) * 2);
  text-wrap: balance;
}

.standfirst {
  font-size: 1.06rem;
  color: var(--ink-soft);
  margin: 0 0 calc(var(--step) * 4);
  max-width: 46ch;
  text-wrap: pretty;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: calc(var(--step) * 3);
}

.price__amount {
  font-size: clamp(2.3rem, 6vw, 3rem);
  font-weight: 700;
  font-stretch: 105%;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.price__amount[data-state="loading"] {
  color: transparent;
  background: linear-gradient(90deg, var(--rule), #f0f1f4, var(--rule));
  border-radius: 4px;
  min-width: 3.6ch;
  animation: shimmer 1.1s linear infinite;
  background-size: 200% 100%;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* The list price, struck through beside what is actually charged. Quiet on
   purpose — the number being paid is the one that matters, and a loud "was"
   reads as a sales tactic rather than a fact. */
.price__was {
  font-size: 1.15rem;
  color: var(--ink-soft);
  text-decoration-thickness: 1px;
  font-variant-numeric: tabular-nums;
}

.price__was[hidden] { display: none; }

.price__unit {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  background: var(--marquee);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.buy:hover { background: #0071e3; }
.buy:disabled { background: #a9b0bb; cursor: default; }

.assurance {
  margin: calc(var(--step) * 2) 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  max-width: 44ch;
}

.fallback {
  margin: calc(var(--step) * 2) 0 0;
  padding: 12px 14px;
  border: 1px solid #f0c98a;
  background: #fdf6e9;
  border-radius: 6px;
  font-size: 0.94rem;
  color: #6b4f18;
}

.fallback[hidden] { display: none; }

/* ── Below the selection ──────────────────────────────────────────────────
   Outside the marquee, so it stays dimmed: it is context, not the offer. */

.terms {
  max-width: min(600px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 6vh, 56px) 20px clamp(56px, 10vh, 96px);
  display: grid;
  gap: 28px;
  /* Three or one, never two-and-an-orphan. */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.term__title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--marquee-ink);
  margin: 0 0 8px;
}

.term__body {
  margin: 0;
  font-size: 0.95rem;
  color: #9ba2ae;
  text-wrap: pretty;
}

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: #6b7280;
}

.footer a { text-decoration-color: rgba(255, 255, 255, 0.25); }

@media (max-width: 560px) {
  .selection__handle { display: none; }
  .selection__readout { display: none; }
  .selection__pane { border-radius: 10px; }
}
