:root {
  color-scheme: light;
  --font-serif: "Old Standard TT", "GFS Baskerville", "Iowan Old Style",
    "Nimbus Roman", Georgia, serif;
  --font-mono: "IBM Plex Mono", "Nimbus Mono PS", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;
  --paper: #fbf7ee;
  --paper-warm: #f4ecdf;
  --paper-panel: rgba(255, 252, 245, 0.72);
  --ink: #184884;
  --ink-deep: #103764;
  --ink-soft: #5477a1;
  --pink: #d98aa3;
  --pink-strong: #bf607f;
  --coral: #f06f98;
  --orange: #ff9a5f;
  --gold: #f2b949;
  --rule: rgba(24, 72, 132, 0.42);
  --rule-soft: rgba(24, 72, 132, 0.22);
  --grid-minor: rgba(199, 84, 121, 0.09);
  --grid-major: rgba(183, 68, 107, 0.18);
  --content-max: 82.5rem;
  --gutter: clamp(1.1rem, 4vw, 4rem);
  --clairefontaine-background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
    radial-gradient(circle at 16% 6%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 34%);
  --clairefontaine-background-position: -1px -1px;
  --clairefontaine-background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px, 100% 100%;
}

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

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 20rem;
  min-height: 100%;
  margin: 0;
  color: var(--ink-deep);
  background-color: var(--paper);
  background-image: var(--clairefontaine-background-image);
  background-position: var(--clairefontaine-background-position);
  background-size: var(--clairefontaine-background-size);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: radial-gradient(circle, rgba(52, 45, 54, 0.2) 0.45px, transparent 0.7px);
  background-size: 7px 9px;
  mix-blend-mode: multiply;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-color: rgba(24, 72, 132, 0.38);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

::selection {
  color: var(--paper);
  background: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--pink-strong);
  outline-offset: 3px;
}

h1,
h2,
h3,
p,
dl {
  margin: 0;
}

.brand-header,
.site-header,
.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 5.35rem;
  border-bottom: 1.5px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.site-footer {
  min-height: auto;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.72rem;
  color: var(--ink-deep);
  text-decoration: none;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
}

.wordmark,
.brand span:first-of-type,
.page-slug,
label,
button,
.status,
.small-label {
  font-family: var(--font-mono);
}

.wordmark,
.brand span:first-of-type {
  color: var(--ink-deep);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0;
}

.page-slug {
  margin-left: -0.62rem;
  color: var(--pink-strong);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0;
}

button,
.submit-button,
.button {
  min-height: 2.8rem;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 0 1rem;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

button:hover,
.submit-button:hover,
.button:hover {
  border-color: var(--pink-strong);
  background: var(--pink-strong);
}

button.secondary,
.file-picker-button,
.button.secondary {
  color: var(--ink);
  background: rgba(255, 252, 245, 0.52);
  border-color: var(--rule);
}

button:disabled,
.submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

input,
select,
textarea {
  border: 1.5px solid var(--rule);
  border-radius: 0;
  color: var(--ink-deep);
  background: rgba(255, 252, 245, 0.66);
}

input::placeholder,
textarea::placeholder {
  color: rgba(84, 119, 161, 0.78);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--pink-strong);
  outline: 2px solid rgba(191, 96, 127, 0.22);
  outline-offset: 0;
}

.paper-panel,
.form-surface,
.login-panel,
.sidebar-section,
.display-panel,
.physiology-plot,
.physiology-readout {
  border: 1.5px solid var(--rule);
  border-radius: 0;
  background: var(--paper-panel);
  box-shadow: none;
}

.science-plate {
  position: relative;
  overflow: hidden;
}

.science-plate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(251, 247, 238, 0.78), rgba(251, 247, 238, 0.12) 48%, rgba(251, 247, 238, 0.6)),
    radial-gradient(ellipse at 58% 45%, rgba(240, 111, 152, 0.08), rgba(251, 247, 238, 0.12) 45%, rgba(251, 247, 238, 0.72) 100%);
  mix-blend-mode: multiply;
}

.heart-ink-plate,
.heart-map-image {
  opacity: 0.72;
  mix-blend-mode: multiply;
  filter: contrast(1.05) saturate(0.9);
}

.image-credit {
  color: rgba(84, 119, 161, 0.72);
  font-family: var(--font-mono);
  font-size: 0.46rem;
  line-height: 1.45;
}

@media (max-width: 42rem) {
  .brand-header,
  .site-header {
    min-height: 4.6rem;
  }

  .brand-mark {
    width: 2.25rem;
    height: 2.25rem;
  }

  .wordmark,
  .brand span:first-of-type,
  .page-slug {
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
