:root {
  color-scheme: light;
  --red: #b51622;
  --steel: #8792a8;
  --ink: #24272d;
  --muted: #757983;
  --paper: #f4eee5;
  --line: rgba(36, 39, 45, 0.14);
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.studio {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100vw;
  height: 100vh;
  min-height: 620px;
  background:
    radial-gradient(circle at 62% 38%, rgba(255, 255, 255, 0.92), rgba(246, 241, 234, 0.82) 42%, rgba(225, 215, 202, 0.9)),
    var(--paper);
}

.stage {
  position: relative;
  grid-row: 2;
  min-height: 0;
}

.statement {
  position: relative;
  z-index: 2;
  grid-row: 1;
  max-width: none;
  padding: 20px 34px 8px clamp(360px, 30vw, 470px);
  color: var(--ink);
  pointer-events: none;
}

.statement p {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.statement h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(1.85rem, 3.2vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.dock {
  position: absolute;
  z-index: 2;
  left: 22px;
  top: 22px;
  bottom: 22px;
  width: min(310px, calc(100vw - 44px));
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 24px 70px rgba(36, 39, 45, 0.14);
  backdrop-filter: blur(16px);
}

.paint-controls,
.send-form {
  display: grid;
  gap: 14px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.swatch {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow:
    inset 0 0 0 1px rgba(36, 39, 45, 0.16),
    0 9px 20px rgba(36, 39, 45, 0.1);
}

.swatch.is-active {
  border-color: var(--ink);
}

.custom-swatch {
  overflow: hidden;
  cursor: pointer;
  background: conic-gradient(#f04444, #f2c94c, #49c56d, #41a7f5, #8f62ff, #f04444);
}

.custom-swatch::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.72);
}

.custom-swatch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.range-field span,
.send-form label > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.range-field strong {
  color: var(--ink);
}

.range-field input {
  width: 100%;
  accent-color: var(--red);
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ghost,
.primary,
.secondary {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.ghost {
  color: var(--ink);
  background: rgba(36, 39, 45, 0.08);
}

.ghost.is-active {
  color: var(--white);
  background: var(--ink);
}

.send-form {
  margin-top: auto;
  gap: 10px;
}

.send-form input[type="text"],
.send-form input[type="email"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
}

.primary {
  color: var(--white);
  background: var(--red);
}

.secondary {
  color: var(--ink);
  background: #e5dacb;
}

@media (max-width: 760px) {
  html,
  body {
    overflow: auto;
  }

  .studio {
    min-height: 100vh;
    height: auto;
    padding-bottom: 18px;
  }

  .stage {
    position: relative;
    grid-row: 2;
    height: 58vh;
    min-height: 430px;
  }

  .statement {
    max-width: none;
    padding: 24px 24px 6px;
  }

  .statement h2 {
    font-size: clamp(1.9rem, 8.8vw, 3.2rem);
  }

  .dock {
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    width: auto;
    margin: 12px;
  }
}
