@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,400..800,0..100,0..1;1,9..144,400..800,0..100,0..1&family=Karla:ital,wght@0,400..700;1,400..600&display=swap");

/* ==========================================================================
   Terra & Ton — "Twenty on the shelf"
   ========================================================================== */

:root {
  /* colour */
  --oat: #EADFC8;
  --oat-light: #F6EEDD;
  --terracotta: #C2643F;
  --kiln: #9C4A2B;
  --clay-pink: #E4B3A2;
  --charcoal: #2F2B29;
  --estuary: #5E7F7A;
  --clay-raw: #D9A47E;
  --ink-soft: #5A514B;
  --white: #FFFFFF;

  /* type */
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Karla", "Segoe UI", system-ui, sans-serif;
  --step--1: clamp(0.84rem, 0.8rem + 0.2vw, 0.94rem);
  --step-0: clamp(1rem, 0.96rem + 0.22vw, 1.13rem);
  --step-1: clamp(1.18rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.38rem, 1.22rem + 0.8vw, 1.85rem);
  --step-3: clamp(1.7rem, 1.4rem + 1.4vw, 2.5rem);
  --step-4: clamp(2rem, 1.55rem + 2.2vw, 3.3rem);
  --step-5: clamp(2.35rem, 1.6rem + 3.8vw, 4.9rem);

  /* space */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-s: 0.85rem;
  --space-m: 1.25rem;
  --space-l: 2rem;
  --space-xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);
  --space-2xl: clamp(3.5rem, 2.5rem + 5vw, 7rem);

  /* shape */
  --wobble: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --wobble-2: 18px 225px 18px 255px / 255px 18px 225px 18px;
  --wobble-soft: 2.2rem 1.4rem 2.6rem 1.2rem / 1.3rem 2.4rem 1.5rem 2.6rem;
  --blob: 58% 42% 55% 45% / 47% 56% 44% 53%;
  --line: 2px solid var(--charcoal);
  --pencil: 3px 4px 0 var(--charcoal);

  --wrap: 72rem;
  --measure: 62ch;
}

/* ---------- base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--charcoal);
  background-color: var(--oat);
  /* stoneware speckle */
  background-image:
    radial-gradient(circle at 30% 40%, rgba(47, 43, 41, 0.09) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 20%, rgba(156, 74, 43, 0.08) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 50% 80%, rgba(47, 43, 41, 0.06) 0 0.8px, transparent 1.4px);
  background-size: 23px 29px, 41px 37px, 17px 19px;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-s);
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}
h1 { font-size: var(--step-5); font-weight: 700; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 var(--space-m); max-width: var(--measure); overflow-wrap: break-word; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--charcoal); }

a { color: var(--kiln); text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-style: wavy; text-decoration-skip-ink: auto; }
a:hover { color: var(--charcoal); }

:focus-visible {
  outline: 3px solid var(--kiln);
  outline-offset: 3px;
  border-radius: 6px;
}

ul, ol { padding-left: 1.2em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: var(--space-xs) var(--space-m);
  background: var(--charcoal);
  color: var(--oat-light);
  border-radius: var(--wobble);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- header & nav ---------- */

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: var(--line);
  border-bottom-left-radius: 50% 6px;
  border-bottom-right-radius: 50% 10px;
  background: var(--oat);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding-block: var(--space-s);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--charcoal);
  text-decoration: none;
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1;
  white-space: nowrap;
}
.brand svg { width: 2.4rem; height: 2.4rem; flex: none; }
.brand__amp { color: var(--kiln); font-style: italic; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.55rem 0.95rem;
  font: 700 var(--step--1) / 1 var(--font-body);
  color: var(--charcoal);
  background: var(--oat-light);
  border: var(--line);
  border-radius: var(--wobble);
  cursor: pointer;
  white-space: nowrap;
}
.nav-toggle__bars { display: inline-block; width: 1.1rem; height: 2px; background: var(--charcoal); position: relative; border-radius: 2px; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: var(--charcoal); border-radius: 2px; }
.nav-toggle__bars::before { top: -6px; transform: rotate(-2deg); }
.nav-toggle__bars::after { top: 6px; width: 80%; transform: rotate(3deg); }

#site-nav {
  display: none;
  position: absolute;
  left: 1rem; right: 1rem; top: calc(100% + 0.5rem);
  padding: var(--space-m);
  background: var(--oat-light);
  border: var(--line);
  border-radius: var(--wobble-soft);
}
#site-nav[data-open="true"] { display: block; }

.nav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2xs); }
.nav__list a {
  display: block;
  padding: 0.55rem 0.8rem;
  color: var(--charcoal);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--wobble);
}
.nav__list a:hover { background: var(--clay-pink); }
.nav__list a[aria-current="page"] { background: var(--clay-pink); box-shadow: inset 0 0 0 2px var(--charcoal); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.8rem 1.4rem;
  font: 700 var(--step-0) / 1.1 var(--font-body);
  color: var(--white);
  background: var(--kiln);
  border: var(--line);
  border-radius: var(--wobble);
  box-shadow: var(--pencil);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { color: var(--white); background: var(--charcoal); transform: translate(-1px, -1px) rotate(-0.6deg); box-shadow: 5px 6px 0 var(--terracotta); }
.btn:active { transform: translate(2px, 3px); box-shadow: 0 0 0 var(--charcoal); }
.btn--ghost { color: var(--charcoal); background: var(--oat-light); }
.btn--ghost:hover { color: var(--charcoal); background: var(--clay-pink); }
.btn--small { padding: 0.5rem 0.9rem; font-size: var(--step--1); }
.btn--wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-m); margin-top: var(--space-l); }

/* ---------- sections ---------- */

.section { padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-xl); }
.section__head { margin-bottom: var(--space-l); max-width: 40rem; }
.section__head p { color: var(--ink-soft); }

/* hand-drawn wavy divider (inline SVG with class .squiggle) */
.squiggle { width: 100%; height: 22px; color: var(--charcoal); }
.squiggle path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- hero ---------- */

.hero { padding-block: var(--space-xl) var(--space-2xl); }
.hero__grid { display: grid; gap: var(--space-l); align-items: center; }
.hero__text p { max-width: 36rem; }
.hero__art { position: relative; }
.hero__art::before {
  content: "";
  position: absolute;
  inset: 6% 4% 14% 8%;
  background: var(--clay-pink);
  border-radius: var(--blob);
  z-index: -1;
}
.hero__art svg { width: 100%; height: auto; }

/* ---------- illustration strokes ---------- */

.ink { fill: none; stroke: var(--charcoal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ink--thin { stroke-width: 1.6; }
.ink--fill { stroke: none; }
.glaze-estuary { fill: var(--estuary); }
.glaze-oat { fill: var(--oat-light); }
.glaze-pink { fill: var(--clay-pink); }
.glaze-terracotta { fill: var(--terracotta); }
.glaze-charcoal { fill: var(--charcoal); }
.clay { fill: var(--clay-raw); }
.shelf-plank { fill: var(--kiln); }

/* ---------- batch tally ---------- */

.batch__grid { display: grid; gap: var(--space-l); align-items: center; }
.tally {
  padding: var(--space-l) var(--space-m);
  background: var(--oat-light);
  border: var(--line);
  border-radius: var(--wobble-soft);
  transform: rotate(-1deg);
}
.tally svg { width: 100%; height: auto; }
.tally path { fill: none; stroke: var(--charcoal); stroke-width: 3; stroke-linecap: round; }
.tally path.tally__strike { stroke: var(--kiln); stroke-width: 3.5; }
.tally figcaption {
  margin-top: var(--space-s);
  font-family: var(--font-head);
  font-style: italic;
  font-size: var(--step-1);
  text-align: center;
}

/* ---------- shelf & pieces ---------- */

.shelf {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl) var(--space-l);
  list-style: none;
  margin: 0;
  padding: 0;
}
.piece {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-m);
}
.piece__art {
  position: relative;
  padding: var(--space-m) var(--space-m) 0;
  border-bottom: 5px solid var(--kiln);
  border-bottom-left-radius: 40% 6px;
  border-bottom-right-radius: 60% 9px;
}
.piece__art svg { width: 100%; max-width: 15rem; height: auto; margin-inline: auto; }
.piece__body { padding-top: var(--space-m); display: grid; gap: var(--space-2xs); }
.piece__name { font-size: var(--step-2); margin: 0; }
.piece__name a { color: var(--charcoal); text-decoration: none; }
.piece__name a:hover { text-decoration: underline wavy var(--kiln); }
.piece__glaze { margin: 0; color: var(--ink-soft); font-size: var(--step--1); }
.piece__text { margin: var(--space-2xs) 0 0; font-size: var(--step--1); }
.price { font-family: var(--font-head); font-weight: 700; font-size: var(--step-1); color: var(--kiln); margin: 0; }

.badge {
  position: absolute;
  top: 0; right: 0.5rem;
  display: grid;
  place-items: center;
  width: 4.6rem; height: 4.6rem;
  padding: 0.4rem;
  font: 700 0.72rem / 1.1 var(--font-body);
  text-align: center;
  color: var(--charcoal);
  background: var(--clay-pink);
  border: var(--line);
  border-radius: var(--blob);
  transform: rotate(8deg);
}
.badge--inline { position: static; transform: rotate(-3deg); width: auto; height: auto; padding: 0.35rem 0.8rem; border-radius: var(--wobble); display: inline-block; }
.made-to-order {
  margin: 0;
  font-family: var(--font-head);
  font-style: italic;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.made-to-order::before { content: "~ "; color: var(--kiln); }

/* ---------- process thread ---------- */

.thread { position: relative; display: grid; gap: var(--space-l); list-style: none; margin: 0; padding: 0; }
.stage {
  position: relative;
  padding: var(--space-m) var(--space-m) var(--space-m) 4.2rem;
}
.stage__mark {
  position: absolute;
  left: 0; top: var(--space-m);
  width: 3.2rem; height: 3.2rem;
}
.stage__mark svg { width: 100%; height: 100%; }
.stage h3 { margin-bottom: var(--space-2xs); }
.stage p { font-size: var(--step--1); margin: 0; color: var(--ink-soft); }
.stage--wide { padding-left: 0; display: grid; gap: var(--space-l); align-items: center; }

/* ---------- parcel label ---------- */

.label {
  position: relative;
  max-width: 52rem;
  margin-inline: auto;
  padding: var(--space-xl) var(--space-l) var(--space-l);
  background: var(--oat-light);
  border: var(--line);
  border-radius: var(--wobble-soft);
  transform: rotate(0.6deg);
}
.label::before {
  content: "";
  position: absolute;
  top: 1.1rem; left: 50%;
  width: 1.2rem; height: 1.2rem;
  margin-left: -0.6rem;
  border: var(--line);
  border-radius: 50%;
  background: var(--oat);
}
.label h2 { text-align: center; margin-top: var(--space-s); }
.label__list { list-style: none; margin: var(--space-l) 0 0; padding: 0; display: grid; gap: var(--space-m); }
.label__list li {
  padding: var(--space-s) 0 var(--space-s);
  border-top: 2px dashed var(--charcoal);
}
.label__list strong { display: block; font-family: var(--font-head); font-size: var(--step-2); line-height: 1.15; }
.label__list span { color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- studio ---------- */

.studio {
  background: var(--clay-pink);
  border-block: var(--line);
  border-top-left-radius: 50% 18px;
  border-top-right-radius: 50% 10px;
  border-bottom-left-radius: 50% 12px;
  border-bottom-right-radius: 50% 20px;
}
.studio__grid { display: grid; gap: var(--space-l); align-items: start; }
.studio address { font-style: normal; font-size: var(--step-1); line-height: 1.5; }
.studio__facts { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-s); }
.studio__facts li { padding-left: 1.6rem; position: relative; }
.studio__facts li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.8rem; height: 0.8rem; background: var(--kiln); border-radius: var(--blob); }
.studio a { color: var(--charcoal); font-weight: 700; }

/* ---------- inner pages ---------- */

.page-head { padding-block: var(--space-xl) var(--space-l); }
.page-head p { color: var(--ink-soft); }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-3); margin-top: var(--space-xl); }
.prose h3 { margin-top: var(--space-l); }
.prose li { margin-bottom: var(--space-xs); }

/* ---------- product page ---------- */

.product { display: grid; gap: var(--space-xl); align-items: start; }
.product__art { position: relative; padding: var(--space-l); background: var(--oat-light); border: var(--line); border-radius: var(--wobble-soft); }
.product__art svg { width: 100%; height: auto; }
.options { border: 0; padding: 0; margin: 0 0 var(--space-l); }
.options legend { font-family: var(--font-head); font-weight: 600; font-size: var(--step-1); margin-bottom: var(--space-xs); }
.options__row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.option { position: relative; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option span {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--oat-light);
  border: var(--line);
  border-radius: var(--wobble);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.option input:checked + span { background: var(--clay-pink); box-shadow: var(--pencil); }
.option input:focus-visible + span { outline: 3px solid var(--kiln); outline-offset: 3px; }
.swatch { display: inline-block; width: 1.1rem; height: 1.1rem; border: var(--line); border-radius: var(--blob); }
.swatch--estuary { background: var(--estuary); }
.swatch--oat { background: var(--oat); }
.swatch--pink { background: var(--clay-pink); }
.swatch--terracotta { background: var(--terracotta); }
.swatch--charcoal { background: var(--charcoal); }

/* ---------- forms ---------- */

.form { display: grid; gap: var(--space-m); max-width: 36rem; }
.form__field { display: grid; gap: var(--space-2xs); }
.form__field label { font-weight: 700; }
.form__input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  font: inherit;
  color: var(--charcoal);
  background: var(--oat-light);
  border: var(--line);
  border-radius: var(--wobble-2);
}
textarea.form__input { min-height: 9rem; resize: vertical; border-radius: var(--wobble-soft); }
.form__input:focus-visible { outline: 3px solid var(--kiln); outline-offset: 2px; }
.form__field[data-state="error"] .form__input { border-color: var(--kiln); background: #FBE9E2; }
.form__hint { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }
.form__status { margin: 0; min-height: 1.6em; font-weight: 700; }
.form__status[data-state="error"] { color: var(--kiln); }
.form__status[data-state="sent"] { color: var(--estuary); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: var(--space-2xl);
  padding-block: var(--space-xl) var(--space-l);
  background: var(--charcoal);
  color: var(--oat);
  border-top-left-radius: 50% 22px;
  border-top-right-radius: 50% 14px;
}
.site-footer a { color: var(--oat-light); }
.site-footer a:hover { color: var(--clay-pink); }
.site-footer :focus-visible { outline-color: var(--clay-pink); }
.footer__grid { display: grid; gap: var(--space-l); }
.footer__brand { font-family: var(--font-head); font-variation-settings: "SOFT" 100, "WONK" 1; font-size: var(--step-3); font-weight: 700; margin: 0 0 var(--space-xs); line-height: 1; }
.footer__title { font-family: var(--font-head); font-size: var(--step-1); margin: 0 0 var(--space-xs); color: var(--clay-pink); }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2xs); }
.site-footer address { font-style: normal; }
.footer__base { margin-top: var(--space-xl); padding-top: var(--space-m); border-top: 1px dashed rgba(234, 223, 200, 0.4); font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: var(--space-m); justify-content: space-between; }
.footer__base p { margin: 0; }

/* ---------- style guide helpers ---------- */

.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--space-m); list-style: none; padding: 0; margin: 0; }
.sg-swatch { display: grid; gap: var(--space-2xs); font-size: var(--step--1); }
.sg-swatch__chip { height: 5.5rem; border: var(--line); border-radius: var(--blob); }
.sg-swatch__chip--oat { background: var(--oat); }
.sg-swatch__chip--oat-light { background: var(--oat-light); }
.sg-swatch__chip--terracotta { background: var(--terracotta); }
.sg-swatch__chip--kiln { background: var(--kiln); }
.sg-swatch__chip--pink { background: var(--clay-pink); }
.sg-swatch__chip--charcoal { background: var(--charcoal); }
.sg-swatch__chip--estuary { background: var(--estuary); }
.sg-swatch__chip--clay { background: var(--clay-raw); }
.sg-type > * { margin-bottom: var(--space-m); }
.sg-type__meta { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }
.sg-block { padding-block: var(--space-xl); border-bottom: 2px dashed rgba(47, 43, 41, 0.35); }

/* ---------- breakpoints ---------- */

@media (min-width: 480px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .label__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  #site-nav {
    display: block;
    position: static;
    padding: 0;
    background: none;
    border: 0;
  }
  .nav__list { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
  .nav__list a { padding: 0.45rem 0.75rem; }
  .hero__grid { grid-template-columns: 1.05fr 1fr; gap: var(--space-xl); }
  .batch__grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .thread { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio__grid { grid-template-columns: 1.2fr 1fr; }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .product { grid-template-columns: 1fr 1fr; }
  .stage--wide { grid-template-columns: 1fr 1.3fr; }
  .label__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .label__list li { border-top: 0; border-left: 2px dashed var(--charcoal); padding: 0 var(--space-m); }
  .label__list li:first-child { border-left: 0; padding-left: 0; }
}

@media (min-width: 1040px) {
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shelf--five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-l) var(--space-m); }
  .shelf--five .badge { width: 4rem; height: 4rem; font-size: 0.66rem; right: 0; }
  .thread { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .thread::before {
    content: "";
    position: absolute;
    left: 2%; right: 2%; top: 2.6rem;
    height: 14px;
    border-top: 2px dashed var(--kiln);
    border-radius: 50% 50% 0 0 / 14px 14px 0 0;
    z-index: -1;
  }
  .stage { padding: 4.8rem 0 0; }
  .stage__mark { left: 0; top: 0; width: 4rem; height: 4rem; }
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover { transform: none; }
}

@media print {
  .site-header, .site-footer, .nav-toggle { display: none; }
  body { background: var(--white); }
}

/* === inner pages: page-head underline === */

.page-head .squiggle { max-width: 14rem; margin-top: var(--space-xs); color: var(--kiln); }

/* === process: stage art === */

.stage__art {
  position: relative;
  padding: var(--space-l);
  background: var(--oat-light);
  border: var(--line);
  border-radius: var(--wobble-soft);
}
.stage__art::before {
  content: "";
  position: absolute;
  inset: 14% 18% 18% 14%;
  background: var(--clay-pink);
  border-radius: var(--blob);
}
.stage__art svg { position: relative; width: 100%; max-width: 22rem; height: auto; margin-inline: auto; }
.stage--wide p { font-size: var(--step-0); color: var(--charcoal); margin: 0 0 var(--space-m); }

@media (min-width: 760px) {
  .stage--flip { grid-template-columns: 1.3fr 1fr; }
  .stage--flip .stage__art { order: 2; }
}
