:root {
  --bg: #f3ece4;
  --bg-2: #fbf7f2;
  --fg: #2a211b;
  --muted: #6b5b4f;
  --line: #e2d6ca;
  --accent: #9a4520;
  --card: rgba(251, 247, 242, 0.86);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16120f; --bg-2: #201a16; --fg: #efe7df; --muted: #b3a497; --line: #33291f;
    --accent: #e8956a; --card: rgba(32, 26, 22, 0.86);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16120f; --bg-2: #201a16; --fg: #efe7df; --muted: #b3a497; --line: #33291f;
  --accent: #e8956a; --card: rgba(32, 26, 22, 0.86);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; transition: background .3s, color .3s; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 15px var(--sans); letter-spacing: .01em; }
.brand-mark { width: 12px; height: 12px; border-radius: 50% 50% 45% 45%; background: var(--accent); }
.controls { display: flex; align-items: center; gap: 8px; }
.pill { font: 500 13px var(--sans); text-decoration: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); backdrop-filter: blur(8px); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--fg); backdrop-filter: blur(8px); }
.lang-btn { font: 700 12px var(--sans); letter-spacing: .04em; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* The clay: fixed on the right half on wide screens. */
.stage { position: fixed; top: 0; right: 0; width: 56vw; height: 100vh; height: 100svh; z-index: 0; }
.stage canvas { width: 100%; height: 100%; display: block; }
.kiln-glow {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 58%, rgba(255, 122, 42, .5), rgba(255, 90, 20, .12) 38%, transparent 66%);
}
.fallback-jar { display: none; position: absolute; left: 50%; top: 50%; width: 38%; transform: translate(-50%, -50%); }
.no-webgl .stage canvas { display: none; }
.no-webgl .fallback-jar { display: block; }

/* Content: the left column. */
main { position: relative; z-index: 1; width: 44vw; max-width: 620px; padding: 0 clamp(20px, 4vw, 64px); }
.section { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 96px 0; }
.eyebrow { font: 600 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.section h1, .section h2 { font: 400 clamp(38px, 5vw, 64px)/1.02 var(--serif); letter-spacing: -0.015em; margin: 0 0 20px; }
.section h1 { font-size: clamp(54px, 8vw, 104px); }
.lead { font: 400 clamp(22px, 2.4vw, 28px)/1.35 var(--serif); font-style: italic; color: var(--muted); margin: 0 0 18px; }
.section p { margin: 0 0 14px; max-width: 46ch; }
.hint { margin-top: 36px; font: 500 13px var(--sans); color: var(--muted); display: flex; align-items: center; gap: 10px; }
.hint::before { content: ""; width: 1px; height: 36px; background: linear-gradient(var(--accent), transparent); animation: drip 2s ease-in-out infinite; }
@keyframes drip { 0%, 100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* Work */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.piece { margin: 0; }
.piece .photo {
  aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 0%, #e8cdb5, #c99a78 60%, #a87454);
  color: rgba(42, 33, 27, .55);
}
.piece:nth-child(2) .photo { background: radial-gradient(120% 80% at 50% 0%, #d9e3df, #8fb0ac 60%, #4f7f7e); }
.piece:nth-child(3) .photo { background: radial-gradient(120% 80% at 50% 0%, #efe3d3, #d6bfa2 60%, #b0906d); }
.piece .photo img { width: 100%; height: 100%; object-fit: cover; }
.piece .photo svg { width: 40%; opacity: .55; }
.piece figcaption { margin-top: 8px; font: 500 14px var(--sans); }
.piece figcaption small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }

/* Contact */
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg); text-decoration: none; font: 600 15px var(--sans); cursor: pointer; }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn:hover { border-color: var(--accent); }

.footer { position: relative; z-index: 1; width: 44vw; max-width: 620px; padding: 32px clamp(20px, 4vw, 64px) 48px; color: var(--muted); font-size: 14px; }

/* Text eases in as it arrives. */
.section > .card { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.section.in > .card { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section > .card { opacity: 1; transform: none; transition: none; }
  .hint::before { animation: none; }
}

/* Phones and narrow screens: the clay sits in the top part of the screen,
   and each section's text arrives in a card below it - never on top of it. */
@media (max-width: 860px) {
  .stage { width: 100vw; height: 50vh; height: 50svh; }
  main, .footer { width: auto; max-width: none; padding-left: 16px; padding-right: 16px; }
  .section { min-height: 100vh; min-height: 100svh; justify-content: flex-end; padding: 52vh 0 7vh; padding: 52svh 0 7svh; }
  .section > .card { background: var(--card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px; }
  .section h1 { font-size: clamp(46px, 13vw, 64px); }
  .section h2 { font-size: clamp(32px, 9vw, 44px); }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pill { display: none; }
}

/* Order form */
.order-form { display: grid; gap: 14px; margin-top: 18px; max-width: 480px; }
.order-form label { display: grid; gap: 6px; font: 600 14px var(--sans); }
.order-form input:not([type="checkbox"]), .order-form textarea {
  font: 400 16px var(--sans); color: var(--fg); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%;
}
.order-form textarea { resize: vertical; min-height: 96px; }
.order-form input:focus, .order-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.photos-field { display: grid; gap: 8px; }
.photos-field .label { font: 600 14px var(--sans); }
.photos-field { gap: 6px; }
.photos-hint { color: var(--muted); font-size: 14px; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.previews:empty { display: none; }
.previews figure { position: relative; margin: 0; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.previews img { width: 100%; height: 100%; object-fit: cover; }
.previews button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.btn.choose { justify-self: start; font: 600 14px var(--sans); padding: 10px 16px; }
.consent { grid-template-columns: auto 1fr; align-items: start; font-weight: 400 !important; color: var(--muted); }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.order-form .btn.primary { justify-self: start; }
.order-form .btn:disabled { opacity: .6; cursor: progress; }
.order-status { min-height: 1.4em; margin: 0; font-weight: 500; }
.order-status[data-kind="error"] { color: #b3261e; }
.order-status[data-kind="done"] { color: var(--accent); }
:root[data-theme="dark"] .order-status[data-kind="error"] { color: #ff8a80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .order-status[data-kind="error"] { color: #ff8a80; } }

/* The order page: the form in the text column, the finished jar beside it. */
.order-page .section { min-height: 0; padding-top: 110px; }
.order-page .section h1 { font-size: clamp(38px, 5vw, 64px); }
@media (max-width: 860px) {
  .order-page .stage { height: 38vh; height: 38svh; }
  .order-page .section { padding-top: 40vh; padding-top: 40svh; }
}
