/* Oil Studio. A television painting set: easel, spotlight, kidney palette.
   Controls stay large on the phone and on the desktop. */

body.page-studio {
  overflow-x: hidden;
  background-color: #140e0c;
  background-image:
    radial-gradient(ellipse 80% 40% at 50% 18%, rgba(255, 196, 130, .12), transparent 70%),
    linear-gradient(180deg, #1a1210 0%, #100c0a 100%);
}
html.studio-painting,
html.studio-painting body {
  overflow: hidden;
  overscroll-behavior: none;
}

.studio-page {
  box-sizing: border-box;
  padding: 5.6rem clamp(0.7rem, 2vw, 1.4rem) 2.6rem;
}
.studio-wrap {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
body.page-studio .page-head {
  margin-bottom: .4rem;
  padding: .25rem .65rem .3rem;
}
body.page-studio .page-head > .kicker {
  font-size: 1.05rem;
}
body.page-studio .page-head h1 {
  font-size: clamp(1.6rem, 2.4vw, 2.05rem);
  margin: 0 0 .15rem;
}
body.page-studio .page-head h1::after { margin-top: .25rem; }
body.page-studio .page-head > p:not(.kicker) {
  font-size: clamp(1.12rem, 1.6vw, 1.3rem);
  line-height: 1.35;
  padding: .4rem .7rem;
  margin-top: .25rem;
}
body.page-studio .page-head a {
  color: var(--fire2);
}

.studio-set {
  position: relative;
  padding: .85rem .75rem 1.1rem;
  border-radius: 18px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.set-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 38% at 38% 24%, rgba(255, 214, 160, .34), transparent 68%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(0, 0, 0, .28), transparent 60%),
    linear-gradient(180deg, #2a1c16 0%, #16110e 62%, #24180f 100%);
}
.set-backdrop::before {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 18%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 220, 170, .06) 0 2px, transparent 2px 48px),
    linear-gradient(180deg, rgba(74, 46, 26, 0), #4a301c 22%, #2c1c12 100%);
}
.set-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .38);
}
.studio-stage,
.brush-tray,
.studio-note,
.page-head {
  position: relative;
  z-index: 1;
}

.studio-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 420px);
  gap: 1rem 1.15rem;
  align-items: start;
}

.easel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.studio-status {
  width: min(100%, 760px);
  font-family: "Josefin Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.3;
  color: #fbf6ee;
  margin: 0 0 .45rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}
.studio-status [aria-live] {
  flex: 1;
  min-width: 0;
}
.studio-chip {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 3px solid #f3e6c8;
  box-shadow: inset 0 -6px 8px rgba(0, 0, 0, .25), 0 2px 0 rgba(0, 0, 0, .35);
  background: #d83a2e;
}

.easel-stand {
  position: relative;
  width: fit-content;
  max-width: 100%;
}
.stretcher {
  position: relative;
  z-index: 2;
  width: fit-content;
  max-width: 100%;
  padding: 16px 16px 20px;
  background:
    linear-gradient(180deg, #e4d0ae, #c4a36e 40%, #a8844e);
  box-shadow:
    inset 0 0 0 3px #6a4524,
    0 16px 28px rgba(0, 0, 0, .45);
}
.canvas-box {
  position: relative;
  width: min(72vw, 760px, calc(min(46vh, 500px) * 4 / 3));
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  background:
    repeating-linear-gradient(90deg, rgba(90, 60, 30, .06) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg, rgba(90, 60, 30, .05) 0 1px, transparent 1px 5px),
    #e6d9c4;
  touch-action: none;
  cursor: none;
}
.canvas-box canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.tool-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 88px;
  height: 128px;
  margin-left: -44px;
  margin-top: -118px;
  transform-origin: 44px 118px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity .28s ease;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .35));
}
.tool-cursor.is-on { opacity: 1; }
.tool-cursor.is-simple {
  transition: none;
  filter: none;
}
.tool-cursor[hidden] { display: none; }
.tool-cursor svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.tool-glyph { display: none; }
.tool-cursor[data-kind="round"] .tool-round,
.tool-cursor[data-kind="flat"] .tool-flat,
.tool-cursor[data-kind="filbert"] .tool-filbert,
.tool-cursor[data-kind="knife"] .tool-knife { display: block; }
.tool-tip { fill: var(--paint, #d83a2e); }
.easel-ledge {
  position: relative;
  z-index: 3;
  width: 108%;
  height: 18px;
  margin: -6px auto 0;
  left: -4%;
  background: linear-gradient(180deg, #c48a52, #7a4c28 45%, #4e3018);
  border-radius: 2px;
  box-shadow: 0 7px 0 #3a2414, 0 14px 16px rgba(0, 0, 0, .35);
}
.easel-legs {
  position: relative;
  width: 86%;
  height: 78px;
  margin: 0 auto;
}
.leg {
  position: absolute;
  top: 0;
  width: 18px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #3e2816, #a06a3c 42%, #5a381e 70%, #2e1c10);
  transform-origin: top center;
}
.leg-l { left: 16%; transform: rotate(14deg); }
.leg-r { right: 16%; transform: rotate(-14deg); }
.crossbar {
  position: absolute;
  left: 24%;
  right: 24%;
  top: 36px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, #8d5a30, #5a381c);
  box-shadow: 0 2px 0 #2a180e;
}
.studio-stool {
  position: absolute;
  left: -6px;
  bottom: 4px;
  width: 54px;
  height: 78px;
  pointer-events: none;
  z-index: 1;
}
.studio-stool::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #c4894e, #6a4122 70%);
  box-shadow: 0 3px 0 #3a2414;
}
.studio-stool::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 12px;
  height: 64px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, #3a2414, #8a5a32, #3a2414);
}

.palette-col { min-width: 0; width: 100%; }
.palette-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .35rem;
}
.studio-col h2,
.palette-bar h2,
.brush-col h2 {
  font-family: "Josefin Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f7f0e4;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.kidney {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 500;
}
.kidney-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .4));
}
.oil-list {
  position: absolute;
  inset: 0;
}
.oil {
  position: absolute;
  width: 54px;
  height: 50px;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
  color: #fbf6ee;
}
/* Light to dark around the rim: white, yellow, ochre, red, crimson, blue, cobalt, green, umber, black. */
.oil:nth-child(1) { left: 33.3%; top: 17.6%; }
.oil:nth-child(2) { left: 51.4%; top: 10%; }
.oil:nth-child(3) { left: 70.8%; top: 17.6%; }
.oil:nth-child(4) { left: 84%; top: 40%; }
.oil:nth-child(5) { left: 83.9%; top: 53.6%; }
.oil:nth-child(6) { left: 74.4%; top: 75%; }
.oil:nth-child(7) { left: 51.4%; top: 87.6%; }
.oil:nth-child(8) { left: 30%; top: 80%; }
.oil:nth-child(9) { left: 21.7%; top: 65%; }
.oil:nth-child(10) { left: 22.8%; top: 35%; }
.dab {
  display: block;
  width: 52px;
  height: 48px;
  margin: 0 auto;
  border-radius: 48% 52% 46% 54% / 42% 46% 58% 54%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .78), transparent 24%),
    radial-gradient(circle at 68% 74%, rgba(0, 0, 0, .28), transparent 48%),
    radial-gradient(circle at 50% 55%, var(--oil), #140c08 145%);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, .28),
    inset 0 -6px 8px rgba(0, 0, 0, .28),
    inset 0 2px 2px rgba(255, 255, 255, .35);
}
.oil-name {
  position: absolute;
  width: max-content;
  max-width: 5.5rem;
  font-size: 1.14rem;
  line-height: 1.05;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px 1px rgba(28, 12, 6, .95), 0 0 2px rgba(28, 12, 6, .8);
}
.oil:nth-child(-n+3) .oil-name {
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
}
.oil:nth-child(3) .oil-name,
.oil:nth-child(7) .oil-name,
.oil:nth-child(10) .oil-name {
  max-width: 4.5rem;
}
.oil:nth-child(4) .oil-name,
.oil:nth-child(5) .oil-name {
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
}
.oil:nth-child(n+6):nth-child(-n+8) .oil-name {
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
}
.oil:nth-child(n+9) .oil-name {
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  text-align: left;
}
.oil[aria-checked="true"] .dab {
  box-shadow:
    0 0 0 3px #fff8ee,
    0 0 0 7px rgba(255, 186, 96, .95),
    0 4px 0 rgba(0, 0, 0, .32);
}
.oil[aria-checked="true"] .oil-name {
  color: #fff6e4;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.brush,
.oil,
.studio-btn {
  font-family: "Josefin Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: .02em;
  color: #fbf6ee;
  cursor: pointer;
}
.brush:focus-visible,
.oil:focus-visible,
.studio-btn:focus-visible,
.studio-size input:focus-visible {
  outline: 3px solid #fff6e4;
  outline-offset: 3px;
}

.brush-tray {
  margin-top: .85rem;
  padding: .7rem .7rem .75rem;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(90, 56, 32, .72), rgba(36, 22, 14, .78));
  box-shadow: inset 0 0 0 2px rgba(228, 196, 150, .28), 0 10px 18px rgba(0, 0, 0, .28);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: .7rem 1rem;
  align-items: end;
}
.brush-col h2 { margin-bottom: .4rem; }
.brush-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
}
.brush {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 72px;
  padding: .4rem .3rem;
  border-radius: 12px;
  border: 2px solid rgba(243, 230, 200, .35);
  background: rgba(16, 10, 6, .4);
}
.brush svg {
  width: 36px;
  height: 36px;
  display: block;
}
.brush[aria-checked="true"] {
  border-color: #f3e6c8;
  background: rgba(243, 230, 200, .16);
  box-shadow: 0 0 0 3px rgba(243, 230, 200, .28);
}
.brush:hover,
.oil:hover,
.studio-btn:hover {
  border-color: #fff6e4;
}
.studio-size {
  display: grid;
  gap: .15rem;
  margin-top: .45rem;
  font-family: "Josefin Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #f7f0e4;
}
.studio-size strong { font-size: 1.3rem; }
.studio-size input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: .2rem 0 0;
  border-radius: 99px;
  background: #1a120c;
  border: 1px solid rgba(243, 230, 200, .35);
  cursor: pointer;
}
.studio-size input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3e6c8;
  border: 3px solid #6a4324;
}
.studio-size input::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3e6c8;
  border: 3px solid #6a4324;
}
.studio-side {
  display: grid;
  gap: .5rem;
  align-content: end;
}
.studio-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}
.studio-btn.studio-print-btn {
  min-height: 64px;
  font-size: 1.4rem;
  background: linear-gradient(180deg, #fff6e4, #e4c98a);
  color: #24180f;
  border-color: #f3e6c8;
}
.studio-print-dialog {
  width: min(34rem, calc(100vw - 1.25rem));
  padding: 1.15rem 1.15rem 1.2rem;
  border: 3px solid #e4c98a;
  border-radius: 16px;
  background: #24160f;
  color: #fbf6ee;
}
.studio-print-dialog::backdrop {
  background: rgba(12, 8, 6, .72);
}
.studio-print-dialog h2 {
  font-family: "Cinzel", Palatino, serif;
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  margin: 0 0 .75rem;
  color: #fff6e4;
}
.studio-print-dialog label {
  display: grid;
  gap: .28rem;
  margin-bottom: .7rem;
  font-family: "Josefin Sans", "Gill Sans", "Trebuchet MS", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
}
.studio-print-dialog input {
  width: 100%;
  box-sizing: border-box;
  font-size: 1.35rem;
  min-height: 58px;
  padding: .4rem .7rem;
  border-radius: 10px;
  border: 2px solid #e4c98a;
  background: #fff8ee;
  color: #24160f;
}
.studio-print-help,
.studio-print-note {
  margin: 0 0 .55rem;
  font-family: "Cormorant Garamond", Palatino, Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.3;
  color: #f3e0c4;
}
.studio-print-note:empty { display: none; }
.studio-print-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: .5rem;
}
.studio-btn {
  min-height: 52px;
  padding: .55rem .55rem;
  border-radius: 10px;
  border: 2px solid rgba(243, 230, 200, .5);
  background: rgba(16, 10, 6, .5);
  color: #fbf6ee;
  line-height: 1.15;
}
.studio-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.studio-btn[aria-pressed="true"] {
  background: #f3e6c8;
  color: #24180f;
  border-color: #f3e6c8;
}
.studio-wipe {
  min-height: 48px;
  padding: .4rem .85rem;
  background: rgba(28, 16, 10, .55);
}

.studio-note {
  margin: .85rem 0 0;
  padding: .15rem .15rem 1.5rem;
  font-family: "Cormorant Garamond", Palatino, Georgia, serif;
  font-size: clamp(1.2rem, 1.7vw, 1.4rem);
  line-height: 1.3;
  color: #f0e4d2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
}
body.page-studio footer {
  position: relative;
  z-index: 5;
  margin-top: .6rem;
  padding-top: 2rem;
}

@media (max-width: 980px) {
  .studio-page {
    padding-top: 6.1rem;
    padding-bottom: 2.8rem;
  }
  body.page-studio .page-head {
    margin-bottom: .35rem;
    padding: .15rem .4rem .2rem;
  }
  body.page-studio .page-head > .kicker,
  body.page-studio .page-head > p:not(.kicker) { display: none; }
  body.page-studio .page-head h1 {
    font-size: 1.45rem;
    margin: 0;
  }
  body.page-studio .page-head h1::after { margin-top: .15rem; }
  .studio-set { padding: .4rem .35rem .7rem; }
  .studio-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
  }
  .easel, .easel-stand, .stretcher, .palette-col { width: 100%; }
  .studio-stool { display: none; }
  .stretcher { padding: 12px 12px 16px; }
  .canvas-box {
    width: 100%;
    aspect-ratio: 3 / 4;
  }
  .easel-legs { height: 64px; }
  .studio-status { font-size: 1.2rem; margin-bottom: .3rem; }
  .studio-chip { width: 36px; height: 36px; }
  .oil-name { font-size: 1.12rem; }
  .brush-tray {
    grid-template-columns: 1fr;
    margin-top: .15rem;
  }
  .brush,
  .studio-btn {
    min-height: 56px;
    font-size: 1.08rem;
  }
  .brush svg { width: 30px; height: 30px; }
  .studio-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .studio-btn.studio-print-btn { min-height: 68px; font-size: 1.45rem; }
  .studio-print-actions { grid-template-columns: 1fr; }
  .studio-note {
    font-size: 1.2rem;
    padding-bottom: 1.8rem;
  }
  .studio-size { font-size: 1.12rem; }
  .studio-size input::-webkit-slider-thumb,
  .studio-size input::-moz-range-thumb {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 980px) and (max-height: 740px) {
  .canvas-box { aspect-ratio: 4 / 5; }
}
