/* Magpie Clip pages. No external fonts, scripts or trackers. */

:root {
  color-scheme: light dark;
  --bg: #faf6ee;
  --surface: #ffffff;
  --text: #1d1a17;
  --muted: #5f5850;
  --border: #e6ded1;
  --accent: #00756b;
  --accent-strong: #005c54;
  --accent-soft: #e0f2ef;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 8px 24px rgb(0 0 0 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1714;
    --surface: #26211d;
    --text: #f2ece4;
    --muted: #b7ada2;
    --border: #3a332d;
    --accent: #3fd0bd;
    --accent-strong: #6fe0d0;
    --accent-soft: #1d3632;
    --shadow: none;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* The page color fills the whole viewport, even below a short page. */
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-wrap: break-word;
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-strong);
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 16px;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 16px;
  top: 8px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  font-weight: 600;
}

/* Hero */

.hero {
  padding: 40px 0 24px;
  text-align: center;
}

.hero-icon {
  width: 112px;
  height: 112px;
}

h1 {
  margin: 16px 0 8px;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 34rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.15rem;
}

.cta {
  margin: 28px 0 8px;
}

/* Placeholder until the app has its Mac App Store link. */
.store-button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.store-button:hover {
  color: var(--bg);
  opacity: 0.88;
}

.fine {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Sections */

main section {
  padding: 28px 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.shot {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  margin: 8px 0 0;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  padding: 16px;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.steps {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 14px 16px 14px 56px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  line-height: 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 12px;
}

.card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* An odd last card spans the row instead of leaving a hole beside it. */
.card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.card ul {
  margin: 0;
  padding-left: 1.1em;
}

.card li + li {
  margin-top: 4px;
}

.note {
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.note > :first-child {
  margin-top: 0;
}

.note > :last-child {
  margin-bottom: 0;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  font: 600 0.85em/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  white-space: nowrap;
}

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  font: 0.85em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* FAQ */

.faq details {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 10px;
}

.faq summary {
  position: relative;
  cursor: pointer;
  padding: 14px 18px 14px 40px;
  font-weight: 600;
  list-style: none;
}

/* A custom marker, so a question that wraps keeps its second line aligned with the first. */
.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 23px;
  border-left: 8px solid var(--muted);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s;
}

.faq details[open] > summary::before {
  transform: rotate(90deg);
}

.faq details > div {
  padding: 0 18px 14px;
}

.faq details > div > :first-child {
  margin-top: 0;
}

/* Long-form pages */

.doc h1 {
  margin-top: 24px;
}

.doc h2 {
  margin-top: 32px;
  font-size: 1.25rem;
}

.doc li + li {
  margin-top: 4px;
}

/* Footer */

.site-footer {
  margin-top: 40px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer a {
  color: var(--muted);
}

figure picture {
  display: block;
}

.shot-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Screenshots may grow past the text column, so the app's text shows near its real size.
   Negative inline margins widen the figure to at most 72rem, centered, with a 16px gutter on each side.
   This works in block flow and inside the .shots grid. */
figure.wide {
  margin-inline: calc(50% - min(36rem, 50vw - 16px));
}

/* Up to 900px the screenshots are close-up crops (see the <picture> sources). On phones they use the full screen width;
   their own transparent edges keep them clear of the screen edge. */
@media (max-width: 640px) {
  figure.wide {
    margin-inline: -16px;
  }

  figure.wide figcaption {
    padding-inline: 16px;
  }
}

.nowrap {
  white-space: nowrap;
}

/* Desktop screenshots carry room for their shadow below the window; pull the caption closer. */
@media (min-width: 901px) {
  figure.wide figcaption {
    margin-top: -24px;
  }
}

/* No single word left alone on the last line of headings and short lines. */
h1,
h2,
.lead,
.fine,
figcaption {
  text-wrap: balance;
}

.shots {
  display: grid;
  gap: 48px;
}

.store-button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.75;
}

/* The wide screenshots extend past the text column; never let them cause sideways scrolling. */
body {
  overflow-x: clip;
}
