/* Fonts are self-hosted (SIL OFL), latin subset: Instrument Serif, Instrument Sans, JetBrains Mono. */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrument-serif-latin-400-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrument-serif-latin-400-italic.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/instrument-sans-latin-wght-normal.woff2) format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/instrument-sans-latin-wght-italic.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
}

:root {
  --paper: #ffffff;
  --ink: #111827;
  --panel: #f1f3f6;
  --muted: #5b6472;
  --alert: #c81e4a;
  --ok: #0f766e;
  --soft: rgba(17, 24, 39, 0.16);
  --water: #86c5d0;
  --display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --data: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b0f19;
    --ink: #f3f4f6;
    --panel: #161c2a;
    --muted: #9aa4b5;
    --alert: #ff7d96;
    --ok: #5fd3c4;
    --soft: rgba(243, 244, 246, 0.18);
    --water: #16233f;
  }
}
:root[data-theme="dark"] {
  --paper: #0b0f19;
  --ink: #f3f4f6;
  --panel: #161c2a;
  --muted: #9aa4b5;
  --alert: #ff7d96;
  --ok: #5fd3c4;
  --soft: rgba(243, 244, 246, 0.18);
  --water: #16233f;
}
html {
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 56px);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px / 1.45 var(--body);
}
body.full {
  overflow: hidden;
}
/* The frame every page shares: the masthead, the tab row, the page and the footer sit in one 1180px column. */
header.mast,
.navbar .tabs {
  width: min(1156px, calc(100% - 24px));
  margin-left: auto;
  margin-right: auto;
}
body > main,
body > footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 12px 24px;
}

/* The masthead scrolls away. Only the tab row under it sticks. */
.mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "theme" "title" "clock";
  gap: 4px 16px;
  margin-top: 16px;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.mast .title {
  grid-area: title;
}
.mast .clock {
  grid-area: clock;
  margin: 4px 0 0;
}
.mast .theme {
  grid-area: theme;
  justify-self: end;
  display: flex;
}
.mast .theme button {
  padding: 0 12px;
  font-size: 14px;
}
.mast .theme button + button {
  margin-left: -2px;
}
.mast .theme button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
@media (min-width: 720px) {
  .mast {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title theme" "title clock";
    align-items: end;
  }
  .mast .clock {
    justify-self: end;
    align-self: end;
    text-align: right;
  }
  .mast .theme {
    align-self: start;
  }
}
.mast .wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 12vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.mast .wordmark a {
  color: var(--ink);
  text-decoration: none;
}
.mast .sub {
  margin: 6px 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(20px, 5.4vw, 26px);
  line-height: 1.2;
}
.mast .note {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 62ch;
}
.mast .when {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}
.mast .when span {
  font-family: var(--data);
  font-weight: 600;
  color: var(--ink);
}
.mast .live,
.mast .sim {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}
.mast .live {
  display: none;
  max-width: 30ch;
}
body.island .mast .live {
  display: block;
}
@media (min-width: 720px) {
  body.island .mast .live {
    margin-left: auto;
  }
}
.mast .sim {
  color: var(--alert);
  font-weight: 600;
}
.mast .sim[hidden] {
  display: none;
}
.mast a:focus-visible,
.navbar a:focus-visible {
  outline: 3px solid var(--alert);
  outline-offset: 2px;
}

.navbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  margin: 0 0 14px;
  padding: 6px 0;
  background: var(--paper);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tabs a {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.tabs a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}
@media (max-width: 480px) {
  .tabs {
    gap: 4px;
  }
  .tabs a {
    padding: 0 4px;
  }
}

.stage {
  margin: 0;
}
.glass {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--water);
  line-height: 0;
}
canvas {
  display: block;
  width: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
#island {
  aspect-ratio: 6 / 5;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: manipulation;
  cursor: crosshair;
  outline: none;
}
@media (min-width: 920px) {
  #island {
    aspect-ratio: 4 / 3;
  }
}

/* Controls and windows that float over the island. */
.hud {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  line-height: 1.4;
}
.hud button,
.card,
.feed {
  box-shadow: 3px 3px 0 var(--ink);
}
@media (max-width: 719px) {
  .glass.has-card .hud {
    display: none;
  }
}
.badge {
  display: inline-block;
  min-width: 24px;
  margin-left: 6px;
  padding: 0 5px;
  background: var(--alert);
  color: var(--paper);
  text-align: center;
  font-family: var(--data);
  font-size: 13px;
  font-weight: 600;
}
.badge[hidden] {
  display: none;
}
.feed {
  position: absolute;
  top: 62px;
  right: 8px;
  width: min(350px, calc(100% - 16px));
  max-height: calc(100% - 70px);
  overflow: auto;
  line-height: 1.4;
  background: var(--panel);
  border: 2px solid var(--ink);
  padding: 10px 12px;
}
.feed[hidden],
.card[hidden] {
  display: none;
}
.feed:focus-visible,
.card:focus-visible {
  outline: 3px solid var(--alert);
  outline-offset: -5px;
}
.feed .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.feed h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
}
.feed ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.feed li {
  display: grid;
  font-size: 15px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0 10px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid var(--soft);
}
.feed time {
  font-family: var(--data);
  font-size: 13px;
  color: var(--muted);
}
.feed .who {
  overflow-wrap: anywhere;
}
.feed .req {
  display: block;
  color: var(--muted);
  font-family: var(--data);
  font-size: 13px;
}
.tag {
  border: 1.5px solid currentColor;
  padding: 1px 6px;
  font-family: var(--data);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.tag.bad {
  color: var(--alert);
}
.tag.good {
  color: var(--ok);
}

/* Expanded: the island takes the whole window. */
body.full .stage {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--paper);
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
body.full .glass {
  flex: 1;
  min-height: 0;
  box-shadow: none;
}
body.full #island {
  height: 100%;
  aspect-ratio: auto;
}
body.full .ticker {
  margin-top: 8px;
}

.ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 4px 4px 12px;
  min-height: 52px;
  font-size: 15px;
}
.ticker p {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
button {
  font-family: var(--body);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
}
.ticker button {
  border-color: var(--paper);
}
button:focus-visible {
  outline: 3px solid var(--alert);
  outline-offset: 2px;
}

/* Sections below the island. */
.home {
  display: grid;
  gap: 24px 16px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 24px;
}
@media (min-width: 920px) {
  .home {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .hoursbox,
  .landedbox,
  .guide-link {
    grid-column: 1 / -1;
  }
}
.home h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
}
.fine {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}
.guide-link {
  margin: 0;
}
.guide-link a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-weight: 500;
}

.tally {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  border: 2px solid var(--ink);
  border-width: 2px 0 0 2px;
}
.tally div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  border-width: 0 2px 2px 0;
}
.tally dt {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
}
.tally dd {
  margin: 0 0 3px;
  font-family: var(--data);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}
/* An odd tally out takes the whole last row. */
.tally div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Landings by hour: one bar an hour of the UTC day. */
.hours {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  align-items: end;
  gap: 2px;
  height: 124px;
  border-bottom: 2px solid var(--ink);
}
.hours i {
  display: block;
  background: var(--ink);
}
.hours i.now {
  background: var(--alert);
}
.hours i.later {
  background: var(--soft);
}
.hoursaxis {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-family: var(--data);
  font-size: 12px;
  color: var(--muted);
}
.hoursbox .fine {
  margin: 6px 0 0;
}

.landed {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(124px, 1fr);
  gap: 10px;
  overflow-x: auto;
}
.landed li {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  background: var(--panel);
}
.landed canvas {
  aspect-ratio: 22 / 16;
  border-bottom: 2px solid var(--ink);
}
.landed .nm {
  padding: 6px 8px 0;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.landed .net {
  padding: 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.landed time {
  padding: 2px 8px 7px;
  font-family: var(--data);
  font-size: 12px;
  color: var(--muted);
}

/* The creature card: a window over the island. */
.card {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: 64%;
  overflow: auto;
  line-height: 1.35;
  border: 2px solid var(--ink);
  background: var(--panel);
  padding: 8px 10px;
}
@media (min-width: 720px) {
  .card {
    right: auto;
    bottom: auto;
    top: 8px;
    width: 330px;
    max-height: calc(100% - 16px);
    padding: 10px 12px;
  }
}
.card .head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card .acts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.card .mug {
  width: 72px;
  flex: none;
  aspect-ratio: 22 / 16;
  border: 2px solid var(--ink);
}
.card .who {
  flex: 1;
  min-width: 0;
}
.card h2 {
  margin: 0;
  font-family: var(--body);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.card .held {
  margin: 8px 0 0;
  border: 2px solid var(--alert);
  padding: 2px 8px;
  color: var(--alert);
  font-weight: 600;
}
.card .latin {
  margin: 2px 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 21px;
  line-height: 1.2;
}
.card dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.5;
}
.card dt {
  color: var(--muted);
}
.card dd {
  margin: 0;
  font-family: var(--data);
  overflow-wrap: anywhere;
}

.card .sessions {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 2px solid var(--ink);
}
.card .sessions li {
  padding: 5px 0;
  font-family: var(--data);
  font-size: 13px;
  border-bottom: 1px solid var(--soft);
  overflow-wrap: anywhere;
}

/* Server-rendered pages (species, method, editions) share this sheet. */
main h1,
main h2,
main h3 {
  font-family: var(--display);
  font-weight: 400;
}
main i,
main em {
  font-family: var(--display);
  font-size: 1.1em;
}
main code,
main pre,
main time {
  font-family: var(--data);
  font-size: 13px;
}

/* The one link a script adds to every page. */
a.grown {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 500;
}
