/* The screensaver stool: a one-screen shop page, the quiet layer that covers it, and the stool flying above both.
   The stool is a canvas moved by script.js; everything else is ordinary HTML. */
:root {
  --oat: #efe8dc;                  /* the page */
  --ink: #2a2421;                  /* text */
  --panel: #d6cbef;                /* the shop window behind the stool */
  --floor: rgba(42, 36, 33, 0.16); /* the shadow on the window's floor */
  --edge: clamp(16px, 3.4vw, 48px);
  --stool-w: 280px;                /* the stool's size: script.js writes it, the window keeps room for it */
  --stool-h: 378px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--oat);
  color: var(--ink);
  font-family: 'DM Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* while the stool is out of its window a finger drags it instead of the page */
html.is-out,
html.is-out body {
  touch-action: none;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

/* while a stool is held nothing on the page gets selected */
html.is-holding,
html.is-holding body {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

/* ---------------------------------------------------------------- the shop */
.shop {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  height: 100svh;
  padding: 0 var(--edge);
}

/* under the dark layer the page is not drawn at all: nothing to repaint while the screensaver runs */
html.is-dark .shop {
  visibility: hidden;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  font-size: 15px;
}

.brand {
  font-family: 'Unbounded Variable', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bar__nav {
  display: flex;
  gap: clamp(16px, 2.6vw, 40px);
}

.bar__nav a,
.bar__bag {
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .bar__nav a:hover,
  .bar__bag:hover {
    opacity: 0.55;
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: stretch;
  gap: clamp(20px, 4vw, 64px);
  min-height: 0;
  padding: 8px 0 18px;
}

.hero__words {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 22px;
  padding-bottom: 6px;
}

.hero__title {
  margin: 0;
  font-family: 'Unbounded Variable', system-ui, sans-serif;
  font-size: clamp(40px, 6.2vw, 104px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero__line {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.45;
  opacity: 0.8;
}

/* ---------------------------------------------------------------- the window */
.window {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0;
  border-radius: 28px;
  background: var(--panel);
  overflow: hidden;
}

.window__spot {
  position: relative;
  width: var(--stool-w);
  height: var(--stool-h);
}

/* the stool's shadow on the floor of the window: it stays when the stool is out */
.window__spot::after {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -3%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--floor), transparent);
}

.window__label {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.window__price {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- hint and button */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 20px;
}

.chip {
  margin: 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(42, 36, 33, 0.07);
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.chip__count {
  display: inline-block;
  min-width: 0.7em;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.chip--button {
  flex: none;
  background: var(--ink);
  color: var(--oat);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@media (hover: hover) {
  .chip--button:hover {
    transform: scale(1.05);
  }
}

.chip--button:active {
  transform: scale(0.96);
}

.chip--button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- the quiet layer and the stool */
.quiet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #1d1923;
  opacity: 0;
  visibility: hidden;
}

.quiet__stamps {
  position: absolute;
  inset: 0;
}

.quiet__stamps canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.quiet__note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  margin: 0;
  padding: 0 var(--edge);
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform;
}

.release {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 70;
  margin: 0;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--oat);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 760px) {
  .bar__nav {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
    padding-top: 0;
  }

  .hero__words {
    gap: 12px;
  }

  .hero__title {
    font-size: clamp(32px, 10vw, 46px);
  }

  .hero__line {
    font-size: 15px;
  }

  .window {
    border-radius: 22px;
  }

  .window__label {
    left: 16px;
    right: 16px;
    bottom: 14px;
    font-size: 13px;
  }

  .foot {
    padding-bottom: 16px;
  }

  .chip {
    padding: 9px 13px;
    font-size: 13px;
  }
}
