:root {
  --bg: #ffffff;
  --accent: #e2643a;
  --paper: #fdfcfa;
  --paper-ink: #1b1a18;
  --sepia: #f1e5cf;
  --sepia-ink: #3d2f1c;
  --night: #15161b;
  --night-ink: #e9e7e2;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 14px;
}

/* ---- the panel takes the colours of the theme ---- */
.panel {
  --page: var(--paper);
  --ink: var(--paper-ink);
  position: relative;
  width: min(356px, 100%);
  border-radius: 26px;
  background: var(--page);
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(27, 26, 24, 0.07),
    0 1px 2px rgba(27, 26, 24, 0.06),
    0 16px 32px -16px rgba(27, 26, 24, 0.22),
    0 40px 70px -40px rgba(27, 26, 24, 0.3);
  transition: color 0.45s ease;
}
.panel[data-theme="sepia"] { --page: var(--sepia); --ink: var(--sepia-ink); }
.panel[data-theme="night"] { --page: var(--night); --ink: var(--night-ink); }
/* the new theme spreads from the swatch as a circle; when it has covered the card, the card takes its colour */
.panel__wash { position: absolute; inset: 0; z-index: -1; clip-path: circle(0px at 50% 100%); }

/* ---- a piece of the article ---- */
.page { height: 172px; padding: 20px 22px 0; overflow: hidden; -webkit-mask: linear-gradient(#000 70%, transparent); mask: linear-gradient(#000 70%, transparent); }
.page__kicker { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.55; }
.page__text { --fs: 16px; margin-top: 6px; }
.page__title { font-size: calc(var(--fs) * 1.42); line-height: 1.16; font-weight: 700; font-stretch: 108%; letter-spacing: -0.02em; }
.page__body { margin-top: 0.5em; font-size: var(--fs); line-height: 1.5; font-weight: 420; opacity: 0.86; }

/* ---- the tools ---- */
.tools { position: relative; display: grid; gap: 10px; padding: 12px 14px 14px; border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); }

.size { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.size__a { flex: none; font-weight: 640; opacity: 0.7; }
.size__a--s { font-size: 13px; }
.size__a--l { font-size: 21px; }
.size__track { position: relative; flex: 1; height: 30px; }
.size__track::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.size__fill { position: absolute; left: 0; top: 13px; height: 4px; width: 100%; border-radius: 4px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0.25); }
.size__ticks { position: absolute; left: 11px; right: 11px; top: 22px; display: flex; justify-content: space-between; }
.size__ticks i { width: 1.5px; height: 4px; border-radius: 1px; background: color-mix(in srgb, var(--ink) 28%, transparent); }
.size__thumb { position: absolute; left: 0; top: 4px; width: 22px; height: 22px; pointer-events: none; }
.size__thumb span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(27, 26, 24, 0.1), 0 3px 8px rgba(27, 26, 24, 0.28), inset 0 -2px 0 rgba(27, 26, 24, 0.05);
}
.size input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.size input:focus-visible + * { outline: none; }
.size__track:focus-within .size__thumb span { box-shadow: 0 0 0 2px var(--accent), 0 3px 8px rgba(27, 26, 24, 0.28); }

.themes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.themes__pill {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 33%;
  border-radius: 99px;
  background: color-mix(in srgb, var(--page) 80%, #ffffff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent), 0 3px 8px -3px rgba(27, 26, 24, 0.35);
  transition: background-color 0.45s ease;
}
.panel[data-theme="night"] .themes__pill { background: #2b2d36; }
.themes button {
  position: relative;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 580;
  opacity: 0.66;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.3s ease;
}
.themes button[aria-checked="true"], .themes button.is-hot { opacity: 1; }
@media (hover: hover) { .themes button:hover { opacity: 1; } }
.themes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(27, 26, 24, 0.22); }
.sw--paper { background: var(--paper); }
.sw--sepia { background: var(--sepia); }
.sw--night { background: var(--night); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #14151a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(20, 21, 26, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (min-width: 900px) and (min-height: 680px) {
  .panel { zoom: 1.25; }
}
