/* Umber — concept stoneware studio. Young Serif for display, Hanken Grotesk for text. */
:root {
  --paper: #f3eee6;
  --paper-2: #ebe3d7;
  --tile: #e4dacb;
  --ink: #2a201a;
  --ink-2: #5a4a3e;
  --ink-3: #8b7a6b;
  --line: rgba(42, 32, 26, .16);
  --line-2: rgba(42, 32, 26, .32);
  --clay: #9b4f2a;
  --clay-2: #7c3c1e;
  --kiln: #16100d;
  --kiln-2: #221914;
  --kiln-ink: #efe5d9;
  --kiln-ink-2: #b9a796;
  --ember: #e8793c;
  --serif: "Young Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --pad: clamp(18px, 4vw, 56px);
  --top-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.012em; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* Buttons: quiet, square-edged */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  background: var(--ink); color: var(--paper);
  border: 0; border-radius: 2px;
  padding: .95rem 1.45rem;
  font: 600 .95rem/1 var(--sans); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background .2s;
}
.btn:hover { background: var(--clay-2); }
.btn:disabled { background: var(--ink-3); cursor: not-allowed; }
.btn.wide { width: 100%; }
.link {
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .32em;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.link:hover { color: var(--clay); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--pad);
  background: rgba(243, 238, 230, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; justify-self: start; }
.brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.brand span { font: 400 1.55rem/1 var(--serif); letter-spacing: -.02em; }
.nav { display: flex; gap: clamp(16px, 2.6vw, 38px); }
.nav a { text-decoration: none; font-size: .95rem; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.basket-btn {
  justify-self: end; background: none; border: 1px solid var(--line-2); border-radius: 2px;
  padding: .55rem .9rem; font-size: .92rem; font-weight: 600; cursor: pointer;
  display: inline-flex; gap: .55em; align-items: center;
}
.basket-btn:hover { border-color: var(--ink); }
.count { min-width: 1.5em; padding: 0 .35em; background: var(--ink); color: var(--paper); font-size: .78rem; line-height: 1.5; text-align: center; border-radius: 1px; }
.count.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.35); background: var(--clay); } }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: calc(100svh - var(--top-h));
  padding: 0;
}
.hero-copy {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(36px, 6vw, 88px) var(--pad);
}
.hero h1 { font-size: clamp(3.1rem, 5.9vw, 5.9rem); line-height: .96; letter-spacing: -.03em; max-width: 8.5ch; }
.lede { margin-top: 1.6rem; max-width: 34ch; font-size: 1.12rem; color: var(--ink-2); }
.hero-actions { margin-top: 2.2rem; display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }
.facts { margin: auto 0 0; padding-top: 2.6rem; display: grid; grid-template-columns: repeat(3, auto); gap: 1.6rem; justify-content: start; }
.facts div { border-top: 1px solid var(--line-2); padding-top: .7rem; }
.facts dt { font-size: .8rem; color: var(--ink-3); }
.facts dd { margin: .15rem 0 0; font-size: .95rem; font-weight: 600; }
.hero-img { margin: 0; position: relative; min-height: 420px; }
.hero-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-img figcaption {
  position: absolute; left: 18px; bottom: 16px;
  font-size: .82rem; color: #f6efe6; text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}

/* Section heads: headline left, note right, hairline above */
section { padding: clamp(64px, 9vw, 128px) var(--pad); }
.sec-head {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 2rem 4rem; align-items: end;
  border-top: 1px solid var(--line-2); padding-top: 1.4rem; margin-bottom: clamp(32px, 4.5vw, 60px);
}
.sec-head h2 { font-size: clamp(2.2rem, 4.4vw, 4.1rem); line-height: 1; letter-spacing: -.025em; max-width: 14ch; }
.sec-head p { color: var(--ink-2); max-width: 40ch; }

/* Table builder */
.builder { background: var(--paper); }
.builder-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(300px, 4fr); gap: clamp(20px, 3vw, 44px); align-items: start; }
.stage {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #6b5440;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 30px 60px -40px rgba(42, 32, 26, .6);
  position: sticky; top: calc(var(--top-h) + 20px);
}
.surface {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(var(--zoom, 1));
  transition: opacity .6s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}
.surface[data-surface="b"] { opacity: 0; }
.surface.show { opacity: 1; }
.pieces { position: absolute; inset: 0; }
.piece {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 50%;
  filter: drop-shadow(calc(var(--d) * .35) calc(var(--d) * .55) calc(var(--d) * .55) rgba(28, 18, 10, .34)) drop-shadow(0 0 1px rgba(28, 18, 10, .35));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), filter .5s, opacity .5s,
    left .9s cubic-bezier(.2, .7, .2, 1), top .9s cubic-bezier(.2, .7, .2, 1), width .9s cubic-bezier(.2, .7, .2, 1);
  z-index: var(--z, 1);
}
.piece img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.piece:hover { transform: translate(-50%, -52%) rotate(var(--r, 0deg)) scale(1.015); }
.piece.lift {
  transform: translate(-50%, -56%) rotate(var(--r, 0deg)) scale(1.05);
  filter: drop-shadow(calc(var(--d) * .9) calc(var(--d) * 1.4) calc(var(--d) * 1.3) rgba(28, 18, 10, .24));
}
.piece.enter { opacity: 0; transform: translate(-50%, -64%) rotate(var(--r, 0deg)) scale(1.08); }
.piece:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.toast {
  position: absolute; left: 50%; top: 16px; transform: translate(-50%, -8px);
  background: rgba(22, 16, 13, .86); color: #f4ebe0; font-size: .88rem; padding: .5rem .85rem; border-radius: 2px;
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.scale-note { position: absolute; right: 12px; bottom: 10px; font-size: .74rem; color: rgba(255, 250, 244, .82); text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }

.controls { display: grid; gap: 1.6rem; }
.ctl { border: 0; padding: 0; margin: 0; min-width: 0; }
.ctl legend { font: 400 1.2rem/1.2 var(--serif); padding: 0; margin-bottom: .75rem; }
.surfaces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.surface-opt { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.surface-opt img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; outline: 1px solid var(--line); transition: outline-color .2s; }
.surface-opt span { display: block; margin-top: .4rem; font-size: .86rem; color: var(--ink-2); }
.surface-opt[aria-pressed="true"] img { outline: 2px solid var(--ink); outline-offset: 3px; }
.surface-opt[aria-pressed="true"] span { color: var(--ink); font-weight: 600; }

.seg { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line-2); border-radius: 2px; }
.seg button { background: none; border: 0; width: 64px; height: 44px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.matrix { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 40px); column-gap: 8px; row-gap: 4px; align-items: center; }
.mx-head { font-size: .72rem; color: var(--ink-3); text-align: center; padding-bottom: 2px; }
.mx-head:first-child { text-align: left; }
.mx-piece { display: flex; align-items: center; gap: .6rem; min-height: 48px; cursor: pointer; }
.mx-piece input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.mx-piece b { font-weight: 600; font-size: .95rem; display: block; line-height: 1.2; }
.mx-piece small { color: var(--ink-3); font-size: .8rem; }
.swatch { position: relative; width: 40px; height: 40px; cursor: pointer; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch span { position: absolute; inset: 5px; background-size: cover; background-position: center; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: inset .2s; }
.swatch input:checked + span { inset: 2px; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.swatch input:focus-visible + span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--clay); }
.mx-row-off { opacity: .4; }
.all-glaze { margin-top: .8rem; font-size: .88rem; color: var(--ink-3); }
.all-glaze button { background: none; border: 0; padding: 0 .1em; margin: 0 .25em; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; cursor: pointer; }
.all-glaze button:hover { color: var(--clay); }

.summary { border-top: 1px solid var(--line-2); padding-top: 1rem; display: grid; gap: .5rem; }
.sum-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; color: var(--ink-2); }
.sum-line.disc { color: var(--clay); }
.sum-line[hidden] { display: none; }
.sum-line.total { color: var(--ink); font: 400 1.6rem/1.2 var(--serif); padding: .3rem 0 .6rem; }
.fine { font-size: .82rem; color: var(--ink-3); }

/* Glazes */
.glazes { background: var(--paper-2); }
.glaze-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.glaze figure { margin: 0; overflow: hidden; aspect-ratio: 4 / 5; background: var(--tile); }
.glaze figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.glaze:hover figure img { transform: scale(1.06); }
.glaze h3 { font-size: 1.9rem; margin-top: 1rem; }
.glaze-meta { font-size: .82rem; color: var(--ink-3); margin-top: .2rem; }
.glaze p.txt { margin-top: .7rem; color: var(--ink-2); font-size: .97rem; }
.glaze .link { margin-top: .9rem; font-size: .92rem; }

/* Kiln: the one dark band on the page */
.kiln { background: var(--kiln); color: var(--kiln-ink); }
.kiln .sec-head { border-top-color: rgba(239, 229, 217, .25); }
.kiln .sec-head p { color: var(--kiln-ink-2); }
.steps-wrap { position: relative; }
.steps {
  list-style: none; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 8px;
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 24vw, 330px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.step { scroll-snap-align: start; }
.step figure { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--kiln-2); }
.step img { width: 100%; height: 100%; object-fit: cover; }
.step .day { display: block; margin-top: .9rem; font-size: .8rem; color: var(--ember); font-weight: 600; }
.step h3 { font-size: 1.5rem; margin-top: .15rem; }
.step p { color: var(--kiln-ink-2); font-size: .95rem; margin-top: .4rem; }
.steps-nav { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.steps-nav button { width: 46px; height: 46px; background: none; border: 1px solid rgba(239, 229, 217, .3); color: var(--kiln-ink); border-radius: 2px; cursor: pointer; font-size: 1.1rem; }
.steps-nav button:hover { border-color: var(--kiln-ink); }

.curve { margin-top: clamp(56px, 7vw, 96px); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 2rem 4rem; align-items: center; }
.curve-copy h3 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
.readout { margin-top: 1.2rem; min-height: 8.5em; color: var(--kiln-ink-2); }
.readout b { display: block; font: 400 2.6rem/1.1 var(--serif); color: var(--kiln-ink); margin-bottom: .35rem; }
.readout strong { color: var(--ember); font-weight: 600; }
.hint { font-size: .82rem; color: rgba(185, 167, 150, .7); margin-top: .6rem; }
.curve-chart svg { width: 100%; height: auto; display: block; touch-action: none; cursor: crosshair; overflow: visible; }
.curve-chart .grid line { stroke: rgba(239, 229, 217, .1); }
.curve-chart .axis text { fill: rgba(185, 167, 150, .75); font: 500 13px var(--sans); }
.curve-chart .band rect { fill: rgba(239, 229, 217, .035); }
.curve-chart .band.on rect { fill: rgba(232, 121, 60, .12); }
.curve-chart .band text { fill: rgba(185, 167, 150, .7); font: 500 12px var(--sans); }
.curve-chart .band.on text { fill: var(--ember); }
.curve-chart .line { fill: none; stroke: var(--ember); stroke-width: 2.5; stroke-linejoin: round; }
.curve-chart .area { fill: url(#heat); }
.curve-chart .cursor line { stroke: rgba(239, 229, 217, .55); stroke-dasharray: 3 4; }
.curve-chart .cursor circle { fill: var(--kiln); stroke: var(--ember); stroke-width: 3; }

/* Shop */
.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.product .tile {
  position: relative; aspect-ratio: 1; background: var(--tile); display: grid; place-items: center; overflow: hidden;
}
.product .tile img {
  width: var(--pw, 72%); aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(10px 16px 14px rgba(42, 32, 26, .28));
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .25s;
}
.product:hover .tile img { transform: rotate(-8deg) scale(1.03); }
.product .tile img.fade { opacity: 0; }
.product h3 { font-size: 1.45rem; margin-top: 1rem; }
.product .spec { font-size: .84rem; color: var(--ink-3); margin-top: .15rem; }
.product .row { display: flex; align-items: center; justify-content: space-between; margin-top: .8rem; gap: .8rem; }
.product .price { font-weight: 600; }
.product .swatches { display: flex; gap: 4px; margin-top: .8rem; }
.product .swatches .swatch { width: 34px; height: 34px; }
.product .glaze-name { font-size: .84rem; color: var(--ink-2); margin-top: .35rem; }
.add-one { background: none; border: 1px solid var(--line-2); border-radius: 2px; padding: .5rem .8rem; font-size: .88rem; font-weight: 600; cursor: pointer; }
.add-one:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* Footer */
.foot {
  padding: 56px var(--pad) 48px; border-top: 1px solid var(--line-2);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2rem 2.4rem; align-items: center;
}
.foot img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.foot-note { max-width: 56ch; color: var(--ink-2); font-size: .92rem; }
.foot-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.foot-nav a { font-size: .92rem; color: var(--ink-2); }

/* Basket drawer */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(22, 16, 13, .42); animation: fade .3s ease; }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(440px, 100%);
  background: var(--paper); display: grid; grid-template-rows: auto 1fr auto auto;
  animation: slide .35s cubic-bezier(.2, .7, .2, 1);
}
.drawer-panel header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-panel h2 { font-size: 1.7rem; }
.x { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 4px 8px; }
.lines { list-style: none; margin: 0; padding: 6px 22px; overflow: auto; }
.lines li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lines .thumb { width: 64px; height: 64px; background: var(--tile); display: grid; place-items: center; }
.lines .thumb img { width: 80%; }
.lines b { display: block; font-weight: 600; font-size: .95rem; }
.lines small { color: var(--ink-3); font-size: .8rem; display: block; line-height: 1.4; }
.qty { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--line-2); background: none; border-radius: 2px; cursor: pointer; line-height: 1; }
.qty span { min-width: 1.6em; text-align: center; font-size: .9rem; }
.line-price { font-weight: 600; font-size: .95rem; }
.empty { padding: 28px 22px; color: var(--ink-3); }
.drawer-panel footer { padding: 18px 22px 24px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(100%); } }

/* Gentle reveal as sections come into view */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .glaze-row, .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder-grid { grid-template-columns: minmax(0, 1fr); }
  .stage { position: relative; top: 0; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem 2.4rem; }
  .controls .summary { grid-column: 1 / -1; }
  .curve { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-img { min-height: 0; aspect-ratio: 4 / 3; order: -1; }
  .hero-copy { padding-top: 34px; }
  .facts { margin-top: 2.2rem; padding-top: 0; }
  .sec-head { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .nav { display: none; }
  .top { grid-template-columns: 1fr auto; }
  .foot { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .controls { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, auto); gap: 1rem 1.4rem; }
  .glaze-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .glaze h3 { font-size: 1.45rem; }
  .glaze p.txt { font-size: .9rem; }
  .products { gap: 14px; }
  .product h3 { font-size: 1.2rem; }
  .product .row { flex-direction: column; align-items: flex-start; }
  .scale-note { display: none; }
  .toast { white-space: normal; text-align: center; width: max-content; max-width: 86%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
