/*
  Ovnayim Studio (demo) - art direction
  Scene:   a dark kiln room at night, one warm lamp over the wheel.
  Palette: soot brown ground, lamp cream for text, wet clay as the only accent.
           Glaze colours appear only on the swatches and the vase itself.
  Type:    Frank Ruhl Libre (display, Hebrew + Latin) and Assistant (text).
  Shape:   square corners, hairline rules. Nothing rounded except the swatches,
           which are glaze test tiles.
*/

:root {
  --soot: #120d0a;
  --soot-2: #1c1511;
  --line: rgba(241, 230, 214, 0.16);
  --cream: #f1e6d6;
  --cream-dim: #b9a995;
  --clay: #c8946b;
  --lamp: rgba(243, 197, 140, 0.2);
  --display: 'Frank Ruhl Libre', 'Times New Roman', serif;
  --text: 'Assistant', system-ui, sans-serif;
  --gutter: clamp(1rem, 4vw, 3rem);
}

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

html { background: var(--soot); color-scheme: dark; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--soot);
  color: var(--cream);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, p { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}

/* Demo ribbon: always in view */
.ribbon {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 0.4rem var(--gutter);
  background: var(--cream);
  color: var(--soot);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem var(--gutter) 0;
}

.brand {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--cream-dim);
}
.brand strong { color: var(--cream); font-weight: 700; }

.lang {
  font-size: 0.9375rem;
  color: var(--cream-dim);
  text-underline-offset: 0.3em;
  padding: 0.5rem 0;
}
.lang:hover { color: var(--cream); }

/* The stage */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.5rem var(--gutter) 3rem;
  background: radial-gradient(70% 46% at 50% 44%, var(--lamp), transparent 72%);
}

.copy { text-align: center; }

h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hint {
  margin: 1rem auto 0;
  max-width: 34ch;
  color: var(--cream-dim);
}

.wheel-wrap {
  position: relative;
  height: min(56svh, 30rem);
  min-height: 19rem;
}

#wheel {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.9s ease;
}
#wheel.is-ready { opacity: 1; }
#wheel.is-shaping { cursor: grabbing; }
#wheel[hidden] { display: none; }

.key-marker {
  position: absolute;
  inset-inline: 12% 12%;
  block-size: 0;
  border-top: 1px dashed var(--cream);
  opacity: 0.7;
  pointer-events: none;
}
.key-marker[hidden] { display: none; }

.fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 2rem;
  border: 1px solid var(--line);
  color: var(--cream-dim);
  text-align: center;
}
.fallback[hidden] { display: none; }

.controls {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  text-align: center;
}

.shape { color: var(--cream-dim); }
.shape strong {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cream);
  margin-inline-start: 0.35em;
}

.glazes {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.glazes legend {
  padding: 0;
  margin: 0 auto 0.75rem;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
}

.swatches {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.swatches button {
  position: relative;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 34%),
    var(--glaze);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.swatches button span {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.swatches button:hover { transform: translateY(-2px); }
.swatches button[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--soot), 0 0 0 4px var(--cream);
}
[data-glaze='celadon'] { --glaze: #9fc4b0; }
[data-glaze='cobalt'] { --glaze: #27408f; }
[data-glaze='terracotta'] { --glaze: #c2643f; }
[data-glaze='oatmeal'] { --glaze: #d9cbb0; }
[data-glaze='ink'] { --glaze: #22222a; }

.glaze-name {
  margin-top: 0.75rem;
  min-height: 1.55em;
  color: var(--cream-dim);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--cream);
  border-radius: 0;
  font: 600 1rem var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-main { background: var(--cream); color: var(--soot); }
.btn-main:hover { background: var(--clay); border-color: var(--clay); }
.btn-quiet { background: transparent; color: var(--cream); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--cream); }

/* Workshop facts */
.facts {
  display: grid;
  gap: 0;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
}
.facts article {
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.facts .num {
  font-family: var(--display);
  color: var(--clay);
  font-size: 0.9375rem;
  letter-spacing: 0.1em;
}
.facts h2 {
  margin: 0.4rem 0 0.5rem;
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
}
.facts article > p:last-child { color: var(--cream-dim); max-width: 36ch; }

.foot {
  display: grid;
  gap: 1.5rem;
  justify-items: center;
  padding: 4rem var(--gutter) 5rem;
  text-align: center;
}
.foot p {
  font-family: var(--display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.2;
  max-width: 22ch;
  text-wrap: balance;
}

/* Booking sheet */
dialog {
  width: min(30rem, calc(100vw - 2rem));
  padding: 2rem;
  border: 1px solid var(--line);
  background: var(--soot-2);
  color: var(--cream);
}
dialog::backdrop { background: rgba(8, 5, 3, 0.72); }
dialog h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1.2;
}
.bubble {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: var(--cream);
  color: var(--soot);
  white-space: pre-line;
  text-align: start;
}
.date {
  display: grid;
  gap: 0.4rem;
  color: var(--cream-dim);
  font-size: 0.9375rem;
}
.date input {
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--soot);
  color: var(--cream);
  font: inherit;
}
.note { margin: 1.25rem 0 1.5rem; color: var(--cream-dim); }
dialog .actions { justify-content: flex-start; }

/* Wide screens: copy on one side, wheel in the middle, controls on the other */
@media (min-width: 62rem) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(24rem, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    min-height: calc(100svh - 7.5rem);
    padding-block: 1rem 2rem;
  }
  .copy { text-align: start; }
  h1 { font-size: clamp(3.25rem, 5.4vw, 6rem); }
  .hint { margin-inline: 0; }
  .wheel-wrap { height: min(74svh, 44rem); }
  .controls { justify-items: start; text-align: start; }
  .glazes legend { margin-inline: 0; }
  .swatches, .actions { justify-content: flex-start; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts article {
    padding-block: 2.5rem 3rem;
    padding-inline: 0 2rem;
    border-bottom: 0;
  }
  .facts article + article {
    padding-inline-start: 2rem;
    border-inline-start: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  #wheel { transition: none; }
  .swatches button, .btn { transition: none; }
  .swatches button:hover { transform: none; }
}
