/* Stillmark Note — the site reads like a page in the app: paper, ink, and Markdown marks
   faded the way the editor fades them. System fonts only; nothing loads from elsewhere. */

:root {
  --paper: #f6f7f4;
  --paper-raised: #fbfcfa;
  --ink: #1c1f1d;
  --graphite: #5d625f;
  --mark: #b4b9b5;
  --rule: #e3e6e2;
  --teal: #2b7468;
  --serif: ui-serif, "New York", "Iowan Old Style", Charter, Georgia, "Noto Serif Thai", "Noto Serif SC", "Noto Serif JP", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Noto Sans SC", "Noto Sans JP", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 38rem;
  --page: 70rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191b1a;
    --paper-raised: #202322;
    --ink: #e6e8e4;
    --graphite: #a2a8a4;
    --mark: #5b625e;
    --rule: #2c302e;
    --teal: #5fb8a9;
  }
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }

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

.wrap { width: min(100% - 2.5rem, var(--page)); margin-inline: auto; }
.prose { max-width: var(--measure); }

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

/* The faded Markdown marks (`#`, `##`, `>`), as the editor shows them. */
.md { color: var(--mark); font-family: var(--mono); font-weight: 400; }

/* ---------- Header ---------- */

.site-header { padding-block: 1.25rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font: 600 1.125rem/1 var(--serif); letter-spacing: -0.01em;
  white-space: nowrap;
}
.wordmark::before {
  content: ""; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--ink);
}

.site-nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; white-space: nowrap; }
/* On the narrowest phones the header keeps Guide and the language; Support is in the footer. */
@media (max-width: 25rem) {
  .site-nav { gap: 0.9rem; }
  .site-nav .secondary { display: none; }
}
.site-nav > a { color: var(--graphite); text-decoration: none; }
.site-nav > a:hover, .site-nav > a[aria-current="page"] { color: var(--ink); }

.languages { position: relative; }
.languages summary {
  list-style: none; cursor: pointer; color: var(--graphite);
  padding: 0.25rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px;
}
.languages summary::-webkit-details-marker { display: none; }
.languages[open] summary { color: var(--ink); }
.languages ul {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 10;
  margin: 0; padding: 0.35rem; list-style: none; min-width: 9rem;
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 0.75rem;
  box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.08);
}
.languages a { display: block; padding: 0.4rem 0.7rem; border-radius: 0.5rem; color: var(--ink); text-decoration: none; }
.languages a:hover { background: var(--paper); }
.languages a[aria-current="true"] { color: var(--teal); }

/* ---------- Hero: a note being written ---------- */

.hero { padding-block: clamp(3rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem); }
.hero .wrap { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: 1.15fr 0.85fr; } }

.hero-for { margin: 0 0 1.5rem; color: var(--graphite); font-size: 0.95rem; }

.hero h1 {
  margin: 0;
  font: 600 clamp(2.75rem, 7.5vw, 5.25rem)/1.02 var(--serif);
  letter-spacing: -0.03em;
  white-space: pre-line;
}
.hero h1 .md { font-size: 0.55em; vertical-align: 0.35em; margin-right: 0.35em; }

/* The one moving thing on the site: the cursor, waiting for you to start. */
.caret {
  display: inline-block; width: 0.06em; height: 0.85em; margin-left: 0.08em;
  background: var(--teal); vertical-align: -0.06em; border-radius: 1px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

.lead { margin: 1.75rem 0 0; max-width: 32rem; font-size: 1.2rem; line-height: 1.55; color: var(--graphite); }

.without { margin: 2rem 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.1rem; padding: 0; list-style: none; }
.without-label { flex-basis: 100%; color: var(--graphite); font-size: 0.9rem; }
.without li { color: var(--graphite); }
.without del { text-decoration-color: var(--graphite); text-decoration-thickness: 1px; }

.actions { margin-top: 2.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
/* Until the app is on the App Store: a statement, not a button. Swap for Apple's badge then. */
.store {
  margin: 0; padding: 0.85rem 1.4rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600;
}

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

.phone {
  margin: 0;
  border-radius: 2.6rem; padding: 0.55rem;
  background: var(--ink);
  box-shadow: 0 2.5rem 4rem -1.5rem rgb(28 31 29 / 0.35);
}
.phone img { border-radius: 2.1rem; aspect-ratio: 603 / 1311; width: 100%; object-fit: cover; background: var(--paper-raised); }
.hero .phone { width: min(19rem, 78vw); justify-self: center; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-top: 1px solid var(--rule); }

.section h2 {
  margin: 0 0 2.5rem; max-width: 34rem;
  font: 600 clamp(1.75rem, 3.6vw, 2.5rem)/1.15 var(--serif); letter-spacing: -0.02em;
}
.section h2 .md { font-size: 0.6em; vertical-align: 0.25em; margin-right: 0.4em; }

.features { display: grid; gap: 2.75rem 4rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 48rem) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.features h3 { margin: 0 0 0.6rem; font: 600 1.2rem/1.3 var(--serif); }
.features p { margin: 0; color: var(--graphite); }

.screens { display: grid; gap: 2.5rem 4rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 18rem)); justify-content: center; margin: 0; padding: 0; list-style: none; }
.screens figure { margin: 0; display: grid; gap: 1rem; justify-items: center; }
.screens .phone { width: min(16rem, 100%); }
.screens figcaption { color: var(--graphite); font-size: 0.95rem; text-align: center; }

.price { display: grid; gap: 1rem; max-width: var(--measure); }
.price h2 { margin-bottom: 0.5rem; }
.price p { margin: 0; font-size: 1.15rem; }
.price .note { font-size: 0.95rem; color: var(--graphite); }

/* Questions: native disclosure, so opening one is the only motion. */
.faq { max-width: 44rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 0;
  display: flex; justify-content: space-between; gap: 1rem;
  font: 600 1.1rem/1.4 var(--serif);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--mark); font: 400 1.4rem/1 var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 1.25rem; color: var(--graphite); max-width: var(--measure); }

/* ---------- Documents: guide, privacy, terms, disclaimer, support ---------- */

.doc { padding-block: clamp(3rem, 7vw, 5rem); }
.doc h1 { margin: 0; font: 600 clamp(2.25rem, 5vw, 3.25rem)/1.1 var(--serif); letter-spacing: -0.025em; }
.doc h1 .md { font-size: 0.55em; vertical-align: 0.35em; margin-right: 0.35em; }
.doc .updated { margin: 0.75rem 0 0; color: var(--graphite); font-size: 0.95rem; }
.doc .intro { margin: 1.5rem 0 0; font-size: 1.15rem; color: var(--graphite); }

.doc h2 { margin: 3rem 0 0.75rem; font: 600 1.45rem/1.3 var(--serif); }
.doc h2 .md, .doc h3 .md { margin-right: 0.4em; font-size: 0.75em; }
.doc h3 { margin: 2rem 0 0.5rem; font: 600 1.15rem/1.35 var(--serif); }
.doc p { margin: 0 0 1rem; }
.doc section p, .doc li { color: var(--graphite); }
.doc ul, .doc ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.doc li { margin-bottom: 0.4rem; }

/* "In short", set as a Markdown quote. */
.quote {
  margin: 2rem 0 0; padding: 1.1rem 1.25rem;
  display: grid; grid-template-columns: auto 1fr; gap: 0 0.9rem;
  background: var(--paper-raised); border-radius: 0.9rem;
}
.quote .md { line-height: 1.6; }
.quote ul { margin: 0; padding: 0; list-style: none; }
.quote li { color: var(--ink); margin: 0.15rem 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 1.75rem 1fr; }
.steps li::before { content: counter(step) "."; color: var(--mark); font-family: var(--mono); }

.contact { margin: 2rem 0; font: 600 clamp(1.4rem, 3vw, 1.9rem)/1.2 var(--serif); }
.contact a { text-decoration: none; }
.contact a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--rule); padding-block: 3rem 2.5rem; color: var(--graphite); font-size: 0.95rem; }
.site-footer .wrap { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer p { margin: 0.4rem 0 0; }
.site-footer h2 { margin: 0 0 0.6rem; font: 600 0.95rem/1.4 var(--sans); color: var(--ink); }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
.site-footer a { color: var(--graphite); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer .fine { grid-column: 1 / -1; font-size: 0.85rem; }

/* Not found */
.lost { padding-block: clamp(5rem, 14vw, 9rem); }
.lost h1 { margin: 0 0 1rem; font: 600 clamp(2rem, 5vw, 3rem)/1.1 var(--serif); }
.lost p { color: var(--graphite); }
