/* Site styles: one stylesheet, no frameworks. Colours live in the tokens below. */

:root {
  --navy: #273039;
  --brand: #2a7bb6;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --band: #eef2f6;
  --text: #1d242b;
  --muted: #56616c;
  --border: #dde3e9;
  --link: #1f6aa0;
  --tag-bg: #e8f0f7;
  --tag-text: #1f5a86;
  --shadow: 0 1px 2px rgb(16 24 32 / 0.05), 0 4px 16px rgb(16 24 32 / 0.04);

  --radius: 12px;
  --wrap: 1140px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191e;
    --surface: #1c232a;
    --band: #182027;
    --text: #e4e9ee;
    --muted: #9ba6b1;
    --border: #2b343d;
    --link: #74b6e6;
    --tag-bg: #213242;
    --tag-text: #a9d0ee;
    --shadow: none;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: 12px; top: -48px;
  background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 12px; }

/* Header */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 24px; flex-wrap: wrap;
  min-height: 60px; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: inline-flex; align-items: center; border-radius: 8px; }
.brand img { display: block; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-header nav a {
  color: #cdd6de; text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 4px 0;
}
.site-header nav a:hover { color: #fff; }

/* Intro */

.intro {
  background: var(--navy);
  color: #fff;
  padding: 56px 0 64px;
}
.eyebrow {
  margin: 0 0 10px;
  color: #7fbbe6;
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.intro h1 {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  letter-spacing: -0.02em;
}
.lede {
  margin: 18px 0 0;
  font-size: 1.2rem; line-height: 1.55;
  color: #e9eef2;
}
.intro-note { margin: 14px 0 0; color: #b9c4ce; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  border: 1px solid var(--brand);
}
.button:hover { background: #3389c6; border-color: #3389c6; }
.button.ghost { background: transparent; border-color: rgb(255 255 255 / 0.35); }
.button.ghost:hover { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.6); }

/* Sections */

.section { padding-top: 56px; padding-bottom: 56px; }
.section > h2, .band h2 {
  font-size: 1.75rem; letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.section-lede { color: var(--muted); margin: 0 0 24px; font-size: 1.05rem; }

.group-title {
  margin: 28px 0 14px;
  font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}

/* Project cards */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.project {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 20px 16px;
}
@media (min-width: 700px) {
  .project.wide { grid-column: span 2; }
}
.project h4 { font-size: 1.25rem; }
.project .subtitle { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.project > p { margin: 12px 0 0; font-size: 0.97rem; }

.tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none; padding: 0; margin: 14px 0 0;
}
.tags li {
  background: var(--tag-bg); color: var(--tag-text);
  font-size: 0.78rem; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
}

.project .links {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  margin: auto 0 0; padding-top: 14px;
  font-size: 0.95rem; font-weight: 600;
}
.project .links a { text-decoration: none; }
.project .links a:hover { text-decoration: underline; }
.project .links a::after { content: " →"; }

/* Open science band */

.band {
  background: var(--band);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  list-style: none; padding: 0; margin: 0;
}
.principles li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.principles h3 { font-size: 1.05rem; }
.principles p { margin: 6px 0 0; font-size: 0.95rem; color: var(--muted); }
.aside { margin: 24px 0 0; font-size: 0.95rem; color: var(--muted); }

/* Footer */

.site-footer {
  background: var(--navy);
  color: #b9c4ce;
  font-size: 0.9rem;
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  padding-top: 22px; padding-bottom: 22px;
}

/* Small screens */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .intro { padding: 36px 0 44px; }
  .lede { font-size: 1.08rem; }
  .section { padding-top: 40px; padding-bottom: 40px; }
  .site-header { position: static; }
  .site-header nav { gap: 2px 14px; }
  .site-header nav a { font-size: 0.88rem; }
}

.intro h1 .cred { font-weight: 400; color: #b9c4ce; }

/* Backwards © for the copyleft mark */
.copyleft { display: inline-block; transform: scaleX(-1); }

/* Unreleased projects: shown in place of the links */
.project .soon {
  color: var(--muted);
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px dashed var(--border); border-radius: 999px;
  padding: 2px 10px;
}

/* Placeholder that fills the middle of a card whose details are not public yet */
.project .mystery {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 104px; margin-top: 12px;
  color: var(--muted); font-size: 0.92rem; text-align: center;
}
.project .mystery-mark {
  font-size: 2.8rem; font-weight: 700; line-height: 1;
  color: var(--brand);
}
