/* ============================================================
   LAUREL & LANTERN INN — studio.css (v24, 2026-10-21)
   The easel in the Art Studio: a stretched linen canvas on a walnut
   desk, brushes and colours beside it, coloring pages and art sparks
   above, and a word from Sunny and Pearl after a download.
   Uses only the tokens styles.css defines. The one animation (the
   innkeepers' card easing in) stops with "Still the house" or
   reduced motion.
   ============================================================ */

/* the easel is wider than the room's text column, so the canvas can be a good size */
.studio {
  margin: 64px calc(50% - min(560px, 50vw - 16px)) 0;
  text-align: left;
}
.studio h2 { text-align: center; }
.as-lede { text-align: center; color: var(--parchment-dim); font-size: 1.15rem; max-width: 620px; margin: -12px auto 16px; }
.as-private {
  max-width: 640px; margin: 0 auto 26px; padding: 14px 18px;
  font-size: 0.98rem; color: var(--parchment-dim); text-align: center;
  border: 1px solid var(--parchment-faint); border-radius: 12px; background: rgba(12, 0, 13, 0.4);
}
.as-private strong { color: var(--parchment); font-weight: 600; }
.as[hidden] { display: none; }

.as-label {
  font-family: var(--serif-caps); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--copper); margin: 0 0 8px;
}

/* ---------- buttons ---------- */
.as-btn {
  font-family: var(--serif-caps); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--parchment); background: rgba(12, 0, 13, 0.5);
  border: 1px solid var(--parchment-faint); border-radius: 999px;
  padding: 10px 16px; min-height: 40px; cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.as-btn:hover, .as-btn:focus-visible { border-color: var(--amber); color: var(--amber); }
.as-btn:focus-visible, .as-page:focus-visible, .as-brush:focus-visible, .as-sw:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.as-btn[disabled] { opacity: 0.4; cursor: default; border-color: var(--parchment-faint); color: var(--parchment-dim); }
.as-btn-quiet { background: none; color: var(--parchment-dim); }
.as-btn-amber { background: var(--amber); border-color: var(--amber); color: var(--night-deep); padding: 13px 26px; font-size: 0.78rem; }
.as-btn-amber:hover, .as-btn-amber:focus-visible { background: transparent; color: var(--amber); }
.as-danger:not([disabled]):hover, .as-danger:not([disabled]):focus-visible { border-color: #c96a5a; color: #e08b7c; }
.as-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- coloring pages ---------- */
.as-start { margin-bottom: 18px; }
.as-start > .as-label { text-align: center; }
.as-pages {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px;
}
.as-page {
  font: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 6px 8px; border-radius: 12px; cursor: pointer;
  background: rgba(12, 0, 13, 0.45); border: 1px solid var(--parchment-faint); color: var(--parchment-dim);
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.as-page:hover { border-color: var(--brass); color: var(--parchment); }
.as-page[aria-pressed="true"] { border-color: var(--amber); color: var(--parchment); background: rgba(255, 153, 51, 0.08); box-shadow: 0 0 0 1px var(--amber); }
.as-thumb {
  display: block; width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.as-thumb-blank {
  background:
    repeating-linear-gradient(0deg, rgba(120, 95, 60, 0.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 95, 60, 0.06) 0 1px, transparent 1px 3px),
    #EFE5D3;
}
.as-page-name { font-size: 0.92rem; line-height: 1.2; text-align: center; }

/* ---------- art sparks ---------- */
.as-spark-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.as-spark-btn[aria-expanded="true"] { background: var(--amber); border-color: var(--amber); color: var(--night-deep); }
.as-sparks {
  width: 100%; margin-top: 14px; padding: 18px 20px;
  background: rgba(12, 0, 13, 0.5); border: 1px solid var(--parchment-faint); border-radius: 14px;
}
.as-sparks[hidden] { display: none; }
.as-note { color: var(--parchment-dim); font-style: italic; font-size: 1.02rem; text-align: center; }
.as-spark-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.as-spark {
  padding: 16px 16px 18px; border-radius: 10px;
  background: linear-gradient(160deg, rgba(51, 0, 51, 0.9), rgba(12, 0, 13, 0.9));
  border: 1px solid rgba(204, 153, 102, 0.45);
  box-shadow: inset 0 0 0 4px rgba(12, 0, 13, 0.6), inset 0 0 0 5px rgba(204, 153, 102, 0.2);
}
.as-spark-deck {
  font-family: var(--serif-caps); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--copper); margin-bottom: 8px;
}
.as-spark-text { font-size: 1.1rem; line-height: 1.45; }
.as-sparks .as-actions { justify-content: center; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.is-still) .as-spark { animation: as-card 0.6s ease-out both; animation-delay: calc(var(--n, 0) * 0.09s); }
}
@keyframes as-card {
  from { opacity: 0; transform: perspective(600px) rotateY(-70deg); }
  to   { opacity: 1; transform: none; }
}

/* ---------- the desk ---------- */
.as-desk {
  display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 20px; align-items: start;
  padding: 18px; border-radius: 16px;
  background:
    radial-gradient(120% 70% at 80% 0%, rgba(255, 153, 51, 0.09), rgba(255, 153, 51, 0) 60%),
    linear-gradient(180deg, #3a2414, #2a190d);
  border: 1px solid rgba(204, 153, 102, 0.35);
  box-shadow: 0 18px 44px rgba(12, 0, 13, 0.55);
}
.as-tools { display: flex; flex-direction: column; gap: 18px; }
.as-group { padding-bottom: 16px; border-bottom: 1px solid rgba(204, 153, 102, 0.18); }
.as-group:last-child { border-bottom: 0; padding-bottom: 0; }

.as-brushes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.as-brush {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px 8px; min-height: 64px; border-radius: 10px; cursor: pointer;
  font-family: var(--serif-caps); font-size: 0.58rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--parchment-dim); background: rgba(12, 0, 13, 0.45); border: 1px solid rgba(243, 231, 214, 0.18);
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.as-brush svg { width: 24px; height: 24px; }
.as-brush:hover { border-color: var(--brass); color: var(--parchment); }
.as-brush[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--night-deep); }

.as-range { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin-bottom: 10px; }
.as-range .as-label { grid-column: 1 / -1; margin: 0; }
.as-range input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--amber); cursor: pointer; }
.as-preview {
  width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #EEE4D2; box-shadow: inset 0 0 0 1px rgba(164, 106, 49, 0.4);
}
.as-preview i { display: block; border-radius: 50%; }
.as-preview i.is-eraser { border: 1px dashed rgba(43, 22, 34, 0.7); }
.as-strength-out { min-width: 46px; text-align: right; font-family: var(--serif-caps); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--parchment-dim); }

.as-swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.as-sw {
  width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--c); border: 2px solid rgba(12, 0, 13, 0.6);
  box-shadow: 0 0 0 1px rgba(204, 153, 102, 0.55);
  transition: transform 0.15s, box-shadow 0.2s;
}
.as-sw:hover { transform: scale(1.08); }
.as-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--amber), 0 0 10px rgba(255, 153, 51, 0.45); }
.as-recent-wrap[hidden] { display: none; }
.as-pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.as-picker {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--serif-caps); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--parchment);
}
.as-color {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: none;
  box-shadow: 0 0 0 1px rgba(204, 153, 102, 0.55);
  -webkit-appearance: none; appearance: none;
}
.as-color::-webkit-color-swatch-wrapper { padding: 0; }
.as-color::-webkit-color-swatch { border: 2px solid rgba(12, 0, 13, 0.6); border-radius: 50%; }
.as-color::-moz-color-swatch { border: 2px solid rgba(12, 0, 13, 0.6); border-radius: 50%; }
.as-color:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.as-current { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 0.98rem; color: var(--parchment-dim); font-style: italic; }
.as-current i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(243, 231, 214, 0.5); }

/* ---------- the canvas ---------- */
.as-easel { position: relative; }
.as-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }
.as-bar .as-btn { padding: 8px 14px; min-height: 36px; font-size: 0.64rem; }
.as-frame {
  width: min(100%, max(300px, calc(100vh - 210px)));
  margin: 0 auto; padding: 10px; border-radius: 4px;
  background: linear-gradient(145deg, #6b4a26, #3c2611 45%, #5a3d1e);
  box-shadow: 0 0 0 1px rgba(204, 153, 102, 0.55), 0 14px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 220, 160, 0.18);
}
@supports (height: 100svh) {
  .as-frame { width: min(100%, max(300px, calc(100svh - 210px))); }
}
.as-stack {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden;
  background: #EEE5D5; isolation: isolate;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: crosshair;
  box-shadow: inset 0 0 0 1px rgba(60, 38, 17, 0.5);
}
.as-stack.has-ring { cursor: none; }
.as-stack canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.as-wet, .as-lines { pointer-events: none; }
.as-lines { mix-blend-mode: multiply; }
.as-ring {
  position: absolute; left: 0; top: 0; z-index: 3; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(30, 14, 22, 0.75); box-shadow: 0 0 0 1px rgba(255, 250, 240, 0.7);
}
.as-ring[hidden] { display: none; }
.as-hint { text-align: center; color: var(--parchment-dim); font-style: italic; font-size: 0.95rem; margin-top: 10px; }

/* the question before a painting is cleared or replaced */
.as-ask {
  position: absolute; left: 50%; top: 90px; transform: translateX(-50%); z-index: 5;
  width: min(92%, 440px); padding: 20px 22px 18px; text-align: center; border-radius: 6px;
  background: linear-gradient(180deg, #F6ECDC, #EADBC2); color: #2b1622;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(164, 106, 49, 0.4);
}
.as-ask[hidden] { display: none; }
.as-ask-q { font-family: var(--serif-display); font-size: 1.35rem; font-weight: 600; margin: 0; color: #330033; }
.as-ask-d { margin: 6px 0 0; font-style: italic; color: #5A3A24; }
.as-ask-btns { display: flex; gap: 8px; justify-content: center; margin: 14px 0 0; flex-wrap: wrap; }
.as-ask .as-btn { background: transparent; color: #4a2a1a; border-color: rgba(51, 0, 51, 0.35); }
.as-ask .as-btn:hover, .as-ask .as-btn:focus-visible { color: #7A0059; border-color: #7A0059; }
.as-ask .as-ask-keep { color: #330033; border-color: rgba(51, 0, 51, 0.6); background: rgba(255, 255, 255, 0.4); }
.as-ask .as-btn:focus-visible { outline: 2px solid #006666; outline-offset: 2px; }

/* ---------- finishing ---------- */
.as-finish { display: flex; justify-content: center; margin-top: 22px; }
.as-status { text-align: center; color: var(--copper); min-height: 1.6em; margin-top: 10px; font-size: 1rem; }
.as-say {
  max-width: 600px; margin: 8px auto 0; padding: 18px 22px 16px; border-radius: 8px;
  background: linear-gradient(180deg, #F6ECDC, #EADBC2); color: #2b1622;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(164, 106, 49, 0.4);
}
.as-say[hidden] { display: none; }
.as-say-h { font-family: var(--serif-caps); font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: #7A0059; text-align: center; margin-bottom: 12px; }
.as-say-row { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.as-face {
  display: block; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: #e6d6bb;
  box-shadow: 0 0 0 2px #C9A24A, 0 0 0 4px rgba(51, 0, 51, 0.15);
}
.as-face img { width: 64px; height: 64px; object-fit: cover; }
.as-say-row.is-sunny img { object-position: 50% 35%; }
.as-say-row.is-pearl img { object-position: 50% 0; transform: scale(1.75); transform-origin: 50% 8%; }
.as-say-row p { margin: 0; line-height: 1.4; }
.as-who { display: block; font-family: var(--serif-caps); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: #8a5a2b; }
.as-line { font-size: 1.12rem; }
.as-say-row.is-pearl .as-line { font-style: italic; }
.as-say-close { display: block; margin: 4px auto 0; color: #4a2a1a; border-color: rgba(51, 0, 51, 0.35); }
.as-say-close:hover, .as-say-close:focus-visible { color: #7A0059; border-color: #7A0059; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.is-still) .as-say.is-in { animation: as-say-in 0.5s ease-out both; }
  html:not(.is-still) .as-say.is-in .is-pearl { animation: as-say-in 0.5s ease-out 0.9s both; }
}
@keyframes as-say-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- tablets and phones: the canvas first, the tools under it ---------- */
@media (max-width: 900px) {
  .as-desk { grid-template-columns: 1fr; padding: 14px 12px; gap: 16px; }
  .as-easel { order: 1; }
  .as-tools { order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .as-group { border-bottom: 0; padding-bottom: 0; }
  .as-group.as-colors { grid-column: 1 / -1; }
  .as-brushes { grid-template-columns: repeat(4, 1fr); }
  .as-frame { width: min(100%, 640px); }
  .as-pages { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .as-tools { grid-template-columns: 1fr; }
  .as-frame { padding: 6px; }
  .as-pages {
    display: flex; overflow-x: auto; gap: 8px; padding: 2px 2px 8px; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .as-page { flex: 0 0 96px; scroll-snap-align: start; }
  .as-page-name { font-size: 0.85rem; }
  .as-ask { top: 40px; }
}
