/* portraitserver.com - visual identity borrowed from the Portrait app itself
   (portrait/web/src/index.css + App.css): brand purple #9d5c9d, ZT Nature display face,
   system-ui body, light/dark via prefers-color-scheme only. */

/* ZT Nature - 1001Fonts FFC licence, free commercial use, embeddable
   (see assets/fonts/ZT-Nature-EULA.txt). Headings and the wordmark only. */
@font-face {
  font-family: "ZT Nature";
  src: url("fonts/ZTNature-Regular.otf") format("opentype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ZT Nature";
  src: url("fonts/ZTNature-Bold.otf") format("opentype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "ZT Nature";
  src: url("fonts/ZTNature-Italic.otf") format("opentype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "ZT Nature";
  src: url("fonts/ZTNature-BoldItalic.otf") format("opentype");
  font-weight: 700; font-style: italic; font-display: swap;
}

:root {
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #fff;
  --bg-soft: #faf9fb;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #9d5c9d;
  --accent-bg: rgba(157, 92, 157, 0.1);
  --accent-border: rgba(157, 92, 157, 0.5);
  --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;

  --sans: system-ui, "Segoe UI", Roboto, sans-serif;
  --heading: "ZT Nature", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Consolas, monospace;

  --measure: 720px;
  --wrap: 1100px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #9ca3af;
    --text-h: #f3f4f6;
    --bg: #16171d;
    --bg-soft: #1b1c23;
    --border: #2e303a;
    --code-bg: #1f2028;
    --accent: #c69fc6;
    --accent-bg: rgba(198, 159, 198, 0.15);
    --accent-border: rgba(198, 159, 198, 0.5);
    --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 18px/1.55 var(--sans);
  letter-spacing: 0.18px;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (max-width: 1024px) { body { font-size: 16px; } }

.wrap { width: var(--wrap); max-width: 100%; margin: 0 auto; padding: 0 24px; }

img { max-width: 100%; }
img:not([width]) { height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 0 0 6px 0; z-index: 20;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---- headings & prose ---- */

h1, h2, h3 { font-family: var(--heading); color: var(--text-h); line-height: 1.12; }
h1 { font-size: 54px; letter-spacing: -1.4px; margin: 0 0 20px; }
h2 { font-size: 30px; letter-spacing: -0.5px; margin: 48px 0 14px; }
h3 { font-size: 21px; letter-spacing: -0.2px; margin: 30px 0 10px; }

@media (max-width: 1024px) {
  h1 { font-size: 38px; letter-spacing: -1px; }
  h2 { font-size: 25px; }
}

p, ul, ol, dl, table, pre, blockquote, figure { margin: 0 0 18px; }
li { margin: 6px 0; }
strong { color: var(--text-h); }

code {
  font: 0.86em var(--mono);
  background: var(--code-bg);
  color: var(--text-h);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--code-bg);
  color: var(--text-h);
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font: 13.5px/1.5 var(--mono);
  letter-spacing: 0;
}
pre code { background: none; padding: 0; font-size: inherit; }

blockquote {
  border-left: 3px solid var(--accent-border);
  padding: 2px 0 2px 18px;
  color: var(--text);
}

hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-h); font-weight: 600; }
.table-scroll { overflow-x: auto; }

/* ---- header ---- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.brand picture { display: block; }
.brand-logo { display: block; height: 26px; width: auto; }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--text); text-decoration: none; font-size: 15px; padding: 4px 0; }
.site-nav a:hover { color: var(--text-h); }
.site-nav a.active { color: var(--text-h); border-bottom: 2px solid var(--accent); }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--border); color: var(--text-h);
  font-size: 18px; line-height: 1; padding: 6px 12px; border-radius: 6px; cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 60px;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 24px; border-top: 1px solid var(--border); }
  .site-nav a.active { border-bottom: 0; }
}

#content { display: block; height: 0; }

main { flex: 1; }

/* ---- hero (home) ---- */

.hero {
  text-align: center;
  padding: 72px 0 56px;
  background: radial-gradient(ellipse 80% 55% at 50% -10%, var(--accent-bg), transparent);
}
.hero img.hero-mark {
  width: 84px; height: auto; display: block; margin: 0 auto 24px;
  background: #fff; padding: 12px 14px; border-radius: 16px;
  box-shadow: var(--shadow);
}
.hero h1 { margin-bottom: 14px; }
.hero .lede { font-size: 21px; max-width: 640px; margin: 0 auto 28px; }
@media (max-width: 1024px) { .hero .lede { font-size: 18px; } }

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; text-decoration: none;
  padding: 11px 20px; border-radius: 7px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--accent-border); color: var(--text-h); background: var(--accent-bg);
}
.btn:hover { box-shadow: var(--shadow); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- generic page sections ---- */

.section { padding: 44px 0; }
.section:nth-of-type(even) { background: var(--bg-soft); }
.section > .wrap > h2:first-child { margin-top: 0; }

.lead-in { font-size: 19px; color: var(--text); }

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 24px 0 0;
}
.card {
  border: 1px solid var(--border); border-radius: 10px; padding: 20px 22px;
  background: var(--bg);
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; font-size: 15px; }
.card a.card-link { text-decoration: none; }

.pill {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent);
}

.callout {
  border: 1px solid var(--accent-border);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 14px 18px;
  background: var(--accent-bg);
  margin: 24px 0;
}
.callout.warn { border-color: #d99a00; background: rgba(217, 154, 0, 0.1); }
.callout p:last-child { margin-bottom: 0; }
.callout strong { display: block; margin-bottom: 4px; }

/* ---- doc article layout ---- */

.doc { padding: 44px 0 64px; }
.doc .wrap { max-width: 100%; }
/* Fill the page wrap. Capping this column at --measure inside the wider wrap
   left a lopsided gap on the right of the hub and roadmap pages. */
.doc-inner { max-width: 100%; }
.doc .breadcrumb { font-size: 14px; margin-bottom: 8px; }
.doc .breadcrumb a { color: var(--text); text-decoration: none; }
.doc h1 { font-size: 42px; }
@media (max-width: 1024px) { .doc h1 { font-size: 32px; } }
.doc .doc-lede { font-size: 19px; color: var(--text); margin-bottom: 8px; }

.doc-nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border);
  font-size: 15px;
}
.doc-nav a { text-decoration: none; }

.contact-list { list-style: none; padding: 0; margin: 16px 0 0; }
.contact-list li { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.contact-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  fill: var(--accent);
}
.doc-nav .spacer { flex: 1; }

.toc {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px;
  margin: 0 0 32px; background: var(--bg-soft); font-size: 15px;
}
.toc strong { display: block; margin-bottom: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { text-decoration: none; }

/* ---- footer ---- */

.site-footer { border-top: 1px solid var(--border); margin-top: 0; padding: 24px 0 32px; }
.footer-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  color: var(--accent); font-size: 13px;
}
.footer-grid > :last-child { justify-self: end; text-align: right; }
.footer-status { margin: 0; }
.footer-legal { margin: 0; }
.footer-logo { display: block; line-height: 0; justify-self: center; }
.footer-logo img { height: 20px; width: auto; display: block; }
.footer-disclaimer { margin-top: 16px; }
.footer-disclaimer p { margin: 0; font-size: 12px; color: var(--text); max-width: 760px; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-grid > :last-child { justify-self: center; text-align: center; }
}

/* ---- misc ---- */

.muted { color: var(--text); }
.small { font-size: 14px; }
ul.checks { list-style: none; padding-left: 0; }
ul.checks li { padding-left: 26px; position: relative; }
ul.checks li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
ul.nope li::before { content: "✕"; color: #b8860b; }
