/*
  Lab site — one column, two typefaces, one accent.
  Light: warm paper (after instinct.com). Dark: near-black terminal (after ssi.inc).
*/

:root {
  --paper: #f4efea;
  --ink: #1d1f1e;
  --muted: #6b6862;
  --rule: rgba(29, 31, 30, 0.12);
  --accent: #2f7a68;
  --select-bg: #2f7a68;
  --select-fg: #fdfcfb;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Fluid scale: 17px on phones → 21px on wide screens */
  --text: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem);
  --text-sm: clamp(0.75rem, 0.72rem + 0.12vw, 0.8125rem);
  --leading: 1.42;
  --measure: 38rem;

  --gutter: clamp(1rem, 0.6rem + 1.6vw, 1.5rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 2rem;
  --space-4: 4rem;
  --space-5: 6rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111213;
    --ink: #dcdcd8;
    --muted: #8a8a85;
    --rule: rgba(220, 220, 216, 0.12);
    --accent: #6fd3b0;
    --select-bg: #6fd3b0;
    --select-fg: #111213;
  }
}

:root[data-theme="dark"] {
  --paper: #111213;
  --ink: #dcdcd8;
  --muted: #8a8a85;
  --rule: rgba(220, 220, 216, 0.12);
  --accent: #6fd3b0;
  --select-bg: #6fd3b0;
  --select-fg: #111213;
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text);
  line-height: var(--leading);
  letter-spacing: -0.01em;
  font-kerning: normal;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--select-bg);
  color: var(--select-fg);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  font-family: var(--mono);
  font-size: var(--text-sm);
}

.skip:focus {
  top: var(--space-2);
}

/* One centered column shared by header, content, and footer */

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
}

/* Header — a wordmark and nothing else, like both references */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  padding: 1.25rem var(--gutter) 0;
  font-family: var(--mono);
  font-size: var(--text-sm);
  letter-spacing: 0;
}

.wordmark {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  color: var(--muted);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
}

/* Main column */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--gutter) var(--space-5);
}

section,
.prose {
  max-width: var(--measure);
}

.lead {
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  text-wrap: pretty;
}

.email {
  font-family: var(--mono);
  font-size: 0.9em;
  letter-spacing: 0;
  color: var(--accent);
}

.prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.prose p {
  text-wrap: pretty;
  hanging-punctuation: first;
}

.prose a,
.inline-link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--rule);
}

.prose a:hover,
.inline-link:hover {
  text-decoration-color: currentColor;
}

/* Footer — pinned to the bottom of the viewport on short pages (after instinct.com) */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  padding: 0 var(--gutter) 1.25rem;
  font-family: var(--mono);
  font-size: var(--text-sm);
  letter-spacing: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media print {
  :root {
    --paper: #fff;
    --ink: #000;
  }
  .skip {
    display: none;
  }
}

/* Careers — section labels, role list, facts block (after ndea.com, thinkingmachines.ai) */

.label {
  margin-bottom: var(--space-2);
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.prose .label {
  margin-bottom: 0;
}

.prose ul {
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.roles {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.roles > li {
  border-bottom: 1px solid var(--rule);
}

.roles summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  padding: 0.85rem 0;
  cursor: pointer;
  list-style: none;
}

.roles summary::-webkit-details-marker {
  display: none;
}

.roles summary:hover .role-title {
  color: var(--accent);
}

.roles summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.role-title {
  font-weight: 600;
  text-wrap: balance;
  transition: color 120ms ease;
}

.role-meta {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: var(--text-sm);
  letter-spacing: 0;
  color: var(--muted);
}

.role-meta::after {
  content: "+";
  display: inline-block;
  width: 1em;
  margin-left: 0.75rem;
  text-align: center;
}

details[open] .role-meta::after {
  content: "\2212";
}

.role-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-bottom: 1.5rem;
}

.role-body p {
  text-wrap: pretty;
}

.facts {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.3rem var(--space-2);
  font-family: var(--mono);
  font-size: var(--text-sm);
  letter-spacing: 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  font-variant-numeric: tabular-nums;
}

.apply {
  align-self: flex-start;
  font-weight: 600;
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 0.1em;
}
