/* TDI: the page is a drawing sheet. Black line work on white paper,
   dimension-blue for annotations, a title block to close the sheet. */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --dim: #1446d8;
  --muted: #4f555d;
  --hair: #d5d9de;
  --desk: #e7eaed;
  --sheet: 76rem;
  font-family: "Barlow", system-ui, sans-serif;
  color: var(--ink);
  background: var(--desk);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-size: 1.0625rem; line-height: 1.6; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--dim); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--dim); outline-offset: 3px; }
h1, h2, h3 { font-family: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.nowrap { white-space: nowrap; }

/* Sheet, border and trim marks */
.desk { padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1rem, 3vw, 2.5rem); }
.sheet {
  position: relative;
  max-width: var(--sheet);
  margin: 0 auto;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  padding: clamp(1.25rem, 3.5vw, 3.25rem);
}
.trim { position: absolute; width: 1.4rem; height: 1.4rem; border: 0 solid var(--ink); }
.trim.tl { top: -1.1rem; left: -1.1rem; border-top-width: 1.5px; border-left-width: 1.5px; }
.trim.tr { top: -1.1rem; right: -1.1rem; border-top-width: 1.5px; border-right-width: 1.5px; }
.trim.bl { bottom: -1.1rem; left: -1.1rem; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.trim.br { bottom: -1.1rem; right: -1.1rem; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* Header */
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-family: "Barlow Semi Condensed", "Barlow", sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
}
.brand img { width: 2.5rem; }
/* A drawing that isn't released yet carries a status stamp. */
.state {
  margin: 0;
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--dim);
  outline: 1.5px solid var(--dim);
  outline-offset: 2px;
  color: var(--dim);
  font-family: "Barlow Semi Condensed", "Barlow", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas: "title lead" "title notify";
  align-items: end;
  gap: 1rem clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(3rem, 8vw, 6.5rem);
}
.hero h1 {
  grid-area: title;
  margin: 0;
  font-size: clamp(2.75rem, 7.4vw, 6.1rem);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.012em;
}
.lead {
  grid-area: lead;
  margin: 0;
  font-size: clamp(1.15rem, 1.9vw, 1.35rem);
  line-height: 1.45;
  max-width: 34ch;
}
.notify { grid-area: notify; margin: 0; color: var(--muted); }

.hero-figure { margin: clamp(2.5rem, 6vw, 4.5rem) 0 0; }
.hero-figure img { width: 100%; }

/* A dimension line: extension lines at both ends, arrows, text in the gap. */
.dimension {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.75rem;
  padding: 0.55rem 0;
  border-inline: 1px solid var(--dim);
  color: var(--dim);
  font-size: 0.9375rem;
  line-height: 1.3;
  text-align: center;
}
.dimension::before,
.dimension::after {
  content: "";
  flex: 1;
  height: 9px;
  min-width: 1.5rem;
  background-repeat: no-repeat;
}
.dimension::before {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M0 4.5L14 0V9Z' fill='%231446d8'/%3E%3C/svg%3E"),
    linear-gradient(#1446d8, #1446d8);
  background-size: 14px 9px, 100% 1px;
  background-position: left center, left center;
}
.dimension::after {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 9'%3E%3Cpath d='M14 4.5L0 0V9Z' fill='%231446d8'/%3E%3C/svg%3E"),
    linear-gradient(#1446d8, #1446d8);
  background-size: 14px 9px, 100% 1px;
  background-position: right center, right center;
}

/* Features */
.features { margin-top: clamp(3.5rem, 8vw, 6rem); }
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas: "figure copy";
  align-items: center;
  gap: 2rem clamp(2rem, 5vw, 4.5rem);
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--hair);
}
.feature.is-flipped {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  grid-template-areas: "copy figure";
}
.feature figure { grid-area: figure; margin: 0; }
.feature .copy { grid-area: copy; }
.feature img { width: 100%; max-height: 27rem; object-fit: contain; }
.copy h3 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
}
.copy p { margin: 0 0 0.9rem; max-width: 46ch; }
.copy p:last-child { margin-bottom: 0; }

/* The Gears sample, playable */
.machine svg { width: 100%; }
.machine circle,
.machine path {
  fill: none;
  stroke: var(--ink);
  vector-effect: non-scaling-stroke;
}
.machine circle { stroke-width: 1.6px; }
.machine path { stroke-width: 1px; }
.machine path.mark { stroke-width: 2.6px; }
.wheel {
  transform-box: fill-box;
  transform-origin: center;
  animation: turn linear infinite paused;
}
/* 30, 15 and 20 turns a minute; meshing wheels turn opposite ways. */
.w1 { animation-duration: 2s; }
.w2 { animation-duration: 4s; animation-direction: reverse; }
.w3 { animation-duration: 3s; }
.machine.is-playing .wheel { animation-play-state: running; }
.machine.is-reset .wheel { animation: none; }
@keyframes turn { to { transform: rotate(360deg); } }

.machine figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.controls { display: inline-flex; gap: 0.5rem; }
.controls button {
  min-width: 5.25rem;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: 600 1rem/1.2 "Barlow Semi Condensed", "Barlow", sans-serif;
  cursor: pointer;
}
.controls button:hover { background: var(--ink); color: var(--paper); }
.controls button[data-play] { background: var(--ink); color: var(--paper); }
.controls button[data-play]:hover { background: var(--dim); border-color: var(--dim); }

/* Shorter notes */
.more {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem clamp(2rem, 4vw, 3.5rem);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--hair);
}
.more h3 { margin: 0 0 0.5rem; font-size: 1.4rem; font-weight: 600; line-height: 1.15; }
.more p { margin: 0; }

/* Title block, bottom right of the sheet */
.title-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: clamp(3.5rem, 8vw, 6rem);
}
.title-block dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 36rem);
  margin: 0;
  border: 2.5px solid var(--ink);
}
.title-block dl > div {
  padding: 0.4rem 0.75rem 0.55rem;
  border-bottom: 1px solid var(--ink);
  min-width: 0;
}
.title-block .tb-left { border-right: 1px solid var(--ink); }
.title-block .tb-title,
.title-block .tb-wide { grid-column: 1 / -1; }
.title-block dl > div:nth-last-child(-n + 2) { border-bottom: 0; }
.title-block dt { font-size: 0.8125rem; color: var(--muted); line-height: 1.3; }
.title-block dd { margin: 0; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.title-block .tb-title dd {
  font-family: "Barlow Semi Condensed", "Barlow", sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.15;
}
.copyright { margin: 0.6rem 0 0; font-size: 0.875rem; color: var(--muted); }

@media (max-width: 56rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "lead" "notify";
    gap: 1.25rem;
  }
  .feature,
  .feature.is-flipped {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "figure" "copy";
  }
  .more { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 40rem) {
  .desk { padding: 0.5rem; }
  .sheet { border-width: 1.5px; }
  .trim { display: none; }
  .state { font-size: 0.875rem; padding: 0.2rem 0.55rem; }
  .title-block dl { grid-template-columns: minmax(0, 1fr); }
  .title-block .tb-left { border-right: 0; }
  .title-block dl > div:nth-last-child(2) { border-bottom: 1px solid var(--ink); }
}
