/* James Kehler Ceramics — storefront styles
   The photos carry the color. The circular stamp is the one recurring mark. */

:root {
  --paper: #f3f3f1;
  --surface: #ffffff;
  --ink: #22201d;
  --smoke: #6f6b66;
  --slip: #d4d1cb;
  --iron: #6b3a22;
  --iron-ink: #ffffff;
  --focus: #2f5d8a;
  --radius-img: 2px;
  --gutter: 16px;
  --max: 1240px;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171614;
    --surface: #201f1c;
    --ink: #ecebe7;
    --smoke: #a29d96;
    --slip: #3a3833;
    --iron: #c98a62;
    --iron-ink: #171614;
    --focus: #8fb8e0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171614; --surface: #201f1c; --ink: #ecebe7; --smoke: #a29d96;
  --slip: #3a3833; --iron: #c98a62; --iron-ink: #171614; --focus: #8fb8e0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  font-feature-settings: "ss01";
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 760px) { :root { --gutter: 32px; } }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--slip);
}
.site-head .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { height: 36px; width: auto; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 20px; align-items: center; }
.nav a { text-decoration: none; color: var(--smoke); font-size: 15px; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover { color: var(--ink); }
@media (max-width: 520px) { .nav .hide-sm { display: none; } .brand-name { font-size: 15px; } }

/* The stamp: a circular impression, used for the cart count and "Sold" */
.stamp {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 13px; font-weight: 600; line-height: 1;
}
.cart-link { position: relative; display: flex; align-items: center; gap: 8px; color: var(--ink) !important; }
.cart-link .stamp { color: var(--smoke); }
.cart-link.has-items .stamp { background: var(--iron); border-color: var(--iron); color: var(--iron-ink); }
.cart-link.bump .stamp { animation: press 380ms ease-out; }
@keyframes press { 0% { transform: scale(1); } 40% { transform: scale(0.82); } 100% { transform: scale(1); } }

/* Shop intro */
.intro { padding: 40px 0 8px; display: grid; gap: 6px; }
.intro h1 { margin: 0; font-size: clamp(30px, 6vw, 52px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; max-width: 16ch; }
.intro p { margin: 0; color: var(--smoke); max-width: 52ch; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 24px 0 20px; align-items: center; }
.chip {
  border: 1px solid var(--slip); background: transparent; border-radius: 999px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; min-height: 36px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters .count { margin-left: auto; color: var(--smoke); font-size: 14px; }
.toggle { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--smoke); cursor: pointer; }
.toggle input { accent-color: var(--ink); width: 16px; height: 16px; }

/* Grid */
.grid {
  display: grid; gap: 28px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-bottom: 64px;
}
@media (min-width: 760px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.piece { text-decoration: none; display: grid; gap: 10px; }
.piece-img { position: relative; aspect-ratio: 3 / 4; background: var(--slip); border-radius: var(--radius-img); overflow: hidden; }
.piece-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity 250ms; }
.piece-img img + img { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) { .piece:hover .piece-img img + img { opacity: 1; } }
.piece-meta { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.piece-name { font-weight: 500; }
.piece-detail { color: var(--smoke); font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.piece.is-sold .piece-img img { filter: grayscale(0.6); opacity: 0.55; }
.piece.is-sold .price { color: var(--smoke); text-decoration: line-through; }

.sold-mark {
  position: absolute; top: 12px; right: 12px;
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--iron); color: var(--iron);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: 0.06em;
  transform: rotate(-12deg);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}
.sold-mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid currentColor; opacity: 0.6; }
.hold-mark { position: absolute; left: 10px; bottom: 10px; background: var(--paper); color: var(--ink); font-size: 12px; padding: 4px 9px; border-radius: 999px; }

/* Product page */
.detail { display: grid; gap: 28px; padding: 24px 0 72px; }
@media (min-width: 900px) { .detail { grid-template-columns: 1.25fr 1fr; gap: 56px; padding-top: 40px; align-items: start; } }
.gallery { display: grid; gap: 10px; }
.gallery-main {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0;
  scrollbar-width: none; border-radius: var(--radius-img); background: var(--slip);
}
.gallery-main::-webkit-scrollbar { display: none; }
.gallery-main img { flex: 0 0 100%; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; scroll-snap-align: start; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumbs button { padding: 0; border: 1px solid transparent; background: none; border-radius: var(--radius-img); cursor: pointer; flex: 0 0 auto; }
.thumbs button[aria-current="true"] { border-color: var(--ink); }
.thumbs img { width: 60px; height: 80px; object-fit: cover; border-radius: var(--radius-img); }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--slip); }
.dots span.on { background: var(--ink); }
@media (min-width: 900px) { .dots { display: none; } }
@media (max-width: 899px) { .thumbs { display: none; } }

.info { display: grid; gap: 18px; }
@media (min-width: 900px) { .info { position: sticky; top: 96px; } }
.info h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.info .price { font-size: 22px; }
.info .desc { margin: 0; color: var(--ink); max-width: 46ch; white-space: pre-line; }
.oneoff { display: flex; gap: 12px; align-items: center; color: var(--smoke); font-size: 14px; }
.oneoff .stamp { flex: 0 0 auto; color: var(--iron); width: 34px; height: 34px; font-size: 12px; }
.notes { border-top: 1px solid var(--slip); padding-top: 16px; display: grid; gap: 10px; color: var(--smoke); font-size: 14px; }
.notes p { margin: 0; }

.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 16px; cursor: pointer; text-decoration: none; width: 100%;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
@media (min-width: 900px) { .btn { width: auto; min-width: 240px; } }
.back { display: inline-flex; gap: 6px; color: var(--smoke); text-decoration: none; font-size: 14px; padding-top: 20px; }

/* Cart */
.page { padding: 32px 0 80px; max-width: 720px; }
.page h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 24px; }
.cart-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--slip); }
.cart-row { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--slip); align-items: center; }
.cart-row img { width: 76px; height: 100px; object-fit: cover; border-radius: var(--radius-img); }
.cart-row .piece-detail { -webkit-line-clamp: 1; }
.cart-row .row-side { display: grid; justify-items: end; gap: 6px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--smoke); text-decoration: underline; cursor: pointer; font-size: 14px; }
.cart-total { display: flex; justify-content: space-between; padding: 20px 0 6px; font-size: 18px; font-weight: 500; }
.fine { color: var(--smoke); font-size: 14px; margin: 0 0 20px; }
.notice { border: 1px solid var(--iron); color: var(--ink); padding: 12px 14px; border-radius: 6px; margin: 0 0 20px; font-size: 15px; }
.empty { display: grid; gap: 16px; justify-items: start; color: var(--smoke); }

/* Prose pages */
.prose { display: grid; gap: 20px; }
.prose p { margin: 0; max-width: 60ch; font-size: 18px; line-height: 1.6; }
.about-grid { display: grid; gap: 28px; padding: 32px 0 80px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; } }
.about-grid img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; border-radius: var(--radius-img); background: var(--slip); }
.markets { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--slip); }
.markets li { display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--slip); }
.markets .when { color: var(--smoke); font-variant-numeric: tabular-nums; }

/* Footer */
.site-foot { border-top: 1px solid var(--slip); padding: 28px 0 40px; color: var(--smoke); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-foot a { color: var(--smoke); }

/* Loading */
.skeleton .piece-img { animation: pulse 1.4s ease-in-out infinite; }
.skeleton .bar { height: 12px; background: var(--slip); border-radius: 3px; width: 70%; }
@keyframes pulse { 50% { opacity: 0.55; } }
.error { padding: 40px 0; display: grid; gap: 12px; justify-items: start; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Programmatic focus on route change should not draw a box */
#app:focus { outline: none; }
