/* Visual language mirrors tune-score.com: monochrome, soft grey canvas,
   Satoshi headings, Inter body, black buttons with layered shadows. */
:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --ink: #000000;
  --ink-2: #3d3d3d;
  --muted: #737373;
  --line: #e5e5e5;
  --radius: 10px;
  --radius-card: 14px;
  --shadow-primary:
    rgba(61, 61, 61, 0.72) 0 0.6px 1.08px -1.25px,
    rgba(61, 61, 61, 0.64) 0 2.29px 4.12px -2.5px,
    rgba(61, 61, 61, 0.25) 0 10px 18px -3.75px,
    rgba(0, 0, 0, 0.35) 0 0.71px 0.71px -0.58px,
    rgba(0, 0, 0, 0.33) 0 3.62px 3.62px -1.75px,
    rgba(0, 0, 0, 0.26) 0 13.65px 13.65px -2.92px;
  --shadow-secondary:
    rgba(158, 158, 158, 0.69) 0 0.71px 0.71px -0.58px,
    rgba(158, 158, 158, 0.65) 0 3.62px 3.62px -1.75px,
    rgba(158, 158, 158, 0.52) 0 13.65px 13.65px -2.92px,
    rgb(255, 255, 255) 0 3px 1px 0 inset;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Satoshi', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

.glow {
  position: fixed;
  inset: -20vh -20vw auto;
  height: 70vh;
  background: radial-gradient(ellipse at 50% 30%, #ffffff 0%, rgba(255, 255, 255, 0) 65%);
  pointer-events: none;
  z-index: 0;
}

.topbar, .progress, .app { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 20px 12px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.logo { height: 28px; width: auto; display: block; }

.lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
}

.lang button {
  font: 600 12px/1 var(--font-body);
  letter-spacing: 0.04em;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
}

.lang button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.lang.is-hidden { visibility: hidden; }

.progress {
  max-width: 600px;
  width: calc(100% - 40px);
  margin: 4px auto 0;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  visibility: hidden;
}

.progress.visible { visibility: visible; }

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px max(24px, env(safe-area-inset-bottom));
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: enter 0.28s ease both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.screen.still { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .progress-fill { transition: none; }
}

/* Start + end screens */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding-bottom: 8vh;
}

.badge-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #111;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 6px #e8e8e8, 0 0 0 7px #d4d4d4, var(--shadow-primary);
  color: #fff;
}

.badge-icon svg { width: 30px; height: 30px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-secondary);
}

h1, h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: clamp(30px, 8vw, 44px); line-height: 1.08; max-width: 14em; }

h2 { font-size: clamp(22px, 6vw, 28px); line-height: 1.2; }

.lead { margin: 0; color: var(--ink-2); font-size: 17px; max-width: 30em; }
.note { margin: 0; color: var(--muted); font-size: 15px; max-width: 30em; }

/* Question screen */
.meta { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 8px; }

.hint { font-size: 14px; color: var(--muted); margin: 8px 0 0; }

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  text-align: left;
  font: 500 16px/1.35 var(--font-body);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.option:active { transform: scale(0.985); }

@media (hover: hover) {
  .option:hover { border-color: #bdbdbd; }
}

.option[aria-checked='true'] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.mark {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid #c4c4c4;
  display: grid;
  place-items: center;
  transition: background 0.15s, border-color 0.15s;
}

.mark.radio { border-radius: 50%; }
.mark.check { border-radius: 6px; }

.option[aria-checked='true'] .mark { background: var(--ink); border-color: var(--ink); }

.mark svg { width: 12px; height: 12px; color: #fff; opacity: 0; }

.option[aria-checked='true'] .mark svg { opacity: 1; }

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.scale .option {
  justify-content: center;
  min-height: 64px;
  padding: 0;
  font: 700 22px/1 var(--font-heading);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.field {
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  font: 400 16px/1.45 var(--font-body); /* 16px stops iOS zoom-on-focus */
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  resize: vertical;
  outline: none;
}

.field:focus { border-color: var(--ink); }

textarea.field { min-height: 140px; margin-top: 22px; }

.counter { text-align: right; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Buttons */
.nav {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  font: 600 16px/1 var(--font-body);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-primary); flex: 1; }

.btn-secondary { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-secondary); }

.btn[disabled] { opacity: 0.35; cursor: not-allowed; transform: none; }

.hero .btn-primary { flex: none; min-width: 200px; margin-top: 8px; }

.choices { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin-top: 8px; }

.btn svg { width: 16px; height: 16px; }

.error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fff1f1;
  color: #a11;
  font-size: 14px;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.noscript { text-align: center; padding: 40px 20px; }

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

@media (min-width: 720px) {
  .app { padding-top: 56px; }
  .nav { margin-top: 36px; }
  .hero { padding-bottom: 12vh; }
}
