/* Sundry Software. One stylesheet, no web fonts, light and dark. */

:root {
  color-scheme: light dark;
  --bg: #fcfcfb;
  --text: #1d1d1f;
  --muted: #636366;
  --hairline: #e2e2de;
  --surface: #f4f4f1;
  --window: #ececec;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 12px 32px -8px rgb(0 0 0 / 0.18);
  --ink: #1d1d1f;          /* accent for links and headings, per app */
  --fill: #1d1d1f;         /* accent for primary buttons */
  --on-fill: #ffffff;
  --focus: #2560b8;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 40rem;
  --wide: 66rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161617;
    --text: #f0f0ee;
    --muted: #a2a2a7;
    --hairline: #2f2f31;
    --surface: #1f1f21;
    --window: #2a2a2c;
    --shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 16px 40px -8px rgb(0 0 0 / 0.6);
    --ink: #f0f0ee;
    --fill: #f0f0ee;
    --on-fill: #161617;
    --focus: #79adff;
  }
}

/* Per-app accents, taken from the icons and darkened or lightened for contrast. */
.t-comma    { --ink: #1d7a53; --fill: #1d7a53; --on-fill: #fff; }
.t-lockstep { --ink: #2560b8; --fill: #2560b8; --on-fill: #fff; }
.t-blinders { --ink: #94500f; --fill: #94500f; --on-fill: #fff; }
@media (prefers-color-scheme: dark) {
  .t-comma    { --ink: #5ccf96; --fill: #5ccf96; --on-fill: #0b2a1c; }
  .t-lockstep { --ink: #79adff; --fill: #79adff; --on-fill: #0a1f3d; }
  .t-blinders { --ink: #f2b347; --fill: #f2b347; --on-fill: #2e1a04; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { text-decoration-color: currentColor; }
main a:not(.button) { color: var(--ink); }

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

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.012em; font-weight: 600; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem); letter-spacing: -0.022em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.0625rem; letter-spacing: -0.005em; }
p, ul, ol, dl, pre { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li + li { margin-top: 0.3em; }
small, .small { font-size: 0.875rem; color: var(--muted); }
code, kbd, pre { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--surface); border: 1px solid var(--hairline); border-radius: 4px; padding: 0.05em 0.3em; }
kbd { border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.3em; background: var(--bg); }
pre {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  overflow-x: auto;
  line-height: 1.5;
}
hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.5rem 0; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--fill); color: var(--on-fill); padding: 0.4rem 0.8rem; border-radius: 6px; z-index: 10;
}
.skip:focus { top: 0.75rem; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: var(--measure); }

/* Header */
.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; flex-wrap: wrap; min-height: 3.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 24px; height: 24px; flex: none; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; font-size: 0.9375rem; }
.site-nav li + li { margin-top: 0; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); margin-top: 5rem; padding: 2.5rem 0 3rem; font-size: 0.875rem; color: var(--muted); }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.5rem; }
.footer-cols h2 { font-size: 0.8125rem; color: var(--text); margin-bottom: 0.6rem; letter-spacing: 0; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li + li { margin-top: 0.35rem; }
.footer-cols a { text-decoration: none; }
.footer-cols a:hover { color: var(--text); text-decoration: underline; }
.colophon { margin: 2rem 0 0; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.75rem; padding: 0.55rem 1.15rem;
  border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: filter 0.15s ease, background-color 0.15s ease;
}
.button.primary { background: var(--fill); color: var(--on-fill); }
.button.primary:hover { filter: brightness(1.08); }
.button.secondary { background: transparent; color: var(--ink); border-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.button.secondary:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.button[disabled], .button[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.button svg { width: 1.05em; height: 1.05em; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Sections */
.section { padding: 3.5rem 0 0; }
.section-head { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 0 2.5rem; border-top: 1px solid var(--hairline); padding-top: 2.25rem; }
.section-head > h2 { font-size: 1.25rem; }
@media (max-width: 52rem) { .section-head { grid-template-columns: 1fr; } .section-head > h2 { margin-bottom: 1rem; } }
.lede { font-size: 1.1875rem; line-height: 1.5; color: var(--text); }
.muted { color: var(--muted); }

/* Home */
.intro { padding: 4rem 0 1rem; max-width: 42rem; }
.intro h1 { margin-bottom: 0.4em; }
.intro p { font-size: 1.1875rem; color: var(--muted); margin: 0; }
.app-list { list-style: none; margin: 2.5rem 0 0; padding: 0; border-top: 1px solid var(--hairline); }
.app-list li { margin: 0; }
.app-list li:last-child .app-row { border-bottom: 0; }
.app-row {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 0.25rem 1.5rem; align-items: center;
  padding: 1.5rem 0; border-bottom: 1px solid var(--hairline);
}
.app-row img { width: 5.5rem; height: 5.5rem; }
.app-row h2 { font-size: 1.375rem; margin: 0 0 0.15rem; }
.app-row h2 a { text-decoration: none; color: var(--text); }
.app-row h2 a:hover { color: var(--ink); }
.app-row p { margin: 0; color: var(--muted); }
.app-row .row-meta { display: flex; align-items: center; gap: 1.25rem; white-space: nowrap; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; }
.more { font-weight: 600; text-decoration: none; color: var(--ink) !important; }
.more::after { content: " \2192"; }
@media (max-width: 40rem) {
  .app-row { grid-template-columns: 4rem minmax(0, 1fr); align-items: start; column-gap: 1rem; }
  .app-row img { width: 4rem; height: 4rem; }
  .app-row .row-meta { grid-column: 2; margin-top: 0.6rem; }
}

.bundle { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 2.5rem; align-items: center; }
.bundle-icons { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; }
.bundle-icons img { width: 3rem; height: 3rem; }
@media (max-width: 52rem) { .bundle { grid-template-columns: 1fr; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem 2rem; margin: 0; }
.facts div { border-left: 2px solid var(--hairline); padding-left: 1rem; }
.facts dt { font-weight: 600; margin-bottom: 0.15rem; }
.facts dd { margin: 0; color: var(--muted); }

/* Product page */
.hero { padding: 3.5rem 0 0; display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 0 2rem; align-items: start; }
.hero .icon { width: 8rem; height: 8rem; margin-top: -0.35rem; }
.hero h1 { margin-bottom: 0.2em; }
.hero .lede { color: var(--muted); max-width: 36rem; margin-bottom: 1.4rem; }
.hero .meta { margin: 1rem 0 0; font-size: 0.875rem; color: var(--muted); }
@media (max-width: 40rem) {
  .hero { grid-template-columns: 1fr; padding-top: 2.25rem; }
  .hero .icon { width: 5.5rem; height: 5.5rem; margin: 0 0 1rem -0.25rem; }
}

.shot { margin: 3rem 0 0; }
.window {
  border-radius: 12px; overflow: hidden; background: var(--window);
  box-shadow: var(--shadow);
  border: 1px solid rgb(0 0 0 / 0.12);
}
@media (prefers-color-scheme: dark) { .window { border-color: rgb(0 0 0 / 0.6); } }
.window-bar { height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid rgb(0 0 0 / 0.08); }
.window-bar span { width: 12px; height: 12px; border-radius: 50%; background: rgb(0 0 0 / 0.12); }
@media (prefers-color-scheme: dark) { .window-bar span { background: rgb(255 255 255 / 0.14); } .window-bar { border-color: rgb(0 0 0 / 0.4); } }
.window img { width: 100%; height: auto; display: block; }
.window-real { border-radius: 10px; }
.shot-narrow { max-width: 50rem; margin-left: auto; margin-right: auto; }
.shot-pair { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.shot-pair figcaption { grid-column: 1 / -1; }
.popover { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgb(0 0 0 / 0.12); max-width: 20rem; }
.popover img { width: 100%; height: auto; display: block; }
@media (max-width: 40rem) { .shot-pair { grid-template-columns: 1fr; } .popover { margin: 0 auto; } }
.shot figcaption { margin-top: 0.9rem; font-size: 0.875rem; color: var(--muted); }

.why p { max-width: var(--measure); }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2.5rem; }
.features h3 { margin-bottom: 0.3em; }
.features p { margin: 0; color: var(--muted); }
.features + h3 { margin-top: 2.5rem; }
@media (max-width: 40rem) { .features { grid-template-columns: 1fr; } }
.not-yet { color: var(--muted); }

.buy-box {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
  padding: 1.75rem; max-width: 40rem; margin-bottom: 1.5rem;
}
.buy-box h3 { font-size: 1.25rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.buy-box .small { margin: 1rem 0 0; }
.btc-panel { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--hairline); }
.btc-panel[hidden] { display: none; }
.field label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field .optional { font-weight: 400; color: var(--muted); }
.field input {
  width: 100%; max-width: 24rem; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); border-radius: 8px; padding: 0.55rem 0.7rem;
}
.field .hint { font-size: 0.875rem; color: var(--muted); margin: 0.45rem 0 1rem; max-width: 32rem; }
.form-error { color: #b42318; font-weight: 500; margin: 1rem 0 0; }
@media (prefers-color-scheme: dark) { .form-error { color: #ff8a80; } }
.form-error[hidden] { display: none; }
.notice { border-left: 3px solid var(--ink); padding: 0.2rem 0 0.2rem 1rem; }

.reqs { margin: 0; padding: 0; list-style: none; }
.reqs li { padding: 0.55rem 0; border-bottom: 1px solid var(--hairline); margin: 0; }
.reqs li:first-child { padding-top: 0; }

details { border-bottom: 1px solid var(--hairline); }
details:first-of-type { border-top: 1px solid var(--hairline); }
summary { cursor: pointer; padding: 0.85rem 1.5rem 0.85rem 0; font-weight: 600; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.8rem; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "\2212"; }
details > :not(summary) { margin-top: 0; }
details > div { padding: 0 0 1rem; color: var(--muted); }
details > div p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1.25rem; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.75rem; margin: 0; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -0.05rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--ink); color: var(--ink); font-weight: 600; font-size: 0.9375rem;
}
.steps h3 { margin-bottom: 0.2em; }
.steps p { margin: 0; color: var(--muted); }

.help-grid { display: grid; gap: 2rem; }
.help-grid h3 { font-size: 1.125rem; }
.help-grid ol, .help-grid ul { color: var(--muted); }

/* Plain pages */
.page { padding-top: 3rem; }
.page h1 { margin-bottom: 0.6em; }
.page h2 { margin-top: 2.2rem; font-size: 1.25rem; }
.page .lede { color: var(--muted); }

/* Thanks page */
.status { display: flex; gap: 0.75rem; align-items: flex-start; }
.spinner { width: 1.1rem; height: 1.1rem; margin-top: 0.3rem; flex: none; border-radius: 50%; border: 2px solid var(--hairline); border-top-color: var(--text); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.keyblock { display: flex; gap: 0.75rem; align-items: stretch; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.keyblock pre { flex: 1 1 18rem; margin: 0; white-space: pre-wrap; word-break: break-all; font-size: 0.8125rem; user-select: all; }
.app-actions { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.75rem; }
.app-actions li { margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--hairline); }
.app-actions img { width: 2.5rem; height: 2.5rem; }
.app-actions .name { font-weight: 600; min-width: 6rem; }

/* Guides */
.guide-meta { color: var(--muted); font-size: 0.9375rem; }
.toc { border: 1px solid var(--hairline); border-radius: 10px; padding: 1rem 1.25rem; margin: 2rem 0; font-size: 0.9375rem; }
.guide .toc h2 { font-size: 0.875rem; margin: 0 0 0.5rem; }
.toc ol { margin: 0; }
.guide h2 { margin-top: 2.6rem; scroll-margin-top: 1rem; }
.guide h3 { margin-top: 1.6rem; }
.guide .app-callout { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 1.25rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 1.25rem; margin-top: 1rem; }
.guide .app-callout img { width: 4rem; height: 4rem; }
.guide .app-callout p:last-child { margin-bottom: 0; }
.guide-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }
.guide-list li { margin: 0; padding: 1.25rem 0; border-bottom: 1px solid var(--hairline); }
.guide-list h2 { font-size: 1.1875rem; margin: 0 0 0.25rem; }
.guide-list h2 a { text-decoration: none; color: var(--text); }
.guide-list h2 a:hover { text-decoration: underline; }
.guide-list p { margin: 0; color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; margin: 0 0 1.25rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { font-weight: 600; }
.table-scroll { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
  .spinner { animation: none; border-top-color: var(--muted); }
}

/* Studio mark: inverts with the color scheme. */
.mark-bg { fill: var(--text); }
.mark-s { stroke: var(--bg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 30rem) {
  .site-nav ul { gap: 0.25rem 0.85rem; }
  .buy-box { padding: 1.25rem; }
  .buy-box .actions .button, .btc-panel .button { width: 100%; }
  .hero .actions .button { flex: 1 1 auto; }
}
.button { text-wrap: balance; }
@media (max-width: 30rem) {
  .guide .app-callout { grid-template-columns: 1fr; gap: 0.75rem; }
  .guide .app-callout img { width: 3rem; height: 3rem; }
}

/* Manual Bitcoin payment page */
.btc-pay .lede { font-size: 1.0625rem; }
.btc-pay .notice-confirm {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border-radius: 10px;
  font-weight: 500;
}
.btc-pay .qr {
  margin: 1.5rem 0;
  width: min(16rem, 100%);
  padding: 0.75rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.btc-pay .qr svg { width: 100%; height: auto; display: block; }
.btc-pay .pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  margin: 0 0 1rem;
}
.btc-pay .pay-row dt {
  flex: 0 0 6.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.btc-pay .pay-row dd {
  flex: 1 1 14rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9375rem;
  word-break: break-all;
}
.btc-pay .copy {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
}
.btc-pay .copy:hover { border-color: var(--text); }
.btc-pay .timer { color: var(--muted); margin-top: 0.5rem; }
.btc-pay .status-ok { font-weight: 500; }
