@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..900,0..100;1,9..144,300..900,0..100&family=Familjen+Grotesk:ital,wght@0,400;0,500;0,700;1,400;1,500&family=DM+Mono:wght@400;500&display=swap");

:root {
  /* Mid-century palette: oat paper, Eames persimmon, deep teal */
  --paper: #e8dcc0;
  --paper-card: #efe6ce;
  --ink: #1c1812;
  --ink-soft: #5a4f3f;
  --ink-mute: #8c8068;
  --persimmon: #d44f22;
  --persimmon-deep: #a8381a;
  --teal: #2e5f5c;
  --teal-deep: #1d4441;
  --hairline: rgba(28, 24, 18, 0.18);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background-color: var(--paper);
}

body {
  font-family:
    "Familjen Grotesk",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background-color: var(--paper);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--ink);
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Atmospheric atomic-age motifs: two large circles bleeding off the edges.
   No gradients — just flat shapes set very low contrast. */
body::before {
  content: "";
  position: fixed;
  bottom: -55vmin;
  right: -32vmin;
  width: 115vmin;
  height: 115vmin;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  top: -28vmin;
  left: -30vmin;
  width: 72vmin;
  height: 72vmin;
  background: var(--persimmon);
  border-radius: 50%;
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

.paco-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-paco {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 150px;
  pointer-events: none;
  user-select: none;
  border-radius: 50%;
  opacity: 0;
  will-change: transform;
  contain: layout paint;
  mix-blend-mode: multiply;
}

.floating-paco.ready {
  opacity: 1;
}

@media (max-width: 800px) {
  .floating-paco {
    width: 110px;
    height: 110px;
  }

  .floating-paco:nth-child(n + 5) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-paco {
    display: none;
  }
}

.container {
  background: #efe6cede;
  padding: 2.75rem 2.5rem 2.25rem;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  max-width: 480px;
  width: 100%;
  position: relative;
  z-index: 1;
  animation: card-arrive 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Editorial mark — a thin persimmon bar above the headline. Eames-spare. */
.container::before {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  background: var(--persimmon);
  margin-bottom: 1.5rem;
  animation: bar-stretch 0.7s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transform-origin: left center;
}

h1 {
  font-family: "Fraunces", "Cochin", "Hoefler Text", serif;
  font-variation-settings:
    "opsz" 144,
    "SOFT" 100,
    "wght" 600;
  font-weight: 600;
  font-size: clamp(3.5rem, 11vw, 5rem);
  letter-spacing: -0.025em;
  color: var(--persimmon);
  text-align: left;
  line-height: 0.88;
  margin-bottom: 0.75rem;
  animation: rise 0.7s 0.22s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

p {
  font-family: "Fraunces", serif;
  font-variation-settings:
    "opsz" 14,
    "SOFT" 100,
    "wght" 400;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: left;
  margin-bottom: 2.25rem;
  max-width: 30ch;
  animation: rise 0.7s 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.controls {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ink);
  animation: rise 0.7s 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.bpm-control {
  margin-bottom: 1.75rem;
}

.bpm-control label {
  display: flex;
  align-items: baseline;
  font-family: "Familjen Grotesk", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.85rem;
}

/* The numeric readout — a measurement-instrument feel. */
#bpmValue,
#volumeValue {
  font-family: "DM Mono", "Courier New", monospace;
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--persimmon);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  margin-right: 3px;
}

input[type="range"] {
  width: 100%;
  height: 2px;
  background: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0.5rem 0 0.5rem;
  border: none;
  border-radius: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--persimmon);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition:
    transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 0.18s ease;
  margin-top: 0;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  background: var(--persimmon-deep);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(0.96);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--persimmon);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition:
    transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1),
    background-color 0.18s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.18);
  background: var(--persimmon-deep);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 0 0 4px var(--paper),
    0 0 0 5.5px var(--ink);
}

input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow:
    0 0 0 4px var(--paper),
    0 0 0 5.5px var(--ink);
}

.bpm-labels {
  display: flex;
  justify-content: space-between;
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  margin-top: 0.65rem;
}

.play-button {
  width: 100%;
  padding: 1.1rem 1.5rem;
  background: var(--persimmon);
  color: var(--paper-card);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font-family: "Familjen Grotesk", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 0.5rem;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.play-button:hover {
  background: var(--ink);
  color: var(--paper-card);
}

.play-button:active {
  transform: translateY(1px);
}

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

.play-button.playing {
  background: var(--teal);
  color: var(--paper-card);
  animation: heartbeat 1.8s ease-in-out infinite;
}

.play-button.playing:hover {
  background: var(--teal-deep);
  animation: none;
}

@keyframes card-arrive {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bar-stretch {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes heartbeat {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .container,
  .container::before,
  h1,
  p,
  .controls,
  .play-button.playing {
    animation: none;
  }
}
