/* VibeCAD's design system: the drafting sheet (docs/DESIGN.md, sheet VC-001). Graphite on vellum, zero radius,
   controls are stamps, vermilion only for markups, blue only for dimensions. The landing adds landing.css. */
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url('/fonts/martian-mono.woff2') format('woff2'); font-weight: 100 800; font-stretch: 75% 112%; font-display: swap; }
@property --chamfer { syntax: '<length>'; inherits: false; initial-value: 8px; }

:root {
  color-scheme: light;
  --vellum: #eeece6; --vellum-2: #e2dfd6; --graphite: #272927; --graphite-2: #5d605b;
  --vermilion: #f65a35; --vermilion-ink: #b83a1b; --blue: #347cbb; --blue-ink: #25609a; --verified: #286b44;
  --face: #f6f4ee; --grid-ink: 5%;
  --focus: var(--vermilion); --danger: var(--vermilion-ink);
  --rule: 1.5px; --hair: .75px; --ease: cubic-bezier(.3, 0, .1, 1);
  --text: 'Archivo', Arial, sans-serif; --mono: 'Martian Mono', ui-monospace, monospace;
  --wrap: 1120px; --gutter: 32px;
}
@supports (color: oklch(0% 0 0)) {
  :root {
    --vellum: oklch(94.1% .008 95); --vellum-2: oklch(90.5% .01 95); --graphite: oklch(27.5% .005 145); --graphite-2: oklch(47% .008 130);
    --vermilion: oklch(66% .2 37); --vermilion-ink: oklch(52% .16 35); --blue: oklch(56% .11 250); --blue-ink: oklch(46% .11 250); --verified: oklch(47% .1 152);
  }
}
/* The night sheet (owner, 2026-11-20): the same drawing on a deep graphite sheet, lines and lettering in the vellum's
   colour, vermilion still only for markups; the studio's Preferences › Theme (this browser's vc_prefs) or the system's
   scheme chooses it (lib/theme.js). The values and their contrast are the studio's (CommandAGI
   packages/applets/vibecad/src/theme/tokens.css): lettering 13.6 : 1, labels 7.8 : 1, blue-ink 9.7 : 1. Its specificity
   is over the @supports block. */
:root[data-theme=dark] {
  color-scheme: dark;
  --vellum: #1b1d1b; --vellum-2: #252825; --graphite: #e9e6dd; --graphite-2: #b3b0a6;
  --vermilion: #ff6a45; --vermilion-ink: #ff9a7a; --blue: #6aa9e4; --blue-ink: #9cc8f2; --verified: #6fcf97;
  --face: #2c2f2c; --grid-ink: 7%;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; color: var(--graphite); font: 400 15px/1.6 var(--text); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
  background:
    linear-gradient(to right, color-mix(in oklab, var(--graphite) var(--grid-ink), transparent) var(--hair), transparent var(--hair)) 0 0 / 19px 19px,
    linear-gradient(to bottom, color-mix(in oklab, var(--graphite) var(--grid-ink), transparent) var(--hair), transparent var(--hair)) 0 0 / 19px 19px,
    var(--vellum);
}
main { flex: 1; }
h1, h2, h3, p, ol, ul, figure, pre, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { color: var(--graphite); font-weight: 220; font-stretch: 125%; letter-spacing: -.035em; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px dashed var(--focus); outline-offset: 4px; }
::selection { background: color-mix(in oklab, var(--vermilion) 22%, transparent); }
[hidden] { display: none !important; }
.wrap { width: min(100%, var(--wrap)); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -64px; background: var(--graphite); color: var(--vellum); padding: 10px 14px; z-index: 60; }
.skip:focus { top: 12px; }

/* lettering: the condensed uppercase hand of a drawing's labels */
.label, .lettering { font: 640 12px/1.3 var(--text); font-stretch: 62%; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite-2); }
.label b { color: var(--graphite); font: 600 11px var(--mono); }

/* controls: every control is a stamp, one 45° chamfer top-right */
.btn {
  --chamfer: 8px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 16px 7px 12px;
  border: var(--rule) solid var(--graphite); border-radius: 0; background: var(--vellum); color: var(--graphite);
  font: 650 13px/1.2 var(--text); font-stretch: 75%; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; text-decoration: none;
  clip-path: polygon(0 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%);
}
.btn::after { content: ''; position: absolute; top: 0; right: 0; width: calc(var(--chamfer) * 1.4142); height: var(--rule); background: var(--graphite); transform-origin: 100% 0; rotate: -45deg; }
.btn:hover { --chamfer: 14px; text-decoration: none; }
.btn.primary { background: var(--graphite); color: var(--vellum); }
.btn.danger { color: var(--vermilion-ink); }
.btn.quiet { border-color: transparent; clip-path: none; background: none; }
.btn.quiet::after { display: none; }
.btn.quiet:hover { background: var(--vellum-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.full { width: 100%; }
.icon { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: var(--hair) solid transparent; border-radius: 0; background: none; color: var(--graphite-2); cursor: pointer; }
.icon:hover { border-color: var(--graphite); color: var(--graphite); }
.icon.danger:hover { color: var(--vermilion-ink); border-color: var(--vermilion); }
.icon svg, .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }

/* header and footer of the inner pages (the landing's navigation is its title block) */
.top { position: sticky; top: 0; z-index: 10; background: var(--vellum); border-bottom: var(--rule) solid var(--graphite); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 54px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--graphite); }
.brand:hover { text-decoration: none; }
.brand svg { width: 129px; height: auto; }
/* The wordmark, drawn inline so it takes the sheet's ink: graphite letters, the vermilion triangle at their cap height. */
.wordmark-tri { fill: var(--vermilion); }
.top .side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.foot { border-top: var(--rule) solid var(--graphite); margin-top: 72px; padding-block: 22px; font-size: 13px; color: var(--graphite-2); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-left: auto; }
.foot a { color: var(--graphite); font: 640 12px var(--text); font-stretch: 75%; letter-spacing: .06em; text-transform: uppercase; }

/* forms and dialogs */
.narrow { width: min(100%, 420px); margin-inline: auto; padding: 56px 20px 0; }
.narrow h1 { font-size: 32px; line-height: 1.1; margin-bottom: 8px; }
.field { display: block; margin-top: 14px; }
.field > span { display: block; margin-bottom: 5px; font: 640 12px var(--text); font-stretch: 62%; letter-spacing: .08em; text-transform: uppercase; }
.field small { color: var(--graphite-2); font-size: 12px; text-transform: none; letter-spacing: 0; font-stretch: 100%; font-weight: 400; }
input { width: 100%; min-height: 38px; padding: 7px 10px; border: var(--rule) solid var(--graphite); border-radius: 0; background: var(--vellum); color: var(--graphite); font: 400 14px/1.3 var(--mono); font-stretch: 90%; }
input:focus-visible { outline-offset: 2px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 42px; }
.pw .icon { position: absolute; right: 3px; top: 3px; }
.form-actions { margin-top: 18px; }
.error { min-height: 1.4em; margin-top: 10px; font-size: 13px; color: var(--vermilion-ink); }
.ok { margin-top: 12px; font-size: 13px; color: var(--verified); }
.switch { margin-top: 12px; font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink); cursor: pointer; }
.link:hover { text-decoration: underline; }
.fine { margin-top: 18px; font-size: 12.5px; color: var(--graphite-2); }
.turnstile:not(:empty) { margin-top: 14px; }
dialog { width: min(calc(100vw - 32px), 420px); padding: 22px; border: var(--rule) solid var(--graphite); border-radius: 0; background: var(--vellum); color: var(--graphite); }
dialog::backdrop { background: color-mix(in oklab, var(--graphite) 35%, transparent); }
dialog h2 { font-size: 22px; margin-bottom: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* designs */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 40px; }
.page-head h1 { font-size: 36px; line-height: 1.1; margin-top: 6px; }
.designs { margin-top: 20px; border: var(--rule) solid var(--graphite); }
.designs li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 6px 8px 6px 14px; background: var(--vellum); }
.designs li + li { border-top: var(--hair) solid var(--graphite); }
.designs li:hover { background: var(--vellum-2); }
.designs a { color: var(--graphite); font: 500 14px var(--mono); font-stretch: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.designs time { font: 400 12px var(--mono); color: var(--graphite-2); }
.row-actions { display: flex; gap: 2px; }
.empty { margin-top: 20px; padding: 40px 20px; border: var(--hair) dashed var(--graphite); text-align: center; }
.empty h2 { font-size: 22px; margin-bottom: 6px; }
.empty .actions { display: flex; justify-content: center; margin-top: 16px; }
.banner { margin-top: 16px; padding: 10px 12px; border: 2px solid var(--vermilion); color: var(--vermilion-ink); font-size: 14px; }
.prose { max-width: 680px; padding-top: 48px; }
.prose h1 { font-size: 40px; line-height: 1.05; margin-bottom: 14px; }
.prose h2 { font-size: 13px; margin: 28px 0 6px; font: 640 13px var(--text); font-stretch: 62%; letter-spacing: .08em; text-transform: uppercase; }
.prose p + p { margin-top: 8px; }
.prose .links { display: grid; gap: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.note { margin-top: 12px; font-size: 13px; color: var(--graphite-2); }

@media (max-width: 900px) { :root { --gutter: 20px; } }
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .foot nav { margin-left: 0; }
  .designs li { grid-template-columns: minmax(0, 1fr) auto; }
  .designs time { display: none; }
}
@media (max-width: 460px) {
  .page-head { flex-wrap: wrap; }
  .narrow h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn { transition: --chamfer .24s var(--ease), background-color .24s var(--ease), color .24s var(--ease); }
  .designs li { transition: background-color .12s ease; }
}
