/* Shared design of the whole site: colours, header with menu, cards, forms, footer.
   Role-specific parts live next to their modules under /app/. */

:root {
  --bg: #f6f7f9;
  --fg: #1b1f24;
  --muted: #5b6570;
  --card: #ffffff;
  --line: #d9dee4;
  --accent: #1f6feb;
  --on-accent: #fff;
  --warn: #cf222e;
  --warn-soft: #ffebe9;
  --info: #0550ae;
  --info-soft: #eef4ff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1318;
    --fg: #e6e9ed;
    --muted: #97a1ad;
    --card: #171d24;
    --line: #2a323c;
    --accent: #58a6ff;
    --on-accent: #0f1318;
    --warn: #ff7b72;
    --warn-soft: #3b1219;
    --info: #a5d6ff;
    --info-soft: #121d2f;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
/* Header, main, footer in a column: the footer sits at the bottom of short pages. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  font:
    16px/1.5 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
}
a {
  color: var(--accent);
}

/* Header and menu */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--card);
  padding-top: env(safe-area-inset-top);
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
  margin-right: auto;
}
.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}
.menu a:hover,
.menu a:focus-visible {
  color: var(--fg);
  background: var(--bg);
  outline: none;
}
.menu a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}
.account {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.account .who {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Content */
main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
  display: grid;
  align-content: start;
  gap: 1rem;
}
main:focus {
  outline: none;
}
main > * {
  min-width: 0;
}
h1 {
  margin: 0 0 0.25rem;
  font-size: 1.9rem;
}
h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}
.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}
.page-head {
  margin-bottom: 0.5rem;
}
.page-head.split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
code {
  font-size: 0.9em;
  background: var(--bg);
  padding: 1px 4px;
  border-radius: 4px;
}
.stack {
  display: grid;
  gap: 1rem;
}
.card.stack {
  gap: 0.25rem;
}
.card p {
  margin: 0 0 0.5rem;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  min-width: 0;
}
.cards {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.cards .card {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.cards .card:hover,
.cards .card:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.cards .card strong {
  display: block;
  font-size: 1.1rem;
  color: var(--accent);
}
.cards .card span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Buttons and forms */
button,
.button {
  font: inherit;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary,
.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}
button.wide {
  width: 100%;
  margin-top: 0.5rem;
}
button:disabled {
  opacity: 0.6;
  cursor: progress;
}
input,
select {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  min-width: 0;
}
label {
  font-size: 0.9rem;
  color: var(--muted);
}
.inline-form {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0;
}
.inline-form .row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.inline-form .row input {
  flex: 1 1 14rem;
}
/* Honeypot: off-screen for people, still in the form for bots. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.message {
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--info-soft);
  color: var(--info);
}
.message.error {
  background: var(--warn-soft);
  color: var(--warn);
}

/* Text pages */
.prose section + section {
  margin-top: 1.25rem;
}
.prose p {
  margin: 0 0 0.5rem;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0 0 0.75rem;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* About */
.engineers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.engineer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}
.engineer h2 {
  margin: 0.75rem 0 0;
  font-size: 1.15rem;
}
.engineer p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.9rem;
  padding-bottom: env(safe-area-inset-bottom);
}
.site-footer .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.site-footer p {
  margin: 0;
}

@media (max-width: 480px) {
  .engineers {
    grid-template-columns: 1fr;
  }
  .facts {
    grid-template-columns: 1fr;
  }
}
