:root {
  --ink: #141518;
  --ink-2: #4a4d55;
  --ink-3: #74777f;
  --line: #e2e3e6;
  --line-2: #cfd1d6;
  --soft: #f5f5f3;
  --paper: #ffffff;
  --ok: #1d6b3c;
  --ok-bg: #edf6f0;
  --bad: #9b2420;
  --bad-bg: #fbeeed;
  --radius: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
img, svg { display: block; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Header ---------- */

.notice {
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
}
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 12px; line-height: 20px; text-align: center; font-weight: 600;
}

/* ---------- Buttons and small controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 28px;
  border-radius: var(--radius); border: 1px solid var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2c2e33; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--soft); }
.text-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.text-link:hover { color: var(--ink); }

/* ---------- Product page ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  padding-top: 36px;
  padding-bottom: 72px;
  align-items: start;
}
.gallery { position: sticky; top: 24px; }
.stage {
  background: var(--soft);
  border-radius: var(--radius);
  aspect-ratio: 19 / 14;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.stage.is-dragging { cursor: grabbing; }
.stage svg { width: 100%; height: 100%; }
.render text { font-family: var(--font); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.thumb {
  background: var(--soft); border: 1px solid transparent; border-radius: var(--radius);
  padding: 6px 6px 8px; cursor: pointer;
}
.thumb svg { width: 100%; aspect-ratio: 19 / 14; height: auto; }
.thumb span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.thumb:hover { border-color: var(--line-2); }
.thumb[aria-pressed="true"] { border-color: var(--ink); }
.thumb[aria-pressed="true"] span { color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-3); margin-top: 12px; }

.buy h1 { font-size: 28px; font-weight: 650; letter-spacing: -0.015em; }
.price { font-size: 22px; margin-top: 8px; }
.blurb { color: var(--ink-2); margin-top: 14px; max-width: 46ch; }

.field { border: 0; margin: 0; padding: 22px 0 0; min-width: 0; }
.field + .field { margin-top: 2px; }
.field legend { font-weight: 600; font-size: 14px; padding: 0; float: left; width: 100%; margin-bottom: 10px; }
.field legend + * { clear: left; }
.picked { font-weight: 400; color: var(--ink-2); }
.help { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; clear: left; }
#buildForm { border-top: 1px solid var(--line); margin-top: 22px; }

.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 52px; padding: 6px 4px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font-size: 14px; text-align: center; cursor: pointer; background: #fff;
}
.choices label small { font-size: 12px; color: var(--ink-3); }
.choices.products { grid-template-columns: repeat(2, 1fr); }
.included { margin: 22px 0 0; font-size: 14px; color: var(--ink-2); }
.choices label:hover { border-color: var(--ink-3); }
.choices input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choices input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

.addons { display: grid; gap: 8px; }
.addon {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius);
  cursor: pointer; background: #fff;
}
.addon:hover { border-color: var(--ink-3); }
.addon:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.addon input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); }
.addon-text { display: grid; gap: 2px; }
.addon-text strong { font-size: 14px; font-weight: 600; }
.addon-text span { font-size: 13px; color: var(--ink-3); }
.addon-price { font-size: 14px; white-space: nowrap; }

.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span {
  display: block; width: 36px; height: 36px; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
  outline: 1px solid transparent; outline-offset: 3px;
}
.swatch:hover span { outline-color: var(--line-2); }
.swatch input:checked + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.swatch input:focus-visible + span { outline: 2px dashed var(--ink); outline-offset: 3px; }
.match { order: 99; margin-left: 6px; }

.purchase { display: flex; gap: 12px; margin-top: 28px; }
.purchase .btn { flex: 1; }
.qty { display: flex; border: 1px solid var(--line-2); border-radius: var(--radius); height: 48px; }
.qty button { width: 40px; border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.qty button:hover { color: var(--ink); background: var(--soft); }
.qty input {
  width: 44px; border: 0; text-align: center; background: none; -moz-appearance: textfield; appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.added {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--ok-bg); color: var(--ok); font-size: 14px;
}
.added a { font-weight: 600; }

.assurances { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.assurances li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.assurances svg { width: 22px; height: 22px; flex: none; color: var(--ink); }

.details { margin-top: 28px; border-top: 1px solid var(--line); }
.details details { border-bottom: 1px solid var(--line); }
.details summary {
  list-style: none; cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "+"; font-weight: 400; font-size: 20px; line-height: 1; color: var(--ink-2); }
.details details[open] summary::after { content: "−"; }
.details .body { padding-bottom: 16px; font-size: 14px; color: var(--ink-2); display: grid; gap: 10px; }
.details .body strong { color: var(--ink); }
.specs { margin: 0; padding-bottom: 16px; font-size: 14px; }
.specs div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 6px 0; }
.specs dt { color: var(--ink-3); }
.specs dd { margin: 0; }
.copy { margin-top: 18px; }

/* ---------- Cart ---------- */

.page-head { padding-top: 36px; }
.page-head h1 { font-size: 28px; font-weight: 650; letter-spacing: -0.015em; }
.page-head p { color: var(--ink-2); margin-top: 6px; }

.cart {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px;
  padding-top: 24px; padding-bottom: 72px; align-items: start;
}
.cart-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cart-line {
  display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 20px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.cart-line .pic { background: var(--soft); border-radius: var(--radius); display: block; }
.cart-line .pic svg { width: 100%; height: auto; aspect-ratio: 19 / 14; }
.cart-line h2 { font-size: 15px; font-weight: 600; }
.cart-line h2 a { text-decoration: none; }
.cart-line h2 a:hover { text-decoration: underline; }
.cart-line ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--ink-3); }
.cart-line .row { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.cart-line .qty { height: 38px; }
.cart-line .qty button { width: 34px; }
.cart-line .qty input { width: 36px; }
.line-price { text-align: right; font-size: 15px; white-space: nowrap; }
.line-price small { display: block; font-size: 12px; color: var(--ink-3); }
.keep-shopping { display: inline-block; margin-top: 20px; }

.summary {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  position: sticky; top: 24px;
}
.summary h2 { font-size: 17px; font-weight: 650; margin-bottom: 16px; }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; color: var(--ink-2); }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px; font-size: 16px; font-weight: 650; color: var(--ink); }
.ship-note { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.alert {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); font-size: 14px;
  background: var(--bad-bg); color: var(--bad);
}
.alert.info { background: var(--soft); color: var(--ink-2); }
.pay { margin-top: 20px; min-height: 120px; }
.pay-loading { font-size: 14px; color: var(--ink-3); text-align: center; padding: 40px 0; }
.secure { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink-3); margin-top: 14px; }
.secure svg { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
.agree { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

.empty { padding: 56px 0 96px; text-align: center; }
.empty p { color: var(--ink-2); margin: 8px 0 24px; }

/* ---------- Order complete ---------- */

.done { max-width: 720px; padding-top: 40px; padding-bottom: 80px; }
.done .check {
  width: 44px; height: 44px; border-radius: 50%; background: var(--ok-bg); color: var(--ok);
  display: grid; place-items: center; margin-bottom: 18px;
}
.done .check svg { width: 22px; height: 22px; }
.done h1 { font-size: 28px; font-weight: 650; letter-spacing: -0.015em; }
.done .lead { color: var(--ink-2); margin-top: 8px; }
.order-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; padding: 20px; background: var(--soft); border-radius: var(--radius); }
.order-meta dt { font-size: 12px; color: var(--ink-3); }
.order-meta dd { margin: 2px 0 0; font-size: 14px; word-break: break-word; }
.receipt { margin-top: 28px; border-top: 1px solid var(--line); }
.receipt-line { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.receipt-line ul { list-style: none; margin: 4px 0 0; padding: 0; color: var(--ink-3); font-size: 13px; }
.receipt-totals { padding-top: 10px; }
.done h2 { font-size: 16px; font-weight: 650; margin-top: 32px; }
.done ol { margin: 10px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; display: grid; gap: 6px; }
.done .actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- Text pages (help and policies) ---------- */

.doc { max-width: 760px; padding-top: 40px; padding-bottom: 80px; }
.doc h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.015em; }
.doc .updated { color: var(--ink-3); font-size: 13px; margin-top: 8px; }
.doc .intro { color: var(--ink-2); margin-top: 14px; font-size: 16px; }
.doc h2 { font-size: 18px; font-weight: 650; margin-top: 36px; }
.doc h3 { font-size: 15px; font-weight: 600; margin-top: 22px; }
.doc p, .doc ul { color: var(--ink-2); margin-top: 10px; }
.doc ul { padding-left: 20px; }
.doc li + li { margin-top: 4px; }
.doc strong { color: var(--ink); }
.doc .faq { margin-top: 20px; border-top: 1px solid var(--line); }
.doc .faq details { border-bottom: 1px solid var(--line); }
.doc .faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.doc .faq summary::-webkit-details-marker { display: none; }
.doc .faq summary::after { content: "+"; font-weight: 400; font-size: 20px; line-height: 1; color: var(--ink-2); }
.doc .faq details[open] summary::after { content: "−"; }
.doc .faq details > p { margin: 0 0 16px; }
.contact-box { margin-top: 20px; padding: 20px; background: var(--soft); border-radius: var(--radius); }
.contact-box p { margin: 0; }
.contact-box p + p { margin-top: 6px; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: var(--soft); font-size: 14px; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 36px; }
.footer-grid p + p { margin-top: 6px; }
.footer-name { font-weight: 650; color: var(--ink); }
.footer-grid h2 { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.footer-grid nav a { display: block; text-decoration: none; padding: 3px 0; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 18px; padding-bottom: 24px; font-size: 12px; color: var(--ink-3);
  /* Top rule lines up with the text instead of running into the page padding. */
  background: linear-gradient(var(--line), var(--line)) 50% 0 / calc(100% - 48px) 1px no-repeat;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; gap: 28px; padding-top: 20px; }
  .gallery { position: static; }
  .cart { grid-template-columns: 1fr; gap: 32px; }
  .summary { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .header-row { height: 56px; }
  .nav { gap: 18px; }
  .logo { font-size: 16px; }
  .buy h1, .page-head h1, .done h1, .doc h1 { font-size: 24px; }
  .choices { grid-template-columns: repeat(2, 1fr); }
  .thumbs { gap: 8px; }
  .specs div { grid-template-columns: 1fr; gap: 0; }
  .cart-line { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; }
  .line-price { grid-column: 2; text-align: left; }
  .line-price small { display: inline; margin-left: 6px; }
  .order-meta { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-base { background-size: calc(100% - 32px) 1px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
