/* Terra Tinker shop pages (the map maker and the plaque maker).
   Inks of a topographic map sheet: black type, contour brown for elevation and the
   sheet's collar, hydro blue for water, a woodland tint for fills. One typeface,
   Archivo, used at two widths: wide for the name, condensed for figures.
   Each page adds its own sheet on the table: static/styles.css (the map and its
   collar), plaque_page/plaque.css (the plaque on its board). */

@font-face {
  font-family: "Archivo";
  src: url("vendor/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("vendor/fonts/archivo-latin-wdth-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --table: #e7eae3;      /* the drafting table under the sheet */
  --sheet: #ffffff;
  --ink: #1c211e;
  --ink-2: #4f5852;
  --rule: #d2d8cf;
  --contour: #9a5528;    /* contour brown */
  --hydro: #1a6fa8;      /* water blue */
  --woodland: #dbe9cf;   /* woodland tint */
  --alert: #b3261e;
  --wide: 125%;
  --narrow: 72%;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--table);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--hydro); outline-offset: 2px; }
a { color: var(--hydro); }
h1, h2 { margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.hint { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.error { margin: 10px 0 0; color: var(--alert); font-size: 14px; }

/* Buttons */
.primary, .secondary, .chip, .search button {
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.primary {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
}
.primary:hover { background: #000; }
.primary:disabled { background: #7b827d; cursor: progress; }
.primary.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 14px; }
.secondary {
  padding: 10px 16px;
  border: 1.5px solid var(--ink);
  background: var(--sheet);
}
.secondary:hover { background: var(--woodland); }
.secondary:disabled { color: var(--ink-2); border-color: var(--rule); cursor: progress; }
.button-link { display: inline-block; text-decoration: none; color: var(--ink); }
.chip {
  white-space: nowrap;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  background: var(--sheet);
  font-size: 13px;
}
.nav-link {
  border: 0;
  background: none;
  padding: 6px 2px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.nav-link:hover { color: var(--hydro); }
.back {
  border: 0;
  background: none;
  padding: 0;
  color: var(--hydro);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  align-self: flex-start;
}

/* Masthead: the wide name, the narrow product */
.masthead {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 24px;
  background: var(--sheet);
  border-bottom: 1.5px solid var(--ink);
}
.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 750;
  font-stretch: var(--wide);
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.product-name {
  padding-left: 14px;
  border-left: 1px solid var(--rule);
  font-stretch: var(--narrow);
  font-size: 17px;
  font-weight: 560;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
.product-name:hover { color: var(--ink); }
.nav { margin-left: auto; display: flex; gap: 20px; }

/* Make a map: steps | sheet on the table | preview and price */
.design {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 390px;
  height: calc(100vh - 56px);
}
.steps {
  overflow-y: auto;
  padding: 6px 24px 28px;
  background: var(--sheet);
  border-right: 1px solid var(--rule);
}
.step { padding: 18px 0 20px; border-bottom: 1px solid var(--rule); }
.step:last-of-type { border-bottom: 0; }
.step h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 650;
}
.step-no {
  font-stretch: var(--narrow);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: var(--contour);
  font-variant-numeric: tabular-nums;
}
.search { display: flex; gap: 6px; }
.search input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--sheet);
}
.search button { padding: 0 14px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; }

.segmented { display: flex; border: 1.5px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--sheet); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: block;
  padding: 7px 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 560;
  border-left: 1px solid var(--rule);
}
.segmented span small {
  display: block;
  font-size: 12px;
  font-weight: 450;
  font-stretch: var(--narrow);
  color: var(--ink-2);
}
.segmented label:first-child span { border-left: 0; }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:checked + span small { color: #d9ded9; }
.segmented input:focus-visible + span { outline: 2px solid var(--hydro); outline-offset: -3px; }
.segmented.compact span { padding: 5px 2px; font-stretch: var(--narrow); font-size: 15px; }

.slider { display: grid; grid-template-columns: 1fr auto; align-items: baseline; margin-top: 16px; }
.slider label { font-size: 14px; color: var(--ink-2); }
.slider output {
  font-stretch: var(--narrow);
  font-weight: 650;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.slider input { grid-column: 1 / -1; width: 100%; margin: 8px 0 0; accent-color: var(--ink); }
.slider .hint { grid-column: 1 / -1; }

.field-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 16px; }
.field-label { flex: 1 0 100%; font-size: 14px; color: var(--ink-2); }
.field-row .segmented { flex: 1; }
.pieces { font-size: 14px; }
select {
  padding: 6px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--sheet);
}
.check { display: flex; gap: 9px; align-items: center; margin-top: 9px; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.check.disabled { color: var(--ink-2); }
.coverage-note { margin-top: 18px; }


/* The middle column: what is being made, on the drafting table */
.table { position: relative; min-height: 360px; overflow: hidden; isolation: isolate; }

/* Preview and price */
.product {
  display: grid;
  grid-template-rows: minmax(250px, 44%) minmax(0, 1fr);
  min-height: 0;
  background: var(--sheet);
  border-left: 1px solid var(--rule);
}
.product.checking-out { grid-template-rows: minmax(170px, 26%) minmax(0, 1fr); }
.viewer { position: relative; min-height: 0; overflow: hidden; background: #f2f4ef; border-bottom: 1px solid var(--rule); }
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  padding: 24px;
  text-align: center;
}
.viewer-empty-title { margin: 0; font-size: 17px; font-weight: 650; }
.viewer-empty .secondary { margin-top: 14px; }
.viewer-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.viewer-bar > * { pointer-events: auto; }
.viewer-bar p { margin: 0; padding: 2px 6px; border-radius: 3px; background: rgba(242, 244, 239, 0.85); font-size: 13px; color: var(--ink-2); }
.viewer-bar p.failed { color: var(--alert); }

.buybox, .checkout { overflow-y: auto; padding: 20px 24px 28px; }
.map-title, .checkout h2, .item-name {
  font-size: 20px;
  font-weight: 750;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.specs { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 16px 0 0; }
.price {
  font-stretch: var(--narrow);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.price-note { font-size: 13px; color: var(--ink-2); }
.price-lines { margin: 10px 0 16px; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.price-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.price-lines li span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }
.includes { margin: 16px 0 0; padding: 0; list-style: none; font-size: 14px; }
.includes li { position: relative; padding: 3px 0 3px 22px; }
.includes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 10px;
  height: 5px;
  border: solid var(--contour);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.build-details { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 13px; }
.build-details summary { cursor: pointer; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 10px 0 0; }
.stats dt { color: var(--ink-2); }
.stats dd { margin: 0; }
.notes { margin: 8px 0 0; padding-left: 18px; color: var(--contour); }

/* Checkout */
.checkout { display: flex; flex-direction: column; }
.checkout h2 { margin: 12px 0 14px; }
.checkout-item { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.checkout-item img { width: 96px; height: 72px; object-fit: cover; border: 1px solid var(--rule); border-radius: 3px; background: #f2f4ef; }
.item-name { margin: 0; font-size: 16px; }
.checkout > label { margin-top: 14px; font-size: 14px; font-weight: 560; }
.checkout input {
  margin-top: 5px;
  padding: 9px 11px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--sheet);
}
.checkout select { margin-top: 5px; padding: 9px 11px; }
.checkout input[aria-invalid="true"] { border-color: var(--alert); }
.checkout .price-lines { margin: 16px 0 0; }
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 0 4px;
  padding-top: 8px;
  border-top: 1.5px solid var(--ink);
  font-weight: 650;
}
.total span:last-child { font-stretch: var(--narrow); font-size: 24px; font-variant-numeric: tabular-nums; }
.payment { margin: 16px 0 12px; padding: 10px 12px 12px; border: 1px dashed var(--ink-2); border-radius: 4px; }
.payment legend { padding: 0 4px; font-size: 14px; font-weight: 560; }
.payment p { margin: 0; font-size: 13px; color: var(--ink-2); }
.fine { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-2); }

/* Order page */
.order-view, .maps-view { min-height: calc(100vh - 56px); }
.order-view { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); }
.order-main { padding: 28px 36px 48px; background: var(--sheet); border-right: 1px solid var(--rule); }
.order-id {
  margin: 18px 0 2px;
  font-stretch: var(--narrow);
  font-weight: 650;
  font-size: 15px;
  color: var(--contour);
  font-variant-numeric: tabular-nums;
}
.order-main h1 {
  font-size: 30px;
  font-weight: 750;
  font-stretch: 112%;
  letter-spacing: -0.015em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: step; }
.progress li {
  padding-top: 10px;
  border-top: 4px solid var(--rule);
  font-size: 13px;
  color: var(--ink-2);
  counter-increment: step;
}
.progress li::before {
  content: counter(step);
  margin-right: 6px;
  font-stretch: var(--narrow);
  font-weight: 700;
  color: var(--contour);
}
.progress li.done { border-top-color: var(--ink); color: var(--ink); }
.progress li.current { border-top-color: var(--contour); color: var(--ink); font-weight: 560; }
.order-status { margin: 12px 0 0; font-size: 15px; }
.files { display: grid; gap: 10px; margin-top: 18px; }
.files a.primary { text-align: center; text-decoration: none; }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; }
.file-list a {
  padding: 6px 10px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}
.file-list a:hover { background: var(--woodland); }
.order-section { margin-top: 30px; }
.order-section h2 { margin-bottom: 8px; font-size: 16px; font-weight: 650; }
.plain { margin: 0; padding-left: 18px; font-size: 14px; }
.plain li { margin: 3px 0; }
.order-model { position: relative; min-height: 420px; }
.order-model .viewer { position: absolute; inset: 0; border: 0; }
.order-model-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--ink-2); }

/* Your maps */
.maps { max-width: 760px; margin: 0 auto; padding: 36px 24px 60px; }
.maps h1 { font-size: 30px; font-weight: 750; font-stretch: 112%; letter-spacing: -0.015em; }
.maps-list { margin: 20px 0 24px; padding: 0; list-style: none; background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; }
.maps-list li + li { border-top: 1px solid var(--rule); }
.maps-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
}
.maps-list a:hover { background: #f4f6f1; }
.maps-list .name { font-weight: 650; }
.maps-list .meta { font-size: 13px; color: var(--ink-2); }
.maps-list .state { font-size: 13px; text-align: right; }
.maps-list .amount { font-stretch: var(--narrow); font-weight: 650; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
.maps-list .empty { padding: 18px 16px; color: var(--ink-2); }

/* Dialogs */
dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 20px 22px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--sheet);
  color: var(--ink);
}
dialog::backdrop { background: rgba(28, 33, 30, 0.4); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head h2 { font-size: 19px; font-weight: 750; font-stretch: 112%; }
.how-steps { margin: 8px 0 12px; padding-left: 22px; }
.how-steps li { margin: 8px 0; }
.how-steps li::marker { font-stretch: var(--narrow); font-weight: 700; color: var(--contour); }
.feedback fieldset { margin: 14px 0 12px; padding: 0; border: 0; }
.feedback legend { margin-bottom: 8px; padding: 0; font-weight: 560; }
.feedback > label { display: block; margin-bottom: 4px; font-size: 14px; color: var(--ink-2); }
.rating { display: flex; gap: 6px; }
.rating label { position: relative; }
.rating input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rating span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 34px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  font-stretch: var(--narrow);
  font-weight: 650;
  font-size: 17px;
}
.rating input:checked + span { background: var(--ink); color: #fff; }
.rating input:focus-visible + span { outline: 2px solid var(--hydro); outline-offset: 2px; }
.feedback textarea { width: 100%; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 4px; resize: vertical; }
.feedback-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* Narrower screens */
@media (max-width: 1180px) {
  .design { grid-template-columns: 310px minmax(0, 1fr); grid-template-rows: minmax(480px, 64vh) auto; height: auto; }
  .steps { grid-row: 1 / span 2; }
  .product { grid-column: 2; grid-template-rows: 340px auto; border-left: 0; border-top: 1px solid var(--rule); }
}
@media (max-width: 760px) {
  .masthead { gap: 10px; padding: 0 16px; }
  .product-name, #how-open { display: none; }
  .wordmark { font-size: 18px; }
  .nav { gap: 14px; }
  .nav-link { white-space: nowrap; }
  .design { grid-template-columns: 1fr; grid-template-rows: none; }
  .table { order: -1; height: 66vh; }
  .steps { grid-row: auto; padding: 0 16px 16px; border-right: 0; }
  .product { grid-column: 1; }
  .buybox, .checkout { padding: 18px 16px 24px; }
  .order-view { grid-template-columns: 1fr; }
  .order-main { padding: 20px 16px 36px; border-right: 0; }
  .order-model { order: -1; min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
