/* Theme 34 — "Drawing sheet".
 *
 * The page is a drafting sheet: a hairline grid field, plates squared onto it, a title block over
 * every plate, and every dimension set on its own line. Spare everywhere except in the drawings,
 * which are dense on purpose — extension lines, hatched surfaces, leaders and a value on every
 * dimension line — because on this site the drawing is the answer and not an illustration beside
 * it. That is the direction's one departure and it is deliberate.
 *
 * Hand-written. No framework, no reset library, about one selector per idea.
 */

/* --- fonts: Outfit for headings, Work Sans for everything a number is set in ---------------- */

@font-face {
  font-family: Outfit;
  src: url("/assets/fonts/outfit-var-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
    U+FFFD;
}

@font-face {
  font-family: "Work Sans";
  src: url("/assets/fonts/work-sans-var-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
    U+FFFD;
}

/* --- ground --------------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--grid) var(--hair), transparent var(--hair)),
    linear-gradient(to bottom, var(--grid) var(--hair), transparent var(--hair));
  background-size: 2rem 2rem;
  color: var(--ink);
  font-family: var(--face-text);
  font-size: var(--fs-base);
  line-height: var(--lh-text);
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
  font-family: var(--face-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 var(--s3); }
p:last-child { margin-bottom: 0; }

a { color: var(--cut-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s4);
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--s4);
  top: var(--s2);
  z-index: 9;
  background: var(--sheet);
  color: var(--ink);
  padding: var(--s2) var(--s3);
  border: var(--hair) solid var(--ink);
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- sheet head ------------------------------------------------------------------------------ */

.head { background: var(--sheet); border-bottom: 2px solid var(--ink); }

.head-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s5);
  padding-block: var(--s3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--face-display);
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.015em;
}
.brand svg { display: block; width: 1.75rem; height: 1.75rem; }
.mark-board { fill: var(--board); stroke: var(--ink); stroke-width: 1.2; }
.mark-cut { fill: none; stroke: var(--cut); stroke-width: 2; stroke-linejoin: miter; }

.tasks { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-left: auto; }
.tasks a {
  display: inline-block;
  padding: var(--s2) 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.tasks a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.tasks a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--cut); }

.crumbs { font-size: var(--fs-mini); color: var(--ink-2); padding-block: var(--s3) 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: var(--s2); color: var(--ink-3); }

main { display: block; padding-block: var(--s4) var(--s7); }

/* --- plate ----------------------------------------------------------------------------------- */

.plate {
  background: var(--sheet);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  margin-block: var(--s4);
}
.plate > * { padding-inline: var(--s4); }
.plate > *:last-child { padding-bottom: var(--s4); }

.plate-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  padding-block: var(--s3);
  border-bottom: 2px solid var(--ink);
  margin-bottom: var(--s4);
}
.plate-key {
  font-family: var(--face-display);
  font-size: var(--fs-mini);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--cut-ink);
}
.plate-head h2 { font-size: var(--fs-xl); }
.plate-sub,
.plate-note { font-size: var(--fs-sm); color: var(--ink-2); }
.plate-note { margin-left: auto; }
.plate-foot {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-top: var(--s3);
}

/* --- the answer plate ------------------------------------------------------------------------ */

.answer { border-color: var(--ink); border-width: 2px; }
.answer .plate-head { border-bottom-color: var(--cut); }
.answer h1 { font-size: var(--fs-2xl); margin-bottom: var(--s4); }

.hero { margin-bottom: var(--s5); }
.hero-label,
.leads dt {
  display: block;
  font-size: var(--fs-mini);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--ink-2);
  margin-bottom: var(--s1);
}
.hero-range { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.hero-to {
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--ink-2);
}

.leads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s4) var(--s6);
  margin: 0;
}
.leads > div { min-width: 6.5rem; }
.leads dd { margin: 0; }
.leads--tight { gap: var(--s3) var(--s5); margin-bottom: var(--s4); }
.leads--wide > div { min-width: 9rem; }

/* --- the value component: one value, up to three notations ----------------------------------- */

.v {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  font-family: var(--face-num);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.v-u {
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-2);
}

/* A fraction, set as a fraction: a real numerator over a real denominator, and the slash is one
   continuous stroke — Work Sans' U+2044, measured, not assumed. */
.fr {
  display: inline-flex;
  align-items: baseline;
  font-size: 0.6em;
  letter-spacing: 0;
  margin-left: 0.14em;
}
.fr sup,
.fr sub { font-size: 0.8em; line-height: 1; position: relative; }
.fr sup { vertical-align: super; top: -0.12em; }
.fr sub { vertical-align: sub; top: 0.1em; }
.fr-s { padding-inline: 0.01em; }

.v-hero { font-size: var(--fs-hero); line-height: var(--lh-tight); }
.v-lead { font-size: var(--fs-value); line-height: var(--lh-tight); }

/* The other two notations of the same value. Size, weight and colour step down together, so a
   greyscale print keeps the hierarchy. */
.v-alt {
  display: block;
  font-family: var(--face-text);
  font-size: var(--fs-sm);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  letter-spacing: 0;
  margin-top: var(--s1);
}
.v-alt span { white-space: nowrap; }
.v-alt span + span::before { content: "·"; margin-inline: 0.45em; color: var(--ink-3); }

/* --- drawings -------------------------------------------------------------------------------- */

.fig {
  margin: 0 0 var(--s4);
  background: var(--sheet-sunk);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s2);
}
.fig svg { display: block; width: 100%; max-width: var(--fig-max); height: auto; margin-inline: auto; }

/* The drawing is part of the answer, so it is squared onto the answer plate and shares its edge. */
.fig-joined .fig {
  margin-top: calc(var(--s4) * -1);
  border: 2px solid var(--ink);
  border-top: 0;
  padding: var(--s3) var(--s2) var(--s2);
}

/* Lines. A drawing is read at arm's length, so nothing here is a hairline for its own sake. */
.d-solid { fill: var(--board); stroke: var(--board-edge); stroke-width: 1.1; stroke-linejoin: round; }
/* A surface a section cuts through is hatched, so it reads as a surface and not as a shape. The
   pattern is declared in every drawing that uses one; the rule is here because a CSS fill beats a
   presentation attribute and .d-solid would otherwise paint over it. */
.d-solid--hatch { fill: url(#hatch-cut); }
.d-cut { fill: none; stroke: var(--cut); stroke-width: 2.6; stroke-linejoin: miter; stroke-linecap: round; }
.d-nose { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-dasharray: 7 4; }
.d-ex { fill: none; stroke: var(--ink-3); stroke-width: 0.9; stroke-dasharray: 4 3; }
.d-dl { fill: none; stroke: var(--ink-2); stroke-width: 1.3; }
.d-dl--cut { stroke: var(--cut); }
.d-tk { fill: none; stroke: var(--ink-2); stroke-width: 1.7; }
.d-ld { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.d-dot { fill: var(--ink-2); stroke: none; }
.d-dot--cut { fill: var(--cut); }
.d-fl { fill: none; stroke: var(--ink); stroke-width: 1.8; }
.d-ht { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.d-bub { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.d-waste { stroke: var(--rule-strong); stroke-width: 0.8; }
.d-bar { stroke: var(--cut); stroke-width: 7; stroke-linecap: butt; }
.d-bar--run { stroke: var(--rule-strong); }

/* Labels. 15 and 19 viewBox units against a 340-unit box: at the narrowest phone the drawing is
   still the widest thing on the page, so a value renders at about 18 CSS px and a name at 14.5. */
.fig text {
  font-family: var(--face-text);
  font-variant-numeric: tabular-nums;
  fill: var(--ink);
}
.d-nm {
  font-size: 15px;
  font-weight: 600;
  fill: var(--ink-2);
  letter-spacing: 0.02em;
}
.d-nm--src { font-size: 14px; font-weight: 500; fill: var(--ink-3); letter-spacing: 0; }
.d-vl { font-size: 19px; font-weight: 700; fill: var(--ink); }
.d-vl--sm { font-size: 17px; }
.fig .u { font-size: 0.62em; font-weight: 600; fill: var(--ink-2); }
.fig .fn,
.fig .fd { font-size: 0.66em; }

/* --- inputs ---------------------------------------------------------------------------------- */

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--s3);
}
.field label {
  display: block;
  font-size: var(--fs-mini);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--ink-2);
  margin-bottom: var(--s1);
}
.field-in {
  display: flex;
  align-items: stretch;
  border: var(--hair) solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--sheet-sunk);
  overflow: hidden;
}
.field input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.75rem;
  padding: var(--s2) var(--s3);
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-family: var(--face-num);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.field input:focus-visible { outline-offset: -3px; }
/* Read-only until the site registers a solver: a field that looks editable and is not is the
   defect this gating exists to avoid, so it is drawn as a stated figure rather than as a well. */
.field-in:has(input[readonly]) { background: var(--sheet); border-style: dashed; }
.field-unit {
  display: flex;
  align-items: center;
  padding-inline: var(--s3);
  background: var(--sheet);
  border-left: var(--hair) solid var(--rule);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.fields-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.go {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 2.75rem;
  padding: var(--s2) var(--s5);
  border: 2px solid var(--cut);
  border-radius: var(--radius);
  background: var(--cut-soft);
  color: var(--cut-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease);
}
.go:hover { background: var(--sheet); }
.go[hidden] { display: none; }

/* --- tables: hairlines, tabular figures, and no sideways scroll ------------------------------- */

.dims {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
}
.dims th,
.dims td {
  text-align: right;
  padding: var(--s2);
  border-bottom: var(--hair) solid var(--rule);
  vertical-align: baseline;
}
.dims thead th {
  font-family: var(--face-display);
  font-size: var(--fs-mini);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--ink-2);
  border-bottom: 2px solid var(--ink);
  vertical-align: bottom;
}
.dims th[scope="row"],
.dims .lead { text-align: left; font-weight: 600; color: var(--ink); }
.dims tbody tr:last-child th,
.dims tbody tr:last-child td { border-bottom: 0; }
.dims tr[data-current] { background: var(--cut-soft); }
.dims tr[data-current] th[scope="row"] { box-shadow: inset 3px 0 0 var(--cut); }
.dims--pairs th[scope="row"] { width: 55%; font-weight: 500; }
.sub { display: block; font-size: var(--fs-mini); color: var(--ink-2); font-weight: 400; }

/* Below 34rem a row of seven dimensions stops being a row and becomes a small card — the header
   travels with each cell. Nothing scrolls sideways, ever. */
@media (max-width: 33.99rem) {
  .dims--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .dims--stack tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s1) var(--s3);
    padding: var(--s3) 0;
    border-bottom: var(--hair) solid var(--rule);
  }
  .dims--stack td,
  .dims--stack th { border: 0; padding: 0; text-align: left; }
  .dims--stack th[scope="row"] {
    grid-column: 1 / -1;
    font-family: var(--face-display);
    font-size: var(--fs-lg);
  }
  .dims--stack td::before {
    content: attr(data-label);
    display: block;
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    color: var(--ink-2);
  }
  .dims--stack tr[data-current] { padding-inline: var(--s3); }
}

/* --- pass / fail: glyph, word and border weight, never colour alone --------------------------- */

.flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.1em 0.5em;
  border-radius: var(--radius);
  font-size: var(--fs-mini);
  font-weight: 600;
  white-space: nowrap;
}
.flag svg { width: 0.85em; height: 0.85em; flex: none; }
.flag--pass { color: var(--cut-ink); background: var(--cut-soft); border: var(--hair) solid var(--cut); }
.flag--fail { color: var(--warn); background: var(--warn-soft); border: 2px dashed var(--warn); }

/* --- cut list, layout steps ------------------------------------------------------------------ */

.marks { list-style: none; margin: 0; padding: 0; counter-reset: mark; }
.marks li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
  padding-block: var(--s2);
  border-bottom: var(--hair) solid var(--rule);
}
.marks li:last-child { border-bottom: 0; }
.marks li::before {
  counter-increment: mark;
  content: counter(mark);
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  font-size: var(--fs-mini);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  border: var(--hair) solid var(--rule-strong);
  border-radius: 50%;
}
.mark-pair { display: inline-flex; align-items: baseline; gap: 0.35em; }
.mark-x { color: var(--ink-2); }
.marks .mark-v { margin-left: auto; text-align: right; }

.steps { margin: 0; padding-left: var(--s5); }
.steps li { padding-block: var(--s2); border-bottom: var(--hair) solid var(--rule); }
.steps li:last-child { border-bottom: 0; }
.steps-slots { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s2) 0 0; }
.chip {
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--ink-2);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  padding: 0.1em 0.45em;
}

/* --- links out -------------------------------------------------------------------------------- */

.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--s2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.links a {
  display: block;
  padding: var(--s3);
  min-height: 2.75rem;
  border: var(--hair) solid var(--rule);
  border-left: 3px solid var(--cut);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.links a:hover { background: var(--cut-soft); border-color: var(--rule-strong); border-left-color: var(--cut); }

.siblings { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.siblings a {
  display: inline-flex;
  flex-direction: column;
  min-width: 5.5rem;
  min-height: 2.75rem;
  padding: var(--s2) var(--s3);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  text-decoration: none;
}
.siblings a:hover { border-color: var(--ink); }
.sib-n {
  font-family: var(--face-num);
  font-size: var(--fs-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- faq, note, provenance -------------------------------------------------------------------- */

.faq { border-top: var(--hair) solid var(--rule); }
.faq:first-of-type { border-top: 0; }
.faq summary,
.srcs summary {
  display: flex;
  gap: var(--s3);
  align-items: baseline;
  padding-block: var(--s3);
  min-height: 2.75rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker,
.srcs summary::-webkit-details-marker { display: none; }
.faq summary::before,
.srcs summary::before {
  content: "+";
  font-family: var(--face-display);
  color: var(--cut-ink);
  transition: transform var(--dur-2) var(--ease);
}
.faq[open] summary::before,
.srcs[open] summary::before { transform: rotate(45deg); }
.faq > div { padding-bottom: var(--s3); color: var(--ink-2); }

.srcs summary { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; }

.note {
  border-left: 3px solid var(--cut);
  background: var(--cut-soft);
  padding: var(--s3) var(--s4);
  margin-block: var(--s4);
  font-size: var(--fs-sm);
}

/* A provenance line carries a source URL, and a URL does not wrap on its own. */
.prov { font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.prov ul { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.prov li { padding-block: var(--s2); border-bottom: var(--hair) solid var(--rule); }
.prov li:last-child { border-bottom: 0; }
.prov-code { display: block; font-weight: 600; color: var(--ink); }
.prov-secs,
.prov-date { display: block; font-size: var(--fs-mini); }
/* A source URL is a line of prose, not a control, and it is set inline so it reads as one and
   wraps like one. */
.prov-url { display: inline; font-size: var(--fs-mini); }
.prov-updated { font-size: var(--fs-mini); color: var(--ink-2); margin-top: var(--s3); }

.prose h2 { font-size: var(--fs-xl); margin-top: var(--s5); }
.prose p { max-width: 38rem; }

/* --- footer ----------------------------------------------------------------------------------- */

.foot {
  background: var(--sheet);
  border-top: 2px solid var(--ink);
  padding-block: var(--s5);
  font-size: var(--fs-sm);
}
.foot-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--s5); }
.foot h2 {
  font-size: var(--fs-mini);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--ink-2);
  margin-bottom: var(--s2);
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { padding-block: var(--s1); }
.foot a { color: var(--ink); }
.foot-line { font-size: var(--fs-mini); color: var(--ink-2); margin-bottom: var(--s1); }
.foot-legal {
  margin-top: var(--s5);
  padding-top: var(--s3);
  border-top: var(--hair) solid var(--rule);
  font-size: var(--fs-mini);
  color: var(--ink-2);
}

/* --- 404 -------------------------------------------------------------------------------------- */

.dead h1 { font-size: var(--fs-2xl); margin-bottom: var(--s3); }
.dead-p { color: var(--ink-2); margin-bottom: var(--s4); }

/* --- motion: 2/10, and all of it is switchable ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 48rem) {
  .plate > * { padding-inline: var(--s5); }
  .plate > *:last-child { padding-bottom: var(--s5); }
  .answer h1 { font-size: 2.25rem; }
  .fig-joined .fig { padding-inline: var(--s4); }
}
