:root {
  --paper: #edf0f4;
  --card: #ffffff;
  --ink: #0f1b3a;
  --muted: #55607a;
  --line: #d3d9e4;
  --red: #c62b3b;
  --blue: #1f4db8;
  --blue-deep: #173a8c;
  --radius: 10px;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; letter-spacing: -0.015em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

/* Airmail edging, the one loud thing on the page */
.airmail {
  height: 10px;
  background: repeating-linear-gradient(135deg, var(--red) 0 16px, #fff 16px 32px, var(--blue) 32px 48px, #fff 48px 64px);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(237, 240, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.main-nav a:hover { color: var(--blue); }
.basket-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 1rem var(--body); color: #fff; background: var(--ink);
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
}
.basket-btn:hover { background: var(--blue-deep); }
.basket-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px; background: var(--red); font-size: 0.85rem;
}

/* Perforated stamp edge: the mask punches half-circles along each side */
.stamp-wrap { filter: drop-shadow(0 6px 14px rgba(15, 27, 58, 0.22)); }
.stamp {
  --r: 5px; --p: 16px;
  position: relative;
  padding: 16px;
  background: #fff;
  -webkit-mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat,
    radial-gradient(circle at 50% 0, #0000 calc(var(--r) - 0.5px), #000 var(--r)) top / var(--p) var(--r) repeat-x,
    radial-gradient(circle at 50% 100%, #0000 calc(var(--r) - 0.5px), #000 var(--r)) bottom / var(--p) var(--r) repeat-x,
    radial-gradient(circle at 0 50%, #0000 calc(var(--r) - 0.5px), #000 var(--r)) left / var(--r) var(--p) repeat-y,
    radial-gradient(circle at 100% 50%, #0000 calc(var(--r) - 0.5px), #000 var(--r)) right / var(--r) var(--p) repeat-y;
  mask:
    linear-gradient(#000 0 0) center / calc(100% - 2 * var(--r)) calc(100% - 2 * var(--r)) no-repeat,
    radial-gradient(circle at 50% 0, #0000 calc(var(--r) - 0.5px), #000 var(--r)) top / var(--p) var(--r) repeat-x,
    radial-gradient(circle at 50% 100%, #0000 calc(var(--r) - 0.5px), #000 var(--r)) bottom / var(--p) var(--r) repeat-x,
    radial-gradient(circle at 0 50%, #0000 calc(var(--r) - 0.5px), #000 var(--r)) left / var(--r) var(--p) repeat-y,
    radial-gradient(circle at 100% 50%, #0000 calc(var(--r) - 0.5px), #000 var(--r)) right / var(--r) var(--p) repeat-y;
}
.stamp img { width: 100%; height: 100%; object-fit: cover; background: #dfe4ec; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 72px);
  padding: clamp(36px, 6vw, 88px) clamp(18px, 4vw, 56px) clamp(48px, 7vw, 96px);
  max-width: 1280px; margin: 0 auto;
}
.hero h1 { font-size: clamp(2.4rem, 4.8vw, 4.1rem); font-weight: 800; max-width: 16ch; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 46ch; margin: 22px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stage { position: relative; min-height: 440px; }
.hero-stage .stamp-wrap { position: absolute; width: 46%; }
.hero-stage .stamp { aspect-ratio: 3 / 4; }
.hero-stage .s1 { left: 2%; top: 8%; transform: rotate(-7deg); }
.hero-stage .s2 { left: 38%; top: 0; transform: rotate(5deg); z-index: 2; }
.hero-stage .s3 { left: 22%; top: 40%; transform: rotate(-2deg); z-index: 3; }

/* Buttons */
.btn {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
  font: 600 1.0625rem var(--body); border-radius: 999px; padding: 13px 24px; border: 2px solid transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-primary:disabled { background: #98a5c4; cursor: wait; }
.btn-quiet { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn-quiet:hover { background: var(--ink); color: #fff; }
.btn-block { display: block; width: 100%; }

/* Sections */
section { padding: clamp(40px, 6vw, 80px) clamp(18px, 4vw, 56px); }
.section-head { max-width: 1180px; margin: 0 auto 32px; }
.section-head h2 { font-size: clamp(2rem, 3.6vw, 3rem); font-weight: 800; }
.section-head p { color: var(--muted); max-width: 60ch; margin: 12px 0 0; }
.shop { background: #fff; border-block: 1px solid var(--line); }

/* Products */
.product-grid {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 48px;
}
@media (max-width: 760px) { .product-grid { grid-template-columns: minmax(0, 1fr); } }
.product { display: flex; flex-direction: column; gap: 16px; }
.photo-frame { position: relative; }
.product-photo .stamp { aspect-ratio: 4 / 4.4; }
.value-tag {
  position: absolute; left: 30px; bottom: 30px;
  font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1;
  color: #fff; background: var(--ink); padding: 8px 12px; border-radius: 4px;
}
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumb { width: 54px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; cursor: pointer; opacity: 0.7; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--blue); opacity: 1; }
.product h3 { font-size: 1.5rem; font-weight: 700; }
.product .tagline { color: var(--muted); margin: 4px 0 0; }
.product .desc { margin: 0; }
.facts { margin: 0; padding: 0; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.97rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 500; }
.buy-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; }
.price { font-family: var(--display); font-weight: 800; font-size: 1.9rem; }

/* Postage table */
.table-wrap { max-width: 1180px; margin: 0 auto; overflow-x: auto; }
.rates { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.rates th, .rates td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rates thead th { font-weight: 600; color: var(--muted); background: #f7f9fb; }
.rates tbody th { font-weight: 600; }
.rates td:last-child, .rates thead th:last-child { text-align: right; font-weight: 600; }
.rates tr.home th, .rates tr.home td { background: #fff4f5; }
.rates tr.home td:last-child { color: var(--red); }
.fine { max-width: 1180px; margin: 14px auto 0; color: var(--muted); font-size: 0.9rem; }

/* FAQ */
.faq { background: #fff; border-top: 1px solid var(--line); }
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; padding: 20px 4px; font-weight: 600; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--blue); }
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { margin: 0 0 20px; padding: 0 4px; color: var(--muted); max-width: 64ch; }

/* Footer */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px;
  padding: 36px clamp(18px, 4vw, 56px); background: var(--ink); color: #c9d1e6;
}
.site-footer strong { font-family: var(--display); font-size: 1.4rem; color: #fff; }
.site-footer p { margin: 4px 0 0; }
.site-footer a { color: #fff; }
.foot-meta { text-align: right; }

/* Basket drawer */
.scrim { position: fixed; inset: 0; background: rgba(15, 27, 58, 0.5); z-index: 30; }
.basket {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(440px, 100%);
  display: flex; flex-direction: column; background: #fff; box-shadow: -12px 0 40px rgba(15, 27, 58, 0.25);
  transform: translateX(105%); visibility: hidden; transition: transform 0.25s ease, visibility 0s 0.25s;
}
.basket.open { transform: none; visibility: visible; transition: transform 0.25s ease; }
.basket-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.basket-head h2 { font-size: 1.5rem; }
.icon-btn { border: 0; background: none; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--ink); width: 44px; height: 44px; border-radius: 50%; }
.icon-btn:hover { background: var(--paper); }
.basket-body { flex: 1; overflow-y: auto; padding: 8px 22px; }
.empty { padding: 36px 0; color: var(--muted); }
.empty a { font-weight: 600; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.line-name { font-weight: 600; line-height: 1.3; }
.line-price { font-weight: 600; }
.qty { display: inline-flex; align-items: center; margin-top: 8px; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 34px; height: 34px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--ink); border-radius: 50%; }
.qty button:hover { background: var(--paper); }
.qty span { min-width: 28px; text-align: center; font-weight: 600; }
.remove { display: block; margin-top: 6px; border: 0; background: none; padding: 0; color: var(--muted); font: inherit; font-size: 0.88rem; text-decoration: underline; cursor: pointer; text-align: right; }
.basket-foot { padding: 18px 22px 22px; border-top: 1px solid var(--line); background: #f7f9fb; display: grid; gap: 14px; }
.basket-foot[hidden] { display: none; }
.field { display: grid; gap: 6px; font-weight: 600; }
.field select { font: 500 1rem var(--body); padding: 12px 14px; border-radius: 8px; border: 1px solid #aeb7c9; background: #fff; color: var(--ink); }
.totals { margin: 0; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 600; }
.totals .grand { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 1.2rem; }
.totals .grand dt { color: var(--ink); font-weight: 700; }
.basket-foot .fine { margin: 0; text-align: center; }
.error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fdecee; color: #8f1a28; font-weight: 500; }

/* Order confirmation page */
.thanks { max-width: 640px; margin: 0 auto; padding: 96px 24px; text-align: center; }
.thanks h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; margin-bottom: 16px; }
.thanks p { color: var(--muted); margin: 0 0 28px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stage { min-height: 400px; order: -1; max-width: 460px; margin: 0 auto; width: 100%; }
  .main-nav { display: none; }
  .basket-btn { margin-left: auto; }
  .foot-meta { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .basket, .basket.open { transition: none; }
}
