/* CASi Labs v2 — site styles
 * Light overall: off-white surface, navy headers, dark text on light.
 * Graphs are the inversion: dark navy with type-coded edges.
 */

:root {
  /* palette — cool direction */
  --navy:        #2c4a6e;
  --navy-deep:   #1f3550;
  --navy-ink:    #112236;
  --offwhite:    #eef0f7;   /* cool off-white */
  --offwhite-2:  #e6e9f3;   /* cooler card surface */
  --ink:         #1c2228;
  --ink-2:       #2a323b;
  --muted:       #5a6675;
  --muted-2:     #8a93a0;
  --hairline:    #d4d8e6;
  --hairline-2:  #c1c6d8;

  /* periwinkle surface accent — used for nav band, playable section */
  --surface-accent: #7d90db;
  --surface-accent-soft: #c8d0ee;

  /* accent — ochre, scaled by --accent-intensity (0..1) */
  --ochre:       #b8853a;
  --ochre-soft:  #d97a3a;   /* used in graph edges */

  /* graph dark surface */
  --graph-bg:    #0f1d2e;
  --graph-bg-2:  #0c1827;
  --graph-grid:  #1a3050;
  --graph-rail:  #c8d4e2;
  --graph-rail-muted: #8aa1bb;

  /* type */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, sans-serif;

  /* layout */
  --page-max: 1280px;
  --page-pad: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--offwhite);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* type */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy);
  font-weight: 500;
  letter-spacing: -0.012em;
  margin: 0;
}

h1 { font-size: 56px; line-height: 1.08; letter-spacing: -0.018em; }
h2 { font-size: 36px; line-height: 1.18; }
h3 { font-size: 22px; line-height: 1.3; }
h4 { font-size: 17px; line-height: 1.35; }

p  { margin: 0; }

a {
  color: var(--navy);
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

em { font-style: italic; color: var(--ink-2); }

/* layout helpers */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

.section {
  padding: 96px 0;
  border-top: 1px solid var(--hairline);
}
.section:first-of-type { border-top: 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 64ch;
}

.body-text {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 64ch;
}
.body-text + .body-text { margin-top: 22px; }

.measure-narrow { max-width: 56ch; }
.measure-wide   { max-width: 72ch; }

/* nav */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--hairline);
  background: var(--navy);
  border-radius: 4px;
  margin-top: 16px;
}
.site-nav .wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.site-nav .brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  cursor: pointer;
  border-radius: 4px;
  transition: opacity 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.site-nav .brand:hover {
  opacity: 0.92;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.site-nav .brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ochre);
}
.site-nav .brand img {
  height: 96px;
  width: auto;
  display: block;
}
.site-nav ul {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0; padding: 0;
}
.site-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--offwhite);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.site-nav a:hover {
  text-decoration: none;
  border-bottom-color: var(--offwhite);
}
.site-nav a.is-current {
  border-bottom-color: var(--ochre);
  color: #ffffff;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 56px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 32px;
  flex-wrap: wrap;
}
.site-footer .wordmark {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 16px;
  font-weight: 500;
}

/* cards */
.card {
  background: var(--offwhite);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 24px;
  transition: border-color 150ms ease;
}
.card:hover { border-color: var(--navy); }
.card-tight { padding: 18px; border-radius: 8px; }

/* buttons (used very sparingly) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  background: var(--offwhite);
  border: 1px solid var(--navy);
  border-radius: 4px;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}
.btn:hover { background: var(--navy); color: var(--offwhite); text-decoration: none; }

.btn-accent {
  color: var(--offwhite);
  background: var(--navy);
  border-color: var(--navy);
}
.btn-accent:hover { background: var(--navy-deep); border-color: var(--navy-deep); }

/* utility */
.legend {
  display: flex;
  gap: 22px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--sans);
  flex-wrap: wrap;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch {
  width: 14px; height: 2px; display: inline-block;
}

.hairline { height: 1px; background: var(--hairline); border: 0; margin: 0; }

.kicker {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* responsive */
@media (max-width: 900px) {
  :root { --page-pad: 32px; }
  h1 { font-size: 38px; }
  h2 { font-size: 28px; }
  .site-nav ul { gap: 22px; }
  .site-nav a { font-size: 13px; }
}
@media (max-width: 600px) {
  :root { --page-pad: 22px; }
  .site-nav { flex-direction: column; align-items: flex-start; gap: 16px; padding: 18px 0; }
  .site-nav ul { gap: 18px; flex-wrap: wrap; }
  h1 { font-size: 32px; }
}
