/* Perch — one stylesheet, no build step, no dependencies.

   Every value below comes from a token. The previous version had seventeen
   font sizes, five weights, ten corner radii and seven letter-spacings, which
   is not a design so much as a record of every decision made in order. Three
   of those font sizes (.95, .96 and .97rem) differed by less than a third of a
   pixel: three tokens, one appearance. */

:root {
  /* ---- ink ---- */
  --paper:      #FBFAFC;
  --raise:      #FFFFFF;
  --ink:        #16151A;
  --muted:      #5C5A66;
  --faint:      #6E6C78;
  --rule:       #E7E4EC;
  --ring:       rgba(22,21,26,.07);
  --soft:       #F2EFF7;
  --brand:      #5A34D6;
  --btn-ink:    #FFFFFF;
  --brand-lift: #6C4CE0;
  --brand-wash: #EEEAFC;
  --gold:       #AD6200;
  --gold-wash:  #FBF1E2;
  --shadow-sm:  0 1px 2px rgba(22,21,26,.05), 0 6px 18px -10px rgba(22,21,26,.16);
  --shadow-lg:  0 2px 6px rgba(30,20,80,.06), 0 30px 70px -34px rgba(46,28,120,.42);

  /* The dark values live here, once. Two blocks below map them, because a
     media query and an attribute selector cannot share a body. Mapping twice
     is harmless; keeping two copies of the hexes is how themes drift apart. */
  --d-paper: #0D0D11;  --d-raise: #16161C;  --d-ink:   #ECEBF0;
  --d-muted: #9C9AA6;  --d-faint: #8E8C99;  --d-rule:  #26252E;
  --d-ring:  rgba(255,255,255,.09);         --d-soft:  #1B1A22;
  --d-brand: #A294F2;  --d-btn-ink: #16151A; --d-lift: #B3A8F7;
  --d-wash:  #1E1938;  --d-gold:  #FFB020;  --d-gold-wash: #2A1F10;
  --d-shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px -10px rgba(0,0,0,.7);
  --d-shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 30px 70px -34px rgba(0,0,0,.9);

  /* ---- type: eight steps, ~1.13 ratio around a 17px base ---- */
  --t-2xs: .76rem;
  --t-xs:  .87rem;
  --t-sm:  .94rem;
  --t-md:  1rem;
  --t-lg:  1.13rem;
  --t-xl:  clamp(1.2rem, 2.2vw, 1.4rem);
  --t-2xl: clamp(1.7rem, 3.4vw, 2.3rem);
  --t-3xl: clamp(2.5rem, 6.2vw, 3.9rem);

  /* ---- three weights. 550 and 650 only exist on a variable font; off macOS
         they snapped to 500 and 700 and the page changed shape. ---- */
  --w-body: 400;
  --w-mid:  600;
  --w-bold: 700;

  /* ---- tracking belongs to display sizes and small caps, nowhere else ---- */
  --track-tight: -.03em;
  --track-snug:  -.018em;
  --track-wide:  .09em;

  /* ---- four radii ---- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* ---- spacing ---- */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem;  --s7: 3rem;

  --bar-h: 3.6rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: var(--d-paper); --raise: var(--d-raise); --ink: var(--d-ink);
    --muted: var(--d-muted); --faint: var(--d-faint); --rule: var(--d-rule);
    --ring: var(--d-ring);   --soft: var(--d-soft);   --brand: var(--d-brand);
    --btn-ink: var(--d-btn-ink); --brand-lift: var(--d-lift);
    --brand-wash: var(--d-wash); --gold: var(--d-gold);
    --gold-wash: var(--d-gold-wash);
    --shadow-sm: var(--d-shadow-sm); --shadow-lg: var(--d-shadow-lg);
  }
}

:root[data-theme="dark"] {
  --paper: var(--d-paper); --raise: var(--d-raise); --ink: var(--d-ink);
  --muted: var(--d-muted); --faint: var(--d-faint); --rule: var(--d-rule);
  --ring: var(--d-ring);   --soft: var(--d-soft);   --brand: var(--d-brand);
  --btn-ink: var(--d-btn-ink); --brand-lift: var(--d-lift);
  --brand-wash: var(--d-wash); --gold: var(--d-gold);
  --gold-wash: var(--d-gold-wash);
  --shadow-sm: var(--d-shadow-sm); --shadow-lg: var(--d-shadow-lg);
}

* { box-sizing: border-box; }

/* 106.25% of the browser's own base is 17px by default and still honours a
   reader who has raised it. A hard 17px on body while every child used rem
   meant the children were sized against 16px and the relationship the sizes
   implied did not exist. */
html { font-size: 106.25%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
               system-ui, sans-serif;
  font-size: var(--t-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-lift); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--r-sm); }

.wrap { max-width: 66rem; margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2rem); }
.narrow { max-width: 40rem; }
.center { text-align: center; }
.stack-lg { margin-top: var(--s5); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: var(--paper);                                   /* fallback first */
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--rule);
}
.bar .wrap { display: flex; align-items: center; gap: var(--s5); height: var(--bar-h); }
.brandmark {
  display: flex; align-items: center; gap: var(--s2);
  font-weight: var(--w-mid); letter-spacing: var(--track-snug);
  text-decoration: none; color: var(--ink);
}
.brandmark img { width: 26px; height: 26px; border-radius: var(--r-sm); }
.bar nav { margin-left: auto; display: flex; align-items: center; gap: var(--s5); font-size: var(--t-xs); }
.bar nav a { color: var(--muted); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }
.nav-cta { color: var(--brand); font-weight: var(--w-mid); }

/* Four links, a wordmark and a button need 417px; the phone has 375px. Hide
   the in-page jump links, which are only a shortcut past a scroll. Targeting
   :not(.nav-cta) instead would have emptied the nav on the legal pages, where
   every link is a real destination and none of them is the download. */
@media (max-width: 30rem) {
  .bar nav a[href^="#"] { display: none; }
  /* The legal pages keep three real links, and at a 1.5rem gap the theme
     toggle was pushed off the right edge. */
  .bar .wrap, .bar nav { gap: var(--s3); }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(2rem, 4vw, 3.25rem) 0 clamp(2rem, 5vw, 3.5rem);
}
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(46% 46% at 76% 22%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 70%),
    radial-gradient(42% 42% at 18% 8%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
h1 {
  font-size: var(--t-3xl); line-height: 1.04;
  letter-spacing: var(--track-tight); font-weight: var(--w-bold);
  margin: 0 0 var(--s3); text-wrap: balance;
}
.lede {
  font-size: var(--t-xl); color: var(--muted);
  max-width: 42rem; margin: 0 auto var(--s5); text-wrap: balance;
}
.tagline {
  color: var(--muted); font-size: var(--t-sm); font-weight: var(--w-mid);
  margin: 0 0 var(--s5); letter-spacing: .02em;
}
.meta { color: var(--faint); font-size: var(--t-xs); margin-top: var(--s4); }
.price { color: var(--faint); font-size: var(--t-xs); margin-top: 0; }
.price b { color: var(--ink); font-weight: var(--w-mid); }

.loop { margin: var(--s6) auto 0; max-width: 46rem; }
.loop video {
  width: 100%; display: block; border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--ring);
  background: var(--soft);
}
.loop figcaption { margin-top: var(--s3); font-size: var(--t-xs); color: var(--faint); }
.loop figcaption a { color: var(--brand); font-weight: var(--w-mid); }
@media (prefers-reduced-motion: reduce) {
  .loop video { display: none; }
  .loop {
    background: url(assets/demo-poster.webp) center/cover no-repeat;
    aspect-ratio: 1/1; border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  }
}

.cta-row { margin: 0 0 var(--s3); }
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  background: var(--brand); color: var(--btn-ink); text-decoration: none;
  border-radius: var(--r-md); padding: .92rem 1.7rem;
  font-size: var(--t-lg); font-weight: var(--w-mid); letter-spacing: var(--track-snug);
  box-shadow: 0 1px 2px rgba(46,28,120,.22), 0 14px 30px -14px rgba(46,28,120,.55);
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.btn:hover {
  background: var(--brand-lift); transform: translateY(-1px);
  box-shadow: 0 1px 2px rgba(46,28,120,.24), 0 18px 36px -14px rgba(46,28,120,.6);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--brand-lift); outline-offset: 3px; }

.theme-toggle {
  background: none; border: 1px solid var(--rule); border-radius: var(--r-sm);
  color: var(--muted); cursor: pointer; font: inherit; font-size: var(--t-xs);
  padding: .34rem .6rem; line-height: 1; display: inline-flex;
  align-items: center; transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--brand); }
.theme-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .btn, .card { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- sections ---------- */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
section[id] { scroll-margin-top: calc(var(--bar-h) + var(--s4)); }
.eyebrow {
  font-size: var(--t-2xs); font-weight: var(--w-mid);
  letter-spacing: var(--track-wide); text-transform: uppercase;
  color: var(--brand); margin: 0 0 var(--s3);
}
h2 {
  font-size: var(--t-2xl); line-height: 1.15;
  letter-spacing: var(--track-snug); font-weight: var(--w-bold);
  margin: 0 0 var(--s3); text-wrap: balance;
}
h3 { font-size: var(--t-lg); font-weight: var(--w-mid); margin: 0 0 var(--s1); }
p { margin: 0 0 var(--s4); }
.sub { color: var(--muted); max-width: 38rem; }
.sub:last-child { margin-bottom: 0; }

/* ---------- the differentiator ---------- */
.feature { display: grid; gap: clamp(1.8rem, 4vw, 3.4rem); align-items: center; }
@media (min-width: 54rem) {
  .feature { grid-template-columns: 1fr 1.25fr; }
  .feature.flip > :first-child { order: 2; }
}
/* Every screenshot is dark and the page is light by default, so each one
   arrives as a hole punched in the paper. A hairline ring in the ink colour
   makes it a placed object instead. */
.shot {
  width: 100%; height: auto; display: block;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--ring);
}
/* The alert composite carries its own transparent padding so the notification
   can overhang the window. A card shadow on that draws a box around nothing. */
.shot--bare { border-radius: 0; box-shadow: none; }

/* ---------- grid ---------- */
/* Four items and auto-fit is a trap: at this container width it resolves to
   three columns and drops the fourth onto a row of its own. Both four-item
   grids on this page did it. Stating the columns costs two media queries and
   removes the orphan at every width. */
.cards {
  display: grid; gap: var(--s4); margin-top: var(--s6);
  grid-template-columns: 1fr;
}
@media (min-width: 34rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--raise); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm);
}
.card p { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.icon {
  width: 2.2rem; height: 2.2rem; border-radius: var(--r-md); margin-bottom: var(--s3);
  background: var(--brand-wash); color: var(--brand);
  display: grid; place-items: center;
}
.icon svg { width: 20px; height: 20px; display: block; }

/* ---------- gallery ---------- */
.gallery {
  display: flex; gap: var(--s4); overflow-x: auto;
  padding: var(--s2) var(--s1) var(--s5);
  scroll-snap-type: x mandatory;
}
.gallery:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.gallery img {
  flex: 0 0 auto; width: min(34rem, 82vw); height: auto;
  scroll-snap-align: center; border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--ring);
  background: var(--raise);
}
.scroll-hint { font-size: var(--t-xs); color: var(--faint); margin: 0; }

/* ---------- privacy strip ---------- */
.strip { background: var(--soft); border-block: 1px solid var(--rule); }
.checks {
  list-style: none; padding: 0; margin: var(--s5) 0 0;
  display: grid; gap: var(--s3) var(--s5);
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) { .checks { grid-template-columns: repeat(2, 1fr); } }
.checks li {
  display: flex; gap: var(--s3); align-items: flex-start;
  color: var(--muted); font-size: var(--t-sm);
}
.checks b { color: var(--ink); font-weight: var(--w-mid); }
.tick { color: var(--brand); flex: none; font-weight: var(--w-bold); }

/* ---------- legal pages ---------- */
.doc { padding: clamp(2.5rem, 6vw, 4rem) 0 6rem; }
.doc h1 { font-size: var(--t-2xl); text-align: left; margin-bottom: var(--s1); }
.doc .stamp { color: var(--faint); font-size: var(--t-xs); margin: 0 0 var(--s6); }
.doc h2 { font-size: var(--t-lg); font-weight: var(--w-mid); margin: var(--s6) 0 var(--s2); }
.doc p, .doc li { color: var(--muted); }
.doc strong { color: var(--ink); font-weight: var(--w-mid); }
.doc ul { padding-left: 1.15rem; }
.doc li { margin-bottom: var(--s1); }
.doc li::marker { color: var(--faint); }
.callout {
  background: var(--gold-wash); border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.1rem 1.3rem; margin: var(--s5) 0;
}
.callout p { margin: 0; }
.callout p + p { margin-top: var(--s3); }
code {
  background: var(--soft); border: 1px solid var(--rule);
  padding: .12em .4em; border-radius: var(--r-sm);
  font-size: .88em; overflow-wrap: anywhere;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--rule); padding: var(--s6) 0 var(--s7);
  color: var(--faint); font-size: var(--t-xs);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; }
footer nav { margin-left: auto; display: flex; gap: var(--s5); }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }
