/* SLEEP-XR. Direction A, "Instrument": a PVT device's grey housing, one red LED
   display. Red means measurement, so it is kept to the LED and the PVT marks. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-standard-normal.de2f1fe81758.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "DSEG7";
  src: url("../fonts/DSEG7Classic-Bold.4ecf993fb87b.woff2") format("woff2");
  font-display: block;
}

:root {
  --page: #E6E8E2;
  --panel: #F2F3EF;
  --housing: #CFD2CB;
  --housing-edge: #B3B7AE;
  --rule: #C4C8BF;
  --ink: #1C211E;
  --ink-soft: #3F4742;
  --muted: #4A524D;
  --on-ink: #F3F4F0;
  --glass: #160806;
  --led: #FF4426;
  --led-ghost: rgba(255, 68, 38, 0.08);
  --focus: #2B5FD9;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Keep the footer at the bottom on short pages. */
main { flex: 1 0 auto; }

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: #000; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

h1, h2, h3 { margin: 0; line-height: 1.05; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: 72px 32px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 10; background: var(--on-ink); padding: 8px 12px; }

.notice {
  background: var(--ink);
  color: var(--on-ink);
  text-align: center;
  font-size: 15px;
  padding: 8px var(--gutter);
}

/* Header and footer */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-block: 20px;
}

.wordmark {
  font-weight: 800;
  font-stretch: 125%;
  font-size: 21px;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  font-size: 16px;
}

.site-footer { background: var(--ink); color: #DCDFD8; margin-top: 0; }
.site-footer a { color: var(--on-ink); }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-block: 40px;
  font-size: 15px;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}
.button:hover { color: var(--on-ink); background: #000; }
.button--small { min-height: 42px; padding: 0 18px; font-size: 15px; }
.button--off { background: transparent; color: var(--muted); border: 1.5px dashed #8A9086; }
.button--off:hover { background: transparent; color: var(--muted); }

.text-link { font-weight: 600; font-size: 17px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }

/* Hero */

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
  padding-block: 48px 88px;
}
.hero__text { flex: 1 1 480px; min-width: 0; }
.hero__device { flex: 0 1 420px; min-width: min(280px, 100%); }
.hero__tagline { color: var(--muted); margin-bottom: 16px; }
.hero__title {
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.hero__subtitle {
  margin-top: 20px;
  font-size: clamp(21px, 2.3vw, 28px);
  line-height: 1.22;
  font-weight: 500;
  font-stretch: 88%;
  max-width: 26ch;
}
.hero__intro { margin-top: 28px; max-width: 54ch; }
.hero__caption { margin: 18px 4px 0; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 46ch; }

/* The PVT device */

.device {
  background: var(--housing);
  border: 1px solid var(--housing-edge);
  border-radius: 28px;
  padding: 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -3px 0 var(--housing-edge),
    0 18px 40px -24px rgba(28, 33, 30, 0.45);
}
.device__labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}
.device__message { margin: 18px 0; min-height: 52px; font-size: 17px; line-height: 1.45; }
.device__button {
  width: 100%;
  height: 92px;
  border: 0;
  border-radius: 18px;
  background: var(--ink);
  color: var(--on-ink);
  font: inherit;
  font-weight: 700;
  font-stretch: 112%;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 5px 0 #000;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.device__button:active { transform: translateY(2px); box-shadow: 0 3px 0 #000; }

.led {
  position: relative;
  display: block;
  background: var(--glass);
  border-radius: 10px;
  padding: 22px 24px;
  text-align: right;
  font-family: "DSEG7", monospace;
  font-size: min(80px, 17vw);
  line-height: 1;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}
.led__ghost { color: var(--led-ghost); }
.led__digits {
  position: absolute;
  top: 22px;
  right: 24px;
  color: var(--led);
  text-shadow: 0 0 0.22em rgba(255, 68, 38, 0.5);
}

/* Bands and sections */

.band { padding-block: 80px; }
.band--light { background: var(--panel); border-block: 1px solid var(--rule); }
.section-title { font-weight: 800; font-stretch: 112%; font-size: 40px; }
.section-title--small { font-size: 28px; }
.lede { margin-top: 18px; max-width: 54ch; }

.split { display: flex; flex-wrap: wrap; gap: 48px 72px; }
.split__main { flex: 1 1 340px; min-width: 0; }
.split__side, .topics { flex: 1 1 440px; min-width: 0; }

.panel { margin-top: 32px; padding: 24px; background: var(--page); border-radius: 16px; }
.prose { font-size: 16px; }
.prose h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.prose p + p { margin-top: 10px; }
.prose .button { margin-top: 18px; }

.topics { list-style: none; margin: 0; padding: 0; }
.topics__item { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-top: 1px solid var(--rule); }
.topics__item:last-child { border-bottom: 1px solid var(--rule); }
.topics__title { font-size: 19px; font-weight: 650; line-height: 1.3; }
.topics__detail { font-size: 15px; color: var(--muted); line-height: 1.4; }

/* Dates */

.dates {
  list-style: none;
  margin: 28px 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.dates__item { display: flex; flex-direction: column; padding: 20px; border-radius: 14px; background: #DDDFD9; }
.dates__item--first { background: var(--housing); }
.dates__item--dark { background: var(--ink); color: var(--on-ink); }
.dates__label, .dates__weekday { font-size: 15px; color: var(--ink-soft); }
.dates__item--dark .dates__label, .dates__item--dark .dates__weekday { color: #C9CDC5; }
.dates__date { margin-top: 6px; font-size: 26px; font-weight: 700; font-stretch: 110%; line-height: 1.2; }

/* Flying in: the jet-lag dial */

.flying-in {
  margin-top: 40px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 28px;
  padding: 40px clamp(20px, 5vw, 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px 64px;
}
.flying-in__text { flex: 1 1 380px; min-width: 0; }
.flying-in__text .muted { margin-top: 14px; font-size: 17px; max-width: 46ch; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

.dial { flex: 0 1 420px; min-width: min(260px, 100%); position: relative; container-type: inline-size; }
.dial__svg { display: block; width: 100%; height: auto; }
.dial__labels { font-family: "Archivo", sans-serif; font-size: 22px; font-weight: 600; fill: var(--muted); }
.dial__centre {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6cqw;
  pointer-events: none;
}
.dial__caption { font-size: 3.5cqw; color: var(--muted); white-space: nowrap; }
.dial__caption--strong { font-size: 3.9cqw; font-weight: 700; color: var(--ink); }
.led--small { font-size: 9.4cqw; padding: 2.4cqw 3.2cqw; border-radius: 2cqw; }
.led--small .led__digits { top: 2.4cqw; right: 3.2cqw; }

/* Program timeline */

.timeline {
  display: flex;
  gap: 2px;
  height: 56px;
  margin-top: 32px;
  border-radius: 10px;
  overflow: hidden;
}
.timeline__block { flex-basis: 0; background: var(--housing); }
.timeline__block--alt { background: #B9BDB5; }
.timeline__block--break { background: #DDDFD9; }
.timeline__block--pvt { background: var(--led); }
.timeline__scale { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; color: var(--muted); }

.highlights {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 40px;
  font-size: 17px;
  line-height: 1.45;
}

/* People */

.people { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 18px; }
.people li { display: flex; flex-direction: column; }
.people__name { font-size: 20px; font-weight: 650; }
.people__aff { font-size: 16px; color: var(--muted); }
.committee { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; font-size: 16px; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .device__button:active { transform: none; }
}

/* Pages with forms: login, submissions */

.narrow { max-width: 760px; }
.page-title { font-weight: 800; font-stretch: 112%; font-size: clamp(30px, 5vw, 44px); line-height: 1.08; }
.inline-form { display: inline; margin: 0; }
.text-button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.messages { padding-top: 8px; }
.message { padding: 12px 16px; border-radius: 12px; background: var(--housing); font-size: 16px; }
.message--error { background: var(--ink); color: var(--on-ink); }

.form { margin-top: 28px; display: flex; flex-direction: column; gap: 20px; }
.form__group { border: 0; border-top: 1px solid var(--rule); margin: 0; padding: 24px 0 0; display: flex; flex-direction: column; gap: 18px; }
.form__legend { padding: 0; font-size: 22px; font-weight: 750; font-stretch: 110%; }
.form-errors { padding: 14px 16px; border-radius: 12px; background: var(--ink); color: var(--on-ink); font-size: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 16px; font-weight: 650; }
.field__help { font-size: 15px; color: var(--muted); line-height: 1.45; }
.field__error { font-size: 15px; font-weight: 600; color: #B42A12; }
.field--error input, .field--error textarea { border-color: #B42A12; }

.field input[type="text"], .field input[type="email"], .field input[type="file"], .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid #8A9086;
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}
.field textarea { line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }

.choices { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.choices .field__label { padding: 0; margin-bottom: 4px; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 36px; font-size: 16px; line-height: 1.4; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; accent-color: var(--ink); }

.author { padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--rule); }
.author__number { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.author__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.author__checks { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 10px; }

.cards { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.card__link { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--rule); text-decoration: none; }
.card__link:hover { border-color: var(--ink); }
.card__title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.card__meta { font-size: 15px; color: var(--muted); }

.receipt { margin: 28px 0 40px; background: var(--housing); border: 1px solid var(--housing-edge); border-radius: 24px; padding: 20px; }
.receipt__row--lead { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 18px; font-weight: 650; }
.led--inline { display: inline-block; font-size: 44px; padding: 12px 16px; }
.led--inline .led__digits { top: 12px; right: 16px; }
.receipt__list { margin: 18px 0 0; display: grid; gap: 0; }
.receipt__list > div { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--housing-edge); }
.receipt__list dt { font-size: 15px; color: var(--ink-soft); }
.receipt__list dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.hash { font-size: 14px; letter-spacing: 0.02em; }
.abstract { margin-top: 12px; margin-bottom: 32px; max-width: 66ch; }

@media (max-width: 520px) {
  .receipt__list > div { grid-template-columns: 1fr; }
}
