/* The public-facing pages — the landing page, the shop, the thank-you page and
   the terms (web-0.45.3).
 *
 * Deliberately NOT the builder's styles.css. That file dresses an application:
 * a card grid, pickers, sheets. These are pages someone reads and buys from,
 * and the two have almost nothing in common beyond the palette. Keeping them
 * apart means a change to the builder's chrome can't move a price.
 *
 * The palette is the one the landing page already used, lifted out of its
 * inline <style> so four pages can't drift apart. Gold on black, Georgia for
 * the brand, matching the desktop app's mockup. */

:root {
  --bg: #0e0d0b;
  --panel: #17140f;
  --panel-edge: #241f18;
  --line: #211d16;
  --ink: #f3eee4;
  --ink-soft: #b8ad98;
  --ink-dim: #8e8471;
  --gold: #f2b24c;
  --gold-deep: #d98a1f;
  --gold-dark: #b06f14;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a.plain { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.topbar {
  /* Three columns so the brand sits dead centre whatever is on the right
     (web-0.48.5, Gavin: "something larger and the name centre"). */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* The text logo (web-0.48.6) — one image instead of emblem + typed name. */
.brand img.wordmark { height: 84px; width: auto; display: block; }
.brand span {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--gold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.topbar .navlinks { grid-column: 3; justify-self: end; }

.navlinks { display: flex; align-items: center; gap: 8px; }

.tab {
  border: 1px solid #4a4034;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}
.tab:hover { background: #1a1712; border-color: var(--gold-deep); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.cta,
button.cta {
  display: inline-block;
  background: linear-gradient(var(--gold-deep), var(--gold-dark));
  color: #1a1207;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: inherit;
  padding: 14px 28px;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
.cta:hover { filter: brightness(1.07); }
.cta:disabled { filter: grayscale(0.6) brightness(0.7); cursor: default; }

.cta.ghost {
  background: none;
  border: 1px solid #4a4034;
  color: var(--gold);
  box-shadow: none;
}
.cta.ghost:hover { background: #1a1712; border-color: var(--gold-deep); }

/* ── Page furniture ──────────────────────────────────────────────────────── */

main { flex: 1; width: 100%; }

.wrap {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.wrap.narrow { max-width: 44rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: normal; color: var(--ink); }
h1 { font-size: 2rem; margin: 0 0 8px; }
h2 { font-size: 1.35rem; margin: 36px 0 10px; }
h3 { font-size: 1.05rem; margin: 22px 0 6px; }
p { color: var(--ink-soft); margin: 10px 0; }
.lede { font-size: 1.08rem; color: var(--ink-soft); max-width: 38rem; }
.dim { color: var(--ink-dim); font-size: 0.9rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 20px;
}

footer {
  text-align: center;
  color: #6f6656;
  font-size: 0.82rem;
  padding: 16px;
  border-top: 1px solid var(--line);
}
footer a { color: #8e8471; text-decoration: underline; text-underline-offset: 3px; }

/* Off-screen but still rendered and read: `display: none` would have the h1
   discounted by crawlers, which defeats the point of adding it. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── The landing hero ────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 56px;
  gap: 8px;
}
.hero img.logo { width: 280px; height: 280px; max-width: 70vw; margin-bottom: 4px; }
.hero p { max-width: 30rem; font-size: 1.02rem; margin: 6px 0 22px; }
.hero p.sub { font-size: 0.92rem; color: var(--ink-dim); margin: -12px 0 24px; }

/* Two calls to action side by side, stacking on a phone. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ── The shop ────────────────────────────────────────────────────────────── */

/* A finish's or an accessory's photos and videos (web-0.54.0). */
.gallery { margin: 12px 0 4px; }
.gallery-stage {
  border: 1px solid #3a3228;
  border-radius: 10px;
  background: #0a0908;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-stage img, .gallery-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery-thumb {
  flex: 0 0 64px;
  height: 64px;
  padding: 0;
  border: 1px solid #3a3228;
  border-radius: 8px;
  background: #13110d;
  color: var(--gold);
  font-size: 20px;
  overflow: hidden;
  cursor: pointer;
}
.gallery-thumb { position: relative; }
.gallery-thumb img, .gallery-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.gallery-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 3px #000;
}
.gallery-thumb.is-active { border-color: var(--gold); }

/* A row of chunky radio "chips". The native radio is kept in the DOM — it is
   what makes arrow keys, labels and form semantics work — and hidden visually,
   with the label doing the drawing. */
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.choices input { position: absolute; opacity: 0; width: 0; height: 0; }
.choices label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 8.5rem;
  padding: 12px 16px;
  border: 1px solid #3a3228;
  border-radius: 10px;
  background: #13110d;
  cursor: pointer;
}
.choices label .name { font-weight: 600; color: var(--ink); }
.choices label .meta { font-size: 0.84rem; color: var(--ink-dim); }
.choices label:hover { border-color: #5a4c3a; }
.choices input:checked + label {
  border-color: var(--gold-deep);
  background: #1d1810;
  box-shadow: inset 0 0 0 1px var(--gold-deep);
}
.choices input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }

.field { margin: 14px 0; }
.field label.cap {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-dim);
  margin-bottom: 5px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field textarea,
.field input[type="number"] {
  width: 100%;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid #3a3228;
  background: #13110d;
  color: var(--ink);
  font: inherit;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold-deep); }
.field textarea { resize: vertical; }

/* The calculator (web-0.51.0): three counts side by side, then a line saying
   how many sheets that is and how many spaces are left on the last one. */
.countgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.countgrid .count { display: flex; flex-direction: column; gap: 5px; font-size: 0.86rem; color: var(--ink-dim); }
.sheetline { margin: 10px 0 0; color: var(--ink); font-size: 0.95rem; }
.sheetline strong { color: var(--gold); }
.extras { padding: 12px 14px; border: 1px dashed var(--gold-deep); border-radius: 10px; background: #15120c; }
.stepper { display: flex; gap: 8px; align-items: stretch; }
.stepper .cta { width: auto; padding: 0 14px; min-width: 44px; white-space: nowrap; }
.field .stepper input[type="number"] { width: 5rem; flex: 0 0 auto; text-align: center; }
.extras-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.extras-actions .cta { flex: 1 1 10rem; }

/* The running total. Big, because it is the number the buyer is deciding on. */
.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 4px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-edge);
}
.total .label { color: var(--ink-dim); font-size: 0.9rem; }
.total .amount { font-family: var(--serif); font-size: 2rem; color: var(--gold); }
.total .breakdown { color: var(--ink-dim); font-size: 0.86rem; }

.note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid #3a2f1c;
  background: #191309;
  color: #e0cfa8;
  font-size: 0.9rem;
}
.note.bad { border-color: #4a2626; background: #1b1010; color: #e8bdbd; }
.note[hidden] { display: none; }

/* Price table on the listing. */
table.prices { width: 100%; border-collapse: collapse; margin: 10px 0 4px; }
table.prices th, table.prices td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
}
table.prices th { color: var(--ink-dim); font-weight: 600; font-size: 0.84rem; }
/* Heading and figure must share an edge, or "Gloss" sits at the left of its
   column while £30.00 sits at the right and the table reads as a jumble. */
table.prices th.num, table.prices td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.prices th:first-child, table.prices td:first-child { width: 34%; }

/* Cards side by side. */
.cards { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.cards .panel { flex: 1 1 18rem; }

ol.steps { color: var(--ink-soft); padding-left: 1.2rem; margin: 10px 0; }
ol.steps li { margin: 8px 0; }

/* Phones: one column, and nothing wider than the screen. */
@media (max-width: 560px) {
  /* Brand on its own centred row, the buttons centred under it. */
  .topbar { grid-template-columns: 1fr; justify-items: center; padding: 12px 16px; }
  .brand { grid-column: 1; }
  .brand img.wordmark { height: 66px; }
  .brand span { font-size: 1.2rem; }
  .topbar .navlinks { grid-column: 1; justify-self: center; flex-wrap: wrap; justify-content: center; }
  .wrap { padding: 28px 16px 48px; }
  h1 { font-size: 1.6rem; }
  .choices label { min-width: 0; flex: 1 1 8rem; }
  .cta { width: 100%; text-align: center; }
  .actions { flex-direction: column; }
}

/* ── Account page (web-0.46.0) ───────────────────────────────────────────── */

.acct-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acct-head h1 { margin-bottom: 0; }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--gold); text-decoration: underline; text-underline-offset: 3px;
}

.stat { font-family: var(--serif); font-size: 2rem; color: var(--gold); line-height: 1.1; }
.refcode {
  display: inline-block; font-family: ui-monospace, Menlo, monospace; font-size: 1.35rem;
  letter-spacing: 0.08em; color: var(--ink); background: #0f0d0a;
  border: 1px dashed var(--gold-dark); border-radius: 8px; padding: 6px 12px; margin: 4px 0 10px;
  overflow-wrap: anywhere;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.order { margin-top: 14px; }
.order-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.order-top .what { font-weight: 600; }
.order-top .money { font-family: var(--serif); color: var(--gold); font-size: 1.2rem; }
.order .sub { color: var(--ink-dim); font-size: 0.86rem; }

/* The progress ladder: one dot per step, lit up to where the order has got. */
ol.progress {
  list-style: none; display: flex; padding: 0; margin: 16px 0 6px; gap: 0;
}
ol.progress li {
  flex: 1 1 0; position: relative; text-align: center; font-size: 0.78rem;
  color: var(--ink-dim); padding-top: 22px; min-width: 0;
}
ol.progress li::before {
  content: ""; position: absolute; top: 4px; left: 50%; width: 12px; height: 12px;
  margin-left: -6px; border-radius: 50%; background: #2a241b; border: 2px solid #3a3226; z-index: 1;
}
ol.progress li::after {
  content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: #3a3226;
}
ol.progress li:first-child::after { display: none; }
ol.progress li.done { color: var(--ink-soft); }
ol.progress li.done::before { background: var(--gold); border-color: var(--gold); }
ol.progress li.done::after { background: var(--gold-deep); }
ol.progress li.now { color: var(--gold); font-weight: 600; }
ol.progress li .when { display: block; font-weight: 400; color: var(--ink-dim); font-size: 0.72rem; }

.pill {
  display: inline-block; font-size: 0.76rem; padding: 2px 9px; border-radius: 999px;
  border: 1px solid #3a3226; color: var(--ink-soft);
}
.pill.bad { border-color: #4a2626; color: #e8bdbd; }

/* The code box on the order form. */
.codebox { display: flex; gap: 8px; }
.codebox input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; }
.codebox .cta { padding-left: 16px; padding-right: 16px; width: auto; }
.creditbox { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.creditbox input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--gold); }
#creditMaxBtn { white-space: nowrap; }
.credit-pound { align-self: center; color: var(--gold); font-weight: 600; }
.note.good { border-color: #2c4a2c; background: #0f1a0f; color: #bfe0bf; }

/* Request cancellation (web-0.48.0). */
.cancel-row { margin-top: 14px; }
.cancel-row p { margin: 8px 0 0; }
.cta.small { padding: 9px 16px; font-size: 0.92rem; width: auto; }
.cta:disabled.ghost { filter: none; opacity: 0.45; cursor: not-allowed; }
@media (max-width: 420px) {
  ol.progress li { font-size: 0.7rem; }
}

/* The home page's lone account link (web-0.50.1). */
.homelinks {
  position: absolute;
  top: 18px;
  right: 22px;
  display: flex;
  gap: 6px;
}
.homeaccount {
  color: var(--gold);
  text-decoration: none;
  font-size: 15px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.homeaccount:hover { border-color: var(--gold-deep); }
@media (max-width: 600px) {
  .homelinks { top: 10px; right: 12px; }
  .homeaccount { font-size: 14px; }
}

/* ── Accessories (web-0.55.0) ────────────────────────────────────────────── */
.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin-top: 18px;
}
.acc-card { display: flex; flex-direction: column; margin: 0; }
.acc-card .gallery { margin-top: 0; }
.acc-card h3 { margin: 12px 0 2px; font-family: var(--serif); font-size: 1.15rem; }
.acc-price { margin: 0 0 6px; color: var(--gold); font-weight: 600; }
.acc-stock { color: var(--ink-dim); font-weight: 400; font-size: 0.9em; }
.acc-stock.is-out { color: #e07a6a; }
.acc-desc { margin: 0 0 12px; white-space: pre-line; }
.acc-card .cta { margin-top: auto; width: 100%; }

.basket { list-style: none; padding: 0; margin: 0 0 8px; }
.basket-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.basket-name { min-width: 0; overflow-wrap: anywhere; }
.basket-line .stepper { display: flex; align-items: center; gap: 6px; }
.basket-line .stepper .cta { min-width: 36px; padding: 6px 0; }
.basket-qty { min-width: 1.6em; text-align: center; }
.basket-cost { color: var(--gold); min-width: 4.5em; text-align: right; }

/* ── The basket button (web-0.57.0) — in every page's top bar ───────────── */
.basket-tab { display: inline-flex; align-items: center; gap: 7px; }
.basket-icon { flex: none; }
.basket-count {
  min-width: 1.45em;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1207;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}
.basket-count[hidden] { display: none; }

/* The basket page */
.bdeck {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bdeck-title { font-weight: 600; }
.bdeck-detail { grid-column: 1; color: var(--ink-dim); font-size: 0.9rem; }
.bdeck-cost { grid-row: 1; grid-column: 2; color: var(--gold); text-align: right; }
.bdeck-actions { grid-column: 2; justify-self: end; }
/* web-0.69.4: the Bulk discount line under the decks */
.bdeck-bulk .bdeck-title { font-weight: 600; color: var(--ink-soft); }
.basket-empty { color: var(--ink-soft); }
.basket-added { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.basket-added .cta { width: auto; }
/* Four buttons (web-0.57.0) don't fit beside a centred brand below ~1100px,
   so the bar stacks there as it does on phones: brand centred, buttons under. */
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr; justify-items: center; }
  .brand { grid-column: 1; }
  .topbar .navlinks { grid-column: 1; justify-self: center; flex-wrap: wrap; justify-content: center; }
}

/* ── One shop page (web-0.59.0): the listing whose form is open ─────────── */
.acc-card.is-open { border-color: var(--gold); }

/* ── Centred pages (web-0.60.3, Gavin 2026-11-10) ─────────────────────────
   Headings, intros, listings and button rows sit on the centre line. Forms,
   the basket's lines and long reading text (terms, steps) stay left-aligned
   inside a centred column — centred paragraphs are hard to read. */
.wrap > h1, .wrap > h2, .wrap > section > h1, .wrap > section > h2 { text-align: center; }
.lede { margin-left: auto; margin-right: auto; text-align: center; }
.wrap:not(.narrow) > p.dim, .wrap > section > p.dim { text-align: center; max-width: 44rem; margin-left: auto; margin-right: auto; }
ol.steps { max-width: 40rem; margin: 10px auto; }
.cards { justify-content: center; }
.acc-card { text-align: center; }
.basket-added, .row { justify-content: center; }
#emptyPanel { text-align: center; }
.wrap > section > .acct-head { flex-direction: column; align-items: center; gap: 4px; }
.panel > h1, .panel h2, .panel > h3 { text-align: center; }
.panel .acct-head h2 { text-align: left; }

/* £0 orders (web-0.61.0): the address, asked for on the basket page. */
.shipgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shipgrid #shipName, .shipgrid #shipLine1, .shipgrid #shipLine2 { grid-column: 1 / -1; }

/* ── An accessory's own page (web-0.67.0) ─────────────────────────────────
   The shop card: one photo, the name, price and a one-line summary, clipped
   to two lines. Photo, name and "More details" all open /shop/item/<id>. */
a.acc-photo { text-decoration: none; }
a.acc-photo:hover, a.acc-photo:focus-visible { border-color: var(--gold-deep); }
.acc-name { color: inherit; text-decoration: none; }
.acc-name:hover, .acc-name:focus-visible { color: var(--gold); }
.acc-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.acc-more { display: inline-block; margin: 0 0 12px; font-size: 0.92rem; }

.item-back { margin: 4px 0 14px; }
.item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.item-gallery { margin: 0; }
.item-info h1 { margin: 0 0 6px; text-align: left; }
.item-price { font-size: 1.15rem; }
.item-summary { margin: 0 0 16px; color: var(--ink-soft); }
.item-info > .cta { width: 100%; max-width: 320px; }
.item-added { margin: 10px 0 0; }
.item-added .cta { width: auto; }
.item-details { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.item-details p { margin: 0 0 12px; white-space: pre-line; line-height: 1.6; }
@media (max-width: 760px) {
  .item { grid-template-columns: 1fr; gap: 18px; }
  .item-info > .cta { max-width: none; }
}
