/* Blueprint business card: the page is a drawing sheet, the card is its title block */
:root {
  --paper: #123d70;          /* cyanotype blue */
  --paper-deep: #0b2b55;     /* edges of the sheet */
  --paper-veil: rgba(18, 61, 112, .86); /* fill that lets hidden parts show through faintly */
  --line: #eaf2ff;           /* object lines and lettering */
  --line-2: #a8c5ec;         /* dimensions, hatching, centre lines */
  --grid: rgba(168, 197, 236, .07);
  --grid-major: rgba(168, 197, 236, .13);
  --redline: #ff9a86;        /* checker's red pencil: keyboard focus */
  --gutter: 14px;
  --margin: 18px;            /* the strip that holds the zone references */
}
* { box-sizing: border-box; }
html { background: var(--paper-deep); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--gutter);
  color: var(--line);
  font: 14px/1.45 "B612", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(5, 20, 45, .45) 100%),
    linear-gradient(var(--grid-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper);
  background-attachment: fixed;
}

/* ---- sheet frame ---- */
.sheet {
  position: relative;
  border: 1px solid var(--line-2);
  padding: var(--margin);
  min-height: calc(100dvh - 2 * var(--gutter));
  display: flex;
}
.frame {
  flex: 1;
  border: 2px solid var(--line);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  height: calc(100dvh - 2 * var(--gutter) - 2 * var(--margin) - 2px);
  min-height: 560px;
}
.zones {
  position: absolute;
  display: flex;
  font-size: 10px;
  color: var(--line-2);
}
.zones span { flex: 1; display: flex; align-items: center; justify-content: center; }
.zones-h { left: var(--margin); right: var(--margin); height: var(--margin); }
.zones-h span + span { border-left: 1px solid var(--line-2); }
.zones-top { top: 0; }
.zones-bottom { bottom: 0; }
.zones-v { top: var(--margin); bottom: var(--margin); width: var(--margin); flex-direction: column; }
.zones-v span + span { border-top: 1px solid var(--line-2); }
.zones-left { left: 0; }
.zones-right { right: 0; }

/* ---- drawing field ---- */
.field { position: relative; min-height: 0; display: flex; padding: 12px; }
#drawing { flex: 1; width: 100%; height: 100%; display: block; overflow: visible; }

#drawing .obj { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
#drawing .solid { fill: var(--paper-veil); }
#drawing .thin { fill: none; stroke: var(--line-2); stroke-width: .7; stroke-linecap: round; }
#drawing .center { fill: none; stroke: var(--line-2); stroke-width: .6; stroke-dasharray: 14 3 2 3; }
#drawing .fill { fill: var(--line-2); stroke: none; }
#drawing text { fill: var(--line); font-family: "B612", system-ui, sans-serif; font-size: 11px; }
#drawing text.small { fill: var(--line-2); font-size: 9.5px; }
#drawing text.dimtext { fill: var(--line-2); font-size: 10px; }
#drawing text.view-title { font-size: 13px; font-weight: 700; text-decoration: underline; }

/* ---- DIY box and title block ---- */
.bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  border-top: 2px solid var(--line);
}
.diy { padding: 10px 16px 12px; font-size: 13px; color: var(--line-2); max-width: 70ch; }
.diy h2 { margin: 0 0 4px; font-size: 12.5px; font-weight: 700; color: var(--line); }
.diy ul { margin: 0; padding-left: 1.2em; }

/* name and scale on top, then one cell per row */
.title-block {
  display: grid;
  grid-template-columns: 1fr 150px;
  border-left: 2px solid var(--line);
}
.tb {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 10px 7px;
  border-bottom: 1px solid var(--line-2);
  min-width: 0;
  grid-column: 1 / -1;
}
.tb-name { grid-column: 1; border-right: 1px solid var(--line-2); }
.tb-scale { grid-column: 2; }
.tb-contact { border-bottom: 0; }
.k { font-size: 10px; color: var(--line-2); }
.v { font-size: 13px; }
.title-block h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: .01em; }
.tb-drawing .v { font-weight: 700; }

.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.links a, .diy a { color: var(--line); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.links a:hover, .diy a:hover { text-decoration-color: var(--line); }

a:focus-visible, button:focus-visible { outline: 2px solid var(--redline); outline-offset: 2px; }

/* ---- narrow screens: the sheet grows with its content, title block above the DIY box ---- */
@media (max-width: 900px) {
  .frame { height: auto; min-height: 0; }
  .field { padding: 6px; }
  #drawing { height: auto; aspect-ratio: 1000 / 640; }
  .bottom { grid-template-columns: 1fr; }
  .title-block { border-left: 0; order: -1; }
  .diy { border-top: 2px solid var(--line); }
}
@media (max-width: 520px) {
  :root { --gutter: 8px; --margin: 12px; }
  .zones { font-size: 8px; }
  .title-block { grid-template-columns: 1fr 96px; }
  .title-block h1 { font-size: 24px; }
}
