/* Playground page.
   Implements Figma wC5383GSncabfPynmGpSzw node 820:19667 (1280 x 1463).
   Loaded after landing.css, which supplies the tokens, body, grid canvas,
   stage and nav shell.

   Two halves that want different things. The art frame is a composition, so
   it keeps the site's fixed-frame treatment and its cqw coordinates. The
   creative zone is a tool, so it runs in normal flow down the same 1030
   column the case studies use — the frame only ever placed a heading in it,
   and pinning a canvas and its controls to frame coordinates would fight
   every screen that is not exactly 1280. */

/* ── Art (Figma 820:19667 — the frame is 778 tall, not the usual 832) ──── */

.stage--art {
  --canvas-h: 778;
}

.art-copy {
  position: absolute;
  left: 9.844cqw; /* 126 / 1280 */
  top: 38.359cqw; /* 491 / 1280 */
  width: 28.203cqw; /* 361 / 1280 */
  display: flex;
  flex-direction: column;
  gap: 0.78125cqw; /* 10px */
  z-index: 3;
}

.art-copy h1 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue',
    Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 2.34375cqw; /* 30px */
  line-height: normal;
  letter-spacing: -0.0703125cqw; /* -0.9px */
  color: #323232;
}

.art-copy p {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue',
    Helvetica, Arial, sans-serif;
  font-size: 1.25cqw; /* 16px */
  line-height: normal;
  text-align: justify;
  color: #000;
}

/* 591,220 — a 266 column of two beside a 333x412. The stacked pair adds up to
   the tall one's height exactly, so the row needs no alignment of its own. */
.art-wall {
  position: absolute;
  left: 46.172cqw; /* 591 / 1280 */
  top: 17.188cqw; /* 220 / 1280 */
  display: flex;
  align-items: center;
  gap: 1.016cqw; /* 13px */
  z-index: 3;
}

.art-stack {
  display: flex;
  flex-direction: column;
  gap: 1.016cqw;
  width: 20.781cqw; /* 266 / 1280 */
}

.art-stack img {
  width: 100%;
  border-radius: 0;
  object-fit: cover;
}

.art-stack img:first-child { aspect-ratio: 1844 / 1354; }
.art-stack img:last-child { aspect-ratio: 2392 / 1834; }

.art-tall {
  width: 26.016cqw; /* 333 / 1280 */
  height: 32.188cqw; /* 412 / 1280 */
  border-radius: 0;
  object-fit: cover;
}

/* ══ Creative zone ══════════════════════════════════════════════════════
   Figma 820:19718 — a full-bleed white band under the paper-coloured frame.
   The heading sits at x=129 there, which a centred 1030 column lands within
   four pixels of, so the column carries it. */

.zone {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: 69px 0 80px;
}

.zone-inner {
  width: min(100vw - 2.5rem, 1030px);
  margin-inline: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue',
    Helvetica, Arial, sans-serif;
}

.zone-head {
  /* Title stays on the 361 art column; the lede may run wider so it keeps one line. */
  max-width: none;
}

.zone-title {
  display: flex;
  align-items: flex-end;
  max-width: 361px;
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 30px;
  line-height: normal;
  letter-spacing: -0.9px;
  color: #323232;
}

/* The 'o' of Zone is a paint palette. Masked rather than placed as an <img>
   so it takes the heading's colour, the same way the footer icons do. */
.zone-palette {
  width: 22px;
  height: 36px;
  background: currentColor;
  -webkit-mask: url('../media/paint/icon-palette.svg') no-repeat center / 100% 100%;
  mask: url('../media/paint/icon-palette.svg') no-repeat center / 100% 100%;
}

.zone-lede {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue',
    Helvetica, Arial, sans-serif;
  /* Match .art-copy p: 16px at the 1280 frame, scaling down with the stage. */
  font-size: 16px;
  line-height: normal;
  text-align: left;
  white-space: nowrap;
  color: #000;
}

/* While the art stage is narrower than 1280, its body uses 1.25cqw. The zone
   sits outside that container, so 1.25vw tracks the same size. */
@media (max-width: 80rem) {
  .zone-lede {
    font-size: 1.25vw;
  }
}

/* ── The studio ───────────────────────────────────────────────────────
   Canvas on the left, the three steps that feed it on the right. */

.studio {
  display: grid;
  grid-template-columns: 1fr 380px;
  align-items: start;
  gap: 46px;
  margin-top: 44px;
}

.easel-sheet {
  position: relative;
}

/* The band's own white would swallow the canvas, so the paper it paints on is
   the site's paper colour and reads as a sheet laid on the band. */
.easel-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 604 / 430;
  border: 1px solid #e7e2d4;
  border-radius: 10px;
  background: var(--paper);
  /* A drawing surface has to own its gestures, or a vertical stroke scrolls
     the page instead of painting. There is band above and below to scroll
     from. */
  touch-action: none;
}

/* Drawn over the sheet rather than into it, so it is never something you have
   to erase and never turns up in the exported PNG. */
.easel-ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c3bda9;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.easel-ghost.is-gone {
  opacity: 0;
}

.easel-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

/* ── Pill controls ────────────────────────────────────────────────────
   The site's button language at the smaller size this row wants. In px
   rather than cqw: the zone is in flow and has no frame to scale against. */

.zone-btn {
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 30px;
  background: var(--ink);
  font-family: inherit;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.zone-btn:hover,
.zone-btn:focus-visible {
  background: transparent;
  color: var(--ink);
  transform: translateY(-2px);
}

.zone-btn--ghost {
  background: transparent;
  color: var(--ink);
}

.zone-btn--ghost:hover,
.zone-btn--ghost:focus-visible {
  background: var(--ink);
  color: #fff;
}

/* ── The rail ─────────────────────────────────────────────────────────── */

.rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-step {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8d8a80;
}

/* Only the step number badge — not hex/copy spans nested in the button. */
.rail-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: #efece1;
  font-size: 11px;
  letter-spacing: 0;
  color: #6f6b60;
}

.rail-copy {
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: #323232;
  box-shadow: none;
  cursor: pointer;
}

.rail-copy-hex {
  text-decoration: none;
}

.rail-copy-label {
  display: none;
  text-decoration: underline;
  color: var(--ink);
}

.rail-copy:hover .rail-copy-hex,
.rail-copy:focus-visible .rail-copy-hex {
  display: none;
}

.rail-copy:hover .rail-copy-label,
.rail-copy:focus-visible .rail-copy-label {
  display: inline;
}

/* While giving copied feedback, keep that word visible (don't flip to hex). */
.rail-copy.is-copied .rail-copy-hex {
  display: none;
}

.rail-copy.is-copied .rail-copy-label {
  display: inline;
}

.sources,
.palette {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sources {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.palette {
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.sources button,
.palette button {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #e7e2d4;
  border-radius: 10px;
  background: none;
  overflow: hidden;
  cursor: crosshair;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sources img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.palette button {
  background: var(--well, #f4f1e6);
  border-color: rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.sources button:hover,
.palette button:hover {
  transform: translateY(-2px);
}

/* The ring is drawn outside the swatch so it never eats into the colour. */
.palette button:focus-visible,
.palette button.is-active {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* A colour arriving in a well lands rather than simply appearing. */
.palette button.is-fresh {
  animation: well-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes well-pop {
  0% { transform: scale(0.72); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ── The lens ─────────────────────────────────────────────────────────
   Follows the pointer across the source tiles carrying the colour under it,
   because a 117px thumbnail is too small to read a colour off directly. */

.lens {
  position: absolute;
  left: 0;
  top: 0;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}

.lens.is-on {
  display: flex;
}

.lens i {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  background: var(--lens, #fff);
}

.lens em {
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #323232;
}

/* js/cursor.js hides the native cursor site-wide and draws one 40px circle
   that is deliberately the same everywhere. That is the wrong instrument for
   a paint surface, so inside the studio the decorative cursor stands down and
   the real one comes back — crosshair on anything you sample or paint on.
   js/creative-zone.js owns the class while the pointer is in here. */
.cursor-hushed .cursor {
  opacity: 0;
}

.cursor-on .easel-canvas,
.cursor-on .sources button {
  cursor: crosshair;
}

.cursor-on .palette button,
.cursor-on .zone-btn,
.cursor-on .rail-copy {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .sources button,
  .palette button,
  .zone-btn {
    transition: none;
  }

  .sources button:hover,
  .palette button:hover,
  .zone-btn:hover {
    transform: none;
  }

  .palette button.is-fresh {
    animation: none;
  }
}

/* ── Small screens ────────────────────────────────────────────────────── */

@media (max-width: 60rem) {
  .studio {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  /* The rail's tiles and wells would stretch to half the page on their own. */
  .sources,
  .palette {
    max-width: 380px;
  }
}

@media (max-width: 43rem) {
  .stage--art {
    aspect-ratio: auto;
    min-height: 0;
    padding: 3rem 1.25rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 1.75rem;
    container-type: normal;
  }

  .art-copy,
  .art-wall {
    position: static;
    width: auto;
  }

  .art-copy h1 {
    font-size: clamp(1.5rem, 6.5vw, 1.9rem);
    letter-spacing: -0.03em;
  }

  .art-copy p {
    font-size: 1rem;
    text-align: left;
  }

  .art-wall {
    flex-direction: column;
    gap: 0.75rem;
  }

  .art-stack {
    flex-direction: row;
    width: 100%;
    gap: 0.75rem;
  }

  .art-stack img {
    width: 50%;
  }

  .art-tall {
    width: 100%;
    height: auto;
    aspect-ratio: 333 / 412;
  }

  .zone {
    padding: 3rem 0;
  }

  .zone-title {
    font-size: clamp(1.5rem, 6.5vw, 1.9rem);
    letter-spacing: -0.03em;
  }

  .zone-palette {
    width: 16px;
    height: 26px;
  }

  .zone-lede {
    font-size: 1rem;
    text-align: left;
    white-space: normal;
  }

  .easel-ghost {
    font-size: 13px;
  }
}
