/* Zuse site. An engineering drawing: cool drafting paper, ink, construction blue, and one red line
   for the only thing that crosses the machine boundary. Fonts are self-hosted (SIL OFL). */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/plex-mono-400.woff2") format("woff2"); }

:root {
  --paper: #f5f7f8;
  --ink: #1b2a33;
  --ink-soft: #4a5a64;
  --blue: #3a6ea5;
  --grid: #dce3e8;
  --red: #c8102e;
  --measure: 38rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--paper);
  /* Drafting grid, 120px squares. */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px;
  background-position: -1px -1px;
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gutter); top: 0.75rem; background: var(--paper); padding: 0.4rem 0.75rem; z-index: 2; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}
.wordmark {
  font: 700 1.75rem/1 var(--display);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.top nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-weight: 500; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { color: var(--blue); }
.top .nav-cta { color: var(--blue); }

main > section {
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
  border-bottom: 1px solid var(--grid);
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -0.005em; max-width: 14ch; }
h2 { font-size: clamp(2rem, 4vw, 2.9rem); max-width: 22ch; }
h3 { font-size: 1.45rem; font-weight: 600; }

.lede { font-size: 1.25rem; max-width: var(--measure); margin: 1.25rem 0 0; color: var(--ink-soft); }
.section-lede { max-width: var(--measure); margin: 1rem 0 0; color: var(--ink-soft); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* The drawing: the one bold element on the page. */
.drawing { margin: 0; background: var(--paper); border: 1px solid var(--ink); padding: 1rem 1rem 0.75rem; }
.drawing svg { display: block; width: 100%; height: auto; }
.drawing .tall { display: none; }
.drawing figcaption { font-size: 0.9rem; color: var(--ink-soft); margin-top: 0.5rem; }

.boundary { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 10 6; }
.boundary-label { font: 600 17px var(--display); fill: var(--ink); }
.part { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.part.cloud { stroke-dasharray: 2 3; }
.part-name { font: 600 17px var(--text); fill: var(--ink); }
.part-fig { font: 400 15px "IBM Plex Mono", ui-monospace, monospace; fill: var(--ink); }
.part-note { font: 400 14px var(--text); fill: var(--ink-soft); }
.wire { fill: none; stroke: var(--blue); stroke-width: 1.25; }
.wire.back { stroke-dasharray: 4 3; }
.crossing { fill: none; stroke: var(--red); stroke-width: 2.5; }
.tick { stroke: var(--red); stroke-width: 1.5; }
.crossing-size { font: 700 30px var(--display); fill: var(--red); }
.crossing-note { font: 500 14px var(--text); fill: var(--red); }

/* One orchestrated moment: the boundary crossing draws itself once. */
@media (prefers-reduced-motion: no-preference) {
  .crossing { stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 1.1s 0.4s ease-out forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* Forms */
.signup { margin-top: 2rem; max-width: 32rem; }
.signup label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
input[type="email"], input:not([type]) {
  flex: 1 1 14rem;
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}
button {
  font: 600 1.05rem var(--text);
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
button:hover { background: var(--blue); border-color: var(--blue); }
button[disabled] { opacity: 0.6; cursor: wait; }
.form-note { font-size: 0.92rem; color: var(--ink-soft); margin: 0.6rem 0 0; }
.form-note.ok { color: var(--ink); font-weight: 600; }
.form-note.error { color: var(--red); font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

/* Steps: a real sequence, so it is numbered. */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.steps li { counter-increment: step; padding: 1.25rem 1.25rem 0 0; }
.steps li + li { padding-left: 1.25rem; border-left: 1px solid var(--grid); }
.steps li::before { content: counter(step); display: block; font: 700 2.4rem/1 var(--display); color: var(--blue); margin-bottom: 0.6rem; }
.steps p { margin: 0.5rem 0 0; color: var(--ink-soft); }

/* Tables */
table { width: 100%; max-width: 52rem; border-collapse: collapse; margin-top: 1.75rem; background: var(--paper); }
th, td { text-align: left; padding: 0.75rem 1rem 0.75rem 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { font-weight: 600; border-bottom: 1px solid var(--ink); }
td:last-child { font-weight: 600; white-space: nowrap; }
.aside { max-width: var(--measure); color: var(--ink-soft); margin: 1rem 0 0; }
h3.sub { margin-top: 3rem; }

/* Automotive */
.pilot { max-width: var(--measure); margin: 1.5rem 0 0; padding-left: 1.2rem; }
.pilot li { margin: 0.5rem 0; }
.pilot li::marker { color: var(--blue); }

/* FAQ */
.faq details { max-width: var(--measure); border-bottom: 1px solid var(--grid); padding: 1rem 0; }
.faq h2 { margin-bottom: 1rem; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 0.6rem 0 0; color: var(--ink-soft); }

/* Footer: a drawing title block. */
.titleblock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 3fr) minmax(0, 1fr);
  margin: 3rem var(--gutter);
  border: 1px solid var(--ink);
  background: var(--paper);
}
.titleblock > div { padding: 0.6rem 0.8rem; border-left: 1px solid var(--ink); display: flex; flex-direction: column; gap: 0.2rem; }
.titleblock > div:first-child { border-left: 0; }
.tb-label { font-size: 0.8rem; color: var(--ink-soft); }
.tb-value { font-weight: 500; }

/* Sheet zones on wide screens: heading on the left, content on the right. */
@media (min-width: 1100px) {
  .numbers, .automotive, .faq {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(0, 2fr);
    column-gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
  }
  .section-body > table:first-child, .section-body > .pilot:first-child, .section-body > details:first-child { margin-top: 0; }
  .section-body > details:first-child { padding-top: 0; }
  .faq h2 { margin-bottom: 0; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .steps li, .steps li + li { padding: 1.25rem 0; border-left: 0; border-top: 1px solid var(--grid); }
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock > div { border-left: 0; border-top: 1px solid var(--ink); }
  .titleblock > div:nth-child(-n + 2) { border-top: 0; }
  .titleblock .tb-wide { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .drawing .wide { display: none; }
  .drawing .tall { display: block; }
  .field-grid { grid-template-columns: 1fr; }
  td:last-child { white-space: normal; }
}
