:root {
  color-scheme: dark;
  --black: #11100e;
  --paper: #f1ecdf;
  --paper-muted: rgb(241 236 223 / 62%);
  --line: rgb(241 236 223 / 26%);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  min-height: 100dvh;
  color: var(--paper);
  background: var(--black);
}

.timer-stage {
  position: relative;
  min-width: 0;
  min-height: 100dvh;
  overflow: hidden;
  background: #171512;
}

.timer-surface {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto auto 1fr;
  place-items: center;
  width: 100%;
  min-height: 100dvh;
  padding: max(88px, env(safe-area-inset-top)) 24px max(118px, env(safe-area-inset-bottom));
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--paper);
  background: #171512;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.timer-surface:focus-visible,
.stop-action:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: -7px;
}

.scene-image,
.scene-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-image {
  object-fit: cover;
  transform: scale(1.035);
  filter: saturate(0.84) contrast(1.03);
  transition: opacity 420ms var(--ease-out), transform 8s linear, filter 420ms ease;
  pointer-events: none;
}

.scene-shade {
  background:
    linear-gradient(180deg, rgb(8 7 6 / 46%) 0%, rgb(8 7 6 / 12%) 30%, rgb(8 7 6 / 22%) 64%, rgb(8 7 6 / 70%) 100%),
    radial-gradient(circle at 50% 47%, transparent 0 25%, rgb(8 7 6 / 19%) 72%, rgb(8 7 6 / 42%) 100%);
  pointer-events: none;
}

.edition-label,
.timer-value,
.timer-cue,
.hold-track {
  position: relative;
  z-index: 1;
}

.edition-label {
  align-self: end;
  padding: 7px 11px 6px;
  color: var(--black);
  background: var(--paper);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 14px;
  font-weight: 660;
  letter-spacing: 0.12em;
  line-height: 1;
  transform: rotate(-1.2deg);
  box-shadow: 0 2px 18px rgb(0 0 0 / 16%);
  transition: transform 420ms var(--ease-out), opacity 260ms ease;
}

.timer-value {
  grid-row: 2 / 4;
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: clamp(12rem, min(45vw, 58vh), 34rem);
  font-weight: 400;
  letter-spacing: -0.085em;
  line-height: 0.74;
  text-indent: -0.08em;
  text-shadow: 0 8px 44px rgb(0 0 0 / 24%);
  transform: translateZ(0);
  transition: transform 320ms var(--ease-out), opacity 220ms ease;
}

.timer-cue {
  align-self: start;
  min-height: 24px;
  margin-top: 28px;
  color: rgb(241 236 223 / 88%);
  font-size: 16px;
  font-weight: 560;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 2px 16px rgb(0 0 0 / 58%);
  transition: opacity 220ms ease, transform 320ms var(--ease-out);
}

.hold-track {
  align-self: start;
  width: min(240px, 58vw);
  height: 2px;
  margin-top: 16px;
  overflow: hidden;
  background: rgb(241 236 223 / 26%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.hold-progress {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--paper);
  transform: scaleX(0);
  transform-origin: left;
}

.app-shell[data-phase="movement"] .hold-track {
  opacity: 1;
}

.app-shell[data-holding="true"] .timer-value {
  transform: scale(0.975);
}

.app-shell[data-holding="true"] .scene-image {
  transform: scale(1.01);
  filter: saturate(1) contrast(1.04);
}

.app-shell[data-phase="complete"] .edition-label {
  transform: rotate(1.4deg) scale(1.04);
}

.app-shell[data-phase="complete"] .timer-value {
  opacity: 0.94;
  transform: scale(1.025);
}

.stage-chrome {
  position: absolute;
  z-index: 3;
  top: max(22px, env(safe-area-inset-top));
  right: 22px;
  left: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.wordmark {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-shadow: 0 2px 12px rgb(0 0 0 / 48%);
}

.stop-action {
  min-width: 96px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgb(241 236 223 / 42%);
  border-radius: 999px;
  color: var(--paper);
  background: rgb(17 16 14 / 32%);
  font-size: 14px;
  font-weight: 620;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.stop-action[data-pressing="true"] {
  border-color: var(--paper);
  background: rgb(241 236 223 / 18%);
  transform: scale(0.96);
}

.browser-note {
  position: absolute;
  z-index: 3;
  right: 24px;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 24px;
  margin: 0;
  color: rgb(241 236 223 / 60%);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 2px 12px rgb(0 0 0 / 72%);
  pointer-events: none;
}

.qr-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
  padding: clamp(40px, 5vw, 72px) clamp(34px, 4vw, 58px);
  color: var(--black);
  background:
    linear-gradient(rgb(17 16 14 / 7%) 1px, transparent 1px) 0 0 / 100% 26px,
    var(--paper);
  border-left: 1px solid rgb(241 236 223 / 20%);
}

.catalogue {
  margin: 0 0 28px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.qr-copy h1 {
  max-width: 9ch;
  margin: 0;
  font-family: Didot, "Bodoni 72", "Times New Roman", serif;
  font-size: clamp(3.25rem, 4.7vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.qr-copy > p:last-child {
  max-width: 17rem;
  margin: 30px 0 0;
  color: rgb(17 16 14 / 68%);
  font-size: 16px;
  line-height: 1.65;
}

.qr-lockup {
  align-self: flex-start;
  margin-top: 48px;
  transform: rotate(0.45deg);
}

.qr-image {
  display: block;
  width: 282px;
  height: 282px;
  border: 0;
  background: #fff;
  image-rendering: pixelated;
}

.qr-lockup p {
  margin: 14px 0 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
}

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

noscript {
  position: fixed;
  z-index: 10;
  inset: 20px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--black);
  font-size: 16px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .qr-panel {
    padding-right: 38px;
    padding-left: 38px;
  }
}

@media (max-width: 767px) {
  html,
  body,
  .app-shell,
  .timer-stage,
  .timer-surface {
    min-height: 100dvh;
  }

  .app-shell {
    display: block;
  }

  .timer-stage {
    width: 100%;
  }

  .qr-panel {
    display: none;
  }

  .timer-surface {
    grid-template-rows: 1fr auto auto 1fr;
    padding-right: 18px;
    padding-left: 18px;
  }

  .timer-value {
    font-size: min(52vw, 41vh);
  }

  .timer-cue {
    margin-top: 24px;
  }

  .browser-note {
    right: 18px;
    left: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
