/* ShelfSync's site: the icon's teal as the one brand colour, system sans, real screenshots. */

:root {
  --ground: #ffffff;
  --ground-alt: #f3f6f5;
  --raised: #ffffff;
  --ink: #141a19;
  --ink-muted: #4f5b59;
  --rule: #dfe5e3;
  --brand: #1e4a48;
  --brand-hover: #163937;
  --on-brand: #ffffff;
  --brand-soft: #e3eeec;
  --icon-cream: #f5ede1;
  --icon-tan: #cdbf9e;
  --selection: #cfe3df;
  --shadow: 0 1px 2px rgb(20 26 25 / 0.06), 0 12px 32px -12px rgb(20 26 25 / 0.22);
  --shadow-device: 0 2px 4px rgb(20 26 25 / 0.08), 0 28px 60px -24px rgb(20 26 25 / 0.38);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --page: 72rem;
  --measure: 40rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --space: clamp(4rem, 9vw, 7rem);

  color-scheme: light dark;
  accent-color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1514;
    --ground-alt: #151d1c;
    --raised: #1a2322;
    --ink: #e8efed;
    --ink-muted: #a3b1ae;
    --rule: #26302f;
    --brand: #7cc4ba;
    --brand-hover: #98d3ca;
    --on-brand: #0f1514;
    --brand-soft: #1d3331;
    --selection: #2a4a46;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.7);
    --shadow-device: 0 2px 4px rgb(0 0 0 / 0.5), 0 28px 60px -24px rgb(0 0 0 / 0.85);
  }
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection); color: var(--ink); }

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

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

.skip {
  position: absolute; left: -999px; top: 0.5rem; z-index: 2;
  background: var(--raised); color: var(--ink); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip:focus { left: 0.5rem; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
h1, h2, h3 { margin: 0; line-height: 1.12; text-wrap: balance; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 4.2vw, 3.25rem); font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 720; }
h3 { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.55; color: var(--ink-muted); max-width: var(--measure); }
.small { font-size: 0.92rem; color: var(--ink-muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--ground) 92%, transparent); border-bottom: 1px solid var(--rule); }
@supports (backdrop-filter: blur(1px)) {
  .site-header { backdrop-filter: saturate(1.4) blur(12px); background: color-mix(in srgb, var(--ground) 80%, transparent); }
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 0.25rem 1.4rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 0.4rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0.7rem 1.25rem; border-radius: 12px;
  background: var(--brand); color: var(--on-brand); border: 1px solid transparent;
  font-weight: 650; font-size: 1rem; text-decoration: none; line-height: 1.2;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}
.button:hover { background: var(--brand-hover); color: var(--on-brand); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.outline { background: transparent; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--rule)); }
.button.outline:hover { background: var(--brand-soft); }
.button svg { width: 20px; height: 20px; flex: none; }

.store {
  display: inline-flex; align-items: center; gap: 0.7rem;
  min-height: 52px; padding: 0.5rem 1.1rem 0.5rem 0.9rem; border-radius: 12px;
  background: var(--ink); color: var(--ground); line-height: 1.15;
}
.store svg { width: 24px; height: 24px; flex: none; }
.store small { display: block; font-size: 0.72rem; opacity: 0.75; font-weight: 500; }
.store span { font-weight: 650; font-size: 1.02rem; }

/* Hero */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; overflow: hidden; }
.hero-grid > * { min-width: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lede { margin-bottom: 1.8rem; }
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.requirements { margin-top: 1.25rem; font-size: 0.92rem; color: var(--ink-muted); }
.requirements a { color: inherit; }

/* Its own stacking context, so the overlapping phones stay under the sticky header. */
.devices { position: relative; isolation: isolate; height: clamp(26rem, 46vw, 36rem); }
.devices img {
  position: absolute; width: auto; height: 100%; border-radius: 2.2rem;
  box-shadow: var(--shadow-device); background: var(--raised);
}
.devices .front { left: 4%; top: 0; z-index: 1; }
.devices .back { right: 0; top: 3rem; height: 88%; }

.facts {
  list-style: none; margin: clamp(2.5rem, 5vw, 3.5rem) 0 0; padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2.5rem;
}
.facts li { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.9rem; align-items: start; }
.facts svg { width: 26px; height: 26px; color: var(--brand); grid-row: span 2; margin-top: 0.1rem; }
.facts strong { font-weight: 650; }
.facts span { color: var(--ink-muted); font-size: 0.95rem; grid-column: 2; }

/* Sections */
section.band { padding-block: var(--space); }
section.alt { background: var(--ground-alt); }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head h2 { margin-bottom: 0.8rem; }
.section-head p { color: var(--ink-muted); font-size: 1.1rem; margin: 0; }

/* Where books go */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr) auto minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.flow > * { min-width: 0; }
.flow .arrow { align-self: center; }
.node { background: var(--raised); border: 1px solid var(--rule); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); height: 100%; }
.node h3 { margin: 0.9rem 0 0.4rem; }
.node p { margin: 0; color: var(--ink-muted); font-size: 0.96rem; }
.node .glyph { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.node .glyph svg { width: 24px; height: 24px; }
.node .glyph img { width: 44px; height: 44px; border-radius: 11px; }
.arrow { color: var(--brand); width: 36px; }
.tree {
  margin: 1rem 0 0; padding: 0.9rem 1rem; border-radius: 12px; background: var(--ground-alt);
  font: 0.86rem/1.75 var(--mono); color: var(--ink); overflow-x: auto; white-space: pre;
}
.tree .dir { color: var(--brand); font-weight: 600; }
.tree .dim { color: var(--ink-muted); }

/* Feature rows */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.feature + .feature { margin-top: var(--space); }
.feature.flip .shot { order: 2; }
.feature h2 { margin-bottom: 1rem; }
.feature p { color: var(--ink-muted); font-size: 1.08rem; }
.checks { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 0.7rem; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 0.7rem; align-items: start; }
.checks svg { width: 22px; height: 22px; color: var(--brand); margin-top: 0.15rem; }
.shot { display: flex; justify-content: center; }
.shot img { width: min(100%, 20rem); border-radius: 2rem; box-shadow: var(--shadow-device); }
.wide-shot { margin-top: clamp(2rem, 4vw, 3rem); }
.wide-shot img { width: 100%; border-radius: 1.25rem; box-shadow: var(--shadow-device); }

/* Privacy and requirements */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
.pair h2 { margin-bottom: 0.8rem; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.pair p, .pair li { color: var(--ink-muted); }
.pair ul { padding-left: 1.1rem; margin: 0 0 1rem; }
.pair li { margin-bottom: 0.45rem; }

/* Support */
.support { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.support-block { background: var(--raised); border: 1px solid var(--rule); border-radius: 18px; padding: clamp(1.4rem, 3vw, 2rem); box-shadow: var(--shadow); }
.support-block h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.support-block p { color: var(--ink-muted); }
.support-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.finders { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.support-block .note { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }
.spaced { margin-top: 1.5rem; }

/* Prose pages */
.prose { max-width: var(--measure); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.prose h1 { margin-bottom: 1rem; }
.prose h2 { font-size: 1.45rem; margin: 2.4em 0 0.7em; }
.prose h3 { margin: 1.6em 0 0.5em; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose code { font: 0.9em var(--mono); background: var(--ground-alt); border: 1px solid var(--rule); padding: 0.08em 0.35em; border-radius: 6px; }
.prose details { border-top: 1px solid var(--rule); padding-block: 1rem; }
.prose details:last-of-type { border-bottom: 1px solid var(--rule); }
.prose summary { cursor: pointer; font-weight: 650; list-style-position: outside; }
.prose summary:hover { color: var(--brand); }
.prose details > :not(summary) { margin-top: 0.75rem; color: var(--ink-muted); }
.prose .button { margin-top: 0.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding-block: 2rem 3rem; color: var(--ink-muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer .disclaimer { flex-basis: 100%; margin: 0; }

@media (max-width: 900px) {
  .hero-grid, .feature, .pair, .support { grid-template-columns: 1fr; }
  .feature.flip .shot { order: 0; }
  .devices { height: clamp(22rem, 95vw, 32rem); max-width: 28rem; margin-inline: auto; width: 100%; }
  .devices .front { left: 0; }
  .facts { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .arrow { transform: rotate(90deg); margin: 0 auto; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
