:root {
  --salt: #f5f7f5; /* page */
  --sea: #133f4e; /* deep water: headings, buttons, horizon */
  --shallows: #6e9fa6; /* secondary text, focus */
  --flamingo: #e58e86; /* the sun; used nowhere else */
  --sand: #ddd5c4; /* rules and borders */
  --ink: #1c2a31; /* body text */
  --error: #a3312a;

  --display: "Italiana", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --measure: 36rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  color-scheme: light;
}

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

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: must beat the display rules on .login and other hidden elements */
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
  margin: 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: var(--salt);
  color: var(--ink);
  font: 400 1.0625rem / 1.6 var(--body);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--sea);
}

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

/* ---------- Hero ---------- */

.hero {
  min-height: min(84svh, 52rem);
  display: grid;
  grid-template-rows: 1fr auto;
}

.hero-text {
  align-self: end;
  width: min(var(--measure), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-top: 3rem;
}

.names {
  margin: 0;
  font: 400 clamp(4.5rem, 22vw, 9.5rem) / 0.86 var(--display);
  letter-spacing: -0.01em;
  color: var(--sea);
}
.names span {
  display: block;
  white-space: nowrap;
}
.names span + span {
  padding-left: 0.55em;
}

.when,
.where {
  margin: 0;
}
.when {
  margin-top: 2rem;
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 500;
  color: var(--sea);
}
.where {
  color: color-mix(in srgb, var(--ink) 75%, var(--salt));
}

.horizon {
  position: relative;
  height: clamp(7rem, 18vw, 13rem);
  margin-top: 1.5rem;
  overflow: hidden;
}
/* The sea sits in front of the sun, so only the half above the horizon shows. */
.horizon::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  background: var(--sea);
}
.sun {
  position: absolute;
  right: 16%;
  bottom: 48%;
  width: clamp(6rem, 15vw, 11rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--flamingo);
  transform: translateY(50%);
  animation: rise 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}

@keyframes rise {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sun {
    animation: none;
  }
}

/* ---------- Sub-page top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--measure);
  margin: 0 auto;
  padding: calc(1rem + env(safe-area-inset-top)) var(--gutter) 0;
}
.topbar-home {
  font: 400 1.6rem / 1 var(--display);
  color: var(--sea);
  text-decoration: none;
  white-space: nowrap;
}
.topbar-link {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--shallows);
  text-decoration: none;
}
.topbar-link:hover {
  text-decoration: underline;
}

.subpage .block:first-child {
  padding-top: clamp(2rem, 6vw, 3.5rem);
}

/* Only ever shown to a signed-in admin, so it sits over the hero's empty upper area
   instead of displacing the guest-facing layout. */
.admin-link {
  position: absolute;
  top: calc(1rem + env(safe-area-inset-top));
  right: var(--gutter);
  z-index: 1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}
.admin-link a {
  color: var(--shallows);
  text-decoration: none;
}
.admin-link a:hover {
  text-decoration: underline;
}

/* ---------- Sections ---------- */

main {
  padding: 0 var(--gutter);
}

.block {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 6rem) 0 0;
}
.block:focus {
  outline: none;
}

h2 {
  margin: 0 0 1rem;
  font: 400 clamp(2.4rem, 6vw, 3.25rem) / 1 var(--display);
  color: var(--sea);
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sea);
}

.lead {
  margin: 0 0 1.75rem;
  font-size: 1.15rem;
}

.muted {
  color: color-mix(in srgb, var(--ink) 65%, var(--salt));
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.map {
  margin-top: 2.5rem;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--sand);
  border-radius: 6px;
  overflow: hidden;
  background: var(--sand);
}
.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ---------- Buttons and fields ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.6rem 1.2rem;
  border: 1.5px solid var(--sea);
  border-radius: 999px;
  background: var(--sea);
  color: var(--salt);
  font: 500 1rem / 1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: color-mix(in srgb, var(--sea) 88%, #000);
}
.button-quiet {
  background: transparent;
  color: var(--sea);
}
.button-quiet:hover {
  background: color-mix(in srgb, var(--sea) 8%, transparent);
}
.button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

@media (max-width: 34rem) {
  .actions {
    flex-direction: column;
  }
  .actions .button,
  .submit-row .button {
    width: 100%;
  }
}

label.field {
  display: block;
  margin-top: 1rem;
  font-weight: 500;
}
label.field .hint {
  font-weight: 400;
}

input[type="text"],
input[type="password"],
textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--sand);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus,
textarea:focus {
  border-color: var(--shallows);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shallows) 30%, transparent);
}
textarea {
  min-height: 6rem;
  resize: vertical;
}

.code-input {
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  max-width: 16rem;
}

/* ---------- RSVP ---------- */

.party-name {
  margin-bottom: 0.25rem;
}

.guest {
  margin: 0;
  padding: 1.5rem 0;
  border: 0;
  border-bottom: 1px solid var(--sand);
}
.guest:first-of-type {
  border-top: 1px solid var(--sand);
  margin-top: 1.5rem;
}
.guest legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--sea);
}

.choice {
  clear: both;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.choice label {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--sand);
  border-radius: 999px;
  background: #fff;
}
.choice input:checked + span {
  background: var(--sea);
  border-color: var(--sea);
  color: var(--salt);
}
.choice input:focus-visible + span {
  outline: 3px solid var(--shallows);
  outline-offset: 2px;
}

.form-error {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--error);
  background: color-mix(in srgb, var(--error) 7%, var(--salt));
  color: var(--error);
}

.submit-row {
  margin-top: 2rem;
}

.summary {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  border-top: 1px solid var(--sand);
}
.summary li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--sand);
}
.summary .status {
  color: var(--sea);
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- Footer ---------- */

.footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5rem var(--gutter) calc(3rem + env(safe-area-inset-bottom));
  box-sizing: content-box;
  font-size: 0.95rem;
}
.footer p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 65%, var(--salt));
}

/* ---------- Admin ---------- */

/* The admin tables are wider than the reading measure, so its top bar matches them. */
.admin .topbar {
  max-width: 64rem;
}
.admin main {
  padding-top: 2rem;
}
.admin .block {
  max-width: 64rem;
  padding-top: 0;
}
.admin h3 {
  margin-top: 2.5rem;
}

.login {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}
.login .field {
  flex: 1 1 16rem;
  margin: 0;
}
@media (max-width: 34rem) {
  .login .button {
    width: 100%;
  }
}

.add-form {
  max-width: var(--measure);
}
.guest-rows {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}
.guest-rows legend {
  padding: 0;
  font-weight: 500;
}
.guest-rows .hint {
  font-weight: 400;
}
.guest-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.guest-row input,
.guest-row select {
  margin-top: 0;
}
.guest-row select {
  padding: 0.7rem 0.6rem;
  border: 1.5px solid var(--sand);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
@media (max-width: 34rem) {
  .guest-row {
    grid-template-columns: 1fr 1fr;
  }
  .guest-row input {
    grid-column: 1 / -1;
  }
}
#add-guest-row {
  margin-top: 0.75rem;
}
.tag {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--flamingo) 25%, var(--salt));
  font-size: 0.75rem;
  font-weight: 500;
  vertical-align: middle;
}
.add-success {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--shallows);
  background: color-mix(in srgb, var(--shallows) 10%, var(--salt));
  overflow-wrap: anywhere;
}
.add-success code {
  font-size: 0.95rem;
}

.stats-group {
  margin-top: 1.5rem;
}
.stats-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shallows);
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}
.stats div {
  font-size: 0.95rem;
}
.stats strong {
  display: block;
  font: 400 2.5rem / 1 var(--display);
  color: var(--sea);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-top: 0.5rem;
}
.filters .field {
  flex: 1 1 10rem;
  margin: 0;
}
.filters .field:first-child {
  flex-basis: 16rem;
}
.filters input,
.filters select {
  margin-top: 0.35rem;
}
.filters select,
input[type="search"] {
  display: block;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--sand);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.filters select:focus {
  border-color: var(--shallows);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shallows) 30%, transparent);
}
.filter-summary {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.9rem;
}
@media (max-width: 34rem) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filters .field {
    flex-basis: auto;
  }
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--sand);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th,
td {
  text-align: left;
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--sand);
  vertical-align: top;
}
th {
  font-weight: 600;
  color: var(--sea);
  white-space: nowrap;
}

.guest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 14rem;
}
.guest-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0;
}
.guest-list .status {
  font-weight: 500;
  white-space: nowrap;
}
.status-yes {
  color: var(--sea);
}
.status-no {
  color: var(--error);
}
.status-waiting {
  color: color-mix(in srgb, var(--ink) 50%, var(--salt));
}

.link-cell {
  white-space: nowrap;
}
.link-cell code {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}
.button-danger {
  border-color: color-mix(in srgb, var(--error) 45%, var(--sand));
  color: var(--error);
}
.button-danger:hover {
  background: color-mix(in srgb, var(--error) 8%, transparent);
}
.button-small {
  min-height: 2.25rem;
  padding: 0.3rem 0.85rem;
  font-size: 0.9rem;
}
