:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  color: #201a26;
  background: #f8f6f2;
  --muted: #5e5666;
  --violet: #5c37c4;
  --violet-dark: #452898;
  --border: #dbd4de;
  --surface: #fff;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}

.wrap {
  width: min(1120px, calc(100% - 96px));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  min-height: 76px;
}

.clear-preference {
  margin-top: 8px;
  padding: 5px 0;
  border: 0;
  color: var(--violet-dark);
  background: transparent;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.045em;
  text-decoration: none;
}

.wordmark-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 31px;
  height: 31px;
  border-radius: 8px;
  color: white;
  background: var(--violet);
}

.wordmark-icon i {
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
}

.wordmark-icon i:nth-child(2), .wordmark-icon i:nth-child(4) {
  height: 12px;
}

.wordmark-icon i:nth-child(3) {
  height: 17px;
}

main {
  padding-block: clamp(58px, 9vw, 132px) 64px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(36px, 7vw, 110px);
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5.7vw, 5.35rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.048em;
}

.intro h1 em {
  color: var(--violet);
  font-style: normal;
}

.intro-copy {
  max-width: 35ch;
  margin: 24px 0 34px;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.6;
}

.input-label {
  display: inline-block;
  margin-bottom: 9px;
  font-size: .875rem;
  font-weight: 700;
}

.form-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.form-controls input, .share-field input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #958b9b;
  border-radius: 10px;
  color: inherit;
  background: var(--surface);
}

.form-controls input::placeholder {
  color: #746a79;
}

.form-controls input[aria-invalid="true"] {
  border-color: #a82937;
}

.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  flex-shrink: 0;
  min-height: 50px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}

.primary-button {
  border: 1px solid transparent;
  color: white;
  background: var(--violet);
}

.primary-button:hover {
  background: var(--violet-dark);
}

.primary-button:disabled {
  cursor: wait;
}

.button-indicator {
  font-size: 1.25em;
  line-height: 1;
}

.primary-button:disabled .button-indicator {
  width: .85em;
  height: .85em;
  border: 2px solid #ffffff65;
  border-top-color: white;
  border-radius: 50%;
  font-size: 1em;
  color: transparent;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-error {
  margin: 10px 0 0;
  color: #a02032;
  font-size: .9rem;
  line-height: 1.5;
}

.supported-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 600;
}

.supported-platforms li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.supported-platforms li::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--platform-color);
  content: "";
}

.amazon { --platform-color: #127798; }
.spotify { --platform-color: #18824a; }
.apple { --platform-color: #c62b54; }
.youtube { --platform-color: #ca232b; }

.record-art {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid #c5b5f0;
  border-radius: 30px;
  background:
    repeating-linear-gradient(90deg, transparent 0 35px, #3f238613 35px 36px),
    repeating-linear-gradient(0deg, transparent 0 35px, #3f238613 35px 36px),
    linear-gradient(140deg, #e8dfff, #bdabf4);
}

.record-orbit {
  position: absolute;
  width: 84%;
  aspect-ratio: 1;
  border: 1px dashed #583a9863;
  border-radius: 50%;
}

.record {
  position: relative;
  display: grid;
  place-items: center;
  width: 73%;
  aspect-ratio: 1;
  border: 1px solid #2e2154;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 42%, #9a7ce64d 42% 42.6%, transparent 42.6% 58%, #9a7ce64d 58% 58.6%, transparent 58.6% 68%, #ac8dff8a 68% 68.5%, transparent 68.5%),
    repeating-radial-gradient(circle, #0c061b00 0 5px, #d1baff16 5px 6px),
    conic-gradient(from -18deg, #48386a, #1a1428 18%, #171120 38%, #4b396c 52%, #161022 68%, #181024 88%, #48386a);
  box-shadow: 12px 18px 34px #30215a5c;
}

.record-label {
  width: 38%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #e3d6ff;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 9px, #f4ebff6b 9px 10px),
    conic-gradient(from -45deg, #ba9aff, #8252de 40%, #a985ff 68%, #dfcaff);
}

.record-label::after {
  width: 12%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #20142e;
  content: "";
}

.art-corner {
  position: absolute;
  right: 7%;
  bottom: 7%;
  width: 29px;
  height: 16px;
  background: repeating-linear-gradient(90deg, #553b94 0 2px, transparent 2px 4px, #553b94 4px 5px, transparent 5px 8px);
  opacity: .6;
}

.result {
  max-width: 760px;
  margin-top: clamp(38px, 6vw, 74px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.share-view {
  padding-block-start: clamp(32px, 7vw, 88px);
}

.share-view .intro {
  display: none;
}

.share-view .result {
  margin: 0 auto;
}

.result-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.artwork {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  color: var(--violet);
  background: #ece4ff;
}

.artwork-placeholder {
  font-size: 2.5rem;
}

.artwork img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #ece4ff;
}

.result-details {
  flex: 1 1 15ch;
  min-width: 0;
}

.result-kind {
  margin: 0 0 5px;
  color: var(--violet-dark);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.result h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.3rem, 3vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -.04em;
}

.result-artist {
  margin: 5px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.secondary-button {
  min-height: 44px;
  border: 1px solid var(--border);
  color: var(--violet-dark);
  background: #f8f4ff;
  font-size: .875rem;
}

.secondary-button:hover {
  border-color: var(--violet);
}

.share-field {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.share-field label {
  display: block;
  margin-bottom: 8px;
  font-size: .875rem;
  font-weight: 700;
}

.listen-services {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.result-links {
  margin: 0;
  padding: 7px;
  list-style: none;
}

.result-links li + li {
  border-top: 1px solid #eeeaf0;
}

.service-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}

.service-radio {
  justify-self: center;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--violet);
  cursor: pointer;
}

.platform-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 15px;
  border-radius: 9px;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.platform-link:hover,
.service-radio:checked + .platform-link {
  background: #f8f4ff;
}

.platform-link:focus-visible {
  outline-offset: -2px;
}

.platform-icon {
  display: grid;
  position: relative;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: white;
  background: var(--platform-color);
}

.platform-icon.amazon {
  padding-bottom: 5px;
  font: 700 1.4rem/1 Georgia, serif;
}

.platform-icon.amazon::after {
  position: absolute;
  top: 19px;
  width: 17px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.platform-icon.spotify i {
  position: absolute;
  top: 12px;
  width: 20px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  transform: rotate(10deg);
}

.platform-icon.spotify i:nth-child(2) {
  top: 16px;
  width: 17px;
}

.platform-icon.spotify i:nth-child(3) {
  top: 20px;
  width: 14px;
}

.platform-icon.apple {
  font-size: 1.2rem;
}

.platform-icon.youtube::before {
  width: 17px;
  height: 13px;
  border-radius: 4px;
  background: white;
  content: "";
}

.platform-icon.youtube::after {
  position: absolute;
  width: 6px;
  height: 7px;
  background: var(--platform-color);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
}

.platform-action {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 600;
}

.platform-arrow {
  font-size: 1rem;
}

.listen-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
}

.remember-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
}

.remember-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--violet);
}

.listen-go {
  min-width: 64px;
  min-height: 44px;
}

.listen-go:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 840px) {
  .wrap {
    width: calc(100% - 48px);
  }

  .intro {
    gap: 32px;
  }

  .record-art {
    border-radius: 20px;
  }
}

@media (max-width: 680px) {
  .site-header .wrap {
    min-height: 62px;
  }

  main {
    padding-block: 48px 38px;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .intro h1 {
    font-size: clamp(2.55rem, 10vw, 4.35rem);
  }

  .intro-copy {
    margin-block: 16px 24px;
  }

  .record-art {
    display: none;
  }

  .result-header {
    padding: 16px;
  }

  .listen-actions {
    padding-inline: 16px;
  }

  .platform-link {
    padding-inline: 9px;
  }
}

@media (max-width: 360px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .primary-button {
    padding-inline: 12px;
  }

  .button-indicator {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button:disabled .button-indicator {
    animation: none;
  }
}
