/* The Small Woodshop — plywood cut-layout world.
   Ground is birch ply; sections are painted parts separated by saw kerfs
   (3px ink gaps). No borders, cards or shadows: the kerf is the only divider. */

@font-face { font-family: "Familjen Grotesk"; src: url("fonts/familjen-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --ply: #ecd7ab;        /* birch ply face */
  --ply-deep: #dcbf86;   /* second ply tone, natural parts */
  --ink: #2a2116;        /* kerf, text */
  --ink-soft: #5b4628;   /* secondary text on ply */
  --green: #2f5d50;      /* milk-paint green */
  --oxide: #b24a33;      /* red oxide */
  --mustard: #e3a537;    /* mustard */
  --on-paint: #fbf3e3;   /* text on painted parts */
  --veneer: #f6e9cc;     /* input fields, highlighted row */
  --pencil: #7a6340;     /* placeholder text */
  --green-deep: #26503f; /* button hover */
  --rust: #8f3622;       /* error text on ply */
  --kerf: 3px;
  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Roboto, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem);
  --step-3: clamp(2.1rem, 1.3rem + 4vw, 3.9rem);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ply);
  color: var(--ink);
  font: var(--step-0)/1.6 var(--body);
}
::selection { background: var(--mustard); color: var(--ink); }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }

/* Wordmark strip */
.strip { padding-block: 2px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wordmark { font: 700 1.125rem/1 var(--display); letter-spacing: -0.01em; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.preview-flag { font: 700 0.75rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; background: var(--ink); color: var(--ply); padding: 6px 8px; }

/* The sheet: a 4×8 panel at 2:1, parts nested on an 8×4 grid, kerfs between. */
.sheet {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: var(--kerf);
  padding: var(--kerf);
  aspect-ratio: 2 / 1;
  width: 100%;
  background: var(--ink);
  position: relative;
}
/* Dimension lines: the sheet's real size, drawn the way a cut diagram marks it. */
.dims { display: grid; grid-template-columns: 18px minmax(0, 1fr); grid-template-rows: 18px auto; gap: 4px 6px; }
.dims .sheet { grid-column: 2; grid-row: 2; }
.dim { position: relative; color: var(--ink); }
.dim span { position: absolute; background: var(--ply); padding: 0 5px; font: 600 0.8125rem/1 var(--display); }
.dim-top { grid-column: 2; grid-row: 1; align-self: center; height: 10px; border-inline: 1.5px solid; }
.dim-top::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid; }
.dim-top span { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.dim-side { grid-column: 1; grid-row: 2; justify-self: center; width: 10px; border-block: 1.5px solid; }
.dim-side::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1.5px solid; }
.dim-side span { left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); }

/* The cuts: pencil-line covers over each kerf recede once, in saw order
   (the rip first, then the crosscuts), revealing the ink kerf beneath. */
.uncut { position: absolute; background: var(--ply-deep); animation: 520ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.u-rip { left: 3px; right: 3px; height: 3px; top: calc(6px + 2 * ((100% - 15px) / 4)); transform-origin: right center; animation-name: rip; animation-delay: 150ms; }
.u-cross { top: 3px; bottom: 3px; width: 3px; left: calc(15px + 5 * ((100% - 27px) / 8)); transform-origin: center bottom; animation-name: cross; animation-delay: 620ms; }
.u-cross2 { bottom: 3px; width: 3px; top: calc(9px + 2 * ((100% - 15px) / 4)); left: calc(9px + 3 * ((100% - 27px) / 8)); transform-origin: center bottom; animation-name: cross; animation-delay: 940ms; }
@keyframes rip { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes cross { from { transform: scaleY(1); } to { transform: scaleY(0); } }
.part {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(6px, 1.6vw, 16px);
  text-decoration: none;
  min-width: 0; overflow: hidden;
  transition: filter 160ms ease-out;
}
.part:hover { filter: brightness(1.06); }
.part .grain { position: absolute; top: clamp(8px, 1.6vw, 16px); right: clamp(8px, 1.6vw, 16px); width: clamp(22px, 3vw, 36px); height: auto; opacity: 0.75; }
.part .letter { font: 700 clamp(1.1rem, 0.6rem + 3.2vw, 2.6rem)/1 var(--display); }
.part .name { font: 600 clamp(0.8125rem, 0.55rem + 0.9vw, 1.05rem)/1.15 var(--display); text-wrap: balance; }
.pa { grid-column: 1 / 6; grid-row: 1 / 3; background: var(--green); color: var(--on-paint); }
.pb { grid-column: 6 / 9; grid-row: 1 / 3; background: var(--mustard); color: var(--ink); }
.pc { grid-column: 1 / 4; grid-row: 3 / 5; background: var(--oxide); color: var(--on-paint); }
.pd { grid-column: 4 / 6; grid-row: 3 / 5; background: var(--ink); color: var(--ply); }
.pe { grid-column: 6 / 9; grid-row: 3 / 5; background: var(--ply-deep); color: var(--ink); }
.sheet-cap { margin: 8px 0 0; font: 600 var(--step--1)/1.3 var(--display); color: var(--ink-soft); }

/* Hero: stacked on phones; sheet and offer side by side on wide screens so the
   form stays in the first viewport. */
.hero { display: grid; gap: 0; }
@media (min-width: 900px) {
  /* Headline runs across; the sheet sits beside the lede and form, so both
     columns end close together and the sign-up stays in the first screen. */
  .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 44px; row-gap: 22px; align-items: start; padding-top: 10px; }
  .hero .offer { display: contents; }
  .hero h1 { grid-column: 1 / -1; grid-row: 1; max-width: 22ch; font-size: clamp(2.6rem, 1.2rem + 2.6vw, 3.6rem); }
  .hero .sheet-wrap { grid-column: 1; grid-row: 2 / 4; }
  .hero .lede { grid-column: 2; grid-row: 2; margin-top: 22px; }
  .hero .signup { grid-column: 2; grid-row: 3; }
}

/* Offer */
.offer { padding-block: 20px 8px; display: grid; gap: 14px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); line-height: 1.02; max-width: 16ch; }
.lede { margin: 0; font-size: var(--step-1); line-height: 1.4; max-width: 40ch; }

/* Form: the field is a strip of ply, the button a painted part. */
.signup { display: grid; gap: 10px; max-width: 34rem; }
.signup label { font: 600 var(--step--1)/1.2 var(--display); }
.row { display: grid; gap: var(--kerf); grid-template-columns: 1fr; background: var(--ink); padding: var(--kerf); }
@media (min-width: 560px) { .row { grid-template-columns: 1fr auto; } }
.row input {
  font: var(--step-0)/1.2 var(--body); color: var(--ink);
  background: var(--veneer); border: 0; border-radius: 0; padding: 14px 14px; min-height: 52px; width: 100%;
}
.row input::placeholder { color: var(--pencil); }
.row button {
  font: 700 var(--step-0)/1 var(--display); letter-spacing: 0.01em;
  background: var(--green); color: var(--on-paint); border: 0; border-radius: 0;
  padding: 14px 22px; min-height: 52px; cursor: pointer;
}
.row button:hover { background: var(--green-deep); }
.fine { margin: 0; font-size: var(--step--1); color: var(--ink-soft); max-width: 52ch; }
.status { margin: 0; font: 600 var(--step--1)/1.4 var(--display); min-height: 1.4em; }
.status[data-tone="error"] { color: var(--rust); }

/* Sections below: a steady rhythm, kerf rules between them. */
section.block { padding-block: 40px 8px; display: grid; gap: 16px; max-width: 52rem; }
section.block + section.block { border-top: var(--kerf) solid var(--ink); margin-top: 32px; }
h2 { font-size: var(--step-2); line-height: 1.08; }
.prose { max-width: 66ch; display: grid; gap: 12px; }
.prose p { margin: 0; }

/* Sample: painted panel B */
.sample { background: var(--mustard); padding: clamp(22px, 4vw, 32px); display: grid; gap: 14px; max-width: 52rem; }
.sample h3 { font-size: var(--step-1); }
.sample ul { margin: 0; padding-left: 1.1em; display: grid; gap: 10px; max-width: 62ch; }

/* Cut list */
.cutlist { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.cutlist th { text-align: left; font: 700 var(--step--1)/1.2 var(--display); padding: 0 12px 8px 0; border-bottom: var(--kerf) solid var(--ink); }
.cutlist td { padding: 10px 12px 10px 0; vertical-align: top; }
.cutlist td.qty { font: 700 var(--step--1)/1.6 var(--display); white-space: nowrap; }
.qty-inline { display: none; font: 700 var(--step--1)/1.4 var(--display); color: var(--ink-soft); }
@media (max-width: 559px) {
  .cutlist .qty { display: none; }
  .qty-inline { display: block; }
}
.cutlist td:first-child { width: 3rem; }
.cutlist tr:target td { background: var(--veneer); }
.swatch { display: inline-grid; place-items: center; width: 2rem; height: 2rem; font: 700 1rem/1 var(--display); }
.sw-a { background: var(--green); color: var(--on-paint); }
.sw-b { background: var(--mustard); outline: 3px solid var(--ink); outline-offset: -3px; }
.sw-c { background: var(--oxide); color: var(--on-paint); }
.sw-d { background: var(--ink); color: var(--ply); }
.sw-e { background: var(--ply-deep); outline: 3px solid var(--ink); outline-offset: -3px; }

/* Footer */
footer { margin-top: 56px; border-top: var(--kerf) solid var(--ink); padding-block: 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
.foot { display: grid; gap: 12px; font-size: var(--step--1); color: var(--ink-soft); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: flex-start; font-weight: 700; color: var(--ink); }
.powered { display: flex; align-items: center; gap: 8px; margin: 0; }
.powered img { width: 20px; height: 20px; }
.powered b { color: var(--ink); font-weight: 700; }

/* Plain document pages (privacy, disclosure) */
.doc { padding-block: 12px 0; display: grid; gap: 14px; max-width: 66ch; }
.doc h1 { font-size: var(--step-2); max-width: none; }
.doc h2 { font-size: var(--step-1); margin-top: 12px; }
.doc p, .doc ul { margin: 0; }
.doc ul { padding-left: 1.1em; display: grid; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  .uncut { display: none; }
  .part { transition: none; }
}

/* The guide page: a long read in the same world. Part headings carry their
   paint swatch so the sheet's lettering follows the reader. */
.guide { gap: 12px; padding-bottom: 8px; }
.guide h2 { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: var(--kerf) solid var(--ink); }
.guide h2 .swatch { flex: none; }
.guide h3 { font-size: var(--step-1); margin-top: 10px; }
.guide ol, .guide ul { padding-left: 1.3em; display: grid; gap: 8px; }
.guide li { padding-left: 2px; }
.guide li ol { margin-top: 8px; display: grid; gap: 6px; }

/* EmailOctopus's embedded form sits inside the offer; reserve its height so
   the page doesn't jump while it loads. */
.eo-form { min-height: 64px; }
/* Shown in place of the form while emails wait on the mailing address (engine.json "signupPaused"). */
.signup-soon { margin: 0; padding: 14px 16px; background: var(--veneer); border: var(--kerf) solid var(--ink); font: 600 var(--step-0)/1.4 var(--display); max-width: 34rem; }
/* The embed switches its own focus outline off; keyboard users still need to see where they are. */
.eo-form input:focus-visible { outline: 3px solid var(--ink) !important; outline-offset: 3px; }
.cta-link { display: inline-flex; align-items: center; min-height: 52px; padding: 0 22px; background: var(--green); color: var(--on-paint); font: 700 var(--step-0)/1 var(--display); text-decoration: none; }
.cta-link:hover { background: var(--green-deep); }
