/* Site and app chrome. The surface is a drawing sheet: warm paper, graphite linework, hairlines instead
   of soft shadows, square corners, and one signal colour — the checked-print green (docs/identity.md).
   Type is self-hosted IBM Plex; nothing on this page is fetched from a third party at runtime. */

/* One variable file for the text face: the real 600, not a synthesised bold (Google Fonts serves the
   same static file for "400" and "600" of a variable family — see scripts/vendor-fonts.sh). */
@font-face {
  font-family: "Plex Sans";
  src: url("/fonts/IBMPlexSans-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/IBMPlexMono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1a1c1a;          /* the declared ink: graphite, and the base of every strong rule */
  --ink-soft: #3a3f3c;
  --ink-faint: #5c6360;     /* 5.45:1 on paper — labels, never body copy */
  --ink-mute: #6b6659;      /* 4.7:1 on paper — the smallest readable step */
  --line: #d9d5c8;          /* paper fibre */
  --line-soft: #e7e3d7;
  --paper: #f4f1e8;         /* the sheet */
  --vellum: #fffdf8;        /* a card laid on it */
  --surface-2: #ece8dc;
  --accent: #007000;        /* checked-print green — declared accent (moved 2026-09-29, docs/identity.md) */
  --accent-ink: #ffffff;
  --accent-soft: #e3efe3;
  --markup: #b03a2e;        /* the red pen: a drawing colour, never chrome */
  --ok: #007000;
  --warn: #8a5a08;
  --danger: #a5342a;
  --radius: 2px;
  --radius-sm: 2px;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Plex Sans", -apple-system, BlinkMacSystemFont, "Guardian Sans", system-ui, "Segoe UI", sans-serif;
  /* The 10 mm grid of a drawing sheet, used under the rail and the empty states. */
  --sheet-grid: repeating-linear-gradient(to right, rgba(26, 28, 26, 0.05) 0 1px, transparent 1px 10px),
    repeating-linear-gradient(to bottom, rgba(26, 28, 26, 0.05) 0 1px, transparent 1px 10px);
}

* { box-sizing: border-box; }

/* `hidden` must win over any explicit `display` on the element: the drop hint, the context menu and the
   modal are all display:grid, which would otherwise override it and leave them on screen. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 0.5em; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-top: 1.4rem; }
p { margin: 0 0 0.9em; }
/* A sources list is a list of long URLs. Without this, one link is wider than a phone and the whole
   page scrolls sideways. */
a, code, .fine, li, dd { overflow-wrap: anywhere; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* A drafting sheet has no italics: emphasis is weight. */
em, i { font-style: normal; font-weight: 600; }

/* The sheet-number plate: what a drawing calls itself. */
.plate {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--ink);
  padding: 0.05rem 0.35rem;
  background: var(--vellum);
}

/* The signature detail: a graphic scale bar, drawn to the sheet's own scale (public/editor.js). */
.scalebar {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.scalebar svg { display: block; overflow: visible; }
.scalebar .sb-label { letter-spacing: 0.04em; }
.scalebar.is-unset { color: var(--ink-mute); }
.scalebar.is-unset svg { opacity: 0.5; }

/* A drawing sheet's margin ticks, used for the landing hero's frame. */
.sheet-frame {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line);
}
.sheet-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
}

kbd {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.1em 0.4em;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.fine { color: var(--ink-faint); font-size: 0.85rem; }
.center { text-align: center; }

/* --- chrome ---------------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem clamp(1rem, 3vw, 2.5rem);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brandmark {
  width: 18px; height: 18px; border-radius: 4px; display: inline-block;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent-ink) 70%, transparent);
}
.tabs { display: flex; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.tabs a { color: var(--ink-soft); font-size: 0.92rem; }
.tabs a.here { color: var(--ink); font-weight: 600; }
.who { display: flex; align-items: center; gap: 0.6rem; }
.who .name { color: var(--ink-faint); font-size: 0.9rem; }
.sitetabs { margin-left: 0; }
.sitebar .who { margin-left: auto; }

.sitemain { display: block; }
.appmain { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: #175736; border-color: #175736; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.tiny { padding: 0.25rem 0.55rem; font-size: 0.82rem; }
.btn.ghost { background: transparent; }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 0.9rem; cursor: pointer; padding: 0; }
.iconbtn { background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 0.85rem; padding: 0.1rem 0.25rem; color: var(--ink-soft); }
.iconbtn:hover { border-color: var(--line); }

.cta-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }

/* --- public pages ---------------------------------------------------------------------------- */

.sitemain > section { padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 5vw, 4rem); max-width: 1180px; margin: 0 auto; }
.sitemain > .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { margin-bottom: 0.6rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; font-weight: 600; color: var(--accent); margin-bottom: 0.6rem; }
.lede { font-size: 1.05rem; color: var(--ink-soft); max-width: 62ch; }
.mock { background: #ffffff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mock-bar { display: flex; align-items: center; gap: 0.35rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
.mock-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-title { margin-left: 0.5rem; font-size: 0.8rem; color: var(--ink-faint); font-family: var(--mono); }
.mock svg { display: block; width: 100%; height: auto; }

.cols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.cols.two { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }

.card {
  background: var(--vellum);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.card h2 {
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
}
.card p:last-child { margin-bottom: 0; }

.band { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band h2 { margin-bottom: 0.3rem; }

.price-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  background: var(--vellum);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}

.faq dl { margin: 0; }
.faq dt { font-weight: 620; margin-top: 1rem; }
.faq dd { margin: 0.25rem 0 0; color: var(--ink-soft); max-width: 78ch; }
.faq { max-width: 900px; }

.linklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.linklist li { border-left: 2px solid var(--accent-soft); padding-left: 0.8rem; }
.linklist a { display: block; font-weight: 600; }
.linklist span { color: var(--ink-faint); font-size: 0.88rem; }

.narrow { max-width: 780px !important; }
.legal h2 { margin-top: 1.6rem; }
.legal p { color: var(--ink-soft); }

.ticks { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.ticks li { margin-bottom: 0.35rem; }
ul.ticks { list-style: none; padding-left: 0; }
ul.ticks li { padding-left: 1.3rem; position: relative; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

.keys { width: 100%; }
.keys td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line-soft); }
.keys td:last-child { color: var(--ink-soft); }
.keys .key { white-space: nowrap; color: var(--ink); }
.keys td:first-child { width: 40%; }
@media (max-width: 520px) {
  .keys .key { white-space: normal; }
  .keys td { padding: 0.35rem 0.3rem; }
}

form.stack { display: grid; gap: 0.7rem; }
form.stack label { display: grid; gap: 0.25rem; font-size: 0.9rem; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="color"], input[type="number"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  min-width: 0;
}
input[type="color"] { padding: 0.1rem; height: 2rem; width: 3rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
label.check, label.row { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }

.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.grid th, table.grid td { text-align: left; padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.grid th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); font-weight: 650; }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid .empty { color: var(--ink-faint); text-align: center; padding: 1rem; }

.flash { border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; margin: 0 0 1rem; font-size: 0.92rem; }
.flash.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.flash.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.badge { display: inline-block; font-size: 0.75rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }

.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 1.5rem clamp(1rem, 3vw, 2.5rem); }
.foot-inner { max-width: 1180px; margin: 0 auto; display: grid; gap: 0.4rem; font-size: 0.85rem; color: var(--ink-faint); }
.foot-links a { color: var(--ink-soft); }
.foot-fine { max-width: 90ch; }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h3 { color: var(--ink-soft); }

.project-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.project-card { display: flex; align-items: center; gap: 0.75rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 0.7rem 0.9rem; background: var(--vellum); }
.project-main { display: grid; gap: 0.1rem; text-decoration: none; color: var(--ink); flex: 1; }
.project-main:hover { text-decoration: none; }
.project-name { font-weight: 620; }
.project-meta, .project-when { color: var(--ink-faint); font-size: 0.85rem; }
.appbanner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.5rem clamp(1rem, 3vw, 2.5rem); border-bottom: 2px solid var(--ink); background: var(--vellum); }
.appbanner h1 { font-size: 1.6rem; margin: 0; }
.appbanner .lede { margin: 0.25rem 0 0; font-size: 0.95rem; }
.appmain > section { padding: 1.5rem clamp(1rem, 3vw, 2.5rem); max-width: 1180px; margin: 0 auto; }
.appmain > .cols { max-width: 1180px; }

@media (max-width: 860px) {
  .sitemain > .hero { grid-template-columns: 1fr; }
  .sitetabs { display: none; }
  .sitebar .who { margin-left: auto; }
}

/* --- print ----------------------------------------------------------------------------------- */

@media print {
  body { background: #fff; font-size: 11px; }
  .topbar, .foot, .btn, .appbanner, .panel, .rail, .toolbar, .statusbar { display: none !important; }
  .appmain > section, .print-sheet { padding: 0; max-width: none; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 0.5rem; margin-bottom: 1rem; }
  .print-head h1 { font-size: 18px; margin: 0; }
  .print-meta { text-align: right; font-size: 10px; color: #444; display: grid; }
  table.grid.print { font-size: 10px; }
  table.grid.print th, table.grid.print td { border-bottom: 1px solid #ddd; padding: 2px 4px; }
  h2 { page-break-after: avoid; }
  table { page-break-inside: auto; }
  tr { page-break-inside: avoid; }
  .print-note { margin-top: 1.5rem; border-top: 1px solid #ddd; padding-top: 0.5rem; }
}
