/* DatumKey — drafting-sheet design system */
:root {
  --paper: #eef1f3;
  --sheet: #ffffff;
  --ink: #15212e;
  --ink-soft: #4a5866;
  --line: #8c99a6;
  --line-soft: #d3dae0;
  --blue: #1d4f7a;
  --blue-wash: #e3ecf4;
  --amber: #c98200;
  --amber-ink: #1a1200;
  --amber-fill: #f2a50f;
  --focus: #1d4f7a;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e161e; --sheet: #15202b; --ink: #e5ebf0; --ink-soft: #a6b3bf;
    --line: #5f7080; --line-soft: #2a3846; --blue: #86b6df; --blue-wash: #1a2c3d;
    --amber: #f0a818; --amber-fill: #f0a818; --focus: #86b6df; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e161e; --sheet: #15202b; --ink: #e5ebf0; --ink-soft: #a6b3bf;
  --line: #5f7080; --line-soft: #2a3846; --blue: #86b6df; --blue-wash: #1a2c3d;
  --amber: #f0a818; --amber-fill: #f0a818; --focus: #86b6df; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif; font-size: 17px; line-height: 1.55;
  font-variation-settings: "wdth" 100;
}
img, svg, iframe { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sheet); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Type scale (1.25) */
h1, h2, h3 { line-height: 1.12; margin: 0 0 0.5em; font-weight: 750; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); font-variation-settings: "wdth" 112; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-variation-settings: "wdth" 108; }
h3 { font-size: 1.2rem; font-variation-settings: "wdth" 104; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: 1.2rem; color: var(--ink-soft); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-head { border-bottom: 1px solid var(--line-soft); background: var(--sheet); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.15rem; font-variation-settings: "wdth" 112; }
.brand svg { width: 34px; height: 30px; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--blue); }

/* Buttons */
.btn { display: inline-block; font: inherit; font-weight: 650; text-decoration: none; padding: 12px 20px; border-radius: 3px; border: 2px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; }
.btn-primary { background: var(--amber-fill); border-color: var(--amber-fill); color: var(--amber-ink); }
.btn-primary:hover { filter: brightness(0.95); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* Hero: the drawing sheet */
.hero { padding: clamp(32px, 6vw, 72px) 0; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.byline { margin-top: 20px; font-size: 0.98rem; color: var(--ink-soft); }
.byline strong { color: var(--ink); }
.sheet-figure { background: var(--sheet); border: 1px solid var(--line); padding: 10px; position: relative; }
.sheet-figure figcaption { font-size: 0.85rem; color: var(--ink-soft); padding: 8px 4px 0; }
.drawing .obj { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.drawing .hid { fill: none; stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 6 4; }
.drawing .ctr { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 14 3 2 3; }
.drawing .hit { fill: var(--amber-fill); fill-opacity: 0.28; stroke: var(--amber); stroke-width: 2.4; }
.drawing .dim { fill: none; stroke: var(--blue); stroke-width: 1.1; }
.drawing .arrow { fill: var(--blue); }
.drawing text { fill: var(--ink); font-family: "Archivo", sans-serif; font-size: 15px; }
.drawing .call { fill: var(--sheet); stroke: var(--ink); stroke-width: 1.4; }
.drawing .grid { stroke: var(--line-soft); stroke-width: 1; }
.drawing .zone { fill: var(--ink-soft); font-size: 11px; }

/* Sections */
section.band { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line-soft); }
section.band.alt { background: var(--sheet); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 40px; }
.cols h3 { padding-top: 12px; border-top: 3px solid var(--blue); }
.cols p { font-size: 1rem; }

/* Title block — the trust panel */
.title-block { display: grid; grid-template-columns: repeat(6, 1fr); border: 2px solid var(--ink); background: var(--sheet); margin-top: 8px; }
.title-block > div { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 10px 14px 12px; min-width: 0; }
.title-block .k { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 2px; }
.title-block .v { font-weight: 650; overflow-wrap: anywhere; }
.tb-2 { grid-column: span 2; } .tb-3 { grid-column: span 3; } .tb-4 { grid-column: span 4; } .tb-6 { grid-column: span 6; }
.title-block > div:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .title-block { grid-template-columns: 1fr 1fr; }
  .tb-2, .tb-3, .tb-4 { grid-column: span 1; } .tb-6, .tb-wide { grid-column: span 2; }
}

/* About + headshot */
.about { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 24px 32px; align-items: start; }
.headshot { width: 112px; aspect-ratio: 1 / 1; border-radius: 50%; max-width: 100%; object-fit: cover; border: 1px solid var(--line); background: var(--sheet); }
.headshot-pending { display: grid; place-items: center; text-align: center; font-size: 0.85rem; color: var(--ink-soft); border-style: dashed; padding: 8px; }
@media (max-width: 560px) { .about { grid-template-columns: 1fr; } .headshot { width: 96px; } }

/* Lists, notes */
.checks { list-style: none; padding: 0; margin: 0 0 1em; max-width: var(--measure); }
.checks li { padding: 6px 0 6px 30px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 4px; top: 0.85em; width: 12px; height: 12px; border: 2px solid var(--blue); transform: rotate(45deg); }
.note { border-left: 4px solid var(--amber); background: var(--sheet); padding: 12px 16px; max-width: var(--measure); }
.pending { color: var(--ink-soft); font-style: italic; }

/* Projects */
.proj-list { display: grid; gap: 0; }
.proj { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px 40px; padding: 32px 0; border-top: 1px solid var(--line-soft); }
.proj:first-child { border-top: 0; }
.proj .meta { color: var(--ink-soft); font-size: 0.95rem; }
.proj ul { margin: 0 0 1em; padding-left: 1.1em; max-width: var(--measure); }
.proj li { margin: 4px 0; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; background: var(--blue-wash); }
.video-pending { display: grid; place-items: center; border: 1px dashed var(--line); color: var(--ink-soft); padding: 16px; text-align: center; }
.status { display: inline-block; font-size: 0.85rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink-soft); margin-bottom: 8px; }
.proj.featured { background: var(--sheet); border: 2px solid var(--ink); padding: 28px; margin-bottom: 24px; }
@media (max-width: 820px) { .proj { grid-template-columns: 1fr; } .hero .wrap { grid-template-columns: 1fr; } }

/* Download form */
.form-sheet { background: var(--sheet); border: 2px solid var(--ink); padding: clamp(20px, 4vw, 32px); max-width: 560px; }
label { display: block; font-weight: 650; margin-bottom: 6px; }
input[type="email"] { width: 100%; font: inherit; padding: 12px; border: 2px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--ink); }
input[type="email"]:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-wash); }
input[aria-invalid="true"] { border-color: #b3261e; }
.field-error { color: #b3261e; font-size: 0.95rem; margin: 6px 0 0; min-height: 1.4em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .field-error { color: #ff8a80; } }
.consent { font-size: 0.9rem; color: var(--ink-soft); margin: 12px 0; }
.form-status { margin-top: 12px; font-weight: 600; }
.cf-turnstile { margin: 14px 0; min-height: 65px; }

/* Prose pages */
.prose { padding: clamp(32px, 6vw, 64px) 0; }
.prose h2 { margin-top: 1.6em; font-size: 1.4rem; }
.prose ul { max-width: var(--measure); }

/* Footer */
.site-foot { border-top: 2px solid var(--ink); background: var(--sheet); padding: 28px 0; font-size: 0.95rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .drawing .hit { animation: flag 1.2s ease-out 0.4s both; }
  .drawing .callout { animation: appear 0.5s ease-out 1.2s both; }
}
@keyframes flag { from { fill-opacity: 0; stroke-opacity: 0; } to { fill-opacity: 0.28; stroke-opacity: 1; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* Preview gate (temporary, removed at launch) */
body.gate { min-height: 100vh; display: grid; }
.gate-main { display: grid; place-items: center; padding-block: 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.gate-sheet { max-width: 640px; width: 100%; }
.gate-mark { width: 54px; height: 48px; color: var(--ink); margin-bottom: 20px; }
.gate-form { width: 100%; }
.gate-form h1 { font-size: 1.8rem; }
input[type="password"] { width: 100%; font: inherit; padding: 12px; border: 2px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--ink); }
input[type="password"]:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-wash); }
