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

html {
  min-width: 20rem;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, var(--brand-soft), transparent 34rem),
    var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  text-rendering: optimizeLegibility;
}

button,
input,
summary {
  font: inherit;
}

button,
label,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--brand);
  text-underline-offset: 0.2em;
}

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

[hidden] {
  display: none !important;
}

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

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header-inner,
.site-footer-inner {
  display: flex;
  width: min(100%, calc(var(--content-max) + 8rem));
  margin: 0 auto;
  padding:
    var(--space-4)
    max(var(--gutter), env(safe-area-inset-right))
    var(--space-4)
    max(var(--gutter), env(safe-area-inset-left));
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  color: var(--text-primary);
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: var(--weight-display-bold);
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 1.55rem;
  aspect-ratio: 1;
  border: 0.2rem solid var(--brand);
  border-radius: var(--radius-full);
}

.brand-mark::after {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  width: 0.48rem;
  aspect-ratio: 1;
  border: 0.15rem solid var(--bg);
  border-radius: var(--radius-full);
  background: var(--band-banger);
  content: "";
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.header-nav a {
  color: var(--text-secondary);
}

.site-main {
  min-height: calc(100vh - 8rem);
  min-height: calc(100dvh - 8rem);
  padding:
    var(--space-8)
    max(var(--gutter), env(safe-area-inset-right))
    var(--space-16)
    max(var(--gutter), env(safe-area-inset-left));
}

.app-shell,
.info-panels {
  width: min(100%, var(--content-max));
  margin-inline: auto;
}

.app-view {
  animation: view-in var(--motion-base) var(--ease-out);
}

.drop-view {
  display: grid;
  gap: var(--space-6);
}

.drop-copy {
  display: grid;
  gap: var(--space-3);
  text-align: center;
}

.eyebrow,
.score-eyebrow,
.section-eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: var(--weight-body-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.drop-title,
.progress-title,
.error-title {
  max-width: 15ch;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.drop-subtitle {
  max-width: 35rem;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: var(--text-md);
}

.dropzone {
  display: grid;
  min-height: 20rem;
  padding: var(--space-8) var(--space-5);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  place-items: center;
  align-content: center;
  gap: var(--space-6);
  text-align: center;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.dropzone[data-active="true"] {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: scale(1.01);
}

.photo-glyph {
  position: relative;
  display: block;
  width: 5.5rem;
  height: 4.5rem;
  border: 0.25rem solid var(--brand);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
}

.photo-glyph::before {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 0.8rem;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background: var(--band-banger);
  content: "";
}

.photo-glyph::after {
  position: absolute;
  right: 0.7rem;
  bottom: 0.6rem;
  left: 0.7rem;
  height: 1.9rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  clip-path: polygon(0 100%, 32% 24%, 53% 63%, 72% 38%, 100% 100%);
  content: "";
}

.picker-actions,
.result-actions {
  display: grid;
  width: min(100%, 24rem);
  gap: var(--space-3);
}

.button {
  display: inline-flex;
  min-height: 3.25rem;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-body-bold);
  line-height: var(--leading-snug);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--text-on-brand);
}

.button-primary:hover:not(:disabled) {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.visually-hidden:focus-visible + .button {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.drop-hint,
.privacy-hint,
.progress-note,
.device-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.privacy-hint,
.device-note {
  text-align: center;
}

.waitlist {
  display: grid;
  margin-top: var(--space-8);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  gap: var(--space-3);
}

.waitlist-title,
.waitlist-subtitle,
.waitlist-status {
  margin: 0;
}

.waitlist-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display-bold);
  letter-spacing: var(--tracking-tight);
}

.waitlist-subtitle,
.waitlist-status {
  color: var(--text-secondary);
}

.waitlist-form {
  display: grid;
  margin-top: var(--space-2);
  gap: var(--space-3);
}

.waitlist-email-label {
  font-weight: var(--weight-body-bold);
}

.waitlist-email {
  min-height: 3.25rem;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-primary);
}

.waitlist-email::placeholder {
  color: var(--text-tertiary);
}

.waitlist-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.waitlist-consent input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  accent-color: var(--brand);
}

.waitlist-privacy-link {
  grid-column: 2;
  justify-self: start;
}

.waitlist-status {
  min-height: 1.5em;
  font-size: var(--text-sm);
}

.preload-status,
.progress-view {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.preload-status {
  display: grid;
  gap: var(--space-2);
}

.progress-status-small {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-display-semibold);
}

.progress-view {
  display: grid;
  min-height: 26rem;
  place-content: center;
  gap: var(--space-6);
  text-align: center;
}

.progress-meter {
  width: 100%;
  height: 0.55rem;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-full);
  accent-color: var(--brand);
  background: var(--bg-sunken);
}

.progress-meter::-webkit-progress-bar {
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
}

.progress-meter::-webkit-progress-value {
  border-radius: var(--radius-full);
  background: var(--brand);
}

.progress-meter::-moz-progress-bar {
  border-radius: var(--radius-full);
  background: var(--brand);
}

.result-view {
  --score-color: var(--band-good);
  display: grid;
  gap: var(--space-8);
}

.result-view[data-band="rough"] {
  --score-color: var(--band-rough);
}

.result-view[data-band="okay"] {
  --score-color: var(--band-okay);
}

.result-view[data-band="good"] {
  --score-color: var(--band-good);
}

.result-view[data-band="great"] {
  --score-color: var(--band-great);
}

.result-view[data-band="banger"] {
  --score-color: var(--band-banger);
}

.score-hero {
  display: grid;
  padding: var(--space-8) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  justify-items: center;
  gap: var(--space-5);
  text-align: center;
}

.band-pill {
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--score-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-display-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.score-ring {
  --ring-progress: 0deg;
  --ring-track: rgb(20 22 28 / 0.1);
  display: grid;
  width: min(70vw, 16rem);
  aspect-ratio: 1;
  padding: 0.8rem;
  border-radius: var(--radius-full);
  background: conic-gradient(
    from -90deg,
    var(--score-color) var(--ring-progress),
    var(--ring-track) 0
  );
  box-shadow: 0 0 2rem var(--brand-soft);
  place-items: center;
}

.score-stack {
  display: grid;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--bg-elevated);
  place-content: center;
}

.score-value {
  color: var(--score-color);
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-display-extrabold);
  letter-spacing: var(--tracking-tight);
  line-height: 0.82;
}

.score-out-of {
  margin-top: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-body-bold);
}

.verdict {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}

.result-section {
  display: grid;
  gap: var(--space-5);
}

.section-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-display-bold);
}

.dimension-list {
  display: grid;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  gap: var(--space-5);
}

.dimension {
  display: grid;
  gap: var(--space-2);
}

.dimension-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
}

.dimension-label,
.dimension-value,
.tip-label {
  font-family: var(--font-display);
  font-weight: var(--weight-display-semibold);
}

.dimension-value {
  font-variant-numeric: tabular-nums;
}

.dimension-track {
  height: 0.65rem;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
}

.dimension-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--score-color);
  transition: width var(--motion-celebrate) var(--ease-out);
}

.result-view.is-revealed .dimension-fill {
  width: var(--dimension-score);
}

.flag-callout {
  padding: var(--space-5);
  border: 1px solid var(--score-color);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
}

.flag-copy {
  margin: var(--space-2) 0 0;
  font-size: var(--text-md);
  font-weight: var(--weight-body-medium);
}

.tip-list {
  display: grid;
  padding: 0;
  margin: 0;
  gap: var(--space-3);
  list-style: none;
}

.tip-card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-left: 0.3rem solid var(--score-color);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.tip-label,
.tip-copy {
  margin: 0;
}

.tip-copy {
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-md);
}

.result-actions {
  width: 100%;
}

.share-panel {
  display: grid;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  gap: var(--space-4);
}

.share-title,
.share-subtitle,
.share-note,
.share-status {
  margin: 0;
}

.share-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display-bold);
  letter-spacing: var(--tracking-tight);
}

.share-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-md);
}

.share-preview {
  display: block;
  width: min(100%, 27rem);
  height: auto;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  background: #0b0d12;
  box-shadow: var(--shadow-lg);
}

.share-photo-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-3);
  font-weight: var(--weight-body-bold);
}

.share-photo-option input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.15rem 0 0;
  accent-color: var(--brand);
}

.share-note,
.share-status {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.share-actions {
  display: grid;
  gap: var(--space-3);
}

.share-status {
  min-height: 1.5em;
}

.result-ad-slot {
  width: min(100%, 336px);
  height: 280px;
  margin-inline: auto;
}

.debug-panel {
  overflow: auto;
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.error-view {
  display: grid;
  min-height: 26rem;
  padding: var(--space-8) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  place-content: center;
  justify-items: center;
  gap: var(--space-6);
  text-align: center;
}

.error-glyph {
  position: relative;
  width: 5rem;
  height: 3.75rem;
  border: 0.25rem solid var(--brand);
  border-radius: var(--radius-lg);
  transform: rotate(-4deg);
}

.error-glyph::after {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  left: 0.7rem;
  height: 0.25rem;
  border-radius: var(--radius-full);
  background: var(--brand);
  content: "";
  transform: rotate(10deg);
}

.info-panels {
  display: grid;
  margin-top: 0;
  gap: var(--space-3);
}

.info-panel {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.info-panel:not([open]) {
  display: none;
}

.info-panel[open] {
  margin-top: var(--space-16);
}

.info-panel summary {
  color: var(--text-primary);
  font-weight: var(--weight-body-bold);
  cursor: pointer;
}

.info-panel[open] summary {
  margin-bottom: var(--space-6);
}

.info-title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xl);
}

.info-panel p {
  color: var(--text-secondary);
}

.imprint-address {
  display: grid;
  color: var(--text-secondary);
  font-style: normal;
}

.privacy-date {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.privacy-intro,
.privacy-closing {
  font-size: var(--text-md);
}

.privacy-section {
  margin-top: var(--space-8);
}

.privacy-section h3 {
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
}

.info-ad-slot {
  width: min(100%, 728px);
  height: 100px;
  margin: var(--space-8) auto 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.site-footer-inner {
  align-items: flex-start;
}

.footer-tagline,
.footer-copyright {
  margin: 0;
}

.footer-tagline {
  font-family: var(--font-display);
  font-weight: var(--weight-display-semibold);
}

.footer-copyright {
  margin-top: var(--space-1);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

@media (prefers-color-scheme: dark) {
  .score-ring {
    --ring-track: rgb(255 255 255 / 0.12);
  }
}

:root[data-theme="dark"] .score-ring {
  --ring-track: rgb(255 255 255 / 0.12);
}

:root[data-theme="light"] .score-ring {
  --ring-track: rgb(20 22 28 / 0.1);
}

@media (max-width: 30rem) {
  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-nav {
    width: 100%;
    justify-content: flex-start;
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(var(--space-2));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 40rem) {
  .site-main {
    padding-top: var(--space-12);
  }

  .picker-actions,
  .result-actions {
    grid-template-columns: 1fr 1fr;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .share-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .info-ad-slot {
    height: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: var(--motion-instant) !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--motion-instant) !important;
  }
}
