/* Mech Sketch landing page. The page is the app's drafting board: the same
   grey-green ground, white sheets of paper on it, and the colours the sketcher
   uses for what is still free (blue), what holds it (green) and loads (red). */

@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: "LM Italic"; font-display: swap; src: url("fonts/lm-italic.woff2") format("woff2"); }
@font-face { font-family: "LM Roman"; font-display: swap; src: url("fonts/lm-roman.woff2") format("woff2"); }
@font-face { font-family: "LM Mono"; font-display: swap; src: url("fonts/lm-mono.woff2") format("woff2"); }

:root {
  --board: #e7ebe5;
  --board-lo: #d9dfd6;
  --rule: #c2cabf;
  --paper: #ffffff;
  --ink: #17201b;
  --muted: #4c5850;
  --free: #1b5ad1;
  --mark: #0c7a5e;
  --mark-bg: #d9efe6;
  --load: #d32f2f;
  --math: "LM Italic", "Latin Modern Roman", "Times New Roman", serif;
  --mono: "LM Mono", "Latin Modern Mono", ui-monospace, monospace;
  --measure: 34rem;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font: 400 1.0625rem/1.55 "Barlow", system-ui, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--free); text-underline-offset: 0.18em; }
a:hover { color: #123f96; }
:focus-visible { outline: 2px solid var(--free); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0; }
.math { font-family: var(--math); font-size: 1.08em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 6px 12px; z-index: 5; }
.skip:focus { left: 8px; }

/* Buttons, as in the app: ink on the board. */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 6px; font-family: inherit; font-weight: 500; font-size: 1.0625rem; text-decoration: none; cursor: pointer;
}
.button:hover { background: #2a3630; color: var(--paper); }
.button.small { min-height: 36px; padding: 0 14px; font-size: 0.97rem; }
.quiet { font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.fine { color: var(--muted); font-size: 0.95rem; }
.fine code, .tikz code { font-family: var(--mono); font-size: 0.95em; }

/* The bar along the top. */
.bar, .foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1240px; margin: 0 auto; padding: 14px var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.125rem; }
.brand:hover { color: var(--ink); }
.beta-badge { margin-left: 2px; padding: 1px 7px 2px; border-radius: 999px; background: #e2570a; color: #fff; font-size: 0.75rem; font-weight: 500; }
.beta-note { margin-top: 18px; padding: 10px 14px; border-left: 3px solid #e2570a; background: var(--board-lo); font-size: 0.95rem; }

main > section { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

/* The hero: the claim on the left, the truss that draws itself on the right. */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
  padding-top: clamp(28px, 6vw, 72px) !important; padding-bottom: clamp(48px, 8vw, 104px) !important;
}
.hero h1 { font-size: clamp(2.3rem, 1.5rem + 3.1vw, 4.1rem); letter-spacing: -0.02em; line-height: 1.04; max-width: 13ch; }
.hero .lead { margin-top: 22px; font-size: clamp(1.1rem, 1rem + 0.35vw, 1.25rem); max-width: var(--measure); color: #26312b; }
.hero .actions { margin-top: 30px; }
.hero .fine { margin-top: 16px; }
.hero-figure { margin: 0; }

.sheet { position: relative; background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(23, 32, 27, 0.45); }
.sheet::before {
  /* The sketcher's dotted grid, faint, on the paper. */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, #c9d0c6 0.9px, transparent 1.2px);
  background-size: 22px 22px; background-position: 11px 11px; pointer-events: none;
}
#truss { position: relative; display: block; width: 100%; height: auto; padding: 4% 3% 15%; overflow: visible; }
#truss .math { font-family: var(--math); font-size: 7.4px; text-anchor: middle; fill: var(--ink); }
.members line { stroke: var(--ink); stroke-width: 0.95; stroke-linecap: round; transition: stroke 0.5s ease; }
.members.free line { stroke: var(--free); }
.members circle { fill: var(--paper); stroke: var(--ink); stroke-width: 0.6; transition: stroke 0.5s ease; }
.members.free circle { stroke: var(--free); }
.members .origin { fill: none; stroke: #8a958d; stroke-width: 0.45; }
.ext, .dim { fill: none; stroke: var(--ink); stroke-width: 0.32; color: var(--ink); }
.sym { fill: var(--paper); stroke: var(--ink); stroke-width: 0.55; }
.hatch { fill: none; stroke: var(--ink); stroke-width: 0.35; }
.load { fill: none; stroke: var(--load); stroke-width: 0.75; color: var(--load); }
#truss .load-name { fill: var(--load); }
.glyph rect { fill: var(--mark-bg); }
.glyph path { fill: none; stroke: var(--mark); stroke-width: 0.55; stroke-linecap: round; }
.dims, .supports, .loads, .names, .glyph { transition: opacity 0.45s ease; }
#truss.drawing .dims, #truss.drawing .supports, #truss.drawing .loads, #truss.drawing .names { opacity: 0; }
#truss.drawing .glyph { opacity: 0; }
#truss.drawing.constrained .glyph { opacity: 1; }
#truss.drawing.dimensioned .dims { opacity: 1; }
#truss.drawing.dimensioned .glyph { opacity: 0; }
#truss.drawing.annotated .supports, #truss.drawing.annotated .loads, #truss.drawing.annotated .names { opacity: 1; }
#truss:not(.drawing) .glyph { opacity: 0; }

/* The degrees-of-freedom box, as it sits in the corner of the app. */
.titleblock {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; align-items: baseline; gap: 10px;
  padding: 5px 14px 6px; background: var(--paper); border: 1.5px solid var(--ink);
}
.tb-count { font-size: 1.85rem; font-weight: 600; line-height: 1; color: var(--free); min-width: 0.65em; font-variant-numeric: tabular-nums; }
.tb-state { font-size: 0.97rem; font-weight: 500; }
.titleblock.done .tb-count { color: var(--ink); }
.hero-figure figcaption { min-height: 34px; margin-top: 10px; text-align: right; }
.replay { font: 500 0.95rem "Barlow", sans-serif; color: var(--free); background: none; border: 0; padding: 6px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }
.replay:hover { color: #123f96; }

/* How it is made: said plainly, where everyone sees it. */
.notice {
  display: flex; width: fit-content; gap: 10px; align-items: center; margin-top: 24px;
  padding: 10px 16px 10px 14px; border: 1.5px solid #e2570a; border-radius: 8px; background: #fbe6d8;
}
.notice svg { flex: none; color: #c2470a; }
.notice p { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; color: #17201b; }

/* The demo: the whole workflow, recorded in the app. */
.demo { padding-bottom: clamp(56px, 8vw, 104px) !important; }
.demo > p { margin-top: 12px; max-width: 40rem; color: var(--muted); }
.demo-video { margin: 26px 0 0; }
.demo-video video {
  display: block; width: 100%; height: auto; aspect-ratio: 1280 / 760; background: var(--board-lo);
  border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 18px 40px -28px rgba(23, 32, 27, 0.45);
}

/* The workflow: four steps, in order. */
.steps { padding-bottom: clamp(56px, 8vw, 112px) !important; }
.steps h2 { max-width: 20ch; }
.step-list { list-style: none; counter-reset: step; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px clamp(24px, 3.5vw, 48px); }
.step-list li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 6px; align-content: start; }
.step-list img { grid-column: 1 / -1; margin-bottom: 12px; border: 1px solid var(--rule); background: var(--paper); aspect-ratio: 908 / 575; object-fit: cover; object-position: top; }
.step-list h3::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-right: 10px;
  border: 1.5px solid var(--ink); border-radius: 50%; font-size: 0.9em; vertical-align: 0.05em;
}
.step-list h3 { grid-column: 1 / -1; }
.step-list p { grid-column: 1 / -1; color: var(--muted); max-width: 30rem; padding-left: calc(1.7em * 1.125 / 1.0625 + 10px); }

/* TikZ: what is written, and what LaTeX makes of it. */
.tikz {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(28px, 5vw, 72px); align-items: center;
  padding-top: clamp(56px, 8vw, 104px) !important; padding-bottom: clamp(56px, 8vw, 104px) !important;
  border-top: 1px solid var(--rule);
}
.tikz-text > * + * { margin-top: 16px; }
.tikz-text p { max-width: var(--measure); }
.code {
  margin-top: 24px !important; padding: 16px 18px; overflow-x: auto;
  background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--ink);
  font: 0.86rem/1.55 var(--mono); color: var(--ink);
}
.page { margin: 0; }
.page img { width: 100%; background: var(--paper); border: 1px solid var(--rule); box-shadow: 0 18px 40px -28px rgba(23, 32, 27, 0.45); padding: 2% 3%; }
.page figcaption { margin-top: 10px; color: var(--muted); font-size: 0.95rem; }

/* What it draws: the app's own tool icons. */
.draws { padding-top: clamp(56px, 8vw, 104px) !important; padding-bottom: clamp(48px, 7vw, 88px) !important; border-top: 1px solid var(--rule); }
.draw-list { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 3.5vw, 48px); }
.draw-list li { display: flex; gap: 16px; padding: 22px 0 24px; border-top: 1px solid var(--rule); }
.draw-list .icon { flex: none; color: var(--ink); margin-top: 1px; }
.draw-list p { margin-top: 4px; color: var(--muted); }

/* Free, offline, files: three facts. */
.yours { padding-bottom: clamp(48px, 7vw, 88px) !important; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 3.5vw, 48px); background: var(--board-lo); padding: 28px clamp(20px, 3vw, 36px); }
.facts dt { font-weight: 600; font-size: 1.125rem; }
.facts dd { margin: 6px 0 0; color: #36423b; }

/* Questions. */
.faq { padding-bottom: clamp(48px, 7vw, 88px) !important; }
.faq h2 { margin-bottom: 18px; }
.faq details { max-width: 46rem; border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 500; font-size: 1.0625rem; list-style-position: outside; }
.faq summary::marker { color: var(--muted); }
.faq details p { padding: 0 0 18px; color: #36423b; max-width: var(--measure); }

/* Support. */
.support { padding-top: clamp(48px, 7vw, 88px) !important; padding-bottom: clamp(56px, 8vw, 104px) !important; border-top: 1px solid var(--rule); }
.support p { margin-top: 12px; max-width: var(--measure); }
.support .actions { margin-top: 24px; }

.foot { border-top: 1px solid var(--rule); padding-top: 22px; padding-bottom: 28px; flex-wrap: wrap; }
.disclaimer { flex: 1 1 100%; padding-right: max(0px, calc(100% - 46rem)); margin-bottom: 14px; color: var(--muted); font-size: 0.95rem; }
.foot .brand { font-size: 1rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.95rem; }

@media (max-width: 960px) {
  .hero, .tikz { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 15ch; }
  .page { max-width: 30rem; }
  .draw-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .step-list, .draw-list, .facts { grid-template-columns: 1fr; }
  .facts { gap: 18px; }
  .titleblock { right: 8px; bottom: 8px; padding: 3px 10px 4px; gap: 8px; }
  .tb-count { font-size: 1.4rem; }
  .tb-state { font-size: 0.85rem; }
  .bar .button.small { min-height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .members line, .members circle, .dims, .supports, .loads, .names, .glyph { transition: none; }
}
