/* MensuraMedia Pages — "Measured" dark theme.
   Tokens are the single source of truth; components use only var(--*).
   See .claude/skills/mm-pages-theme/SKILL.md before changing anything here. */

@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-var.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  /* ground and surfaces */
  --bg: #0E1013;
  --surface: #14171B;
  --surface-sunk: #0A0C0F;
  --line: #262B33;
  --line-strong: #3A414B;
  /* text (all pass 4.5:1 on --bg and --surface) */
  --text: #E8EAED;
  --text-2: #C9CED5;
  --text-muted: #B4BBC4;
  --text-subtle: #9AA3AE;
  /* accent: mint (stable, links, primary action) */
  --accent: #7BD389;
  --accent-hover: #A6E3AF;
  --accent-line: #2F5A37;
  --on-accent: #0E1013;
  /* amber: in development / design phase / caution */
  --warn: #F2B872;
  --warn-line: #6B4F2A;
  --lin: #FFA222;
  /* type */
  --font-display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, "Noto Sans CJK JP", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "DejaVu Sans Mono", monospace;
  /* layout */
  --max: 1180px;
  --gutter: 24px;
  --radius: 10px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code, pre, kbd { font-family: var(--font-mono); }
code { background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 4px; font-size: .92em; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 6px; z-index: 10; font-weight: 600; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* signature: the ruler strip across the top of every page */
.ruler { height: 14px; background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 10px), repeating-linear-gradient(90deg, #5A636F 0 1px, transparent 1px 100px); background-size: 100% 6px, 100% 14px; background-repeat: no-repeat; }

/* header */
.site-header { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand svg { stroke: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.nav a { color: var(--text-2); text-decoration: none; padding: 12px 14px; font-size: 15px; border-radius: 6px; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a.nav-cta { color: var(--on-accent); background: var(--accent); font-weight: 600; padding: 12px 16px; }
.nav a.nav-cta:hover { background: var(--accent-hover); }
.crumb { display: inline-flex; gap: 8px; align-items: center; color: var(--text-subtle); text-decoration: none; font-size: 14px; padding: 12px 0; }
.crumb:hover { color: var(--text); }

/* shared type */
.eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.display { font-weight: 700; font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -.03em; max-width: 920px; }
.lede { margin: 0; font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: var(--text-muted); max-width: 680px; }
.section-title { font-weight: 600; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.02em; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }

/* chips */
.chip { display: inline-block; font-family: var(--font-mono); font-size: 12px; line-height: 1.4; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--text-2); }
.chip--stable { color: var(--accent); border-color: var(--accent-line); }
.chip--dev, .chip--design { color: var(--warn); border-color: var(--warn-line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 8px; font-size: 16px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: var(--font-body); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--ghost { color: var(--text); border-color: var(--line-strong); background: transparent; font-weight: 500; }
.btn--ghost:hover { color: var(--text); background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { padding-top: clamp(48px, 8vw, 80px); padding-bottom: 48px; display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.hero--hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; align-items: end; }
.hero-copy { display: flex; flex-direction: column; gap: 20px; }

.lin { color: var(--lin); }

/* project title block: centred name, tagline, split buttons, shields */
.title-block { padding-top: clamp(32px, 6vw, 64px); padding-bottom: 48px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.app-name { font-weight: 700; font-size: clamp(30px, 8vw, 88px); line-height: 1.02; letter-spacing: -.035em; color: var(--text); max-width: 980px; overflow-wrap: break-word; }
.app-tagline { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; color: var(--text); max-width: 760px; }
.title-block .lede { max-width: 720px; }
.sbtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.sbtn { display: inline-flex; align-items: stretch; min-height: 44px; border-radius: 6px; overflow: hidden; text-decoration: none; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-strong); }
.sbtn > span { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; }
.sbtn-label { background: var(--line-strong); color: var(--text); }
.sbtn-action { background: var(--surface); color: var(--text); font-weight: 500; }
.sbtn:hover .sbtn-action { background: var(--line); color: var(--text); }
.sbtn--primary { border-color: var(--accent); }
.sbtn--primary .sbtn-action { background: var(--accent); color: var(--on-accent); }
.sbtn--primary:hover .sbtn-action { background: var(--accent-hover); color: var(--on-accent); }
.shields { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; max-width: 900px; }
.shield { display: inline-flex; border-radius: 4px; overflow: hidden; font-family: var(--font-mono); font-size: 12px; line-height: 1; }
.shield > span { padding: 5px 8px; white-space: nowrap; }
.shield > span:first-child { background: var(--line-strong); color: var(--text); }
.shield > span + span { background: var(--accent-line); color: var(--text); }
.shield--ok > span + span { background: var(--accent); color: var(--on-accent); }
.shield--warn > span + span { background: var(--warn); color: var(--on-accent); }
.shield--tag > span:first-child { background: var(--line); color: var(--text-2); }
@media (max-width: 480px) { .shield > span { white-space: normal; } }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0; }
.stats div { background: var(--surface); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stats dt { font-size: 13px; color: var(--text-subtle); order: 2; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: 36px; font-weight: 600; order: 1; }

/* project grid */
.projects { padding-bottom: 72px; display: flex; flex-direction: column; gap: 24px; }
.projects-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 44px; padding: 0 16px; border-radius: 999px; font: 500 14px var(--font-body); cursor: pointer; background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); }
.filters button:hover { color: var(--text); border-color: var(--text-subtle); }
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.card { height: 100%; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 180px; transition: border-color .15s; }
.card:hover { color: var(--text); border-color: var(--accent); }
.card-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1.25; flex: 1 1 auto; }
.card-top .chip { flex-shrink: 0; }
.card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); flex-grow: 1; }
.card-stack { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); }
[hidden] { display: none !important; }

/* bands */
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-inner { padding-top: 64px; padding-bottom: 64px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 32px; }
.pillar { display: flex; flex-direction: column; gap: 10px; }
.pillar svg { stroke: var(--accent); }
.pillar h3 { font-size: 20px; }
.pillar p { margin: 0; color: var(--text-muted); line-height: 1.55; }

/* project page */
.shot { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.shot img { display: block; width: 100%; }
.shot figcaption { padding: 12px 16px; font-size: 14px; color: var(--text-subtle); border-top: 1px solid var(--line); }
.section { padding-top: 24px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 28px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.features li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.features .num { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); }
.features h3 { font-size: 20px; font-weight: 600; }
.features p { margin: 0; color: var(--text-muted); line-height: 1.55; font-size: 15px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 40px; align-items: start; }
.stack-col { display: flex; flex-direction: column; gap: 14px; }
.list { margin: 0; padding-left: 20px; color: var(--text-muted); line-height: 1.9; }
.term { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.term-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); }
.term pre { margin: 0; padding: 18px 16px; font-size: 14px; line-height: 1.7; color: var(--text); overflow-x: auto; white-space: pre; }
.copy { min-height: 36px; min-width: 44px; padding: 0 12px; background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); border-radius: 6px; font: 500 13px var(--font-body); cursor: pointer; }
.copy:hover { color: var(--text); }
.facts { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.facts table { width: 100%; border-collapse: collapse; font-size: 15px; }
.facts th, .facts td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts th { width: 200px; color: var(--text-subtle); font-weight: 500; }
.callout { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--warn-line); background: var(--surface); border-radius: var(--radius); padding: 16px 18px; line-height: 1.55; color: var(--text-2); }
.callout svg { flex-shrink: 0; stroke: var(--warn); margin-top: 2px; }
.callout strong { color: var(--text); }
.faq { max-width: 820px; display: flex; flex-direction: column; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; }
.faq p { margin: 12px 0 0; color: var(--text-muted); line-height: 1.6; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }

/* evolving-software notice (required on every page) */
.evolving { border-top: 1px solid var(--line); }
.evolving p { margin-top: 0; margin-bottom: 0; padding-top: 20px; padding-bottom: 20px; font-size: 14px; color: var(--text-subtle); line-height: 1.6; }

/* footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; color: var(--text-subtle); font-size: 14px; }
.site-footer .mono { font-family: var(--font-mono); }

@media (max-width: 560px) {
  .stats dd { font-size: 28px; }
  .stats div { padding: 14px; }
  .facts th { width: 120px; }
}
