/* Yardwise Quilts - cutting-mat page. System fonts only, no external resources. */
:root {
  --mat: #174d3a;        /* cutting-mat green: hero ground, white text 9.6:1 */
  --mat-deep: #0f3628;
  --paper: #f7f8f3;      /* page ground */
  --card: #ffffff;
  --ink: #14241c;        /* body text on paper 15:1 */
  --muted: #455a4e;      /* secondary text on paper 7:1 */
  --line: #c9d3c8;
  --ruler: #f2c12e;      /* ruler yellow: primary button, ink text on it 10:1 */
  --chalk: #a3261b;      /* errors on white 7:1 */
  --focus: #0b4fbf;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 var(--sans); }
a { color: #0b4a33; text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 9; }

/* Mat band: header + hero share a gridded green ground */
.mat {
  background-color: var(--mat);
  background-image:
    linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 22px 22px;
  color: #fff;
  border-bottom: 10px solid var(--ruler);
  position: relative;
}
/* ruler ticks on the yellow edge */
.mat::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background-image: repeating-linear-gradient(90deg, rgba(20,36,28,.8) 0 1px, transparent 1px 11px);
  background-size: 100% 5px; background-repeat: no-repeat; background-position: left bottom;
}
.top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; min-height: 48px; }
.brand { font-weight: 800; font-size: 19px; letter-spacing: .01em; color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 9px; min-height: 44px; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand small { display: none; font-weight: 500; opacity: .85; font-size: 13px; }
.top .tag { font-size: 13px; background: rgba(0,0,0,.28); padding: 4px 10px; border-radius: 99px; }

.hero { padding: 0 0 14px; }
.hero h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--ruler); }
.hero .sub { margin: 0; font-size: 16px; line-height: 1.4; max-width: 46ch; color: #eaf3ec; }
.hero .sub strong { color: #fff; background: rgba(242,193,46,.28); padding: 0 5px; border-radius: 3px; }

/* Tool area */
.tool { padding: 14px 0 8px; }
.tool-grid { display: grid; gap: 12px; grid-template-areas: "tabs" "out" "form"; }
.tabs { grid-area: tabs; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.tabs button {
  width: 100%; min-height: 44px; padding: 6px 2px; font: 700 14px/1.15 var(--sans); color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 8px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--mat); color: #fff; border-color: var(--mat); }
.tabs button:hover { border-color: var(--mat); }

/* Result: the cut sheet, with a yellow ruler edge */
.out {
  grid-area: out; background: var(--card); border: 2px solid var(--ink); border-radius: 10px; padding: 10px 14px 12px 34px; position: relative; overflow: hidden;
}
.out::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px; background: var(--ruler); border-right: 2px solid var(--ink);
}
.out::after {
  content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 10px;
  background-image: repeating-linear-gradient(180deg, var(--ink) 0 1px, transparent 1px 8px);
}
.out .kicker { margin: 0 0 4px; font: 700 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.out .kicker b { background: var(--ruler); color: var(--ink); padding: 2px 6px; border-radius: 3px; }
.answer { display: flex; gap: 12px; align-items: center; }
.answer svg { width: 72px; height: 72px; flex: none; }
.big { font-size: 36px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0; }
.big small { font-size: 17px; font-weight: 700; margin-left: 4px; }
.answer p { margin: 4px 0 0; font-size: 15px; line-height: 1.35; }
.how { font: 13px/1.4 var(--mono); color: var(--muted); margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); }
.list { margin: 6px 0 0; padding: 0; list-style: none; font-size: 15px; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.list li b { font-variant-numeric: tabular-nums; text-align: right; }
.share { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn2 { min-height: 44px; padding: 8px 14px; font: 700 15px var(--sans); border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 8px; cursor: pointer; }
.btn2:hover { background: #eef3ec; }

/* Form */
.form { grid-area: form; background: var(--card); border: 2px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; }
.form h2 { margin: 0 0 6px; font-size: 16px; position: absolute; left: -999px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.fields[disabled] { display: none; }
.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field label { font-weight: 700; font-size: 14px; }
.field label span { font-weight: 400; color: var(--muted); }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 6px 10px; font: 600 18px var(--sans); color: var(--ink);
  background: #fbfcfa; border: 2px solid #6b7d72; border-radius: 8px;
}
.field input::placeholder { color: #5f7267; font-weight: 500; }
.field.wide { grid-column: 1 / -1; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.hint button { all: unset; cursor: pointer; color: #0b4a33; text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; }
.hint button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.err { color: var(--chalk); font-weight: 700; font-size: 15px; margin: 8px 0 0; }
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; margin-top: 8px;
  font: 800 18px var(--sans); color: var(--ink); background: var(--ruler); border: 2px solid var(--ink); border-bottom-width: 5px; border-radius: 10px; cursor: pointer;
}
.btn:hover { background: #f7cf55; }
.btn:active { border-bottom-width: 2px; margin-top: 11px; }
.share .btn { width: auto; margin: 0; padding: 0 16px; font-size: 16px; border-bottom-width: 2px; min-height: 44px; }

/* Phones: until the visitor runs a calculation, the example shows only its answer, so the button stays on the first screen */
@media (max-width: 759px) {
  .out.is-example .list, .out.is-example .how, .out.is-example .share { display: none; }
}

/* Success */
.done { grid-column: 1 / -1; grid-area: auto; background: #eaf5ee; border: 2px solid var(--mat); border-radius: 10px; padding: 14px; }
.done h3 { margin: 0 0 6px; font-size: 19px; }
.done p { margin: 6px 0; }
.next { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.next a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 2px solid var(--mat); border-radius: 8px; background: #fff; font-weight: 700; text-decoration: none; color: var(--ink); }

/* Sections below the tool */
section.block { padding: 26px 0 6px; }
section.block h2 { font-size: 22px; line-height: 1.2; margin: 0 0 8px; }
.cols { display: grid; gap: 14px; }
.panel { background: var(--card); border: 2px solid var(--line); border-radius: 10px; padding: 14px; }
.panel h3 { margin: 0 0 6px; font-size: 17px; }
.panel p { margin: 6px 0; }
.url { font: 14px/1.45 var(--mono); background: #eef3ec; border: 1px dashed #6b7d72; border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }
.sheet { background: #fff; border: 1px solid var(--ink); padding: 10px 12px; font: 13px/1.4 var(--mono); box-shadow: 4px 4px 0 var(--line); }
.sheet b { display: block; font: 800 15px var(--sans); }
.quote { border-left: 5px solid var(--ruler); padding: 4px 12px; margin: 10px 0; background: #fffbea; }
.fine { font-size: 14px; color: var(--muted); }

footer { margin-top: 28px; background: var(--mat-deep); color: #e4efe7; padding: 18px 0 26px; font-size: 15px; }
footer a { color: #fff; }
footer p { margin: 6px 0; }
footer .made { font-weight: 800; }

@media (min-width: 760px) {
  body { font-size: 18px; }
  .top { padding: 10px 0; }
  .hero { padding: 18px 0 34px; }
  .hero h1 { font-size: 44px; max-width: 20ch; margin-bottom: 8px; }
  .form h2 { position: static; font-size: 18px; margin-bottom: 8px; }
  .hero .sub { font-size: 20px; }
  .brand small { display: inline; }
  .tool-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "tabs tabs" "form out"; align-items: start; gap: 18px; }
  .tabs { grid-template-columns: repeat(8, 1fr); }
  .tabs button { font-size: 15px; min-height: 48px; }
  .big { font-size: 56px; }
  .answer svg { width: 120px; height: 120px; }
  .out, .form { padding-top: 16px; }
  .out { padding-left: 42px; }
  .cols { grid-template-columns: 1fr 1fr; }
  .cols.three { grid-template-columns: 1fr 1fr 1fr; }
}

@media print {
  body { background: #fff; font-size: 12pt; }
  .mat, .tabs, .form, .share, .done, section.block, .skip { display: none !important; }
  .tool { padding: 0; }
  .tool-grid { display: block; }
  .out { border: 1px solid #000; }
  footer { background: #fff; color: #000; }
  footer a { color: #000; }
}
