@font-face {
  font-family: 'EMH Grotesk';
  src: url('https://cdn.evanhollander.org/fonts/EMHGrotesk.woff2') format('woff2-variations'),
       url('https://cdn.evanhollander.org/fonts/EMHGrotesk.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'EMH Mono';
  src: url('https://cdn.evanhollander.org/fonts/EMHMono.woff2') format('woff2-variations'),
       url('https://cdn.evanhollander.org/fonts/EMHMono.woff2') format('woff2');
  font-weight: 300 700; font-style: normal; font-display: swap;
}

/* Colours come from cdn.evanhollander.org/themes.css. These are derived from them. */
:root {
  --muted: color-mix(in srgb, var(--text) 62%, var(--surface));
  --line: color-mix(in srgb, var(--text) 14%, var(--surface));
  --soft: color-mix(in srgb, var(--primary) 9%, var(--surface));
  --radius: 12px;
}

* { box-sizing: border-box; }
em, i { font-style: normal; font-weight: 500; }
body {
  margin: 0; padding: 40px 16px; background: var(--canvas); color: var(--text);
  font: 400 16px/1.5 'EMH Grotesk', system-ui, sans-serif;
}
a { color: var(--primary); }
h1 { margin: 0 0 8px; font: 600 28px/1.2 'EMH Grotesk', system-ui, sans-serif; letter-spacing: -.01em; }
h2 { margin: 0 0 10px; font: 600 12px/1 'EMH Grotesk', system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h3 { margin: 0; font-weight: 600; }
p { margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 8px; }
.eyebrow { margin: 0 0 18px; font: 600 12px/1 'EMH Grotesk', system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.err { color: var(--red); margin: 8px 0 0; }
.ok { color: var(--primary); font-weight: 500; }
[hidden] { display: none !important; }

/* Controls */
button, input, textarea, select { font: inherit; color: inherit; }
button, a.button {
  display: inline-block; padding: 9px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500;
}
button:hover, a.button:hover { border-color: var(--primary); }
button.primary, a.button.primary { background: var(--primary); border-color: var(--primary); color: var(--canvas); }
button.ghost, a.button.ghost { background: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
input, textarea, select {
  width: 100%; padding: 10px 12px; background: var(--canvas); border: 1px solid var(--line); border-radius: 8px;
}
label { display: grid; gap: 4px; font-weight: 500; }

/* Cards used by the approve, 404, and admin pages */
.card { max-width: 600px; margin: 0 auto; padding: 28px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.narrow { max-width: 480px; }
.card.wide { max-width: 720px; }
.details { display: grid; grid-template-columns: 84px 1fr; gap: 10px 12px; margin: 16px 0; }
.details dt { font: 600 12px/1.6 'EMH Grotesk', system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.details dd { margin: 0; }
.note { white-space: pre-wrap; padding: 12px 14px; background: var(--soft); border-radius: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* Home page */
.types { display: grid; gap: 12px; margin-top: 16px; }
.types a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; background: var(--surface); }
.types a:hover, .types a:focus-visible { border-color: var(--primary); }
.types strong { display: block; font-size: 18px; font-weight: 600; }
.types span { color: var(--muted); }

/* Booking page: info, calendar, then times or the form */
.booker { max-width: 1000px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: 260px minmax(300px, 1fr) 250px; }
.booker > section { padding: 28px; }
.booker > section + section { border-left: 1px solid var(--line); }
.meta { display: grid; gap: 6px; margin: 16px 0; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chips button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--canvas); }

.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-head h2 { margin: 0; font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--text); font-weight: 600; }
.cal-head button { padding: 4px 11px; font-size: 18px; line-height: 1.2; }
.cal-head button:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.dow { font: 600 11px/2 'EMH Grotesk', system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.day { padding: 0; aspect-ratio: 1; border: 0; border-radius: 50%; background: transparent; font-weight: 400; color: var(--muted); cursor: default; }
.day[disabled] { opacity: .5; }
.day.open { background: var(--soft); color: var(--primary); font-weight: 600; cursor: pointer; }
.day.open:hover { background: var(--primary); color: var(--canvas); border: 0; }
.day[aria-pressed="true"] { background: var(--primary); color: var(--canvas); }
.day.today { text-decoration: underline; text-underline-offset: 3px; }
.empty { margin-top: 16px; color: var(--muted); }

.times-head { font-weight: 600; margin-bottom: 12px; }
.times { display: grid; gap: 8px; max-height: 440px; overflow: auto; padding: 2px; }
.time { width: 100%; padding: 11px 12px; color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, var(--surface)); font-family: 'EMH Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; }
.time:hover { background: var(--primary); color: var(--canvas); }

button:disabled { opacity: .8; cursor: progress; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

form.book { display: grid; gap: 12px; }
.picked { padding: 10px 12px; background: var(--soft); border-radius: 8px; font-weight: 500; }
.back { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; text-align: left; font-weight: 500; }
.hp { position: absolute; left: -9999px; }
.done h3 { margin-bottom: 6px; }

@media (max-width: 920px) {
  body { padding: 20px 12px; }
  .booker { grid-template-columns: 1fr; }
  .booker > section + section { border-left: 0; border-top: 1px solid var(--line); }
  .times { max-height: none; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* Admin */
.bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bar form { margin: 0; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.path { font-family: 'EMH Mono', ui-monospace, monospace; font-size: 14px; }
.hint { color: var(--muted); font-weight: 400; font-size: 14px; }
.admin-form { display: grid; gap: 12px; margin: 14px 0; }
.admin-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
legend { font-weight: 500; padding: 0 4px; }
label.check { display: flex; align-items: center; gap: 6px; font-weight: 400; }
label.check input { width: auto; }
button.danger { color: var(--red); }
input[readonly] { color: var(--muted); }
