/* Plain and light: white, black, green. Red only for errors. */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #525252;     /* 7.8:1 on white */
  --line: #d4d4d4;
  --soft: #f5f5f5;
  --green: #15803d;     /* 5:1 on white, white text on it passes */
  --green-dot: #16a34a;
  --green-tint: #f0fdf4;
  --red: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { background: #bbf7d0; color: var(--ink); }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

p, h1, figure { margin: 0; }

.page { max-width: 520px; margin: 0 auto; }

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } }

/* the photo */
.collage { padding: 20px 20px 0; }
.collage img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 14px;
  background: var(--soft);
}

.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 28px max(36px, env(safe-area-inset-bottom));
}
.bottom { margin-top: auto; }
.grow { flex-grow: 1; }

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
}
[data-screen="gate"] .meta::before,
[data-screen="home"] .meta::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-dot);
  flex-shrink: 0;
}

.intro { display: flex; flex-direction: column; gap: 12px; }
.title { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
.lede { font-size: 18px; color: var(--muted); }
.question { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.help { color: var(--muted); }

/* forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 15px; font-weight: 500; }
.field input {
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  width: 100%;
}
.field input::placeholder { color: #8a8a8a; }
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px #bbf7d0; }

.error { color: var(--red); font-size: 15px; font-weight: 500; }

/* buttons */
.buttons { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s, background-color 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #166534; }
.btn-secondary { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--soft); }
.btn:focus-visible, .back-link:focus-visible { outline: 3px solid #86efac; outline-offset: 2px; }
.btn:disabled { opacity: 0.6; }

.back-link { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; align-self: flex-start; padding: 6px 0; }
.back-link:hover { color: var(--ink); }

.shake { animation: shake 0.3s; }
@keyframes shake {
  25%, 75% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
}

/* quiz */
.progress-wrap { display: flex; flex-direction: column; gap: 10px; }
.progress { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width 0.25s ease; }

.fields { display: flex; flex-direction: column; gap: 16px; }
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chips.stack { grid-template-columns: 1fr; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.chip span::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 1.5px solid #a3a3a3;
  border-radius: 6px;
  background: var(--bg) center / 14px no-repeat;
}
.chip input[type=radio] + span::before { border-radius: 50%; }
.chip input:checked + span { border-color: var(--green); background: var(--green-tint); }
.chip input:checked + span::before {
  border-color: var(--green);
  background-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}
.chip input[type=radio]:checked + span::before { background-image: none; box-shadow: inset 0 0 0 4px var(--bg); }
.chip input:focus-visible + span { outline: 3px solid #86efac; outline-offset: 2px; }
.other { margin-top: 16px; }

.note { background: var(--soft); border-radius: var(--radius); padding: 12px 14px; color: var(--muted); font-size: 15px; }

.quiz-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding-top: 8px; }

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

/* who's coming + results */
.text-link { color: var(--green); font-weight: 700; text-align: center; padding: 10px; text-decoration: underline; text-underline-offset: 3px; }
.crew { display: flex; flex-direction: column; gap: 28px; }
.crew-head, .r-head { margin: 0 0 10px; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.crew-head span, .r-head span { background: var(--green-tint); color: var(--green); border-radius: 999px; padding: 1px 9px; font-size: 13px; }
.crew ul, .r-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.crew li, .r-list li { padding: 14px 2px; border-bottom: 1px solid var(--line); font-size: 18px; }
.r-list li { font-size: 16px; padding: 11px 2px; }
.results { display: flex; flex-direction: column; gap: 32px; }
.r-none { color: var(--muted); font-size: 15px; }
.r-bar { margin-bottom: 12px; }
.r-bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; margin-bottom: 5px; }
.r-bar-track { height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.r-bar-fill { height: 100%; background: var(--green); border-radius: 999px; }
.already { display: flex; flex-direction: column; gap: 12px; }
.already-msg { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.already-msg::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green-dot); flex-shrink: 0; }
.already .help { text-align: center; font-size: 15px; }

/* weekend calendar */
.wk-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cal-wrap { display: flex; flex-direction: column; gap: 22px; }
.cal-title { font-weight: 700; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 6px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); padding-bottom: 4px; }
.cal-day {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #a3a3a3;
}
.cal-day.in-range {
  color: var(--ink);
  font-weight: 500;
  background: var(--green-tint);
  border-top: 1.5px solid #bbf7d0;
  border-bottom: 1.5px solid #bbf7d0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.cal-day.r-start { border-left: 1.5px solid #bbf7d0; border-radius: 10px 0 0 10px; }
.cal-day.r-end { border-right: 1.5px solid #bbf7d0; border-radius: 0 10px 10px 0; }
.cal-day.r-start.r-end { border-radius: 10px; }
.cal-day.in-range.picked { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.cal-day.in-range.focus { outline: 3px solid #86efac; outline-offset: -3px; }
.any-row { grid-template-columns: 1fr; margin-top: 18px; }
.wk-summary { margin-top: 12px; font-size: 15px; }

/* grouped options */
.opt-group + .opt-group { margin-top: 22px; }
.group-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.group-label span { text-transform: none; letter-spacing: 0; font-weight: 500; background: var(--soft); border-radius: 999px; padding: 1px 9px; }
