:root {
  color-scheme: light dark;
  --accent: #ff6b4a;
  --accent-pressed: #ec5639;
  --accent-soft: #fff0ec;
  --ink: #111114;
  --muted: #6e6e76;
  --grouped: #f2f2f7;
  --surface: #ffffff;
  --soft: #f7f7fa;
  --line: rgba(17, 17, 20, 0.1);
  --shadow: 0 18px 55px rgba(32, 25, 40, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--grouped);
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background: var(--grouped);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.page {
  width: min(100% - 32px, 520px);
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom));
}

.invite-card,
.home-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.site-header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 740;
  letter-spacing: -0.025em;
}

.tally-mark {
  display: grid;
  width: 28px;
  height: 26px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  color: var(--accent);
}

.tally-mark i {
  display: block;
  border-radius: 999px;
  background: currentColor;
}

.tally-mark i:nth-child(2),
.tally-mark i:nth-child(4),
.tally-mark i:nth-child(6),
.tally-mark i:nth-child(8) {
  transform: scaleX(0.55);
}

.header-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.invite-experience {
  padding-top: 8px;
}

.people-connection {
  display: grid;
  grid-template-columns: 78px minmax(64px, 1fr) 78px;
  align-items: start;
  gap: 12px;
  padding: 28px 30px 12px;
}

.person {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}

.person > span {
  overflow: hidden;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 720;
}

.avatar-owner {
  color: #fff;
  background: var(--accent);
}

.avatar-friend {
  color: var(--ink);
  background: var(--soft);
}

.avatar-friend svg {
  width: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.route-line {
  position: relative;
  height: 64px;
}

.route-line::before {
  position: absolute;
  top: 31px;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--line);
}

.route-line span {
  position: absolute;
  top: 20px;
  left: 50%;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface);
  font-size: 17px;
  font-weight: 700;
}

.route-line span::before {
  content: "→";
}

.invite-content,
.home-content {
  padding: 18px 30px 32px;
}

.eyebrow,
.summary-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

h1 {
  margin: 7px 0 14px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif;
  font-size: clamp(2.25rem, 8vw, 3rem);
  font-weight: 740;
  letter-spacing: -0.045em;
  line-height: 1.03;
  overflow-wrap: anywhere;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.48;
}

.trip-summary {
  margin-top: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.date-summary {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 13px;
}

.date-summary svg,
.copy-button svg,
.unavailable-symbol svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.date-summary svg {
  width: 23px;
  color: var(--muted);
}

.date-summary > span {
  display: grid;
  gap: 2px;
}

.date-summary strong {
  font-size: 16px;
  font-weight: 650;
}

.actions {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.button {
  display: grid;
  min-height: 56px;
  padding: 0 22px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  text-align: center;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  transition: transform 120ms ease, background-color 120ms ease;
}

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

.button.primary {
  color: #fff;
  background: var(--accent);
}

.button.primary:active {
  background: var(--accent-pressed);
}

.button.secondary {
  color: var(--ink);
  background: var(--soft);
}

.copy-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

.copy-button svg {
  width: 18px;
}

.copy-status {
  min-height: 18px;
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.helper {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.unavailable-state {
  padding: 48px 30px 36px;
}

.unavailable-symbol {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 36px;
  place-items: center;
  border-radius: 19px;
  color: var(--accent);
  background: var(--accent-soft);
}

.unavailable-symbol svg {
  width: 29px;
}

.unavailable-state h1 {
  max-width: 380px;
}

.unavailable-state .lede {
  max-width: 410px;
}

.unavailable-state .button {
  margin-top: 34px;
}

.home-content {
  padding-top: 48px;
  padding-bottom: 44px;
}

.testing-note {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 22px 0 4px;
  color: var(--muted);
  font-size: 14px;
}

footer a {
  color: inherit;
  text-underline-offset: 3px;
}

.hidden {
  display: none !important;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 58%, white);
  outline-offset: 3px;
}

@media (max-width: 540px) {
  html,
  body {
    background: var(--surface);
  }

  .page {
    width: 100%;
    padding: env(safe-area-inset-top) 0 max(16px, env(safe-area-inset-bottom));
  }

  .invite-card,
  .home-card {
    min-height: calc(100dvh - env(safe-area-inset-top));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .site-header {
    padding-right: 20px;
    padding-left: 20px;
  }

  .people-connection {
    padding-right: 24px;
    padding-left: 24px;
  }

  .invite-content,
  .home-content,
  .unavailable-state {
    padding-right: 24px;
    padding-left: 24px;
  }

  h1 {
    font-size: clamp(2.25rem, 11vw, 2.75rem);
  }

  footer {
    background: var(--surface);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff7e5f;
    --accent-pressed: #ff6445;
    --accent-soft: #3c2420;
    --ink: #fbf8fc;
    --muted: #aaa7af;
    --grouped: #101014;
    --surface: #1b1b20;
    --soft: #29292f;
    --line: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
