/* ============================================================
   KILN — small-batch ceramics
   Warm clay palette, tactile shadows, paper grain.
   ============================================================ */

:root{
  --paper:   #efe6dc;   /* warm clay-slip cream */
  --paper-2: #e7dbcd;   /* slightly deeper card paper */
  --terra:   #9c5b33;   /* terracotta accent — large text only */
  --terra-deep: #7c4426;/* AA-safe accent for small text/links */
  --ink:     #3a2f28;   /* fired-umber ink */
  --ink-soft:#6b5a4e;   /* muted body */
  --line:    rgba(58,47,40,.16);
  --shadow-lg: 0 24px 48px -20px rgba(58,47,40,.35), 0 8px 16px -8px rgba(58,47,40,.18);
  --shadow-sm: 0 10px 24px -12px rgba(58,47,40,.30);
  --ease: cubic-bezier(.23,.9,.28,1);
  --serif: "Lora", Georgia, serif;
  --sans: "Work Sans", system-ui, sans-serif;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior:auto; } }

body{
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* paper grain — pure CSS/SVG, no assets */
body::before{
  content:"";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: .5;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.62 0 0 0 0 0.53 0 0 0 0 0.45 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection{ background: var(--terra); color: var(--paper); }

h1,h2,h3{ font-family: var(--serif); font-weight: 500; line-height: 1.08; }

a{ color: var(--terra-deep); text-underline-offset: 3px; }
a:hover{ color: var(--ink); }

.skip{
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: .5rem 1rem; border-radius: 4px; z-index: 100;
  transition: top .2s;
}
.skip:focus{ top: 1rem; }

:focus-visible{ outline: 2px solid var(--terra-deep); outline-offset: 3px; border-radius: 2px; }

.visually-hidden{
  position:absolute; width:1px; height:1px; overflow:hidden;
  clip:rect(0 0 0 0); white-space:nowrap;
}

/* ============ NAV ============ */
.nav{
  position: fixed; top:0; left:0; right:0; z-index: 20;
  display:flex; align-items:center; gap: 2rem;
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  transition: background .35s, box-shadow .35s;
}
.nav.scrolled{
  background: rgba(239,230,220,.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.wordmark{
  font-family: var(--serif); font-weight: 600;
  font-size: 1.45rem; letter-spacing: .14em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: baseline;
}
.wordmark-o{
  width:.72em; height:.72em; margin: 0 .07em;
  border-radius: 50% 50% 46% 46%;
  background: var(--terra);
  align-self: center;
  position: relative; top:.02em;
}
.nav-links{ display:flex; gap: 1.6rem; margin-left:auto; }
.nav-links a{
  text-decoration:none; color: var(--ink);
  font-size: .92rem; font-weight: 500; letter-spacing: .04em;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover{ border-bottom-color: var(--terra); }
.cart-btn{
  font: 500 .92rem var(--sans); letter-spacing:.04em;
  color: var(--paper); background: var(--ink);
  border: none; border-radius: 999px;
  padding: .55rem 1.1rem; cursor: pointer;
  display:inline-flex; align-items:center; gap:.5rem;
  transition: background .25s, transform .25s var(--ease);
}
.cart-btn:hover{ background: var(--terra-deep); }
.cart-btn.bump{ transform: scale(1.08); }
.cart-count{
  background: var(--paper); color: var(--ink);
  border-radius: 999px; min-width: 1.35em; height: 1.35em;
  display:inline-grid; place-items:center;
  font-size:.8rem; font-weight:600; padding: 0 .3em;
}

/* ============ HERO ============ */
.hero{
  min-height: 100svh;
  display:grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: clamp(5.5rem, 10vh, 7rem) clamp(1.25rem, 4vw, 3rem) 2rem;
  max-width: 1500px; margin-inline:auto;
}
.hero-kicker{
  font-size:.78rem; font-weight:500; letter-spacing:.22em;
  text-transform: uppercase; color: var(--terra-deep);
  margin-bottom: 1.4rem;
}
.hero-title{
  font-size: clamp(2.9rem, 6.6vw, 5.6rem);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1.6rem;
}
.hero-title em, .hero-title .accent{ color: var(--terra); font-style: normal; }
.ht-line{ display:block; overflow:hidden; }
.ht-line span{ display:block; transform: translateY(110%); }
.ht-line:nth-child(3) span{ color: var(--terra); }
body.loaded .ht-line span{ transition: transform 1.1s var(--ease); transform: none; }
body.loaded .ht-line:nth-child(2) span{ transition-delay: .1s; }
body.loaded .ht-line:nth-child(3) span{ transition-delay: .2s; }

.hero-sub{
  color: var(--ink-soft); max-width: 34rem;
  margin-bottom: 2rem;
}
.hero-ctas{ display:flex; flex-wrap:wrap; gap: .9rem; }

.btn{
  font: 500 .95rem var(--sans); letter-spacing:.03em;
  text-decoration:none; cursor:pointer;
  border-radius: 999px; padding: .8rem 1.6rem;
  transition: background .25s, color .25s, transform .2s var(--ease), box-shadow .25s;
  display:inline-block; border: 1px solid var(--ink);
}
.btn-solid{ background: var(--ink); color: var(--paper); }
.btn-solid:hover{ background: var(--terra-deep); border-color: var(--terra-deep); color: var(--paper); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-ghost{ background: transparent; color: var(--ink); }
.btn-ghost:hover{ background: var(--ink); color: var(--paper); }

.hero-stage{ position:relative; height: min(78vh, 720px); min-height: 380px; }
#wheel-canvas{
  width:100%; height:100%; display:block;
  touch-action: pan-y;
}
.hero-caption{
  position:absolute; bottom: .4rem; left:50%; transform: translateX(-50%);
  font-size:.72rem; letter-spacing:.18em; text-transform:uppercase;
  color: var(--ink-soft); white-space: nowrap;
}
@media (max-width:480px){
  .hero-caption{ white-space: normal; text-align:center; max-width: 94vw; line-height:1.6; }
}

/* ============ FIRING STRIP ============ */
.firing-strip{
  display:flex; flex-wrap:wrap; justify-content:center; align-items:center;
  gap: .6rem 1.2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem clamp(1.25rem, 4vw, 3rem);
  font-size: .88rem; letter-spacing:.02em;
  color: var(--ink-soft);
  background: var(--paper-2);
}
.firing-strip strong{ color: var(--terra-deep); font-weight:600; }

/* ============ SECTIONS ============ */
section{ padding: clamp(4rem, 9vw, 7.5rem) clamp(1.25rem, 4vw, 3rem); }
.section-head{ max-width: 1400px; margin: 0 auto 3rem; }
.section-index{
  font-size:.78rem; font-weight:500; letter-spacing:.22em;
  text-transform:uppercase; color: var(--terra-deep);
  margin-bottom: .9rem;
}
.section-title{
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  margin-bottom: 1rem;
}
.section-note{ color: var(--ink-soft); max-width: 40rem; }
.section-note strong{ color: var(--ink); }

/* ============ SHOP GRID — irregular rhythm ============ */
.shop-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.1rem, 2.4vw, 2rem);
  max-width: 1400px; margin: 0 auto;
  align-items: start;
}
.product{
  background: var(--paper-2);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease), box-shadow .45s;
  position: relative;
}
.product:hover{ transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.product.span-5{ grid-column: span 5; }
.product.span-4{ grid-column: span 4; }
.product.span-3{ grid-column: span 3; }
.product.drop-1{ margin-top: 2.6rem; }
.product.drop-2{ margin-top: 5rem; }

.product-stage{ position:relative; }
.product canvas{
  width:100%; display:block; cursor: grab;
  touch-action: pan-y;
  border-radius: 8px;
}
.product canvas:active{ cursor: grabbing; }
.product.tall canvas{ aspect-ratio: 3 / 3.6; }
.product.mid canvas{ aspect-ratio: 3 / 3.1; }
.product.wide canvas{ aspect-ratio: 3 / 2.5; }
.spin-hint{
  position:absolute; top:.55rem; right:.65rem;
  font-size:.66rem; letter-spacing:.14em; text-transform:uppercase;
  color: var(--ink-soft);
  pointer-events:none;
}
.product-name{
  font-size: 1.35rem; margin-top: .9rem;
  display:flex; align-items:baseline; justify-content:space-between; gap:.8rem;
}
.product-price{ font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--terra-deep); white-space:nowrap; }
.product-spec{ font-size:.86rem; color: var(--ink-soft); margin-top:.15rem; }
.product-batch{ font-size:.76rem; letter-spacing:.05em; color: var(--ink-soft); margin-top:.55rem; }
.product-batch .low{ color: var(--terra-deep); font-weight:600; }
.add-btn{
  margin-top: .9rem; width: 100%;
  font: 500 .9rem var(--sans); letter-spacing:.03em;
  border: 1px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  padding: .65rem 1rem; cursor:pointer;
  transition: background .25s, color .25s;
}
.add-btn:hover{ background: var(--ink); color: var(--paper); }
.add-btn.added{ background: var(--terra-deep); border-color: var(--terra-deep); color: var(--paper); }
.add-btn[disabled]{ opacity:.55; cursor: default; }

/* ============ PROCESS ============ */
.process{ background: var(--ink); color: var(--paper); }
.process .section-index{ color: #d9a273; }
.process .section-title{ color: var(--paper); }
.process-list{
  list-style:none;
  display:grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.4rem, 3vw, 2.8rem);
  max-width: 1400px; margin: 0 auto;
  counter-reset: step;
}
.process-step{
  border-top: 1px solid rgba(239,230,220,.22);
  padding-top: 1.4rem;
  counter-increment: step;
}
.process-step::before{
  content: "0" counter(step);
  font-family: var(--serif); font-style: italic;
  color: #d9a273; font-size: .95rem;
  display:block; margin-bottom: .8rem;
}
.ps-icon{ width: 44px; height:44px; color:#d9a273; margin-bottom: .9rem; }
.process-step h3{ font-size: 1.5rem; margin-bottom:.5rem; color: var(--paper); }
.process-step p{ font-size:.95rem; color: #cbbdb0; }

/* ============ STUDIO ============ */
.studio-inner{ max-width: 1400px; margin:0 auto; }
.studio-cols{
  display:grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin: 2.2rem 0 3rem;
  color: var(--ink-soft); max-width: 62rem;
}
.studio-cols strong{ color: var(--terra-deep); }
.studio-facts{
  display:grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem; max-width: 62rem;
  border-top: 1px solid var(--line); padding-top: 1.6rem;
}
.studio-facts dt{
  font-size:.72rem; letter-spacing:.18em; text-transform:uppercase;
  color: var(--ink-soft); margin-bottom:.35rem;
}
.studio-facts dd{ font-family: var(--serif); font-size: 1.15rem; }

/* ============ LETTER ============ */
.letter{ background: var(--paper-2); border-top: 1px solid var(--line); }
.letter-inner{ max-width: 44rem; margin: 0 auto; text-align:center; }
.letter-title{ font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-bottom: .9rem; }
.letter p{ color: var(--ink-soft); }
.letter-form{
  display:flex; gap:.7rem; justify-content:center; flex-wrap:wrap;
  margin-top: 1.8rem;
}
.letter-form input{
  font: 400 1rem var(--sans);
  padding: .8rem 1.2rem; min-width: min(20rem, 70vw);
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink);
}
.letter-form input::placeholder{ color: var(--ink-soft); }
.letter-confirm{ margin-top: 1.1rem; font-family: var(--serif); font-style: italic; color: var(--terra-deep); min-height: 1.5em; }

/* ============ CART DRAWER ============ */
.drawer-scrim{
  position: fixed; inset:0; z-index: 40;
  background: rgba(58,47,40,.4);
  opacity:0; transition: opacity .3s;
}
.drawer-scrim.open{ opacity:1; }
.cart-drawer{
  position: fixed; top:0; right:0; bottom:0; z-index: 50;
  width: min(26rem, 100vw);
  background: var(--paper);
  box-shadow: -18px 0 50px rgba(58,47,40,.25);
  padding: 1.6rem 1.6rem 2rem;
  transform: translateX(102%);
  transition: transform .45s var(--ease);
  display:flex; flex-direction:column;
  overflow-y:auto;
}
.cart-drawer.open{ transform: none; }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:1.2rem; }
.drawer-head h2{ font-size:1.6rem; }
.drawer-close{
  font-size: 1.6rem; line-height:1; border:none; background:none;
  color: var(--ink); cursor:pointer; padding:.2rem .5rem; border-radius:6px;
}
.drawer-close:hover{ color: var(--terra-deep); }
.drawer-empty{ color: var(--ink-soft); font-style: italic; font-family: var(--serif); }
.drawer-list{ list-style:none; flex:1; }
.drawer-item{
  display:flex; justify-content:space-between; align-items:baseline; gap:1rem;
  padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.drawer-item-name{ font-family: var(--serif); font-size:1.05rem; }
.drawer-item-qty{ font-size:.82rem; color: var(--ink-soft); }
.drawer-item-price{ font-weight:600; font-size:.95rem; white-space:nowrap; }
.drawer-remove{
  border:none; background:none; color: var(--ink-soft);
  font-size:.78rem; letter-spacing:.06em; text-transform:uppercase;
  cursor:pointer; text-decoration:underline; text-underline-offset:3px; padding:.2rem;
}
.drawer-remove:hover{ color: var(--terra-deep); }
.drawer-foot{ margin-top:1.4rem; }
.drawer-total{ display:flex; justify-content:space-between; font-size:1.1rem; margin-bottom:.6rem; }
.drawer-fine{ font-size:.8rem; color: var(--ink-soft); margin-bottom: 1rem; }
.drawer-checkout{ width:100%; }
.drawer-confirm{ margin-top: 1rem; font-family: var(--serif); font-style: italic; color: var(--terra-deep); }

/* ============ TOAST ============ */
.toast{
  position: fixed; left:50%; bottom: 1.4rem; z-index: 60;
  transform: translate(-50%, 140%);
  background: var(--ink); color: var(--paper);
  font-size:.92rem; padding:.85rem 1.4rem; border-radius: 999px;
  box-shadow: var(--shadow-lg);
  transition: transform .5s var(--ease);
  max-width: min(34rem, 92vw); text-align:center;
  pointer-events:none;
}
.toast.show{ transform: translate(-50%, 0); }

/* ============ FOOTER ============ */
.footer{
  border-top: 1px solid var(--line);
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem) 3rem;
  display:flex; flex-direction:column; gap:.7rem; align-items:center;
  text-align:center;
}
.footer-mark{ font-family: var(--serif); font-size:1.05rem; }
.footer nav a{ font-size:.9rem; }
.footer-fine{ font-size:.8rem; color: var(--ink-soft); max-width: 40rem; }

/* ============ REVEALS ============ */
.reveal{ opacity:0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in{ opacity:1; transform:none; }

/* ============ GUIDE & 404 ============ */
.guide-body{
  max-width: 46rem; margin: 0 auto;
  padding: 5rem clamp(1.25rem, 5vw, 2.5rem) 5rem;
}
.guide-body .back{ display:inline-block; margin-bottom: 2.5rem; font-size:.9rem; }
.guide-body h1{ font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 1.2rem; }
.guide-body h2{
  font-size: 1.5rem; margin: 2.6rem 0 .8rem;
  padding-top: 1.4rem; border-top: 1px solid var(--line);
}
.guide-body p, .guide-body li{ color: #55463c; }
.guide-body ul, .guide-body ol{ padding-left: 1.3rem; margin: .6rem 0; }
.guide-body li{ margin: .45rem 0; }
.guide-body code{
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size:.86em; background: var(--paper-2);
  padding:.1em .4em; border-radius:4px;
}
.guide-body strong{ color: var(--ink); }

.lost{
  min-height:100svh; display:grid; place-items:center; text-align:center;
  padding: 2rem;
}
.lost svg{ width: min(230px, 55vw); height:auto; margin-bottom: 1.6rem; }
.lost h1{ font-size: clamp(2.2rem, 7vw, 3.6rem); margin-bottom: .9rem; }
.lost p{ color: var(--ink-soft); max-width: 30rem; margin: 0 auto 1.8rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px){
  .shop-grid{ grid-template-columns: repeat(6, 1fr); }
  .product.span-5, .product.span-4, .product.span-3{ grid-column: span 3; }
  .product.drop-2{ margin-top: 2.6rem; }
  .process-list{ grid-template-columns: repeat(2, 1fr); }
  .studio-facts{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px){
  .hero{
    grid-template-columns: 1fr;
    padding-top: 6rem;
    text-align:left;
  }
  .hero-stage{ height: min(52vh, 460px); min-height: 320px; order: -1; margin-top: 1rem; }
  .studio-cols{ grid-template-columns: 1fr; }
}
@media (max-width: 620px){
  .nav-links{ display:none; }
  .shop-grid{ grid-template-columns: 1fr; }
  .product.span-5, .product.span-4, .product.span-3{ grid-column: 1 / -1; }
  .product.drop-1, .product.drop-2{ margin-top: 0; }
  .process-list{ grid-template-columns: 1fr; }
  .hero-title{ font-size: clamp(2.5rem, 11.5vw, 3.4rem); }
  .firing-strip{ flex-direction: column; gap:.25rem; text-align:center; }
  .firing-strip span[aria-hidden]{ display:none; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
  .reveal{ opacity:1; transform:none; }
  .ht-line span{ transform:none; }
  .product:hover{ transform:none; }
}
