/* Generated by tools/build_site.py - edit there, not here. */

/* NEITHER END IS TAKEN TO ITS EXTREME. The app's own dark surface is #1A1C1E,
   which is right on a phone held at night and reads as a black page in a browser
   window - and it was darker than the phone screenshots lying on it, so every
   image glowed like a light box. The light end started at #FBFCFE, near enough
   to paper that the cards on it had nothing to lift off. So the page sits a step
   in from both: a soft grey-blue in light, a lifted charcoal in dark, with the
   cards and the code blocks moving the other way in each. */
:root {
  --surface:  #F1F4F8;
  --raise:    #FAFBFD;
  --line:     #D5DCE5;
  --ink:      #161A20;
  --ink-mid:  #4C555F;
  --accent:   #2C5AA0;
  --record:   #C0392F;
  --play:     #14713C;
  --code-bg:  #E7ECF3;
  --wrap:     44rem;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #22262B;
    --raise:   #2C3137;
    --line:    #3B4149;
    --ink:     #E4E7EB;
    --ink-mid: #B2BAC4;
    --accent:  #9ECAFF;
    --record:  #FF7A6B;
    --play:    #6FDF9B;
    --code-bg: #1B1F23;
  }
}

:root[data-theme="dark"] {
    --surface: #22262B;
    --raise:   #2C3137;
    --line:    #3B4149;
    --ink:     #E4E7EB;
    --ink-mid: #B2BAC4;
    --accent:  #9ECAFF;
    --record:  #FF7A6B;
    --play:    #6FDF9B;
    --code-bg: #1B1F23;
}

* { box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  line-height: 1.62;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

/* The RULE spans the window; the CONTENT does not. A sticky bar whose border
   stops short of the edges reads as a floating card rather than a header, so
   the bar stays full width and everything inside it sits in the same column as
   the prose - same max-width, same side padding, so the wordmark starts exactly
   where the headline does. */
.bar {
  padding: .9rem 0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 5;
}
.column { max-width: var(--wrap); margin: 0 auto; padding: 0 1.4rem; }
.bar .column {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700;
         color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand img { border-radius: 22%; }
.bar-end { display: flex; align-items: center; gap: .9rem; }
.bar nav a { color: var(--ink-mid); text-decoration: none; margin-left: 1.1rem;
             font-size: .92rem; }
.bar nav a:first-child { margin-left: 0; }
.bar nav a:hover { color: var(--accent); }

.theme {
  display: inline-flex; align-items: center; gap: .35rem;
  font: inherit; font-size: .92rem; color: var(--ink-mid);
  background: var(--raise); border: 1px solid var(--line); border-radius: 999px;
  padding: .2rem .66rem; cursor: pointer;
}
.theme:hover { color: var(--accent); border-color: var(--accent); }
.theme svg { width: 14px; height: 14px; }
/* The word goes before the button does. Below this the wordmark, three links and
   a labelled button do not fit on one line, and a masthead that wraps to two
   looks broken rather than responsive. */
@media (max-width: 32rem) {
  .theme .theme-name { display: none; }
  .bar nav a { margin-left: .85rem; }
  .bar-end { gap: .6rem; }
}

main { max-width: var(--wrap); margin: 0 auto; padding: 2.6rem 1.4rem 5rem; }

h1 { font-size: 2.1rem; line-height: 1.18; letter-spacing: -.02em; margin: 0 0 .8rem; }
h2 { font-size: 1.28rem; margin: 2.6rem 0 .7rem; letter-spacing: -.01em; }
h3 { font-size: 1.02rem; margin: 1.6rem 0 .4rem; }
p  { margin: .7rem 0; }
a  { color: var(--accent); }
.lead { font-size: 1.1rem; color: var(--ink-mid); }
.muted { color: var(--ink-mid); font-size: .93rem; }

.cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 .6rem; }
.btn {
  display: inline-block; padding: .62rem 1.15rem; border-radius: 999px;
  background: var(--accent); color: var(--surface); text-decoration: none;
  font-weight: 600; font-size: .96rem; border: 1px solid transparent;
}
.btn.ghost { background: var(--raise); color: var(--accent); border-color: var(--line); }
.btn:hover { filter: brightness(1.06); }

.shots {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .8rem; margin: 2.2rem 0 .6rem;
}
.shot {
  padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: var(--raise); cursor: zoom-in; overflow: hidden; display: block;
}
.shot img { width: 100%; height: auto; display: block; }
.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1rem; overflow-x: auto; font-size: .86rem; line-height: 1.5;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
p code, li code { background: var(--code-bg); padding: .1rem .32rem; border-radius: 5px; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .94rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line);
         vertical-align: top; }
th { color: var(--ink-mid); font-weight: 600; }

.note {
  border-left: 3px solid var(--record); background: var(--raise);
  padding: .8rem 1rem; border-radius: 0 10px 10px 0; margin: 1.4rem 0;
}
/* Two callouts on one page, and they are not the same kind of thing: one is a
   warning about the law, the other is a fact about how the app behaves. The
   accent keeps the second from reading as a second alarm. */
.note.info { border-left-color: var(--accent); }
.note strong { color: var(--ink); }

footer {
  border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.6rem 0 3rem;
  color: var(--ink-mid); font-size: .9rem; text-align: center;
}
footer a { color: var(--ink-mid); }

/* ── the screenshot viewer ── */

.viewer {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .82);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem; cursor: zoom-out;
}
.viewer[hidden] { display: none; }
.viewer img {
  max-width: min(92vw, 420px); max-height: 92vh;
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
/* FITTING THE HEIGHT STOPS BEING AN ENLARGEMENT ON A SHORT WINDOW. These are
   phone screenshots at roughly 1:2.24 and the thumbnail is already ~230px wide,
   so in a docked browser pane 92vh can be SMALLER than the picture that was
   clicked. Below that point, size by width and let the overlay scroll -
   flex-start rather than centre, or the overflowing top cannot be reached. */
@media (max-height: 780px) {
  .viewer { align-items: flex-start; overflow: auto; }
}
.vnav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.vnav:hover { background: rgba(255, 255, 255, .26); }
/* Beside the picture where there is room for them, at the window's edge where
   there is not: the image is capped at 420px, so past a ~1000px window the
   arrows can sit outside it, and below that they overlap it. */
.vnav.prev { left: max(.6rem, calc(50vw - min(46vw, 210px) - 62px)); }
.vnav.next { right: max(.6rem, calc(50vw - min(46vw, 210px) - 62px)); }
.viewer.solo .vnav { display: none; }
.vcount {
  position: fixed; bottom: 1.2rem; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .75); font-size: .85rem;
}
.viewer.solo .vcount { display: none; }
