/*
 * Monograph's public pages (/about/, /typst-editor/, …): plain HTML, so
 * search engines read them without running the app. Same look as the app's
 * frame: ivory paper and burgundy in light, warm stone in dark
 * (src/index.css), Source Serif for display, IBM Plex Sans for text.
 */

:root {
  color-scheme: light;
  --desk: #e4ddcf;
  --paper: #fcfaf4;
  --surface: #f5f0e5;
  --raised: #fffdf8;
  --rule: #e2d9c8;
  --rule-strong: #cbbfa9;
  --ink: #2b2420;
  --ink-soft: #4e443d;
  --ink-muted: #7a6e63;
  --accent: #7c2232;
  --accent-fill: #7c2232;
  --accent-fill-hover: #661a28;
  --accent-wash: #f2e4df;
  --on-accent: #fcf7ee;
  --string: #52692c;
  --page-shadow: 0 0 0 1px rgb(60 45 30 / 0.07), 0 1px 2px rgb(60 45 30 / 0.12), 0 6px 18px -6px rgb(60 45 30 / 0.22);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desk: #161514;
    --paper: #20201d;
    --surface: #1c1b19;
    --raised: #292825;
    --rule: #2f2e2a;
    --rule-strong: #47453f;
    --ink: #e7e3da;
    --ink-soft: #cac5ba;
    --ink-muted: #9d988d;
    --accent: #dfa5ac;
    --accent-fill: #8a3b49;
    --accent-fill-hover: #9c4655;
    --accent-wash: #312b2a;
    --on-accent: #f7f2ee;
    --string: #b7cc95;
    --page-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px -8px rgb(0 0 0 / 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #161514;
  --paper: #20201d;
  --surface: #1c1b19;
  --raised: #292825;
  --rule: #2f2e2a;
  --rule-strong: #47453f;
  --ink: #e7e3da;
  --ink-soft: #cac5ba;
  --ink-muted: #9d988d;
  --accent: #dfa5ac;
  --accent-fill: #8a3b49;
  --accent-fill-hover: #9c4655;
  --accent-wash: #312b2a;
  --on-accent: #f7f2ee;
  --string: #b7cc95;
  --page-shadow: 0 0 0 1px rgb(0 0 0 / 0.35), 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px -8px rgb(0 0 0 / 0.6);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}
.measure { max-width: 42rem; }

/* ---- top bar ---- */
.bar { border-bottom: 1px solid var(--rule); background: var(--surface); }
.bar .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.125rem; }
.brand svg { color: var(--accent); width: 1.25rem; height: 1.25rem; }
.bar nav { display: flex; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; font-size: 0.875rem; }
.bar nav a { color: var(--ink-soft); text-decoration: none; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--accent); }

/* ---- type ---- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); text-wrap: balance; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.015em; margin: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.35rem; }
p { margin: 0 0 1rem; }
.lede { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ink-soft); margin: 1rem 0 0; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); font-weight: 500; margin: 0 0 0.75rem; }
code, kbd { font-family: var(--mono); font-size: 0.9em; background: var(--surface); border: 1px solid var(--rule); border-radius: 3px; padding: 0.05em 0.35em; }

/* ---- hero ---- */
.hero { padding: 4.5rem 0 3.5rem; display: grid; gap: 3rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.note { font-size: 0.875rem; color: var(--ink-muted); margin-top: 0.85rem; }

.button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.25rem; border-radius: 3px; font-weight: 500; font-size: 0.95rem; text-decoration: none; border: 1px solid var(--rule-strong); color: var(--ink); background: var(--raised); }
.button:hover { border-color: var(--ink-muted); }
.button.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-fill-hover); }

/* A drawn page with Typst source beside it: what the app does, at a glance. */
.specimen { display: grid; grid-template-columns: 1fr 0.85fr; gap: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--desk); }
.specimen pre { margin: 0; padding: 1rem; font-family: var(--mono); font-size: 0.72rem; line-height: 1.7; background: var(--paper); color: var(--ink-soft); overflow: hidden; white-space: pre; border-right: 1px solid var(--rule); }
.specimen .k { color: var(--accent); }
.specimen .s { color: var(--string); }
.specimen .c { color: var(--ink-muted); font-style: italic; }
.specimen .page { margin: 1rem; background: #fff; color: #1d1d1d; box-shadow: var(--page-shadow); padding: 1rem 0.9rem; font-family: var(--serif); font-size: 0.62rem; line-height: 1.45; aspect-ratio: 1 / 1.4142; overflow: hidden; }
.specimen .page b { display: block; font-size: 1rem; margin-bottom: 0.4rem; }
.specimen .page i { display: block; text-align: center; margin: 0.5rem 0; }

/* ---- sections ---- */
section { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.grid { display: grid; gap: 1.75rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); margin-top: 1.75rem; }
.grid p { color: var(--ink-soft); font-size: 0.975rem; margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-top: 1.25rem; }
.table { overflow-x: auto; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); font-size: 0.85rem; }
td:first-child { color: var(--ink-soft); }

details { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; }
details summary { cursor: pointer; font-weight: 500; }
details p { margin: 0.6rem 0 0; color: var(--ink-soft); }

.cta { text-align: center; padding: 4rem 0; }
.cta p { color: var(--ink-soft); }

footer { border-top: 1px solid var(--rule); background: var(--surface); font-size: 0.875rem; color: var(--ink-muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; padding-top: 1.75rem; padding-bottom: 2rem; }
footer a { color: var(--ink-soft); }
footer .fine { flex-basis: 100%; margin: 0.5rem 0 0; }

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; padding-top: 3rem; }
  .specimen { grid-template-columns: 1fr; }
  .specimen pre { border-right: 0; border-bottom: 1px solid var(--rule); }
  .specimen .page { max-width: 16rem; margin: 1rem auto; }
}
