:root {
  color-scheme: light;
  --paper: #f7f4eb;
  --ink: #29221d;
  --soft-ink: #68594d;
  --clay: #974730;
  --line: #d9d0c2;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.5 var(--sans);
}

a { color: inherit; text-underline-offset: .25em; text-decoration-thickness: 1px; }
a:hover { color: var(--clay); }
button { font: inherit; }
img { display: block; }
h1, h2, p, figure { margin: 0; }

.shell { width: min(100% - clamp(2.25rem, 8vw, 9rem), 80rem); margin-inline: auto; }
.top {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font: 1.5rem/1 var(--serif);
  letter-spacing: -.04em;
  white-space: nowrap;
  text-decoration: none;
}
.wordmark em { color: var(--clay); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--clay);
}
.brand-mark i {
  width: .93rem;
  height: .69rem;
  border: 1px solid #f9eedf;
  border-radius: 36% 36% 55% 55% / 16% 16% 85% 85%;
  position: relative;
}
.brand-mark i::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: .24rem;
  border: 1px solid #f9eedf;
  border-radius: 50%;
}
.guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  color: var(--soft-ink);
  font-size: .875rem;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-block: clamp(2.1rem, 4.3vw, 4.15rem) clamp(1.6rem, 3vw, 2.55rem);
}
.eyebrow {
  color: var(--clay);
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .135em;
  text-transform: uppercase;
}
h1 {
  margin-top: .38rem;
  font: 400 clamp(3rem, 6.8vw, 6.45rem)/.99 var(--serif);
  letter-spacing: -.073em;
}
h1 em, h1 span { color: var(--clay); }
.intro-copy {
  max-width: 18.7rem;
  padding-bottom: .24rem;
  color: var(--soft-ink);
  font-size: 1.04rem;
  line-height: 1.6;
}

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.69fr) minmax(22rem, 1fr);
  gap: clamp(.9rem, 2.2vw, 1.9rem);
  align-items: start;
}
.preview {
  min-width: 0;
  overflow: hidden;
  border-radius: 5px;
  outline: 1px solid var(--line);
  outline-offset: -1px;
  background: #eee6d8;
}
.stage {
  isolation: isolate;
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 1120 / 810;
  background: #bf9c83;
}
.piece {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .34s ease-out;
}
.stage.is-zoomed .piece { transform: scale(1.7); }
.stage-label, .zoom {
  z-index: 1;
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #37281f;
  background: #f8eee0;
  border: 1px solid #aa8972;
  border-radius: 100px;
}
.stage-label {
  top: clamp(.7rem, 2vw, 1.45rem);
  left: clamp(.7rem, 2vw, 1.45rem);
  padding: .46rem .75rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stage-label span {
  width: .5rem;
  aspect-ratio: 1;
  border: 1px solid var(--clay);
  background: var(--clay);
  border-radius: 50%;
}
.zoom {
  right: clamp(.7rem, 2vw, 1.45rem);
  bottom: clamp(.7rem, 2vw, 1.45rem);
  min-height: 3rem;
  padding: .55rem .85rem;
  cursor: pointer;
  font-size: .875rem;
}
.zoom:hover, .zoom[aria-pressed="true"] { background: #fff9ed; border-color: #5e3d2e; }
.lens {
  width: .76rem;
  height: .76rem;
  margin-right: .17rem;
  position: relative;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.lens::before {
  content: "";
  position: absolute;
  width: .34rem;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  left: .51rem;
  top: .6rem;
}
.lens::after {
  content: "";
  position: absolute;
  inset: .27rem .12rem auto;
  border-top: 1px solid currentColor;
}
.preview-error {
  position: absolute;
  inset: auto 1rem 4.5rem;
  padding: .75rem;
  background: var(--paper);
  border-radius: 4px;
}
figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem 1rem;
  flex-wrap: wrap;
  padding: .86rem clamp(.85rem, 2vw, 1.45rem);
}
.pairing { font: 1.16rem/1.3 var(--serif); }
.pairing span { color: var(--clay); padding-inline: .1rem; }
.preview-note { color: var(--soft-ink); font-size: .8125rem; }

.controls {
  min-width: 0;
  background: #fffcf5;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: clamp(1.15rem, 2.25vw, 2rem);
}
fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
legend {
  padding: 0;
  margin-bottom: .77rem;
  font: 400 1.58rem/1.1 var(--serif);
  letter-spacing: -.035em;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
:focus-visible, .choice input:focus-visible + label {
  outline: 2px solid #79412e;
  outline-offset: 3px;
}
.shape-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.shape-grid label {
  display: grid;
  justify-items: center;
  gap: .22rem;
  padding: .58rem .2rem .49rem;
  min-height: 4.25rem;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f9f6ee;
  cursor: pointer;
  font-size: .875rem;
}
.shape-grid label:hover { background: #f2e9dc; }
.shape-grid input:checked + label {
  border-color: var(--clay);
  background: #f3e6db;
  color: #713620;
  font-weight: 700;
}
.glaze-field { margin-top: 1.4rem; }
.palette {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .63rem .35rem;
  text-align: center;
}
.palette label {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .30rem;
  height: 100%;
  min-height: 4rem;
  padding: .15rem .06rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.12;
  hyphens: auto;
  overflow-wrap: break-word;
}
.swatch {
  display: grid;
  place-items: center;
  width: 2.15rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #35291e45;
  background: radial-gradient(ellipse at 36% 30%, #fff5e739, transparent 63%), var(--swatch);
}
.palette label:hover .swatch { outline: 1px solid var(--soft-ink); outline-offset: 2px; }
.palette input:checked + label .swatch { outline: 2px solid var(--clay); outline-offset: 2px; }
.palette input:checked + label { color: #743b26; font-weight: 700; }
.palette input:checked + label .swatch::after {
  content: "";
  width: .65rem;
  height: .35rem;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
  filter: drop-shadow(0 1px 1px #281c14);
}
.maker-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: .2rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #f4eee3;
}
.maker-switch label {
  display: grid;
  place-items: center;
  min-height: 2.5rem;
  border-radius: 100px;
  cursor: pointer;
  font-size: .9rem;
  letter-spacing: .02em;
}
.maker-switch label:hover { background: #ece2d4; }
.maker-switch input:checked + label {
  background: var(--clay);
  color: #fff8ee;
  font-weight: 700;
}
.maker-note { margin: .5rem 0 .85rem; color: var(--soft-ink); font-size: .8125rem; text-align: center; }
.pattern-field { margin-top: 1.4rem; }
.pattern-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.pattern-grid label {
  display: grid;
  justify-items: center;
  gap: .3rem;
  padding: .5rem .1rem .45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f9f6ee;
  cursor: pointer;
  font-size: .8125rem;
}
.pattern-grid label:hover { background: #f2e9dc; }
.pattern-grid input:checked + label { border-color: var(--clay); background: #f3e6db; color: #713620; font-weight: 700; }
.pattern-icon {
  width: 2rem;
  height: 1.6rem;
  border-radius: 3px 3px 9px 9px;
  border: 1px solid #b59a83;
  background-color: #efe3cf;
}
.pattern-icon[data-pattern="bands"] { background-image: linear-gradient(transparent 30%, #5a3524 30% 46%, transparent 46% 58%, #5a3524 58% 64%, transparent 64%); }
.pattern-icon[data-pattern="stripes"] { background-image: repeating-linear-gradient(90deg, transparent 0 .3rem, #5a3524 .3rem .45rem); }
.pattern-icon[data-pattern="dots"] { background-image: radial-gradient(circle, #5a3524 .13rem, transparent .15rem); background-size: .55rem .55rem; background-position: .1rem .15rem; }
.pattern-icon[data-pattern="waves"] { background-image: radial-gradient(circle at 50% 100%, transparent .27rem, #5a3524 .28rem .38rem, transparent .39rem), radial-gradient(circle at 50% 0, transparent .27rem, #5a3524 .28rem .38rem, transparent .39rem); background-size: .75rem .55rem; background-position: 0 .25rem, .375rem .8rem; background-repeat: repeat-x; }
.pattern-note { margin-top: .55rem; color: var(--soft-ink); font-size: .8125rem; }
.guide-links { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.glaze-card {
  background: #f3ecdf;
  border-radius: 4px;
  border-left: 3px solid var(--current, #e2cb77);
  margin-top: 1.28rem;
  padding: .85rem 1rem .76rem;
}
.card-top { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.code {
  padding: .1rem .35rem;
  border: 1px solid #d6c9b7;
  border-radius: 3px;
  color: #675749;
  font-size: .75rem;
  white-space: nowrap;
}
.glaze-card h2 { margin-top: .24rem; font: 400 1.57rem/1.1 var(--serif); letter-spacing: -.035em; }
.glaze-card p:not(.eyebrow) { margin-top: .36rem; color: #524337; font-size: .9rem; line-height: 1.48; }
.glaze-card a { display: inline-block; margin-top: .45rem; color: #743b26; font-size: .8125rem; }

.guide {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem clamp(1rem, 2.5vw, 2.6rem);
  border-block: 1px solid var(--line);
  margin-block: 1.8rem 2.3rem;
  padding-block: 1.05rem;
  scroll-margin-top: 1rem;
}
.guide-heading { display: flex; align-items: center; gap: .55rem; }
.asterisk { color: var(--clay); font-size: 1.3rem; line-height: 1; }
.guide h2 { font: 400 1.2rem/1.2 var(--serif); }
.guide p { color: var(--soft-ink); font-size: .875rem; }
.guide a { color: #743b26; font-size: .875rem; }

@media (max-width: 56rem) {
  .intro { align-items: start; flex-direction: column; gap: .85rem; }
  .intro-copy { max-width: 30rem; }
  .studio { grid-template-columns: 1fr; }
  .stage { max-height: 33rem; }
  .guide { grid-template-columns: 1fr; }
}

@media (max-width: 37rem) {
  .top { min-height: 3.8rem; }
  .intro { padding-top: 1.7rem; }
  .preview { position: sticky; z-index: 2; top: 0; }
  .stage { max-height: 38svh; }
  .stage-label { padding: .4rem .6rem; font-size: .65rem; }
  .zoom { font-size: .8rem; }
  figcaption { padding-block: .65rem; }
  .preview-note { display: none; }
}
@media (max-width: 24rem) {
  .palette { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pairing { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .piece { transition: none; }
}
#pottery-3d { position:absolute; inset:0; width:100%; height:100%; touch-action:none; cursor:grab; }
#pottery-3d:active { cursor:grabbing; }
#pottery-3d:focus-visible { outline-offset:-4px; }
#view-controls:not([hidden]) { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem 1rem; padding:.6rem 1rem; background:#f7f2e8; border-bottom:1px solid var(--line); font-size:.85rem; }
#view-controls label { display:flex; align-items:center; gap:.4rem; }
#lamp { width:6.5rem; accent-color:var(--clay); }
#reset-view { margin-left:auto; border:0; padding:.4rem; background:transparent; text-decoration:underline; cursor:pointer; color:var(--clay); }
