/* Sabura site, drawn in the editor's visual language: the page is a board
   (paper with a dot grid, night board in dark mode), controls are the
   editor's graphite rails, and board-like content gets the rough outlines
   the editor draws. Rough outlines and washes in assets/sketch/ are made by
   scripts/make-sketches.mjs from the editor's own sketch generator.
   System fonts only: the site loads nothing from third parties. */
:root {
  /* Paper board and the editor's light chrome */
  --paper: #fcfaf6;
  --dot: rgba(0, 0, 0, 0.08);
  --ink: #1e1e1e;
  --text: #303a3e;
  --muted: #5d6666;
  --link: #1971c2;
  --rail: #fffdf7;
  --rail-border: #b9c0ba;
  --rail-shadow: rgba(52, 59, 63, 0.34);
  --hover: #f4f0df;
  --active: #dce7ed;
  --accent: #366b93;
  --frame-line: rgba(30, 30, 30, 0.35);
  --frame-fill: rgba(30, 30, 30, 0.035);

  --sk-box: url("sketch/box-light.svg");
  --sk-box-alt: url("sketch/box-alt-light.svg");
  --sk-ring: url("sketch/ring-light.svg");
  --sk-arrow: url("sketch/arrow-light.svg");
  --sk-wash-yellow: url("sketch/wash-yellow-light.svg");

  /* The editor's font stacks */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", "Chalkboard SE", "Segoe Print", cursive, sans-serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --measure: 66ch;
  color-scheme: light;
}
/* Dark: the night board and the editor's dark chrome. Follows the system
   unless the visitor picked a theme (data-theme, set by assets/theme.js). */
:root[data-theme="dark"] {
  --paper: #18181b;
  --dot: rgba(255, 255, 255, 0.075);
  --ink: #f4f4f5;
  --text: #edf0f0;
  --muted: #b6bec5;
  --link: #7aa2f7;
  --rail: #2b2f33;
  --rail-border: #687078;
  --rail-shadow: rgba(237, 240, 240, 0.22);
  --hover: #4a4540;
  --active: #414b70;
  --accent: #c1c8ff;
  --frame-line: rgba(244, 244, 245, 0.35);
  --frame-fill: rgba(244, 244, 245, 0.035);

  --sk-box: url("sketch/box-dark.svg");
  --sk-box-alt: url("sketch/box-alt-dark.svg");
  --sk-ring: url("sketch/ring-dark.svg");
  --sk-arrow: url("sketch/arrow-dark.svg");
  --sk-wash-yellow: url("sketch/wash-yellow-dark.svg");
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #18181b;
    --dot: rgba(255, 255, 255, 0.075);
    --ink: #f4f4f5;
    --text: #edf0f0;
    --muted: #b6bec5;
    --link: #7aa2f7;
    --rail: #2b2f33;
    --rail-border: #687078;
    --rail-shadow: rgba(237, 240, 240, 0.22);
    --hover: #4a4540;
    --active: #414b70;
    --accent: #c1c8ff;
    --frame-line: rgba(244, 244, 245, 0.35);
    --frame-fill: rgba(244, 244, 245, 0.035);

    --sk-box: url("sketch/box-dark.svg");
    --sk-box-alt: url("sketch/box-alt-dark.svg");
    --sk-ring: url("sketch/ring-dark.svg");
    --sk-arrow: url("sketch/arrow-dark.svg");
    --sk-wash-yellow: url("sketch/wash-yellow-dark.svg");
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 17px/1.6 var(--font-sans);
  /* The editor's 20px dot grid */
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1.4px 1.1px, var(--dot) 1.05px, transparent 1.5px);
  background-size: 20px 20px;
}
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 3px; }
img, svg, iframe { max-width: 100%; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; overflow: visible; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* Hand-drawn outline: a 9-slice of a rough rectangle drawn on a layer above
   the content, so line weight stays the same at any size and focus rings
   on the content are never clipped. */
.sketch { position: relative; }
.sketch::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 24px solid transparent;
  border-image: var(--sk-box) 24 stretch;
  pointer-events: none;
  z-index: 1;
}
.sketch.alt::before { border-image-source: var(--sk-box-alt); }

/* Editor rails: the framed button groups of the editor's top bar */
.rail {
  display: inline-flex;
  align-items: stretch;
  background: var(--rail);
  border: 1px solid var(--rail-border);
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--rail-shadow);
}
.rail > a,
.rail > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-right: 1px dotted var(--rail-border);
  background: transparent;
  color: var(--text);
  font: 600 14px/1.1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}
.rail > :last-child { border-right: 0; }
.rail > a:hover,
.rail > button:hover { background: var(--hover); }
.rail > a[aria-current="page"] { background: var(--active); color: var(--accent); }
.rail > button.theme-toggle { padding: 0 12px; }
.rail > a:focus-visible,
.rail > button:focus-visible { outline: 2px solid var(--link); outline-offset: -3px; border-radius: 0; }

/* Header: two rails, as the editor places its brand and actions */
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 14px; flex-wrap: wrap; }
.brand { font-size: 19px; letter-spacing: -0.02em; color: var(--ink); }
.rail > a.brand { font-size: 19px; color: var(--ink); padding-left: 10px; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }

/* Hero: the headline written on the board, beside a live board */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; padding-block: 56px 64px; }
.hero h1 {
  margin: 0 0 22px;
  font-family: var(--font-hand);
  font-size: clamp(44px, 5.4vw, 70px);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hero .lede { margin: 0 0 30px; font-size: 19px; max-width: 40ch; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }

/* The main action: the editor's primary rail button */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px 0 16px;
  background: var(--active);
  color: var(--accent);
  border: 1px solid var(--rail-border);
  border-radius: 4px;
  box-shadow: 2px 2px 0 var(--rail-shadow);
  font: 600 17px/1 var(--font-sans);
  text-decoration: none;
}
.button:hover { box-shadow: 3px 3px 0 var(--rail-shadow); text-decoration: none; }
.button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--rail-shadow); }
.button .icon { width: 22px; height: 22px; }

.board-frame { margin: 0; }
.board-frame .sketch { padding: 9px; }
.board-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  background: #fcfaf6;
}
/* The caption is an annotation written on the board under the frame */
.board-frame figcaption {
  position: relative;
  margin: 10px 0 0 18px;
  padding-left: 46px;
  font: 19px/1.35 var(--font-hand);
  color: var(--muted);
}
.board-frame figcaption::before {
  content: "";
  position: absolute;
  left: 0;
  top: -6px;
  width: 34px;
  height: 31px;
  background: var(--sk-arrow) center / contain no-repeat;
}

/* Sections */
.section { padding-block: 56px; }
.section h2,
.page h1,
.page h2 {
  font-family: var(--font-hand);
  font-weight: 400;
  color: var(--ink);
}
.section h2 { margin: 0 0 28px; font-size: clamp(32px, 4vw, 42px); line-height: 1.1; }

/* What you get: four shapes on the board */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 26px; margin: 0; }
.facts > div { padding: 26px 30px 28px; }
.facts > div.wash { background: var(--sk-wash-yellow) center / calc(100% - 10px) calc(100% - 10px) no-repeat; }
.facts dt { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); margin-bottom: 8px; }
.facts dd { margin: 0; max-width: 48ch; }

/* Use it with AI: labelled frames, as Sabura draws grouped shapes */
.section-intro { max-width: var(--measure); margin: 0 0 30px; }
.frames { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 22px 26px; align-items: start; }
.frame {
  margin: 0;
  padding: 16px 24px 22px;
  border: 1.5px dashed var(--frame-line);
  border-radius: 12px;
  background: var(--frame-fill);
}
.frame.wide { grid-column: 1 / -1; }
.frame h3,
.frame-label { margin: 0 0 18px; font: 700 16px/1.3 var(--font-sans); color: var(--ink); opacity: 0.75; }
.frame > p { margin: 0; max-width: var(--measure); }
.note { color: var(--muted); font-size: 15px; max-width: var(--measure); margin: 22px 0 26px; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 54px; margin-bottom: 22px; min-height: 40px; }
.steps li:last-child { margin-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -4px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--sk-ring) center / contain no-repeat;
  font: 700 20px/1 var(--font-hand);
  color: var(--ink);
}
.steps strong { display: block; font-size: 17px; color: var(--ink); margin-bottom: 2px; }

/* A command with its Copy button, framed as one editor rail */
.copy-field { display: flex; margin-top: 10px; max-width: 100%; }
.copy-field input {
  flex: 1;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  border-right: 1px dotted var(--rail-border);
  background: transparent;
  color: var(--text);
  font: 14px var(--font-mono);
}
.copy-field input:focus-visible { outline: 2px solid var(--link); outline-offset: -3px; border-radius: 0; }

code { font: 0.88em var(--font-mono); background: var(--hover); border-radius: 3px; padding: 1px 5px; }
kbd {
  font: 600 0.85em var(--font-sans);
  padding: 1px 6px;
  background: var(--rail);
  border: 1px solid var(--rail-border);
  border-radius: 3px;
  box-shadow: 1px 1px 0 var(--rail-shadow);
}

/* Reading pages (docs, privacy) */
.page { padding-block: 40px 72px; }
.page article { max-width: var(--measure); }
.page h1 { font-size: clamp(42px, 5vw, 56px); line-height: 1.05; margin: 0 0 8px; }
.page h2 { font-size: 32px; line-height: 1.15; margin: 48px 0 10px; }
.page h3 { font-size: 18px; color: var(--ink); margin: 28px 0 6px; }
.page .meta { color: var(--muted); margin: 0 0 28px; }
.page table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 12px 0; }
.page th, .page td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px dotted var(--rail-border); }
.page th { font-weight: 650; color: var(--ink); }
.page .toc { padding: 14px 22px 16px; margin: 24px 0 8px; }
.page .toc .frame-label { margin-bottom: 6px; }
.toc a { display: block; padding: 3px 0; }

/* Footer */
.site-footer { border-top: 1px dotted var(--rail-border); padding-block: 26px 40px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

@media (max-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 32px 40px; }
  .facts, .frames { grid-template-columns: minmax(0, 1fr); }
  /* A taller board on narrow screens, so the editor's bars leave room to read it */
  .board-frame iframe { aspect-ratio: 4 / 5; max-height: 80vh; }
  .section { padding-block: 40px; }
}
@media (max-width: 420px) {
  .site-header .wrap { gap: 6px; }
  .rail > a, .rail > button { padding: 0 8px; font-size: 13px; }
  .rail > button.theme-toggle { padding: 0 8px; }
  .rail > a.brand { padding-left: 7px; font-size: 17px; gap: 7px; }
  .brand svg { width: 24px; height: 24px; }
  .facts > div { padding: 22px 22px 24px; }
  .frame { padding: 14px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .button:active { transform: none; }
}
