:root {
  --ink: #1a1a1d;
  --muted: #5f5f68;
  --line: #e2e2e6;
  --bg: #ffffff;
  --bg-alt: #f7f7f8;
  --accent: #1a1a1d;
  --radius: 6px;
  --logo-filter: brightness(0);
  --wrap: 66rem;
  --prose: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e8ec;
    --muted: #9c9ca6;
    --line: #2b2b31;
    --bg: #131316;
    --bg-alt: #17171b;
    --accent: #e8e8ec;
    --logo-filter: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16.5px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

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

a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
a:hover { opacity: .7; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .05em .3em;
}

/* Visible to screen readers, not on screen. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- hero ---------- */

.hero { padding: clamp(2.75rem, 7vw, 4.5rem) 0 clamp(2rem, 5vw, 3rem); border-bottom: 1px solid var(--line); }

/* Single column on narrow screens; text beside the screenshots once there is
   room, so the carousel fills what would otherwise be empty space. */
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }

/* Grid items default to min-width:auto, so the carousel's full content width
   (six slides) would stop this column shrinking and stretch the whole page on
   a phone. Must apply at every width, not just in the two-column layout. */
.hero-text, .hero-shots { min-width: 0; }

@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 28rem); gap: 3.5rem; }
}

h1 {
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: clamp(1.9rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -.015em;
  font-weight: 650;
}

/* Matches the Notes Connect header: glyph sized to the text, recoloured to
   the current theme's ink. */
.logo-mark {
  height: .82em;
  width: auto;
  flex-shrink: 0;
  filter: var(--logo-filter);
}

.lede { margin: 0 0 1.6rem; max-width: var(--prose); font-size: 1.05rem; color: var(--muted); }
.lede strong { color: var(--ink); font-weight: 600; }

/* fact table */
.facts {
  margin: 0 0 1.7rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-alt);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .7rem 1.5rem;
  font-size: .92rem;
}

.facts > div { display: flex; flex-direction: column; gap: .1rem; }
.facts dt { color: var(--muted); font-size: .8rem; letter-spacing: .03em; text-transform: uppercase; }
.facts dd { margin: 0; }

.cta { margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }

.btn {
  display: inline-block;
  padding: .6rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-weight: 550;
  font-size: .95rem;
}

.btn.ghost { background: transparent; color: var(--ink); }
.btn:hover { opacity: .85; }

/* ---------- sections ---------- */

main section { padding: clamp(2.25rem, 5.5vw, 3.25rem) 0; border-bottom: 1px solid var(--line); }

h2 { margin: 0 0 1.2rem; font-size: 1.25rem; font-weight: 600; letter-spacing: -.005em; }

/* Wide screens: heading in its own left column, content in a wider one beside
   it. Keeps line length readable while using the full container instead of
   leaving the right half empty. */
@media (min-width: 56rem) {
  main section {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    column-gap: 3rem;
    align-items: start;
  }
  main section > h2 { grid-column: 1; grid-row: 1; margin: .15rem 0 0; }
  /* Every non-heading child shares the right column, so multi-part sections
     (steps + note) stay in one flow instead of wrapping under the heading. */
  main section > *:not(h2) { grid-column: 2; }
}

.body { margin: 0; max-width: var(--prose); color: var(--muted); }

.plain { margin: 0; padding: 0; max-width: var(--prose); list-style: none; }
.plain li { margin-bottom: .85rem; color: var(--muted); }
.plain li:last-child { margin-bottom: 0; }
.plain strong { color: var(--ink); font-weight: 600; }

/* ---------- screenshots ---------- */

.carousel { position: relative; display: flex; align-items: center; gap: .5rem; max-width: 100%; }

.track {
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: .25rem .1rem 1rem;
  list-style: none;
  overflow-x: auto;
  /* Without this a flex item refuses to shrink below its content width,
     which would push the whole page wider than the viewport. */
  min-width: 0;
  flex: 1 1 auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.track::-webkit-scrollbar { height: 6px; }
.track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.track > li {
  flex: 0 0 auto;
  width: 195px;
  /* start, not center: snap points then land exactly on index * slideStep,
     which is what the arrow/dot maths assumes. With center alignment,
     mandatory snapping fights every programmatic scroll. */
  scroll-snap-align: start;
  text-align: center;
}

/* The web-interface shot is landscape, so it gets a wider slide instead of
   being shrunk to the width of a portrait device screenshot. */
.track > li.wide { width: 320px; }

.track img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.track p { margin: .5rem 0 0; font-size: .82rem; color: var(--muted); }
.track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

.cbtn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.cbtn:hover { border-color: var(--ink); }
.cbtn[disabled] { opacity: .3; cursor: default; }

.dots { display: flex; justify-content: center; gap: .4rem; margin-top: .2rem; }

.dots button {
  width: .45rem;
  height: .45rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
}

.dots button[aria-selected="true"] { background: var(--muted); }

.hint { margin: .8rem 0 0; text-align: center; font-size: .8rem; color: var(--muted); }

@media (min-width: 48rem) {
  .cbtn { display: block; }
  .hint { display: none; }
}

/* ---------- steps, faq, footer ---------- */

.steps { margin: 0 0 1rem; padding-left: 1.15rem; max-width: var(--prose); }
.steps li { margin-bottom: .45rem; }

.note { margin: 0; max-width: var(--prose); font-size: .89rem; color: var(--muted); }

.faq { margin: 0; max-width: var(--prose); }
.faq dt { font-weight: 600; margin-top: 1.05rem; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: .25rem 0 0; color: var(--muted); }

footer { padding: 2rem 0 2.75rem; font-size: .88rem; color: var(--muted); }
footer p { margin: 0 0 .45rem; }
footer .small { font-size: .8rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
