:root {
  --bg: #C9D7F9;
  --surface: #F3C3BF;
  --ink: #17024C;
  --muted: #5C3B4D;
  --accent: #78372C;
  --accent-text: #FFFFFF;
  --stub: #401926;
  --stub-text: #C9D7F9;
  --rule: #B5989D;
  --label: #C7CEA7;
  --font-display: "Besley", "Times New Roman", serif;
  --font-body: "Livvic", "Segoe UI", sans-serif;
  --max: 72rem;
  --radius: 0.4rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
html:not(.js) .js-only { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.skip {
  position: fixed;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 0.9rem;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }

/* Header is a perforated ticket strip */
.topbar {
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  position: relative;
}
.topbar::after {
  content: "";
  display: block;
  height: 10px;
  background:
    radial-gradient(circle at 8px 0, var(--bg) 5px, transparent 6px) repeat-x;
  background-size: 16px 10px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0 0.6rem;
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
}
.brand img { width: 44px; height: 44px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.3vw, 1.4rem);
  letter-spacing: 0.01em;
  line-height: 1.05;
}
@media (max-width: 420px) {
  .brand-name { max-width: 9.6rem; }
}
#nav-toggle { position: absolute; left: -9999px; }
.nav-toggle {
  display: none;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  background: var(--label);
  color: var(--ink);
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}
.nav { display: flex; align-items: center; gap: 0.35rem 1rem; flex-wrap: wrap; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding: 0.45rem 0.2rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); }
.nav a.cta,
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-text) !important;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink);
}
.nav a.cta:hover,
.cta:hover { background: var(--ink); border-color: var(--ink); color: #fff !important; }
.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  background: var(--label);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border: 2px solid var(--ink);
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* Pending / draft notices */
.notice, .draft-banner, .photo-caption {
  background: var(--label);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
}
.draft-banner { background: var(--surface); }

/* Layout with ticket stub */
.stage {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  min-height: 60vh;
}
.stub {
  background: var(--stub);
  color: var(--stub-text);
  padding: 1.5rem 0.6rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.main { padding: 2rem 0 3.5rem; }

.hero.ticket {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 2rem 1.6rem 2.2rem;
  position: relative;
  box-shadow: 8px 8px 0 var(--stub);
  margin-bottom: 2rem;
}
.kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.7rem;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.lead { font-size: 1.15rem; max-width: 40rem; color: var(--ink); }
.muted { color: var(--muted); }

.section { margin: 2.25rem 0; }
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--surface);
  border: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.card:hover { box-shadow: 5px 5px 0 var(--stub); }
.card-photo {
  background: var(--bg);
  border-bottom: 2px solid var(--ink);
  min-height: 11rem;
  position: relative;
}
.badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  background: var(--label);
  color: var(--ink);
  border: 2px solid var(--ink);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
}
.card-body { padding: 0.95rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.sku { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0.2rem 0;
}
.price-note { font-size: 0.8rem; color: var(--muted); }
.card .cta { align-self: flex-start; margin-top: auto; }

/* Product page */
.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.spec-ticket {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 1.4rem;
}
dl.spec { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.4rem 0.8rem; margin: 1rem 0; }
dl.spec dt { font-weight: 600; color: var(--muted); }
dl.spec dd { margin: 0; }
.photo-frame { border: 2px solid var(--ink); background: var(--bg); position: relative; }
.photo-caption { margin: 0; border-top: 0; }

/* Forms */
form.quote {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 1.25rem;
  display: grid;
  gap: 0.85rem;
  max-width: 40rem;
}
label { font-weight: 600; display: block; margin-bottom: 0.3rem; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0.45rem 0.6rem;
}
textarea { min-height: 8rem; resize: vertical; }
button, .btn {
  font: inherit;
  cursor: pointer;
}
button.cta { border: 2px solid var(--accent); }
.form-ok, .form-err { display: none; padding: 0.75rem 1rem; border: 2px solid var(--ink); }
.form-ok { background: var(--label); }
.form-err { background: var(--surface); }

/* Footer ticket */
.site-footer {
  background: var(--stub);
  color: var(--stub-text);
  padding: 2rem 0 2.5rem;
  margin-top: auto;
}
.site-footer a { color: var(--label); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1.5rem;
}
.footer-brand { display: flex; gap: 0.7rem; align-items: flex-start; }
.footer-brand img { width: 40px; height: 40px; background: var(--surface); }
.legal-name { font-weight: 600; }
.foot-note { font-size: 0.85rem; color: var(--label); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.3rem 0; }
.site-footer h2 { font-size: 1rem; color: #fff; }

/* 404 left aligned, no auto-centering from h1/.lead */
.e404 h1, .e404 .lead, .e404 .cta-row {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}
.e404 { max-width: 36rem; }

.prose { max-width: 42rem; }
.prose p, .prose li { margin: 0 0 0.8rem; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 1rem 1rem 1rem 3.2rem;
  margin: 0 0 0.8rem;
  position: relative;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.7rem; top: 0.85rem;
  width: 1.8rem; height: 1.8rem;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
}

@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .stub {
    writing-mode: horizontal-tb;
    transform: none;
    flex-direction: row;
    padding: 0.6rem 1rem;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
  }
  .product, .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--surface);
    border-bottom: 2px solid var(--ink);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    z-index: 20;
  }
  .topbar { position: relative; }
  #nav-toggle:checked ~ .nav { display: flex; }
  #nav-toggle:checked + .nav-toggle { background: var(--ink); color: #fff; }
  .nav a { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Size prices and selector */
.size-prices {
  list-style: none;
  margin: 0.25rem 0 0.15rem;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.size-prices li,
.size-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  margin: 0;
  padding: 0.15rem 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.size-picker {
  border: 2px solid var(--ink);
  background: var(--bg);
  padding: 0.6rem 0.75rem 0.5rem;
  margin: 0.4rem 0 0.7rem;
}
.size-picker legend {
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0 0.35rem;
}
.size-option {
  cursor: pointer;
  font-weight: 700;
}
.size-option input {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.size-price { white-space: nowrap; }
.draft-tag {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.3rem;
}

.size-sku {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.proposed-spec {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Long support@ addresses must wrap at 390px */
.site-footer .footer-grid > * { min-width: 0; }
a[href^="mailto:"], a.email, .email {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Supplier product photographs */
.card-photo img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--bg);
}
.photo-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.product-gallery .gallery-main {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg);
}
.product-gallery.native-size .gallery-main {
  max-width: 773px;
}
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.4rem;
  list-style: none;
  padding: 0.6rem;
  margin: 0;
}
.gallery-thumbs img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--bg);
  border: 2px solid var(--ink);
}


.quote .agree {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}
.quote .agree input[type="checkbox"] {
  width: auto;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  flex: 0 0 auto;
}
.quote .agree label {
  font-weight: 500;
  margin: 0;
  padding-top: 0.5rem;
}
