/* Stash Library — site styles.
 *
 * The palette is the app's own, sampled from its screenshots rather than invented: warm paper
 * (#fffdf8 / #faf6ef), the rail's deeper sand (#ebe4d8), the blue of a selected chip (#2c52b7),
 * the green a fallen price is written in and the amber of a shopping list. A site that does not
 * look like the app it sells makes the screenshots feel borrowed.
 *
 * Type is deliberately unlike Crate's: this is a keyboard tool, so a crisp grotesque with a mono for
 * key caps and query syntax, not a display serif. Spacing runs on an 8px grid.
 *
 * Key caps follow Eric's design system: tinted with the accent, a border and a heavier bottom edge,
 * one cap per glyph so ⌃⌘S reads as three keys rather than a smudge.
 */

:root {
  --paper: #fffdf8;
  --paper-2: #faf6ef;
  --sand: #ebe4d8;
  --sand-2: #e2d9c9;
  --ink: #1d1b16;
  --ink-2: #433d34;
  --muted: #6a6356;
  --line: #ddd3c2;
  --accent: #2c52b7;
  --accent-ink: #ffffff;
  --accent-soft: rgba(44, 82, 183, .09);
  --green: #1f7f55;
  --amber: #a86a08;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(29, 27, 22, .05), 0 10px 28px rgba(29, 27, 22, .08);
  --shadow-lift: 0 2px 4px rgba(29, 27, 22, .06), 0 16px 36px rgba(29, 27, 22, .12);
  --shot-shadow: rgba(29, 27, 22, .2);
  --maxw: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161b; --paper-2: #181b21; --sand: #1f232c; --sand-2: #272c37;
    --ink: #eceef2; --ink-2: #c9cfd9; --muted: #9aa2b1; --line: #2c313c;
    --accent: #93aaf6; --accent-ink: #0f1420; --accent-soft: rgba(147, 170, 246, .12);
    --green: #4cc48c; --amber: #e0a545;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .4);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 36px rgba(0, 0, 0, .5);
    --shot-shadow: rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  --paper: #14161b; --paper-2: #181b21; --sand: #1f232c; --sand-2: #272c37;
  --ink: #eceef2; --ink-2: #c9cfd9; --muted: #9aa2b1; --line: #2c313c;
  --accent: #93aaf6; --accent-ink: #0f1420; --accent-soft: rgba(147, 170, 246, .12);
  --green: #4cc48c; --amber: #e0a545;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .4);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 36px rgba(0, 0, 0, .5);
  --shot-shadow: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.62 "Inter Tight", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Every screenshot carries its intrinsic width/height so the page reserves the right space before it
   loads. Those attributes also SET the height, so without this a shot scaled by width keeps its full
   pixel height and stretches to many times its proper size. */
img { max-width: 100%; height: auto; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 24px; } }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 50;
  padding: 8px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
}
.skip:focus { top: 12px; text-decoration: none; }

/* --- header ------------------------------------------------------------------------------------ */
.top { display: flex; align-items: center; gap: 24px; padding: 24px 0 8px; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); position: relative; flex: 0 0 26px; }
.brand-mark::after {
  content: ""; position: absolute; left: 6px; top: 6px; width: 6px; height: 14px;
  border-radius: 2px; background: var(--paper);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav .discord, .pill.discord { display: inline-flex; align-items: center; gap: 7px; }
.nav .discord svg, .pill.discord svg { width: 17px; height: 17px; }

/* --- type ---------------------------------------------------------------------------------------- */
.label {
  font: 600 12px/1 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px;
}
h1 {
  font-size: clamp(40px, 5.9vw, 68px); line-height: 1.02; letter-spacing: -.035em;
  margin: 0 0 24px; font-weight: 800;
}
h1 em { font-style: normal; color: var(--accent); }
h2 {
  font-size: clamp(28px, 3.3vw, 40px); line-height: 1.1; letter-spacing: -.025em;
  margin: 0 0 16px; font-weight: 700;
}
h3 { font-weight: 700; letter-spacing: -.01em; }

code {
  font: 500 .86em/1 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 3px 6px; border-radius: 6px; background: var(--sand); color: var(--ink);
  white-space: nowrap;
}

/* Key caps. One element per glyph; adjacent caps sit 3px apart so a chord reads as keys. */
kbd {
  display: inline-block; min-width: 1.7em; text-align: center;
  font: 600 12.5px/1 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 5px 6px 4px; border-radius: 6px; vertical-align: .08em;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 7%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-bottom-width: 2px;
}
kbd + kbd { margin-left: 3px; }

/* --- hero ----------------------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px; align-items: center; padding: 48px 0 40px;
}
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-2); margin: 0 0 32px; max-width: 42ch; }
.pills { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink-2); font-size: 15px; font-weight: 500;
}
a.pill:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.pill.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }

/* A soft wash behind the pictures, so they sit on something rather than float. */
.hero-art { position: relative; min-height: 440px; }
.hero-art::before {
  content: ""; position: absolute; inset: -8% -12% -10% -6%; z-index: -1;
  background: radial-gradient(60% 60% at 55% 45%, var(--accent-soft), transparent 70%);
}
/* The screenshots carry their own frame — a macOS window, an Apple device bezel — with transparent
   corners. So no CSS border or radius, and drop-shadow rather than box-shadow, because drop-shadow
   follows the silhouette instead of casting a rectangle behind a rounded phone. */
.hero-art .mac { width: 100%; max-width: 600px; display: block; filter: drop-shadow(0 20px 44px var(--shot-shadow)); }
.hero-art .phone {
  position: absolute; right: -16px; bottom: -28px; width: 196px;
  filter: drop-shadow(0 18px 36px var(--shot-shadow));
}

/* --- what only Stash does ------------------------------------------------------------------------ */
.only {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  padding: 8px 0 72px;
}
.only-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--paper-2); border: 1px solid var(--line); color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.only-card:hover {
  text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}
.only-card b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.only-card b::after { content: " \2192"; color: var(--accent); font-weight: 600; }
.only-card > span { color: var(--muted); font-size: 15px; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .only-card { transition: none; } .only-card:hover { transform: none; } }

/* --- sections -------------------------------------------------------------------------------------- */
section.band { padding: 88px 0; border-top: 1px solid var(--line); }
section.band.alt { background: var(--paper-2); }
.row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.row.flip .copy { order: 2; }
.row.flip > :not(.copy) { order: 1; }
.copy { max-width: 52ch; }
.copy.wide { max-width: 64ch; margin-bottom: 40px; }
.copy p { color: var(--ink-2); margin: 0 0 16px; }
.copy p.soft { color: var(--muted); font-size: 16px; }
.facts { list-style: none; margin: 24px 0 0; padding: 0; }
.facts li { position: relative; padding-left: 24px; margin-bottom: 12px; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.facts li::before {
  content: ""; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px;
  border-radius: 2px; background: var(--accent); opacity: .7;
}
.shot img { width: 100%; display: block; filter: drop-shadow(0 16px 34px var(--shot-shadow)); }
.shot.phones { display: flex; gap: 24px; justify-content: center; }
.shot.phones picture { flex: 0 1 46%; max-width: 270px; }
.shot.pad { max-width: 1000px; margin: 48px auto 0; }

.note {
  margin-top: 24px; padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--ink-2); font-size: 16px;
}
.note b { color: var(--ink); }

/* --- the keyboard section (its contents are generated by scripts/site_keys.py) ------------------ */
.keys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kgroup {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px 12px;
}
.kgroup h3 {
  margin: 0 0 8px;
  font: 600 12px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.kgroup ul { list-style: none; margin: 0; padding: 0; }
.kgroup li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.kgroup li:first-child { border-top: 0; }
.kl { color: var(--ink-2); font-size: 15.5px; }
.kc { white-space: nowrap; flex: 0 0 auto; }
.kor { margin: 0 6px; color: var(--muted); font-size: 13px; }

/* --- search, as it reads a query ---------------------------------------------------------------- */
.searchmock {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow);
}
.searchmock .field {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 12px; font-size: 17px; font-weight: 500;
  background: var(--paper-2); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.glass {
  position: relative; width: 12px; height: 12px; border: 2px solid var(--muted); border-radius: 50%;
  flex: 0 0 12px; margin-right: 2px;
}
.glass::after {
  content: ""; position: absolute; width: 2px; height: 6px; background: var(--muted);
  right: -4px; bottom: -5px; transform: rotate(-45deg); border-radius: 1px;
}
.caret { width: 2px; height: 20px; background: var(--accent); margin-left: 1px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
.reads { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.read { color: var(--muted); font-size: 15px; }
.read b {
  display: inline-block; min-width: 108px; margin-right: 10px;
  font: 600 13.5px/1.6 "JetBrains Mono", ui-monospace, monospace; color: var(--accent);
}
.result {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line);
}
.result .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 8px; }
.result b { display: block; font-size: 15.5px; }
.result small { color: var(--muted); font-size: 13.5px; }
.small { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }

/* --- a conversation with Claude ---------------------------------------------------------------- */
.chat {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow);
}
.msg { margin: 0; padding: 12px 16px; border-radius: 16px; font-size: 15.5px; line-height: 1.5; max-width: 88%; }
.msg.you { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.msg.ai { align-self: flex-start; background: var(--sand); color: var(--ink); border-bottom-left-radius: 5px; }
.chat .small { margin-top: 4px; }

/* --- the smaller things ------------------------------------------------------------------------ */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.tile { padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
.tile h3 { margin: 0 0 8px; font-size: 17.5px; }
.tile p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* --- closing + footer --------------------------------------------------------------------------- */
.close { text-align: center; padding: 96px 0; border-top: 1px solid var(--line); }
.close h2 { max-width: 20ch; margin: 0 auto 16px; }
.close p { color: var(--ink-2); max-width: 58ch; margin: 0 auto 32px; }
.close .pills { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 32px 0 56px; color: var(--muted); font-size: 14.5px; }
.foot-inner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.foot-links { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }

/* --- support / privacy pages -------------------------------------------------------------------- */
.page { padding: 40px 0 72px; max-width: 760px; }
.page h1 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 8px; }
.page h2 { font-size: 22px; margin: 40px 0 8px; }
.page h3 { font-size: 17.5px; margin: 24px 0 6px; }
.page p, .page li { color: var(--ink-2); }
.page ul { padding-left: 20px; }
.page li { margin-bottom: 8px; }
.updated { color: var(--muted); font-size: 14.5px; margin-bottom: 24px; }
.qa { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.qa h3 { margin-top: 0; }
.emailrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; }
.emailrow code { font-size: 15px; padding: 9px 12px; }
.emailrow button {
  font: 500 14px/1 inherit; padding: 9px 13px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer;
}
.emailrow button:hover { background: var(--sand); }

/* --- screenshots open full size (site.js) --------------------------------------------------------- */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  padding: 28px; background: rgba(16, 15, 12, .88);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.lightbox.on { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; animation: lb-in .16s ease-out; }
@keyframes lb-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lightbox img { animation: none; } }
.lightbox .lb-close {
  position: absolute; top: 18px; right: 20px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .1);
  color: #fff; font: 400 22px/1 system-ui, sans-serif; cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255, 255, 255, .2); }
.lightbox .lb-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.lightbox .lb-cap {
  position: absolute; left: 0; right: 0; bottom: 16px; text-align: center;
  color: rgba(255, 255, 255, .75); font-size: 14px; padding: 0 72px;
}

/* --- narrow ------------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .only { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 32px; }
  .hero-art { min-height: 0; }
  .hero-art .mac { max-width: 100%; margin: 0 auto; }
  .hero-art .phone { position: static; width: 150px; margin: -48px 8% 0 auto; display: block; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .row.flip .copy, .row.flip > :not(.copy) { order: initial; }
  .keys-grid { grid-template-columns: minmax(0, 1fr); }
  section.band { padding: 56px 0; }
  .nav { width: 100%; margin-left: 0; gap: 16px; }
  .nav a { font-size: 14px; }
}
@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .lede { font-size: 18px; }
  .only, .grid { grid-template-columns: minmax(0, 1fr); }
  .only { padding-bottom: 48px; }
  .kgroup li { flex-wrap: wrap; gap: 6px; }
  .read b { min-width: 0; display: block; }
  .foot-links { margin-left: 0; width: 100%; }
  .lightbox { padding: 12px; }
  .lightbox .lb-cap { display: none; }
}

/* A chord never splits across a line; two caps on two lines read as two separate keys. */
.chord { white-space: nowrap; }

/* The key groups flow as two balanced COLUMNS rather than a grid of rows, so a short group isn't
   stretched to the height of the long one beside it. site_keys.py orders them so each column reads
   top to bottom: Anywhere, then Getting around; On a link, then Tabs and videos. */
.keys-grid { display: block; columns: 2; column-gap: 16px; }
.keys-grid .kgroup { break-inside: avoid; margin-bottom: 16px; }
@media (max-width: 900px) { .keys-grid { columns: 1; } }

/* The save sheet is a narrow panel; shown at its own size rather than blown up to fill the column. */
.shot.sheet { display: flex; justify-content: center; }
.shot.sheet picture { width: min(100%, 360px); }
