/* Uses Stay tokens only (tokens.css is a copy of ../design/tokens.css). */
* { box-sizing: border-box; }
html, body { margin: 0; }
html {
  background: var(--stay-deep); /* also fills iOS overscroll */
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--stay-deep);
  color: var(--stay-text);
  font-family: var(--stay-font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
p { margin: 0; }
button, input { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }

.page {
  max-width: 520px;
  margin: 0 auto;
  /* Keep clear of the notch, rounded corners and home bar on iPhone. */
  padding:
    max(var(--stay-space-7), env(safe-area-inset-top))
    max(var(--stay-space-5), env(safe-area-inset-right))
    calc(var(--stay-space-9) + env(safe-area-inset-bottom))
    max(var(--stay-space-5), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: var(--stay-space-5);
}
.center { min-height: 80vh; justify-content: center; align-items: center; }

/* Type */
.h1, .h2 { font-family: var(--stay-font-display); font-weight: 400; margin: 0; color: var(--stay-text); }
.h1 { font-size: 40px; line-height: 1.08; text-wrap: balance; }
.h2 { font-size: 30px; line-height: 1.1; text-wrap: balance; }
.h3 { font-weight: 600; font-size: 18px; line-height: 1.3; margin: 0; }
.body-lg { font-size: 17px; line-height: 1.55; }
.small { font-size: 14px; line-height: 1.5; }
.caption { font-size: 12px; line-height: 1.4; }
.soft { color: var(--stay-text-soft); }
.muted { color: var(--stay-muted); }
.error { color: var(--stay-accent); }
.note { margin-top: calc(-1 * var(--stay-space-3)); }
.number { font-family: var(--stay-font-display); font-size: 16px; color: var(--stay-accent); }
a { color: var(--stay-text); text-underline-offset: 6px; }
.centered { text-align: center; justify-content: center; align-self: center; }

.hero { display: flex; flex-direction: column; gap: var(--stay-space-4); padding-top: var(--stay-space-8); }

/* Progress: one thin segment per question, gold as she goes. */
.progress {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 4px;
  max-width: 520px; margin: 0 auto;
  padding: max(var(--stay-space-4), env(safe-area-inset-top)) var(--stay-space-5) var(--stay-space-2);
  background: var(--stay-deep);
}
.progress[hidden] { display: none; }
.progress span {
  flex: 1; height: 2px; border-radius: 1px;
  background: var(--stay-hairline);
  position: relative; overflow: hidden;
}
.progress span::after {
  content: ''; position: absolute; inset: 0;
  background: var(--stay-accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress span.on::after { transform: scaleX(1); }
.progress + .page { padding-top: var(--stay-space-5); }

/* Choices */
.stack { display: flex; flex-direction: column; gap: var(--stay-space-3); }
.option, .chip {
  cursor: pointer; text-align: left;
  background: var(--stay-raised);
  border: 1px solid var(--stay-hairline);
  transition: border-color 0.15s, background-color 0.15s;
}
.option {
  width: 100%; border-radius: var(--stay-radius-card);
  padding: var(--stay-space-4) var(--stay-space-5);
  font-family: var(--stay-font-display); font-size: 21px; line-height: 1.2;
}
.chips { display: flex; flex-wrap: wrap; gap: var(--stay-space-2); }
.chip {
  border-radius: var(--stay-radius-button);
  padding: var(--stay-space-2) var(--stay-space-4);
  min-height: 44px; font-size: 15px;
}
.option:hover, .chip:hover, .option:focus-visible, .chip:focus-visible { border-color: var(--stay-muted); outline: none; }
.option.picked, .chip.picked { border-color: var(--stay-accent); background: var(--stay-ground); }
.chip.picked { color: var(--stay-accent); }

/* Typing */
.fields { display: flex; flex-direction: column; gap: var(--stay-space-4); }
.field-label { display: flex; flex-direction: column; gap: var(--stay-space-2); font-size: 13px; color: var(--stay-muted); }
.field {
  width: 100%; min-height: 52px;
  background: transparent; border: 0; border-bottom: 1px solid var(--stay-muted);
  border-radius: 0; padding: var(--stay-space-2) 0;
  font-family: var(--stay-font-display); font-size: 24px; color: var(--stay-text);
  -webkit-appearance: none; appearance: none;
}
.field:focus { outline: none; border-bottom-color: var(--stay-accent); }
.field::placeholder { color: var(--stay-muted); opacity: 0.6; }
.field::-webkit-date-and-time-value { text-align: left; }
.field::-webkit-calendar-picker-indicator { filter: invert(0.85); cursor: pointer; }
.at { display: flex; align-items: baseline; gap: 2px; font-family: var(--stay-font-display); font-size: 24px; color: var(--stay-muted); }

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 var(--stay-space-6);
  border-radius: var(--stay-radius-button);
  font-family: var(--stay-font-body); font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer; width: 100%;
}
.btn-primary { background: var(--stay-accent); color: var(--stay-on-accent); border: 0; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: transparent; color: var(--stay-text); border: 1px solid var(--stay-hairline); }
.btn-small { min-height: 40px; width: auto; font-size: 14px; }
.btn-back, .btn-text {
  align-self: flex-start; background: none; border: 0; padding: var(--stay-space-2) 0;
  color: var(--stay-muted); font-size: 14px; cursor: pointer;
}
.btn-text.centered { align-self: center; }
.actions { display: flex; flex-direction: column; gap: var(--stay-space-3); margin-top: var(--stay-space-3); }

.send {
  display: flex; flex-direction: column; gap: var(--stay-space-3);
  padding: var(--stay-space-5); margin-top: var(--stay-space-4);
  background: var(--stay-raised); border: 1px solid var(--stay-hairline); border-radius: var(--stay-radius-card);
}
.send .btn-primary { margin-top: var(--stay-space-2); }

/* Homepage: one quiet line in the dark, fading in slowly. */
.home { min-height: 100vh; min-height: 100svh; gap: var(--stay-space-2); text-align: center; }
.home-line { font-family: var(--stay-font-display); font-size: 28px; line-height: 1.2; color: var(--stay-text); animation: home-in 2.4s ease-out both; }
.home-yet { font-family: var(--stay-font-display); font-style: italic; font-size: 20px; color: var(--stay-accent); animation: home-in 2.4s ease-out 1.6s both; }
@keyframes home-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .home-line, .home-yet { animation: none; } }

/* Guest list (founder only) */
.wide { max-width: 1200px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: var(--stay-space-4); flex-wrap: wrap; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--stay-space-4); margin: 0; }
.figures div { background: var(--stay-raised); border: 1px solid var(--stay-hairline); border-radius: var(--stay-radius-card); padding: var(--stay-space-4); }
.figures dt { font-size: 12px; color: var(--stay-muted); }
.figures dd { margin: 0; font-family: var(--stay-font-display); font-size: 32px; line-height: 1.1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--stay-hairline); border-radius: var(--stay-radius-card); }
.list { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.list th { text-align: left; font-weight: 500; font-size: 12px; color: var(--stay-muted); background: var(--stay-raised); }
.list th, .list td { padding: var(--stay-space-3) var(--stay-space-4); border-bottom: 1px solid var(--stay-hairline); }
.pending ul { margin: var(--stay-space-3) 0 0; padding-left: var(--stay-space-5); }

@media (min-width: 720px) {
  .h1 { font-size: 56px; }
  .h2 { font-size: 40px; }
  .figures { grid-template-columns: repeat(6, 1fr); }
}
