/* The same paper, ink and blue as the app itself (crates/matrical-server/assets/style.css). */
:root {
  color-scheme: light dark;
  --paper: #fbfaf7;
  --raised: #ffffff;
  --ink: #1f2328;
  --soft: #5d646d;
  --line: #e3e0d8;
  --accent: #c2255c;
  --on-accent: #ffffff;
  --tint: #fbe8ec;
  --warn: #fdf1d6;
  --warn-ink: #6b4900;
  --shadow: 0 1px 2px rgb(31 35 40 / .05), 0 12px 32px -12px rgb(31 35 40 / .14);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Charter, "Iowan Old Style", "Bitstream Charter", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16181c;
    --raised: #1e2126;
    --ink: #e7e5e0;
    --soft: #9ea6b0;
    --line: #30343b;
    --accent: #ff8a73;
    --on-accent: #1a0f12;
    --tint: #3b1e27;
    --warn: #3a2f12;
    --warn-ink: #f2cf7e;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -16px rgb(0 0 0 / .6);
  }
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--line) var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  caret-color: var(--accent);
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--accent); text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.55rem, 1.3rem + 1vw, 2rem); line-height: 1.15; }
h3 { font-size: 1.05rem; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }

code, pre { font-family: var(--mono); }
code { font-size: .9em; }

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: .4rem .7rem;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.skip:focus { top: .5rem; }

/* Header: the app's top bar, with the page links in its tabs. */
.bar {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}
.bar .wrap {
  display: flex;
  align-items: center;
  gap: .75rem 1rem;
  padding-block: .6rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand::before {
  content: "";
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--accent);
}
.bar nav { display: flex; gap: .25rem; flex: 1; }
.tab { padding: .3rem .65rem; border-radius: 6px; color: var(--soft); }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"] { color: var(--ink); background: var(--paper); font-weight: 600; }
.bar .login { margin-left: auto; }

.button {
  display: inline-block;
  padding: .55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--raised);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  transition: border-color .15s ease-out, background-color .15s ease-out;
}
.button:hover { text-decoration: none; border-color: var(--soft); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.bar .button { padding: .35rem .8rem; font-size: .95rem; }

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 1.25rem; }

/* Landing */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 3rem;
  align-items: center;
  padding-block: 4.5rem 5rem;
}
.lead { margin-top: 1.25rem; max-width: 34rem; font-size: 1.15rem; color: var(--soft); }
.lead strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.aside { margin-top: 1rem; color: var(--soft); font-size: .9rem; }

/* A space as the app shows it, drawn in HTML. */
.shot {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: .92rem;
}
.shot-bar {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .55rem 1rem;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}
.shot-bar b { font-weight: 700; }
.shot-bar .crumb { color: var(--soft); }
.shot-bar .crumb::before { content: "/"; margin-right: .9rem; color: var(--line); }
.shot-bar .tabs { display: flex; gap: .15rem; color: var(--soft); }
.shot-bar .tabs span { padding: .15rem .5rem; border-radius: 6px; }
.shot-bar .tabs .on { color: var(--ink); background: var(--paper); font-weight: 600; }
.shot-body { padding: 1.1rem 1.25rem 1.25rem 1.6rem; }
.shot-body .title { font: 700 1.2rem/1.2 var(--sans); margin-bottom: .8rem; }
.shot ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.shot li { position: relative; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.shot li strong { font-weight: 500; }
.shot li.new strong { font-weight: 700; }
.shot li.new::before {
  content: "";
  position: absolute;
  left: -.85rem;
  top: calc(.6rem + .75em - .25rem);
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
}
.shot li p { color: var(--soft); font-size: .88rem; margin-top: .1rem; }
.shot .by { color: var(--soft); font-size: .8rem; margin-top: .2rem; }
.shot .by b { color: var(--ink); font-weight: 600; }

section { padding-block: 4.5rem; border-top: 1px solid var(--line); }
.intro { max-width: 40rem; margin-bottom: 2.5rem; }
.intro p { margin-top: .9rem; color: var(--soft); font-size: 1.08rem; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: .6rem;
  font: 700 2.2rem/1 var(--serif);
  color: var(--accent);
}
.steps h3 { margin-bottom: .45rem; }
.steps p { color: var(--soft); }

.cmd {
  margin: .9rem 0 0;
  padding: .6rem .8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--raised);
  font-size: .85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cmd a { font-family: var(--mono); }
.cmd code { font-size: inherit; user-select: all; }
.nw { white-space: nowrap; }

.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3.5rem;
  margin: 0;
}
.features div { padding: 1.25rem 0 1.4rem; border-top: 1px solid var(--line); }
.features dt { font-weight: 650; font-size: 1.05rem; }
.features dd { margin: .35rem 0 0; color: var(--soft); max-width: 34rem; }

.close {
  background: var(--raised);
  text-align: center;
}
.close h2 { max-width: 30rem; margin-inline: auto; }
.close p { margin: 1rem auto 0; max-width: 32rem; color: var(--soft); }
.close .actions { justify-content: center; }

/* Inner pages */
.page { padding-block: 3.5rem 5rem; }
.page > .lead { margin-bottom: 3rem; }
.page h2 { margin: 3.5rem 0 1rem; }

.plans {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.plans th, .plans td { padding: 1rem 1rem 1rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.plans thead th { vertical-align: bottom; border-bottom-color: var(--ink); }
.plans thead th:first-child { width: 40%; }
.plan-name { display: block; font: 700 1.4rem/1.2 var(--serif); }
.price { display: block; margin-top: .3rem; font-weight: 400; color: var(--soft); }
.price b { color: var(--ink); font-size: 1.15rem; }
.plans tbody th { font-weight: 600; }
.plans tbody th small { display: block; font-weight: 400; color: var(--soft); font-size: .88rem; }
.plans td { font-size: 1.05rem; }
.plans tfoot .button { white-space: nowrap; }
.plans tfoot td, .plans tfoot th { border-bottom: 0; padding-top: 1.25rem; }
.soon {
  display: inline-block;
  padding: .45rem .8rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--soft);
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}

.both { margin: 0; padding-left: 1.2rem; max-width: 40rem; }
.both li { padding: .2rem 0; }

.note {
  margin-top: 2rem;
  max-width: 40rem;
  padding: .9rem 1.1rem;
  border-radius: 8px;
  background: var(--warn);
  color: var(--warn-ink);
}

.faq { max-width: 42rem; margin: 0; }
.faq dt { font-weight: 650; margin-top: 1.6rem; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: .35rem 0 0; color: var(--soft); }

.guide { list-style: none; margin: 0; padding: 0; max-width: 46rem; counter-reset: step; }
.guide > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 2.5rem 3rem;
}
.guide > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--raised);
  font: 700 1rem/1 var(--serif);
  color: var(--accent);
}
.guide h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.guide p + p { margin-top: .6rem; }
.cmd + p { margin-top: .9rem; }
.guide p { color: var(--soft); }
.guide p strong { color: var(--ink); font-weight: 600; }
.guide code { overflow-wrap: anywhere; }

.handoff {
  max-width: 46rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
}
.handoff h2 { margin: 0 0 .5rem; font-size: 1.35rem; }
.handoff p { color: var(--soft); }
.handoff .cmd { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); }

.missing { padding-block: 6rem; max-width: 34rem; }
.missing p { margin-top: 1rem; color: var(--soft); }

footer { border-top: 1px solid var(--line); color: var(--soft); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding-block: 2rem 2.5rem; }
footer a { color: var(--soft); }
footer a:hover { color: var(--ink); }
footer .brand { font-size: .95rem; margin-right: auto; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; padding-block: 3rem 3.5rem; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .features { grid-template-columns: minmax(0, 1fr); }
  section { padding-block: 3.5rem; }
}

@media (max-width: 560px) {
  .bar .wrap { flex-wrap: wrap; row-gap: .4rem; }
  .bar nav { order: 3; flex-basis: 100%; margin-left: -.65rem; }
  .bar .login { margin-left: auto; }
  .lead { font-size: 1.05rem; }
  .shot-bar .tabs span:not(.on) { display: none; }
  .plans th, .plans td { padding-right: .6rem; }
  .plans thead th:first-child { width: 34%; }
  .plans td { font-size: 1rem; }
  .guide > li { padding-left: 2.6rem; }
  footer .brand { flex-basis: 100%; margin-bottom: .25rem; }
}

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Phone screenshots: two portrait shots, side by side, framed like a device. */
.phone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 3rem; align-items: center; }
.phone .intro { margin-bottom: 0; }
.shots { display: flex; gap: 1.25rem; justify-content: center; }
.shots img {
  width: min(45%, 15rem); height: auto;
  border-radius: 2rem; border: .4rem solid var(--ink);
  box-shadow: var(--shadow); background: var(--raised);
}
.shots img:last-child { margin-top: 3rem; }
@media (max-width: 52rem) {
  .phone { grid-template-columns: 1fr; gap: 2rem; }
}

/* Long-form pages (privacy): readable line length, room between blocks. */
.prose p { max-width: 42rem; margin: 1rem 0 0; }
.prose .faq + p { margin-top: 1.75rem; }
