/* Material Intelligence Institute (MII) — v0.1 preview. Mobile-first, lab-notebook look. */
/* Inter: SIL Open Font License 1.1. See css/fonts/OFL-Inter.txt */
@font-face { font-family: Inter; src: url("fonts/InterVariable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: Inter; src: url("fonts/InterVariable-Italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  --bg: #f4f6f3;
  --panel: #ffffff;
  --ink: #10171c;
  --muted: #2b363d;      /* >= 10:1 on white */
  --link: #065a42;       /* deep lab green, >= 7:1 on white */
  --accent: #0b7a57;
  --mint: #8fe6c0;       /* used only on dark */
  --header: #0e1a20;
  --line: #cfd8d3;
  --grid: rgba(16, 23, 28, 0.045);
  --pass: #0b6b3a; --pass-bg: #e3f4ea;
  --fail: #9b1c1c; --fail-bg: #fbe7e7;
  --hold: #7a4b00; --hold-bg: #fff2d6;
  --note-bg: #eef3f7; --note-line: #27455c;
  --warn-bg: #fff6dc; --warn-line: #7a4b00;
  --radius: 0.9rem;
  --max: 44rem;
  --wide: 62rem;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--ink); }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.125rem; line-height: 1.6; font-weight: 450;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
a:focus-visible, .btn:focus-visible { outline: 3px solid #f2b705; outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: 0.5rem 0.8rem; z-index: 10; }

/* Header */
.site-header { background: var(--header); color: #fff; border-bottom: 4px solid var(--accent); }
.brand-row { max-width: 76rem; margin: 0 auto; padding: 0.9rem 1.1rem 0.7rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: -0.01em; font-size: 1.15rem; }
.brand .mark { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 0.45rem; background: var(--mint); color: var(--header); font-weight: 900; font-size: 0.85rem; letter-spacing: 0.02em; }
.brand small { display: block; font-weight: 500; font-size: 0.8rem; color: #cfe3da; letter-spacing: 0.02em; }
nav ul { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.35rem; }
nav a { display: inline-block; color: #e9f3ef; text-decoration: none; font-size: 0.95rem; font-weight: 600; padding: 0.35rem 0.6rem; border-radius: 0.4rem; }
nav a:hover { background: rgba(255,255,255,0.1); }
nav a[aria-current="page"] { background: var(--mint); color: var(--header); }

/* Layout */
main { max-width: var(--wide); margin: 0 auto; padding: 1.4rem 1.1rem 2.5rem; }
.prose { max-width: var(--max); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 2.1rem; font-weight: 850; margin: 0.4rem 0 0.8rem; }
h2 { font-size: 1.5rem; font-weight: 800; margin: 2.2rem 0 0.7rem; }
h3 { font-size: 1.18rem; font-weight: 750; margin: 1.2rem 0 0.4rem; }
p, li { color: var(--ink); }
.lead { font-size: 1.25rem; font-weight: 500; color: var(--muted); }
.kicker { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--link); margin: 0; }

/* Hero */
.hero { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.2rem 1.5rem; box-shadow: 0 1px 0 rgba(0,0,0,0.03); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 18px solid rgba(11,122,87,0.08); }
.hero h1 { font-size: 2.25rem; max-width: 22ch; }
.status { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--mono); font-size: 0.85rem; font-weight: 700; background: var(--hold-bg); color: var(--hold); border: 1px solid #e3c27a; border-radius: 999px; padding: 0.2rem 0.7rem; margin: 0.6rem 0 0; }
.status::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--hold); }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0; }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 750; padding: 0.75rem 1.15rem; border-radius: 0.55rem; border: 2px solid var(--accent); }
.btn:hover { background: #075f44; border-color: #075f44; }
.btn-ghost { background: transparent; color: var(--link); border-color: var(--link); }
.btn-ghost:hover { background: #e7f3ee; color: var(--link); }

/* Answer box */
.answer { background: var(--note-bg); border-left: 5px solid var(--note-line); border-radius: 0.5rem; padding: 0.9rem 1.1rem; margin: 1.3rem 0; }
.answer p { margin: 0.35rem 0; }
.answer strong { color: var(--note-line); }
.warn { background: var(--warn-bg); border-left: 5px solid var(--warn-line); border-radius: 0.5rem; padding: 0.8rem 1rem; margin: 1.2rem 0; }
.warn p { margin: 0.3rem 0; }

/* Cards */
.cards { display: grid; grid-template-columns: 1fr; gap: 0.9rem; margin: 1rem 0; padding: 0; list-style: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.05rem; display: flex; flex-direction: column; }
.card h3 { margin-top: 0.2rem; }
.card p { margin: 0.35rem 0; }
.card .tag { font-family: var(--mono); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--link); margin: 0; }
.card .more { margin-top: auto; padding-top: 0.5rem; font-weight: 700; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.7rem; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: 0.7rem; padding: 0.8rem 1rem 0.8rem 3.4rem; position: relative; }
.steps li::before { content: counter(step); position: absolute; left: 0.9rem; top: 0.8rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--header); color: var(--mint); font-weight: 800; display: grid; place-items: center; font-size: 0.95rem; }

/* Data chips & tables */
.chip { font-family: var(--mono); font-weight: 800; font-size: 0.85rem; padding: 0.1rem 0.5rem; border-radius: 0.35rem; border: 1px solid currentColor; white-space: nowrap; }
.chip.pass { color: var(--pass); background: var(--pass-bg); }
.chip.fail { color: var(--fail); background: var(--fail-bg); }
.chip.hold { color: var(--hold); background: var(--hold-bg); }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); }
th { background: #e9efec; font-weight: 750; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); font-size: 0.92rem; }

/* Wheel diagram */
.wheel { display: block; margin: 1rem auto; max-width: 34rem; width: 100%; }

/* Sources */
.sources li { margin: 0.55rem 0; }
.sources .id { font-family: var(--mono); font-weight: 700; color: var(--link); }
.small { font-size: 0.95rem; color: var(--muted); }

/* Next & footer */
.next { margin: 2.4rem 0 0; padding: 1rem 1.1rem; background: var(--header); border-radius: var(--radius); }
.next a { color: #fff; font-weight: 750; text-decoration: none; display: block; }
.next a span { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--mint); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.next a:hover { text-decoration: underline; }
.site-footer { background: var(--header); color: #dfeae5; margin-top: 2rem; }
.site-footer .inner { max-width: var(--wide); margin: 0 auto; padding: 1.4rem 1.1rem 2rem; }
.site-footer a { color: var(--mint); }
.site-footer ul { list-style: none; padding: 0; margin: 0.5rem 0 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.site-footer p { color: #dfeae5; margin: 0.4rem 0; font-size: 0.98rem; }

@media (min-width: 720px) {
  main { padding: 2rem 1.5rem 3rem; }
  .hero { padding: 2.2rem 2.2rem 2.3rem; }
  .hero h1 { font-size: 3rem; }
  h1 { font-size: 2.5rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards.three { grid-template-columns: repeat(3, 1fr); }
  .brand-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
  nav ul { margin: 0; justify-content: flex-end; flex-wrap: nowrap; }
  nav a { font-size: 0.9rem; padding: 0.32rem 0.5rem; white-space: nowrap; }
}
@media (min-width: 720px) and (max-width: 1100px) {
  .brand-row { display: block; }
  nav ul { margin-top: 0.7rem; justify-content: flex-start; flex-wrap: wrap; }
}

/* mission-close v1 (Nov 19, 2026) */
.mission-close { margin: 1.4rem 0 0; padding: 1.2rem 1.15rem 1.25rem; background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: var(--radius); }
.mission-close h2 { margin: 0.2rem 0 0.5rem; }
.mission-close p { max-width: var(--max); }
.mission-close .actions { margin-top: 0.6rem; }

/* stage-chips v1 (Nov 19, 2026) */
.stage { display: inline-block; font-family: var(--mono); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.03em; padding: 0.12rem 0.55rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.stage.idea { color: #3a4650; background: #eceff1; }
.stage.rd { color: #1f4466; background: #e4eef7; }
.stage.testing { color: #7a4b00; background: #fff2d6; }
.cards.one { grid-template-columns: 1fr; }
.card ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
@media (min-width: 720px) and (max-width: 1240px) {
  .brand-row { display: block; }
  nav ul { margin-top: 0.7rem; justify-content: flex-start; flex-wrap: wrap; }
}
