/* Greg the Bug — mail-order catalogue, Prague 1915 */

:root {
  --paper: #F2EBDD;
  --paper-2: #E9DFCB;
  --ink: #2A1E18;
  --ink-soft: #5A4A3F;
  --red: #B5462F;
  --mustard: #C9A13B;
  --rule: #2A1E18;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --gutter: 16px;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--mono);
  overflow-x: hidden;
}
/* paper grain */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .14 0 0 0 0 .1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.05; margin: 0 0 .4em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px dashed var(--red); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- header ---------- */
.site-header { border-bottom: 3px double var(--rule); }
.topline {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  padding-top: 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}
.topline span:nth-child(2) { display: none; }
.head-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding-top: 12px; padding-bottom: 12px;
}
.brand {
  font-family: var(--serif); font-weight: 800; font-size: 28px;
  text-decoration: none; letter-spacing: -.02em; line-height: 1;
}
.brand i { font-weight: 400; font-style: italic; color: var(--red); }
.nav-toggle {
  font: 12px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  background: none; color: var(--ink); border: 1px solid var(--ink);
  padding: 7px 12px; cursor: pointer;
}
.site-nav { display: none; width: 100%; flex-direction: column; margin-top: 12px; border-top: 1px solid var(--rule); }
.site-nav.open { display: flex; }
.site-nav a {
  text-decoration: none; text-transform: uppercase; letter-spacing: .12em; font-size: 13px;
  padding: 12px 0; border-bottom: 1px dotted var(--ink-soft);
}
.site-nav a[aria-current="page"] { color: var(--red); }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden; white-space: nowrap;
  background: var(--ink); color: var(--paper);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
}
.marquee-track { display: inline-flex; padding: 9px 0; animation: marquee 40s linear infinite; }
.marquee-track span { padding: 0 18px; }
.marquee-track span::after { content: '✳'; color: var(--mustard); margin-left: 36px; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- hero ---------- */
.hero { padding: 32px 0 40px; border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; gap: 28px; }
.hero-kicker { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.hero-kicker::after { content: ''; flex: 1; border-top: 1px solid var(--rule); }
.hero h1 {
  font-size: clamp(40px, 11vw, 92px);
  font-weight: 700;
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  line-height: .95;
  letter-spacing: -.025em;
}
.hero h1 em { font-style: italic; font-weight: 400; color: var(--red); }
.hero-sub { max-width: 34em; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 22px; }
.hero-fig { position: relative; max-width: 420px; justify-self: center; width: 100%; }
.hero-fig .frame {
  border: 1px solid var(--ink); padding: 10px; background: var(--paper-2);
  transform: rotate(1.5deg);
}
.hero-fig .frame-inner { border: 1px solid var(--ink); background: var(--paper); }
.hero-fig figcaption { margin-top: 14px; font-size: 12px; text-align: center; }
.badge { position: absolute; width: 120px; top: -26px; left: -10px; transform: rotate(-12deg); z-index: 2; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: 600 13px var(--mono); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; text-align: center;
  color: var(--paper); background: var(--ink);
  border: 1px solid var(--ink); padding: 13px 22px;
  cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--red); border-color: var(--red); color: var(--paper); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--big { width: 100%; padding: 16px 22px; }
.btn:disabled { background: transparent; color: var(--ink-soft); border-style: dashed; cursor: not-allowed; }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: 11px var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--red); }

/* ---------- sections ---------- */
.section { padding-top: 40px; padding-bottom: 40px; }
.section-title {
  display: flex; align-items: center; gap: 14px;
  font-size: clamp(24px, 6vw, 36px); margin-bottom: 26px;
}
.section-title::after { content: ''; flex: 1; border-top: 1px solid var(--rule); }
.section-title .label { font-size: 11px; }

.page-head { padding-top: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: clamp(38px, 10vw, 72px); }
.page-head p { max-width: 36em; color: var(--ink-soft); margin: 0; }

/* ---------- product grid ---------- */
.grid { display: grid; gap: 36px 24px; }
.item { position: relative; }
.item-link { display: block; text-decoration: none; color: inherit; }
.item-link:hover { color: inherit; }
.item-fig {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--ink);
  padding: 14px;
  transition: transform .25s ease;
}
.item-fig .mockup, .item-fig .photo { width: 100%; height: auto; aspect-ratio: 400 / 440; object-fit: cover; }
.item-link:hover .item-fig { transform: rotate(-1.5deg); }
.item-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--rule); padding: 10px 0 6px; margin-top: 4px;
}
.no { font-size: 11px; letter-spacing: .14em; }
.price { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.item-name { font-size: 22px; margin: 10px 0 4px; }
.item-link:hover .item-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.item-tag { font-size: 13px; color: var(--ink-soft); margin: 0; }

/* stamps */
.stamp {
  position: absolute; top: 18px; right: 12px;
  font: 700 13px/1.1 var(--mono); letter-spacing: .14em; text-transform: uppercase; text-align: center;
  color: var(--red); border: 2px solid var(--red); outline: 1px solid var(--red); outline-offset: 2px;
  padding: 6px 10px; transform: rotate(8deg);
  background: rgba(242, 235, 221, .6);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.stamp--hover { opacity: 0; transform: rotate(8deg) scale(1.4); transition: opacity .18s, transform .18s; }
.item-link:hover .stamp--hover, .item-link:focus-visible .stamp--hover { opacity: .9; transform: rotate(8deg) scale(1); }
.stamp--sold { top: 40%; left: 50%; right: auto; font-size: 22px; padding: 8px 16px; transform: translate(-50%, -50%) rotate(-14deg); }
.is-soldout .item-fig svg { opacity: .55; }

/* ---------- home bits ---------- */
.notice-strip { display: grid; gap: 22px; padding-top: 36px; padding-bottom: 36px; border-bottom: 1px solid var(--rule); }
.notice-strip .col { border-top: 1px solid var(--rule); padding-top: 12px; }
.notice-strip h3 { font-size: 20px; }
.notice-strip p { font-size: 13px; color: var(--ink-soft); margin: 0; }
.notice-strip .num { font-family: var(--serif); font-size: 44px; font-weight: 300; color: var(--red); line-height: 1; display: block; margin-bottom: 6px; }

.quote-block { padding: 48px 0; text-align: center; border-bottom: 1px solid var(--rule); }
.quote-block blockquote { margin: 0 auto; max-width: 22em; font-family: var(--serif); font-style: italic; font-size: clamp(24px, 6vw, 40px); line-height: 1.15; }
.quote-block cite { display: block; margin-top: 16px; font-style: normal; }

/* ---------- product page ---------- */
.crumbs { padding: 20px 0 14px; }
.crumbs a { text-decoration: none; }
.pdp { display: grid; gap: 28px; padding-bottom: 40px; border-bottom: 1px solid var(--rule); }
.pdp-fig { align-self: start; }
.pdp-title { font-size: clamp(34px, 9vw, 58px); }
.pdp-tag { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--red); }
.pdp-price { font-family: var(--serif); font-size: 34px; font-weight: 600; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 0; }
.pdp-desc { max-width: 38em; }
.pdp-form { margin-top: 22px; }
.opt { border: 0; padding: 0; margin: 0 0 18px; }
.opt legend { padding: 0; margin-bottom: 8px; }
.opt legend span { color: var(--ink); }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-choice span {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 46px; min-height: 42px; justify-content: center;
  padding: 8px 12px; border: 1px solid var(--ink);
  font-size: 13px; cursor: pointer; background: transparent;
}
.opt-choice--swatch span::before {
  content: ''; width: 14px; height: 14px; border: 1px solid var(--ink); background: var(--sw);
}
.opt-choice input:checked + span { background: var(--ink); color: var(--paper); }
.opt-choice input:focus-visible + span { outline: 2px dashed var(--red); outline-offset: 2px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.qty { display: inline-flex; border: 1px solid var(--ink); }
.qty button {
  width: 40px; height: 40px; border: 0; background: transparent; color: var(--ink);
  font: 18px var(--mono); cursor: pointer;
}
.qty button:hover { background: var(--ink); color: var(--paper); }
.qty input {
  width: 46px; height: 40px; border: 0; border-left: 1px solid var(--ink); border-right: 1px solid var(--ink);
  background: transparent; color: var(--ink); font: 15px var(--mono); text-align: center;
  -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.added { min-height: 1.6em; margin-top: 10px; font-size: 13px; }
.fineprint { list-style: none; padding: 14px 0 0; margin: 20px 0 0; border-top: 1px dashed var(--ink-soft); font-size: 12px; color: var(--ink-soft); }
.fineprint li::before { content: '† '; color: var(--red); }
.more { padding: 40px 0; }

/* ---------- cart ---------- */
.cart-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.cart-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  grid-template-areas: 'fig info info' 'fig qty line' 'fig rm rm';
  gap: 8px 14px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--rule);
}
.cart-fig { grid-area: fig; align-self: start; background: var(--paper-2); border: 1px solid var(--ink); padding: 4px; }
.cart-info { grid-area: info; display: flex; flex-direction: column; gap: 2px; }
.cart-name { font-family: var(--serif); font-size: 20px; font-weight: 600; text-decoration: none; line-height: 1.15; }
.cart-opts, .cart-unit { font-size: 12px; color: var(--ink-soft); }
.cart-row .qty { grid-area: qty; justify-self: start; }
.cart-line { grid-area: line; font-family: var(--serif); font-size: 20px; font-weight: 600; text-align: right; }
.cart-row .link-btn { grid-area: rm; justify-self: start; }
.cart-total { margin-top: 24px; display: grid; gap: 18px; }

.ledger p { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 6px 0; border-bottom: 1px dotted var(--ink-soft); font-size: 14px; }
.ledger small { color: var(--ink-soft); }
.ledger .ledger-total { border-bottom: 3px double var(--rule); border-top: 1px solid var(--rule); font-family: var(--serif); font-size: 22px; font-weight: 600; margin-top: 6px; }
.ledger--box { border: 1px solid var(--ink); padding: 16px; background: var(--paper-2); align-self: start; }
.ledger--box .label { margin-bottom: 8px; }

/* ---------- checkout ---------- */
.checkout-grid { display: grid; gap: 32px; padding: 32px 0 48px; }
.order-form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field input {
  font: 16px var(--mono); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--ink);
  padding: 10px 2px; border-radius: 0;
}
.field input::placeholder { color: #9b8b7c; }
.field input:focus { outline: none; border-bottom: 2px solid var(--red); }
.form-error { color: var(--red); min-height: 1.4em; margin: 0; font-size: 13px; }
.fineprint-inline { font-size: 12px; color: var(--ink-soft); margin: 0; }

.notice { padding: 48px 0; max-width: 36em; }
.notice h1, .notice h2 { font-size: clamp(28px, 7vw, 44px); }

.receipt { position: relative; padding: 48px 0 64px; max-width: 40em; }
.receipt h1 { font-size: clamp(36px, 9vw, 64px); }
.receipt-big { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--red); }
.receipt-box { border: 1px solid var(--ink); border-left: 6px solid var(--red); padding: 16px 18px; margin: 24px 0; background: var(--paper-2); }
.stamp--received { top: 30px; right: 0; font-size: 20px; transform: rotate(10deg); }

/* ---------- about ---------- */
.about-grid { display: grid; gap: 32px; padding: 36px 0 56px; }
.about-body { max-width: 38em; }
.about-body h2 { font-size: 28px; margin-top: 1.2em; }
.about-body p:first-of-type::first-letter {
  float: left; font-family: var(--serif); font-weight: 700; font-size: 64px; line-height: .8;
  padding: 6px 8px 0 0; color: var(--red);
}
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.steps li::before { content: 'No.' counter(s, decimal-leading-zero); font-size: 11px; letter-spacing: .1em; color: var(--red); padding-top: 3px; }
.about-side { border: 1px solid var(--ink); padding: 18px; background: var(--paper-2); align-self: start; }
.about-side h3 { font-size: 22px; }

/* ---------- footer ---------- */
.site-footer { border-top: 3px double var(--rule); padding: 28px 0 36px; margin-top: 24px; }
.foot-grid { display: grid; gap: 16px; }
.foot-brand { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; }
.foot-brand i { font-weight: 400; color: var(--red); }
.foot-brand small { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .1em; color: var(--ink-soft); }
.foot-note { margin: 0; font-size: 13px; border: 1px dashed var(--ink); padding: 10px 12px; }
.foot-nav { display: flex; gap: 18px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

/* ================= larger screens ================= */
@media (min-width: 640px) {
  :root { --gutter: 28px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .notice-strip { grid-template-columns: repeat(3, 1fr); }
  .cart-row {
    grid-template-columns: 96px 1fr auto 90px auto;
    grid-template-areas: 'fig info qty line rm';
  }
  .cart-row .link-btn { justify-self: end; }
  .cart-total { grid-template-columns: 1fr 1fr; align-items: end; }
  .cart-total .ledger { grid-column: 2; }
  .cart-total .btn { grid-column: 2; }
}

@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .topline span:nth-child(2) { display: inline; }
  .nav-toggle { display: none; }
  .site-nav { display: flex !important; flex-direction: row; width: auto; margin: 0; border: 0; gap: 28px; }
  .site-nav a { border: 0; padding: 4px 0; }
  .brand { font-size: 36px; }

  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: center; }
  .hero-fig { justify-self: end; }

  /* asymmetric catalogue: the first item is a feature */
  .grid--catalogue { grid-template-columns: repeat(6, 1fr); gap: 48px 32px; }
  .grid--catalogue .item { grid-column: span 2; }
  .grid--catalogue .item:first-child { grid-column: 1 / span 3; grid-row: span 2; }
  .grid--catalogue .item:nth-child(2) { grid-column: 4 / span 3; }
  .grid--catalogue .item:nth-child(3) { grid-column: 4 / span 3; }
  .grid--catalogue .item:first-child .item-name { font-size: 32px; }

  .grid--featured { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px 28px; }
  .grid--featured .item:nth-child(1) { grid-row: span 2; }
  .grid--featured .item:nth-child(4) { grid-column: 2 / span 2; }
  .grid--featured .item:nth-child(4) .item-link { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .grid--featured .item:nth-child(4) .item-fig { grid-row: span 3; }
  .grid--more { grid-template-columns: repeat(3, 1fr); }

  .pdp { grid-template-columns: 1.1fr 1fr; gap: 56px; }
  .pdp-fig { position: sticky; top: 24px; }
  .checkout-grid { grid-template-columns: 1.3fr 1fr; gap: 56px; }
  .about-grid { grid-template-columns: 2fr 1fr; gap: 64px; }
  .foot-grid { grid-template-columns: 1fr 1.4fr auto; align-items: center; }
}

/* photos & product thumbnails */
.hero-fig .photo { width: 100%; height: auto; aspect-ratio: 1199 / 1300; object-fit: cover; }
.cart-fig .photo { aspect-ratio: 1; object-fit: cover; width: 100%; }
.pdp-fig .photo { aspect-ratio: auto; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
.thumb { width: 64px; height: 64px; padding: 0; border: 1px solid var(--ink-soft); background: var(--paper); cursor: pointer; opacity: .7; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.is-on, .thumb:hover { opacity: 1; border: 2px solid var(--ink); }
