/* The alpha page, in the beta site's "Warm Shop Drawing" palette
   (crates/cabinet-site/site/css/styles/warm.css): manila graph paper and sepia ink above,
   the shop on a dark drawing board in a band along the bottom (see the end of this file). */

:root {
  --paper: #efe2c6;
  --paper-2: #e6d4b0;
  --paper-3: #dcc69b;
  --card: #f8efdc;
  --ink: #2e2219;
  --ink-2: #5a4636;
  --muted: #8a7660;
  --rule: #d2bc93;
  --accent: #b5452a;
  --accent-ink: #fff6ea;
  --marker: #f1c15a;
  --board: #241a13;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  /* The card fills the window, with a thin border of graph paper around it. */
  min-height: 100vh; min-height: 100dvh;
  display: flex; padding: 12px;
  color: var(--ink);
  font: 16.5px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  /* Graph paper: a fine grid with a heavier line every fifth square. */
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--paper-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-3) 1px, transparent 1px),
    linear-gradient(var(--paper-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-2) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

.card {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: 6px 6px 0 var(--paper-3);
  padding: 16px 18px 12px;
}

.brand-row { display: flex; align-items: center; gap: 10px; margin: 0 4px 14px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 1.12rem var(--serif); }

/* ---- The scene and the words, as one block centred in the card ---- */
/* Scene and words start right under the name. The scene grows into any spare height
   until it reaches its own shape; past that, spare height collects above the footer. */
.hero { flex: 1 1 auto; display: flex; flex-direction: column; }

/* ---- The scene ---- */
.stage {
  /* The scene takes whatever height the words leave, never taller than its own shape
     (812 x 300) at the card's width, and never squeezed below a readable size. */
  flex: 1 1 0; min-height: 150px; max-height: calc((100vw - 64px) * 300 / 812);
  position: relative; margin: 0;
  border-radius: 4px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 40%, #35281d 0%, var(--board) 60%, #1a120d 100%);
  box-shadow: inset 0 0 0 1px #00000040;
}
/* A faint grid on the board, the night version of the paper. */
.stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(#ead19614 1px, transparent 1px),
    linear-gradient(90deg, #ead19614 1px, transparent 1px);
  background-size: 24px 24px;
}
.stage svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; } /* the floor runs on past the drawing */
.blade { transform-box: fill-box; transform-origin: center; }
#typing { transform-box: fill-box; transform-origin: 0 0; } /* the elbow */
#rings ellipse, #panel, #kerf-mover, #plan { transform-box: fill-box; transform-origin: center; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; }

.pause {
  /* Pauses or plays the scene (WCAG 2.2.2); alpha.js shows it only while the scene moves. */
  position: absolute; left: 10px; top: 10px;
  font: 500 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: #ead196; background: #00000055; border: 1px solid #ead19666; border-radius: 3px;
  padding: 6px 8px; cursor: pointer; opacity: .7;
}
.pause:hover, .pause:focus-visible { opacity: 1; }
.pause:focus-visible { outline: 2px solid var(--marker); outline-offset: 2px; }

/* ---- The words: always whole, right under the scene ---- */
.copy { flex: none; width: 100%; max-width: 660px; margin: 18px auto 0; padding: 0 8px; text-align: center; }
h1 {
  margin: 0 0 .3em;
  font: 600 clamp(1.9rem, min(5vw, 7vh), 3.4rem)/1.08 var(--serif);
  letter-spacing: -0.015em; font-variation-settings: "SOFT" 60;
}
h1 em { font-style: italic; font-weight: 500; }
p { margin: 0 0 .7em; }
.lede { font-size: 1.15rem; color: var(--ink-2); margin-bottom: .35em; }
.what { font-size: .95rem; color: var(--ink); max-width: 34em; margin: 0 auto .9em; }
.copy a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }

/* Any height left over is shared above and below the block, never between the words. */
.foot { margin-top: auto; padding-top: 14px; text-align: center; font: 500 .72rem var(--mono); letter-spacing: .06em; color: var(--muted); }

@media (max-width: 560px) {
  body { padding: 8px; }
  .card { padding: 10px 10px 10px; }
  .stage { max-height: calc((100vw - 36px) * 300 / 812); min-height: 0; }
  .pause { left: 6px; top: 6px; padding: 4px 6px; font-size: .6rem; }
  .copy { margin-top: 20px; padding: 0 4px; }
  }

/* Short windows (a phone on its side, a small laptop): tighter words, a smaller scene floor. */
@media (max-height: 560px) {
  .card { padding-top: 10px; }
  .brand-row { margin-bottom: 8px; }
  .stage { min-height: 80px; }
  .copy { margin-top: 8px; }
  .foot { display: none; }
  .what { display: none; }
  h1 { font-size: 1.6rem; }
  .lede { font-size: 1rem; }
  }

/* ==== The layout Thomas chose ("band below") ====
   No card: plain graph paper with the name and the words at the top, and the shop as an
   edge-to-edge dark band along the bottom of the window, its floor on the bottom edge.
   These rules come last, so they override the card layout above. */
body { padding: 0; }
.card { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; position: relative; }
.brand-row { margin: 18px 22px 0; }
.hero { flex: 1 1 auto; display: flex; flex-direction: column; }
.copy { order: -1; margin: clamp(16px, 5vh, 56px) auto clamp(16px, 4vh, 40px); padding: 0 20px; }
.stage { order: 1; border-radius: 0; box-shadow: none; flex: 1 1 0; min-height: 200px; max-height: none; } /* runs to the bottom edge */
.pause { left: auto; right: 14px; top: 14px; }
.foot { position: absolute; z-index: 2; top: 22px; right: 22px; padding: 0; }
/* Phones: the band is only as tall as the drawing, and the words centre in the paper above. */
@media (max-width: 560px) {
  .stage { flex: none; height: calc(100vw * 300 / 812 + 36px); min-height: 0; max-height: none; }
  .copy { margin: auto; padding: 24px 18px; }
  .foot { display: none; }
}
