:root {
  --page: #efece6;
  --panel: #fbfaf8;
  --ink: #1d1c1a;
  --muted: #8a867e;
  --line: rgba(29, 28, 26, 0.09);
  --key-base: #c9c4bb;
  --key-side: #a9a399;
  --accent: #ff6b4a;
  --soft: color-mix(in srgb, var(--accent) 14%, #fbfaf8);
  --ui: "Mona Sans Variable", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 90% at 50% 0%, #f7f5f1 0%, var(--page) 60%, #e7e3dc 100%);
  color: var(--ink);
  font-family: var(--ui);
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: min(4vw, 4vh);
}

.panel {
  position: relative;
  width: min(540px, 94vw);
  padding: clamp(14px, 3.2vmin, 22px);
  border-radius: clamp(18px, 3.4vmin, 26px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(29, 28, 26, 0.06),
    0 2px 4px rgba(40, 32, 20, 0.05),
    0 12px 30px rgba(40, 32, 20, 0.08),
    0 40px 80px rgba(40, 32, 20, 0.10);
  display: grid;
  gap: clamp(8px, 2vmin, 14px);
  overflow: hidden;
}
.panel__sheen {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0) 30%);
  pointer-events: none;
}

.head { position: relative; display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: clamp(12px, 2.6vmin, 14px); }
.brand__mark { width: 18px; height: 18px; }
.brand__mark circle { fill: none; stroke: var(--ink); stroke-width: 1.3; mix-blend-mode: multiply; }
.head__label { color: var(--muted); font-size: clamp(11px, 2.3vmin, 12.5px); }
.applied {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px 0 8px;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
  color: var(--ink);
  background: rgba(29, 28, 26, 0.05);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.applied__tick { width: 13px; height: 13px; }
.applied__tick path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }

/* the preview: a small piece of a product page tinted by the accent */
.preview {
  position: relative;
  height: clamp(96px, 27vh, 200px);
  border-radius: clamp(12px, 2.4vmin, 16px);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line) inset;
  isolation: isolate;
}
.preview__tint, .preview__flood { position: absolute; inset: 0; }
.preview__tint { background: color-mix(in srgb, var(--accent) 14%, #fbfaf8); }
.preview__flood {
  --fx: 50%; --fy: 120%; --fr: 0px; --fc: #fff;
  background: color-mix(in srgb, var(--fc) 14%, #fbfaf8);
  clip-path: circle(var(--fr) at var(--fx) var(--fy));
}
.mock { position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr; padding: clamp(8px, 2vmin, 14px); gap: clamp(6px, 1.6vmin, 12px); }
.mock__bar { display: flex; align-items: center; gap: 4px; }
.mock__bar span { width: 6px; height: 6px; border-radius: 50%; background: rgba(29, 28, 26, 0.16); }
.mock__bar i { margin-left: auto; width: 34%; height: 6px; border-radius: 3px; background: rgba(29, 28, 26, 0.08); }
.mock__body { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(8px, 2vmin, 16px); align-items: end; min-height: 0; }
.mock__text { display: grid; gap: clamp(4px, 1vmin, 7px); align-content: end; min-width: 0; }
.mock__title { font-size: clamp(13px, 3.4vmin, 21px); font-weight: 680; letter-spacing: -0.01em; line-height: 1.08; font-stretch: 92%; }
.mock__title em { font-style: normal; color: var(--accent); }
.mock__line { height: 5px; width: 90%; border-radius: 3px; background: rgba(29, 28, 26, 0.10); }
.mock__line--short { width: 62%; }
.mock__button {
  justify-self: start;
  margin-top: 2px;
  padding: clamp(4px, 1vmin, 6px) clamp(9px, 2vmin, 13px);
  border-radius: 99px;
  font-size: clamp(9.5px, 2vmin, 11.5px); font-weight: 620;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent), 0 1px 0 rgba(255,255,255,.35) inset;
}
.mock__chart { height: 100%; max-height: 120px; display: flex; align-items: end; gap: 5px; padding-bottom: 2px; }
.mock__chart span {
  flex: 1; height: calc(var(--h) * 100%); border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
  opacity: .9;
}

.readout { display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 9px; row-gap: 2px; }
.readout__swatch { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset, 0 2px 6px color-mix(in srgb, var(--accent) 45%, transparent); }
.readout__name { position: relative; display: inline-block; overflow: hidden; height: 1.25em; font-weight: 650; font-size: clamp(13px, 2.8vmin, 15px); }
.readout__name span { display: inline-block; }
.readout__hex { font-variant-numeric: lining-nums; color: var(--muted); font-size: clamp(11px, 2.4vmin, 12.5px); letter-spacing: .04em; }
.readout__hex .ch { display: inline-block; }
.readout__hint { grid-column: 1 / -1; color: var(--muted); font-size: clamp(10px, 2.1vmin, 11.5px); }

/* the keys: a glass cap over a coloured well, on a darker base that shows the travel */
.keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, 1.7vmin, 11px);
  padding: clamp(8px, 1.8vmin, 12px);
  border-radius: clamp(14px, 2.6vmin, 18px);
  background: linear-gradient(180deg, #e3dfd8, #d8d3cb);
  box-shadow: 0 1px 2px rgba(0,0,0,.08) inset, 0 -1px 0 rgba(255,255,255,.8) inset, 0 1px 0 rgba(255,255,255,.9);
}
.key {
  position: relative;
  aspect-ratio: 1 / 0.86;
  max-height: 9.4vh;
  min-height: 34px;
  width: 100%;
  border: 0; padding: 0; margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.key:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 12px; }
.key__base {
  position: absolute; inset: 4px 0 0 0;
  border-radius: 11px;
  background: linear-gradient(180deg, var(--key-side), #8f897e);
  box-shadow: 0 6px 10px rgba(40, 32, 20, 0.16), 0 1px 2px rgba(40, 32, 20, 0.2);
}
.key__cap {
  position: absolute; inset: 0 0 4px 0;
  border-radius: 11px;
  overflow: hidden;
  background: color-mix(in srgb, var(--c) 82%, #fff);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -2px 4px rgba(0, 0, 0, 0.12) inset,
    0 0 0 1px rgba(29, 28, 26, 0.12);
  will-change: transform;
}
.key__ink {
  position: absolute; inset: 11% 12% 32%;
  border-radius: 7px;
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 78%, #000) 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.18) inset, 0 0 0 1px rgba(0,0,0,.06) inset;
}
.key__glass {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.12) 38%, rgba(255,255,255,0) 52%, rgba(255,255,255,0.18) 100%);
}
.key__glint {
  position: absolute; top: -20%; bottom: -20%; width: 34%; left: -50%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.75), rgba(255,255,255,0));
  transform: skewX(-18deg);
  opacity: 0;
}
.key__legend {
  position: absolute; left: 0; right: 0; bottom: 10%;
  text-align: center;
  font-size: clamp(7.5px, 1.6vmin, 9.5px); font-weight: 600; letter-spacing: .04em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 1px rgba(0,0,0,.25);
  white-space: nowrap;
}
.key.is-applied .key__cap { box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset, 0 1px 0 rgba(255,255,255,.9) inset, 0 -2px 4px rgba(0,0,0,.12) inset, 0 0 0 2px var(--ink); }

.pointer {
  position: fixed; left: 0; top: 0;
  width: 22px; height: 22px;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
}
.pointer path { fill: #1d1c1a; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

@media (max-width: 420px) {
  .readout__hint { display: none; }
  .head__label { display: none; }
}
@media (max-height: 460px) {
  .readout__hint { display: none; }
}
