@font-face {
  font-family: 'Sansita';
  src: url('/fonts/sansita-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('/fonts/nunito-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('/fonts/nunito-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --coral: #f08e80;
  --coral-deep: #c24a3a;
  --coral-text: #b84434;
  --cream: #fdf0e6;
  --card: #ffffff;
  --ink: #2b1d1a;
  --muted: #6e5a55;
  --line: #ecd9cc;
  --green: #3f6b34;
  --on-coral: #ffffff;
  --field: #ffffff;
  /* Air grows with the text size, never past twice the regular amount. */
  --air: clamp(1rem, 0.5rem + 2vw, 1.5rem);
  --radius: 28px;
  --display: 'Sansita', 'Georgia', serif;
  --body: 'Nunito Sans', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --coral: #f08e80;
    --coral-text: #f5a497;
    --cream: #1e1513;
    --card: #2a1e1b;
    --ink: #fdf0e6;
    --muted: #b8a49e;
    --line: #3d2c28;
    --green: #8fc07f;
    --field: #1e1513;
  }
}
@media (prefers-contrast: more) {
  :root {
    --muted: var(--ink);
    --line: var(--ink);
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1.125rem/1.5 var(--body);
  min-height: 100vh;
  overflow-wrap: break-word;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--coral-deep);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Page frame */
.top {
  background: var(--coral-deep);
  color: var(--on-coral);
  padding: calc(var(--air) * 2) 16px calc(var(--air) * 1.5);
  border-radius: 0 0 var(--radius) var(--radius);
}
.top h1 {
  font-size: clamp(2.5rem, 9vw, 4rem);
}
.top .sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.5rem;
  font-weight: 700;
}
.top .sub a {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.top .sub a[aria-current] {
  text-decoration: none;
  opacity: 1;
}
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}
main {
  padding: var(--air) 0 calc(var(--air) * 3);
}

/* Days and cards */
.day {
  margin-top: calc(var(--air) * 1.5);
}
.day > h2 {
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  color: var(--coral-text);
  margin-bottom: 0.75rem;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--air);
  margin-bottom: 1rem;
}
.time {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.25rem, 10vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.time + .time {
  margin-top: 0.25rem;
}
.time.small {
  font-size: clamp(1.5rem, 6vw, 1.875rem);
}
.label {
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--air) 0 0.25rem;
}
.people {
  list-style: none;
  margin: 0;
  padding: 0;
}
.people li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  align-items: baseline;
  padding: 0.375rem 0;
  border-top: 1px solid var(--line);
}
.people li:first-child {
  border-top: 0;
}
.people .who {
  font-weight: 700;
}
.people .when {
  font-variant-numeric: tabular-nums;
}
.ok {
  color: var(--green);
  font-weight: 700;
}
.flag {
  color: var(--coral-text);
  font-weight: 700;
}
.muted {
  color: var(--muted);
}
.empty {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--muted);
  margin-top: calc(var(--air) * 2);
}

/* Controls */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 375px;
  min-height: 56px;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 28px;
  background: var(--coral-deep);
  color: var(--on-coral);
  font: 700 1.375rem/1.2 var(--display);
  text-decoration: none;
  cursor: pointer;
  margin-top: var(--air);
}
.btn.quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn.small {
  width: auto;
  min-height: 44px;
  font-size: 1.125rem;
  margin-top: 0;
  padding: 0.5rem 1.25rem;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.link {
  background: none;
  border: 0;
  padding: 0.5rem 0;
  min-height: 44px;
  font: 700 1rem var(--body);
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
label,
.field-name {
  display: block;
  font-weight: 700;
  margin: var(--air) 0 0.375rem;
}
input,
select {
  width: 100%;
  max-width: 375px;
  min-height: 56px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--field);
  color: var(--ink);
  font: 700 1.25rem var(--body);
}
select.time-pick {
  font: 700 1.75rem var(--display);
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
  max-width: 375px;
}
.pair select {
  width: 100%;
}
@media (min-resolution: 0dpi) and (max-width: 20rem) {
  .pair {
    grid-template-columns: 1fr;
  }
}
.msg {
  font-weight: 700;
  color: var(--coral-text);
  margin-top: 0.75rem;
}
.msg.good {
  color: var(--green);
}

/* Names */
.names {
  display: grid;
  gap: 0.75rem;
  margin-top: var(--air);
}
.names .btn {
  margin: 0;
  max-width: none;
  justify-content: flex-start;
  font-size: 1.75rem;
  min-height: 72px;
  padding: 0.75rem 1.5rem;
}

/* Login */
.login {
  min-height: 100vh;
  display: grid;
  align-content: center;
  position: relative;
  overflow: hidden;
  padding: calc(var(--air) * 2) 16px;
}
.login::before {
  content: '';
  position: absolute;
  width: 120vmin;
  height: 120vmin;
  border-radius: 50%;
  background: var(--coral);
  left: -60vmin;
  top: -30vmin;
  z-index: 0;
}
.login > * {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.login h1 {
  font-size: clamp(3.5rem, 16vw, 6rem);
  color: var(--ink);
}
.login form {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--air);
  margin-top: var(--air);
}
.login label {
  margin-top: 0;
}

/* Admin tables of settings */
.section {
  margin-top: calc(var(--air) * 1.5);
}
.section > h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.inline input,
.inline select {
  flex: 1 1 12rem;
}
.offer {
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
}
.offer:first-of-type {
  border-top: 0;
}
code.copy {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--field);
  border: 2px solid var(--line);
  border-radius: 16px;
  font-size: 1rem;
  word-break: break-all;
  user-select: all;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: transform 0.12s ease;
  }
  .btn:active {
    transform: scale(0.98);
  }
}

/* Expands in place: a solid triangle in the text colour, pointing in when closed and down when open. */
details.add {
  margin-top: var(--air);
}
details.add > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
details.add > summary::-webkit-details-marker {
  display: none;
}
details.add > summary::before {
  content: '';
  border-style: solid;
  border-width: 0.35em 0 0.35em 0.55em;
  border-color: transparent transparent transparent currentColor;
}
details.add[open] > summary::before {
  border-width: 0.55em 0.35em 0 0.35em;
  border-color: currentColor transparent transparent transparent;
}
@media (prefers-color-scheme: dark) {
  .login::before {
    background: var(--coral-deep);
  }
}
.card > :first-child,
main.wrap > .time:first-of-type {
  margin-top: 0;
}
.time {
  margin: 0;
}
.people + .btn,
.muted + .btn {
  margin-top: var(--air);
}
.top .sub a[aria-current] {
  background: var(--on-coral);
  color: var(--coral-deep);
  border-radius: 999px;
  padding: 0 0.6em;
  margin: 0 -0.6em;
}
.top .sub a[aria-current] ~ a,
.top .sub a:has(~ a[aria-current]) {
  position: relative;
}
main.wrap {
  padding-top: calc(var(--air) * 1.5);
  padding-bottom: calc(var(--air) * 3);
}
main.wrap > .day:first-of-type,
main.wrap > [role='status']:empty + .day {
  margin-top: 0;
}
[role='status']:empty {
  margin: 0;
}
