/* vibeqm.com — the Vibe Quality Model reference site.
   Layout concept: a framework reference, read like a well-kept specification:
   a left-aligned reading column, numbered sections, cited sources, gate-style
   tables, and the five-bar level meter from the book as the recurring mark. */

:root {
  --bg: #f5f7fa;          /* cool off-white, biased toward the navy */
  --panel: #ffffff;
  --fg: #1b2430;          /* body text */
  --ink: #1f3a5f;         /* the book's navy: headings, the mark */
  --muted: #566577;
  --line: #d6dee8;
  --accent: #2a9d8f;      /* the book's teal: bars, rules, fills */
  --accent-text: #1c766b; /* teal dark enough for text on the light ground */
  --accent-soft: #e6f4f2;
  --met: #1c766b;
  --notmet: #a8432a;
  --notvisible: #9a6a12;
  --code-bg: #eef2f7;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: "JetBrains Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --wide: 72rem;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.15rem;
  --step-4: clamp(2.2rem, 1.5rem + 3vw, 3.4rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1622; --panel: #132033; --fg: #d9e2ec; --ink: #e6edf5; --muted: #9aabbd;
    --line: #26374d; --accent: #3cb8a9; --accent-text: #5fcabd; --accent-soft: #15302f;
    --met: #5fcabd; --notmet: #e48a72; --notvisible: #e0b25a; --code-bg: #182841;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1622; --panel: #132033; --fg: #d9e2ec; --ink: #e6edf5; --muted: #9aabbd;
  --line: #26374d; --accent: #3cb8a9; --accent-text: #5fcabd; --accent-soft: #15302f;
  --met: #5fcabd; --notmet: #e48a72; --notvisible: #e0b25a; --code-bg: #182841;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 48rem) { .wrap { padding-inline: 2rem; } }

/* ---- header ---- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-block: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand-name small { display: block; font-family: var(--mono); font-weight: 400; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.04em; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-family: var(--display); font-size: 0.95rem; }
.nav a { color: var(--fg); text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- the five-bar mark and level meter ---- */
.mark { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; }
.mark i { display: block; width: 5px; background: var(--accent); border-radius: 1px; }
.mark i:nth-child(1) { height: 20%; } .mark i:nth-child(2) { height: 40%; }
.mark i:nth-child(3) { height: 60%; } .mark i:nth-child(4) { height: 80%; }
.mark i:nth-child(5) { height: 100%; }

.meter { display: inline-flex; align-items: flex-end; gap: 3px; height: 1.6rem; vertical-align: middle; }
.meter i { display: block; width: 6px; border-radius: 1px; background: var(--line); }
.meter i:nth-child(1) { height: 20%; } .meter i:nth-child(2) { height: 40%; }
.meter i:nth-child(3) { height: 60%; } .meter i:nth-child(4) { height: 80%; }
.meter i:nth-child(5) { height: 100%; }
.meter[data-level="1"] i:nth-child(-n+1),
.meter[data-level="2"] i:nth-child(-n+2),
.meter[data-level="3"] i:nth-child(-n+3),
.meter[data-level="4"] i:nth-child(-n+4),
.meter[data-level="5"] i:nth-child(-n+5) { background: var(--accent); }

/* ---- type ---- */
h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.015em; font-stretch: 88%; }
h2 { font-size: var(--step-3); font-weight: 750; font-stretch: 90%; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
.eyebrow { font-family: var(--mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--fg); max-width: 60ch; }
.prose { max-width: var(--measure); display: grid; gap: 1.1rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
sup.cite a { font-family: var(--mono); font-size: 0.7em; text-decoration: none; padding-inline: 0.1em; }

/* ---- page structure ---- */
main { padding-block: 2.5rem 4rem; display: grid; gap: 4rem; }
.hero { display: grid; gap: 2rem; align-items: start; padding-block: 1rem 0; }
@media (min-width: 60rem) { .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; } }
.hero-text { display: grid; gap: 1.25rem; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.25rem; }
.button { display: inline-block; font-family: var(--display); font-weight: 650; font-size: 1rem; text-decoration: none; padding: 0.7rem 1.1rem; border-radius: 4px; border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.button.primary { background: var(--ink); color: var(--bg); }
.button:hover { text-decoration: none; filter: brightness(1.08); }

.section { display: grid; gap: 1.5rem; }
.section-head { display: grid; gap: 0.6rem; max-width: var(--measure); }
.section-num { font-family: var(--mono); color: var(--accent-text); font-size: var(--step--1); letter-spacing: 0.04em; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.columns { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .columns.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .columns.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.columns > * { min-width: 0; }
.point { display: grid; gap: 0.5rem; align-content: start; border-top: 2px solid var(--accent); padding-top: 0.9rem; }
.point h3 { font-size: 1.1rem; }

/* ---- evidence figures ---- */
.figures { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 48rem) { .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 70rem) { .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.figure { background: var(--panel); padding: 1.1rem 1.1rem 1.2rem; display: grid; gap: 0.4rem; align-content: start; min-width: 0; }
.figure .num { font-family: var(--display); font-weight: 800; font-size: var(--step-3); color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; font-stretch: 88%; }
.figure p { font-size: var(--step--1); line-height: 1.45; }
.figure .src { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }

/* ---- the levels ---- */
.levels { display: grid; gap: 0; border-top: 1px solid var(--line); }
.level { display: grid; gap: 0.6rem 1.5rem; padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
@media (min-width: 56rem) { .level { grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.level-name { display: flex; align-items: center; gap: 0.75rem; }
.level-name strong { font-family: var(--display); font-size: 1.15rem; color: var(--ink); display: block; line-height: 1.2; }
.level-name span { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.level p { font-size: 0.98rem; line-height: 1.5; min-width: 0; }
.level .label { display: block; font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.2rem; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--display); font-weight: 650; color: var(--ink); background: var(--code-bg); font-size: 0.9rem; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- illustrative tool output ---- */
.result { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; min-width: 0; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
.result-head .lvl { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 700; color: var(--ink); }
.result-head .note { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.result ol { list-style: none; margin: 0; padding: 0.4rem 0; font-family: var(--mono); font-size: 0.8rem; }
.result li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.35rem 1rem; }
.result .detail { display: block; color: var(--muted); font-size: 0.72rem; }
.chip { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.chip.met { color: var(--met); } .chip.notmet { color: var(--notmet); } .chip.notvisible { color: var(--notvisible); }
.chip::before { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; margin-right: 0.4rem; background: currentColor; vertical-align: 0.05em; }
.chip.notvisible::before { background: transparent; border: 1.5px solid currentColor; }
.result-foot { padding: 0.75rem 1rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

/* ---- callout and definition ---- */
.definition { border-left: 3px solid var(--accent); padding: 0.2rem 0 0.2rem 1rem; max-width: var(--measure); }
.definition dt { font-family: var(--display); font-weight: 700; color: var(--ink); }
.definition dd { margin: 0.25rem 0 0; }
.rulebox { background: var(--accent-soft); border: 1px solid var(--line); padding: 1.1rem 1.2rem; max-width: var(--measure); border-radius: 4px; }
.rulebox strong { color: var(--ink); font-family: var(--display); }

/* ---- references ---- */
.refs { max-width: var(--measure); font-size: var(--step--1); line-height: 1.5; padding-left: 1.6rem; display: grid; gap: 0.5rem; margin: 0; }
.refs li::marker { font-family: var(--mono); color: var(--muted); }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 3rem; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: grid; gap: 0.75rem; }
.site-footer p { max-width: 80ch; }

.usecase h2 { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.usecase .meter { height: 1.4rem; }
figure.result { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .meter i { transition: background-color 200ms ease; }
}

.facts .level { grid-template-columns: minmax(0, 1fr); }

/* ---- how it works: a real sequence, so it is numbered ---- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 60rem) { .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.steps li { counter-increment: step; background: var(--panel); padding: 1.1rem; display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.steps li::before { content: counter(step); font-family: var(--mono); font-size: 0.8rem; color: var(--accent-text); }
.steps h3 { font-size: 1.05rem; }
.steps p { font-size: 0.95rem; line-height: 1.5; }
