@import url("tokens.css");

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 500 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/ibm-plex-sans-arabic-arabic-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/ibm-plex-sans-arabic-arabic-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/ibm-plex-sans-arabic-arabic-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --display: "Space Grotesk", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
}

[dir="rtl"] {
  --display: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--ground);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

h1 {
  font: 600 clamp(2.5rem, 1.4rem + 3.6vw, 4.25rem) / 1.04 var(--display);
  letter-spacing: -0.02em;
}

h2 {
  font: 500 26px/1.2 var(--display);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

[dir="rtl"] h1 {
  letter-spacing: 0;
  line-height: 1.2;
}

[dir="rtl"] h2 {
  letter-spacing: 0;
}

.wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 48px);
  border-block-end: 1px solid var(--hair);
  background: var(--ground);
}

.brand {
  display: flex;
  flex: none;
}

.brand img {
  display: block;
  height: 32px;
  width: auto;
}

.bar__end {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  font-size: 14px;
  color: var(--muted);
}

.bar__who {
  overflow-wrap: anywhere;
}

.link {
  background: none;
  border: 0;
  padding: 6px 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}

.link:hover {
  color: var(--text);
}

.link-accent {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}

.link-accent:hover {
  color: var(--accent-hover);
}

.split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 480px);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  max-width: 1240px;
  width: 100%;
  margin-inline: auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px);
}

.lede {
  margin-block-start: 20px;
  font-size: 18px;
  color: var(--muted);
  max-width: 46ch;
}

.facts {
  margin-block-start: 36px;
  display: grid;
  gap: 14px;
  max-width: 46ch;
  border-block-start: 1px solid var(--hair);
  padding-block-start: 24px;
  font-size: 15px;
  color: var(--muted);
}

.facts div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.facts svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-block-start: 3px;
  color: var(--accent);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(24px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sub {
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-block-start: 3px;
  accent-color: var(--accent);
}

.check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.check-group legend {
  padding: 0;
  margin-block-end: 6px;
  font-size: 14px;
  font-weight: 500;
}

/* Out of sight, but still in the form for anything that fills in every field. */
.leave-empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  background: var(--ground);
  border: 1px solid var(--field);
  border-radius: 8px;
  padding: 11px 12px;
  font-weight: 400;
  font-size: 16px;
  width: 100%;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input[readonly] {
  color: var(--muted);
}

.field input.code {
  font: 500 22px/1.2 var(--display);
  letter-spacing: 0.4em;
  text-align: center;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.check input:focus-visible,
.tab:focus-visible,
.btn:focus-visible,
.link:focus-visible,
.link-accent:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.err {
  color: var(--error);
  font-size: 13px;
  font-weight: 400;
}

.btn {
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
}

.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn--link,
.btn--line {
  display: inline-block;
  text-decoration: none;
}

.btn--line {
  background: transparent;
  color: var(--text);
  border-color: var(--field);
  font-weight: 500;
}

.btn--line:hover {
  background: rgba(154, 176, 187, 0.1);
  border-color: var(--field);
}

.alt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  border-block-start: 1px solid var(--hair);
  padding-block-start: 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.live {
  color: var(--live);
}

.status--soon {
  color: var(--early);
}

.status--ended {
  color: var(--error);
}

.status--waiting {
  color: var(--accent);
}

.status--none {
  color: var(--muted);
}

.narrow {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.narrow--small {
  max-width: 600px;
}

.project {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  display: grid;
  gap: 16px;
}

.project__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.project__name {
  font-size: 30px;
}

.note {
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--muted);
  border-inline-start: 2px solid var(--deep);
  padding-inline-start: 12px;
}

.foot {
  padding: 18px clamp(16px, 4vw, 48px);
  border-block-start: 1px solid var(--hair);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--ground);
}

.fine {
  font-size: 13px;
  color: var(--muted);
}

.foot__end {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.foot .link-accent {
  font-size: 13px;
}

/* Where a request stands */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
}

.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 14px;
  padding-block-end: 20px;
  font-size: 15px;
}

.steps li:last-child {
  padding-block-end: 0;
}

.steps li::before {
  content: "";
  position: absolute;
  inset-block: 20px 0;
  inset-inline-start: 9px;
  width: 2px;
  background: var(--hair);
}

.steps li:last-child::before {
  display: none;
}

.steps li.done::before {
  background: var(--deep);
}

.steps b {
  display: block;
  font-weight: 500;
}

.steps small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.later b {
  color: var(--muted);
}

.dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--field);
  border-radius: 50%;
  background: var(--panel);
}

.done .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.done .dot svg {
  width: 12px;
  height: 12px;
}

.now .dot {
  border-color: var(--early);
}

.now .dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--early);
  animation: wait 1.8s ease-in-out infinite;
}

@keyframes wait {
  50% {
    opacity: 0.35;
  }
}

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

/* The privacy notice */
.prose {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-wrap: anywhere;
}

.prose h3 {
  font: 500 18px/1.3 var(--display);
}

.prose ul {
  padding-inline-start: 20px;
}


/* Back office */
.ops {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-block-end: 1px solid var(--hair);
}

.tab {
  padding: 10px 14px;
  border-block-end: 2px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-current="page"] {
  color: var(--text);
  border-block-end-color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  color: var(--muted);
}

.stat b {
  display: block;
  font: 500 28px/1.2 var(--display);
  color: var(--text);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
  color-scheme: dark;
}

.filters .field {
  min-width: 0;
}

.filters .field input,
.filters .field select {
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  font-size: 15px;
}

.filters__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.log {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 14px;
}

.log th,
.log td {
  padding: 12px 14px;
  text-align: start;
  vertical-align: top;
  border-block-end: 1px solid var(--hair);
}

.log th {
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.log tr:last-child td {
  border-block-end: 0;
}

.log small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.log__time {
  white-space: nowrap;
}

.log__problem {
  color: var(--error);
}

.log--requests {
  min-width: 680px;
}

/* A hostile or just very long value wraps instead of pushing the other columns out of sight. */
.log--requests td:nth-child(-n + 3) {
  min-width: 150px;
  overflow-wrap: anywhere;
}

.log--people {
  min-width: 820px;
}

.log--people td:nth-child(-n + 3) {
  min-width: 150px;
  overflow-wrap: anywhere;
}

.log--events {
  min-width: 620px;
}

.plain-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}

.end-date {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.end-date input[type="date"] {
  color-scheme: dark;
}

.ended__name {
  font: 500 18px/1.3 var(--display);
  overflow-wrap: anywhere;
}

.form-column {
  width: 100%;
  max-width: 600px;
}

.request-sheet {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 10px 16px;
  font-size: 15px;
}

.request-sheet dt {
  color: var(--muted);
}

.request-sheet dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.decisions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  align-items: start;
}

.alert {
  border-inline-start: 2px solid var(--error);
  padding-inline-start: 12px;
  color: var(--error);
  font-size: 15px;
}

.confirm {
  border-inline-start: 2px solid var(--live);
  padding-inline-start: 12px;
  color: var(--live);
  font-size: 15px;
}

.empty {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--muted);
}

/* The padding is the blank margin scanners need around the code. */
.qr {
  width: min(280px, 100%);
  padding: 24px;
  background: var(--qr-ground);
  color: var(--qr-ink);
  border-radius: 8px;
}

.qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.key {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.backup {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  font-size: 15px;
}

@media (max-width: 640px) {
  .bar__who {
    display: none;
  }

  .request-sheet {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .request-sheet dd {
    margin-block-end: 10px;
  }
}

@media (max-width: 880px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .facts {
    display: none;
  }
}
