/* The guide and the specification pages, on the shared design system (CCF77).
   The page links the design system's fonts.css, tokens.css and site.css at a pinned
   version: they draw the nav, hero, sections, buttons and footer (the vg-site-* classes)
   and set the ground for the cool tone, light and dark. What is left here is this site's
   own: the brand re-keyed to the mark's rose, the cards, the loop, the steps, the levels,
   the charts and the reading styles of the specification pages. The mode is data-theme,
   which a pre-paint script sets from the stored choice, else the OS. */

/* ---------- the brand: the mark's rose (#E8799A, #D65478), as the hub gives it ---------- */
:root {
  --vg-brand: #b8365c;
  --vg-brand-dark: #9e2d4f;
  --vg-brand-light: #d65478;
  --vg-brand-lighter: #e8799a;
  --vg-brand-bg: #fdf0f4;
  --vg-brand-mid: #fbe1e9;
  --vg-brand-border: #f4c0cf;
  --vg-gradient: linear-gradient(135deg, #b8365c 0%, #e8799a 100%);

  /* charts: an ordinal ramp, light to dark, for the three cumulative levels, and a
     neutral for the profile, which is not a level. Hover titles and a table view carry
     the values, since the light step sits below 3:1 against the surface. */
  --lv-1: #f0a3b9;
  --lv-2: #d65478;
  --lv-3: #9e2d4f;
  --lv-p: #a3a3a3;
  --heat-ink: #ffffff;
  color-scheme: light;
}

[data-theme="dark"] {
  --vg-brand: #e8799a;
  --vg-brand-dark: #d65478;
  --vg-brand-light: #ee8fab;
  --vg-brand-lighter: #f4b3c6;
  --vg-brand-bg: rgba(232, 121, 154, 0.1);
  --vg-brand-mid: rgba(232, 121, 154, 0.15);
  --vg-brand-border: rgba(232, 121, 154, 0.3);
  --vg-gradient: linear-gradient(135deg, #e8799a 0%, #f4b3c6 100%);
  --lv-1: #9e2d4f;
  --lv-2: #d65478;
  --lv-3: #f4b3c6;
  --lv-p: #737373;
  --heat-ink: #171717;
  color-scheme: dark;
}

/* site.css styles its own classes and resets nothing, so the page's reset is here */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
/* a button does not inherit the face, and a primary one drawn on a <button> keeps the
   browser's border; the Tailwind preflight the other sites load resets both */
button {
  font: inherit;
}
button.vg-site-btn-primary {
  border: 0;
}
.vg-site code {
  font-size: 0.88em;
  color: var(--vg-brand);
}
.vg-site-brand img,
.vg-site-foot-brand img {
  border-radius: 0;
}
@media (max-width: 600px) {
  .vg-site-wrap {
    padding: 0 16px;
  }
}
@media (max-width: 420px) {
  .vg-site-nav-links .vg-site-btn {
    padding: 9px 13px;
  }
  .vg-site-brand .brand-name {
    display: none;
  }
}
.vg-site-sec-head p + p {
  margin-top: 12px;
}

/* the toggle shows what a click switches to: the sun on dark, the moon on light */
.vg-site-theme-toggle .sun,
[data-theme="dark"] .vg-site-theme-toggle .moon {
  display: none;
}
[data-theme="dark"] .vg-site-theme-toggle .sun {
  display: block;
}

/* ---------- cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.grid.two {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .grid,
  .grid.two {
    grid-template-columns: 1fr;
  }
}
.card {
  background: linear-gradient(180deg, var(--vg-card), var(--vg-muted));
  border: 1px solid var(--vg-border);
  border-radius: var(--vg-radius-panel);
  padding: 26px;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--vg-brand-light) 50%, transparent);
  box-shadow: 0 18px 40px -22px color-mix(in oklab, var(--vg-brand-light) 60%, transparent);
}
.card .ico {
  width: 46px;
  height: 46px;
  border-radius: var(--vg-radius-control);
  display: grid;
  place-items: center;
  background: var(--vg-brand-bg);
  border: 1px solid var(--vg-brand-border);
  font-size: 1.35rem;
  margin-bottom: 18px;
}
.card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 9px;
  letter-spacing: -0.01em;
}
.card p {
  color: var(--vg-muted-foreground);
  font-size: 0.95rem;
}
.card p + p {
  margin-top: 10px;
}
.card .stat {
  font-size: 0.85rem;
  margin-top: 12px;
}
.card .stat b {
  color: var(--vg-foreground);
}

/* the evidence line under a lesson: where a reader goes to check it */
.proof {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--vg-border);
  font-size: 0.8rem;
  color: var(--vg-muted-foreground);
}
.proof a {
  font-family: var(--vg-font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--vg-radius-control);
  border: 1px solid var(--vg-border);
  background: var(--vg-card);
  color: var(--vg-brand);
}
.proof a:hover {
  border-color: var(--vg-brand-light);
}
.proof a.rule {
  background: var(--vg-brand-bg);
  border-color: var(--vg-brand-border);
}

/* ---------- the loop: HTML, so it reflows to a column on a phone ---------- */
.flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 34px;
  position: relative;
}
.flow-node {
  position: relative;
  border: 1px solid var(--vg-border);
  border-radius: var(--vg-radius-panel);
  padding: 18px 16px;
  background: var(--vg-card);
  text-align: center;
}
.flow-node b {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}
.flow-node span {
  color: var(--vg-muted-foreground);
  font-size: 0.86rem;
  line-height: 1.45;
  display: block;
}
.flow-node.person {
  background: var(--vg-brand-bg);
  border-color: var(--vg-brand-light);
}
.flow-node.gate {
  border: 2px solid var(--vg-brand-dark);
}
/* the arrow to the next box: right on a row, down in a column */
.flow-node + .flow-node::before {
  content: "\2192";
  position: absolute;
  left: -27px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--vg-muted-foreground);
  font-size: 1.3rem;
  font-weight: 700;
}
.flow::after {
  content: "\21BA  and back to you for the next task";
  grid-column: 1 / -1;
  text-align: center;
  color: var(--vg-muted-foreground);
  font-size: 0.85rem;
  margin-top: -14px;
}
@media (max-width: 900px) {
  .flow {
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 420px;
    margin: 0 auto;
  }
  .flow-node + .flow-node::before {
    content: "\2193";
    left: 50%;
    top: -27px;
    transform: translateX(-50%);
  }
  .flow::after {
    margin-top: -12px;
  }
}

/* ---------- steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 980px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .steps {
    grid-template-columns: 1fr;
  }
}
.step {
  background: var(--vg-card);
  border: 1px solid var(--vg-border);
  border-radius: var(--vg-radius-panel);
  padding: 22px;
}
.step .n {
  width: 34px;
  height: 34px;
  border-radius: var(--vg-radius-control);
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, var(--vg-brand-light), var(--vg-brand-dark));
  color: #fff;
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.step h3 {
  font-size: 1.02rem;
  margin-bottom: 7px;
  font-weight: 700;
}
.step p {
  color: var(--vg-muted-foreground);
  font-size: 0.9rem;
}
.note {
  max-width: 760px;
  margin: 26px auto 0;
  text-align: center;
  color: var(--vg-muted-foreground);
  font-size: 0.92rem;
}
.vg-site .note a,
.vg-site a.prose,
.vg-site .chart-sub a {
  color: var(--vg-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- levels ---------- */
.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}
@media (max-width: 820px) {
  .levels {
    grid-template-columns: 1fr;
  }
}
.level {
  border: 1px solid var(--vg-border);
  border-radius: var(--vg-radius-panel);
  padding: 22px 24px;
  background: var(--vg-card);
  border-top: 5px solid var(--sw);
}
.level h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.level .tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--vg-muted-foreground);
}
.level p {
  color: var(--vg-muted-foreground);
  font-size: 0.92rem;
  margin-top: 8px;
}

/* ---------- charts ---------- */
.chart {
  border: 1px solid var(--vg-border);
  border-radius: var(--vg-radius-panel);
  padding: 22px 22px 16px;
  background: var(--vg-card);
}
.chart h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.chart .chart-sub {
  color: var(--vg-muted-foreground);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

/* bars: a row per item, the label, the track and the value at the tip; the whole row
   is the hover target, and its title carries the exact figure */
.bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
  border-radius: var(--vg-radius-control);
}
.bars.wide .bar-row {
  grid-template-columns: 17rem 1fr;
}
.bar-row:hover {
  background: var(--vg-muted);
}
.bar-label {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-left: 1px solid var(--vg-border);
  min-height: 24px;
}
.bar-fill {
  display: flex;
  height: 20px;
  gap: 2px;
  flex: 0 0 auto;
}
.bar-fill i {
  display: block;
  height: 100%;
  background: var(--sw, var(--lv-2));
}
.bar-fill i:last-child {
  border-radius: 0 4px 4px 0;
}
.bar-value {
  color: var(--vg-muted-foreground);
  font-size: 0.82rem;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .bar-row,
  .bars.wide .bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* the grade grid: rows are recurrence, columns strength, shade is the count */
.heat {
  display: grid;
  grid-template-columns: 3.2rem repeat(4, 1fr);
  gap: 4px;
  max-width: 560px;
  margin: 0 auto;
  font-size: 0.85rem;
}
.heat .axis {
  display: grid;
  place-items: center;
  color: var(--vg-muted-foreground);
  font-weight: 600;
  padding: 6px 0;
}
.heat .cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1.6;
  border-radius: var(--vg-radius-control);
  font-weight: 700;
  font-size: 1rem;
  background: color-mix(in srgb, var(--lv-3) var(--pct), var(--vg-muted));
}
.heat .cell.hi {
  color: var(--heat-ink);
}
.heat .cell.zero {
  color: var(--vg-muted-foreground);
  font-weight: 500;
}
.heat .corner {
  font-size: 0.72rem;
  color: var(--vg-muted-foreground);
  display: grid;
  place-items: center;
}
.heat-foot {
  text-align: center;
  color: var(--vg-muted-foreground);
  font-size: 0.8rem;
  margin-top: 8px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.84rem;
  color: var(--vg-muted-foreground);
  margin-bottom: 12px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--sw);
  display: inline-block;
}
.chart details {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--vg-muted-foreground);
}
.chart summary {
  cursor: pointer;
  color: var(--vg-brand);
  font-weight: 600;
}
.chart table {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
  font-size: 0.84rem;
}
.chart th,
.chart td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--vg-border);
}
.chart th {
  color: var(--vg-foreground);
}
.table-scroll {
  overflow-x: auto;
}

/* ---------- limits and the banner ---------- */
.limits {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 14px;
  margin-top: 28px;
}
.limits li {
  border: 1px dashed var(--vg-border);
  border-radius: var(--vg-radius-panel);
  padding: 18px 20px;
  background: color-mix(in srgb, var(--vg-muted) 45%, transparent);
  color: var(--vg-muted-foreground);
  font-size: 0.92rem;
}
.limits b {
  color: var(--vg-foreground);
  display: block;
  margin-bottom: 4px;
}
.limits a.prose {
  display: inline-block;
  margin-top: 6px;
}
.banner {
  background: linear-gradient(135deg, var(--vg-brand-bg), var(--vg-card));
  border: 1px solid var(--vg-brand-border);
  border-radius: var(--vg-radius-panel);
  padding: 40px;
  text-align: center;
}
@media (max-width: 600px) {
  .banner {
    padding: 28px 20px;
  }
}
.banner h2 {
  font-family: var(--font-brand);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.banner p {
  color: var(--vg-muted-foreground);
  max-width: 720px;
  margin: 0 auto 22px;
}

/* ---------- the analytics consent, as the hub and claude-tray draw it ---------- */
.consent-settings {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 20px;
  border: 1px solid var(--vg-border);
  border-radius: var(--vg-radius-panel);
  background: var(--vg-popover);
  color: var(--vg-popover-foreground);
  box-shadow: 0 24px 60px -20px color-mix(in oklab, var(--vg-foreground) 35%, transparent);
  font-size: 0.9rem;
  line-height: 1.6;
}
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ---------- the specification pages: one rule or finding, read as a document ---------- */
.reading {
  max-width: 46rem;
  padding-top: 40px;
  padding-bottom: 64px;
}
.reading h1 {
  font-family: var(--font-brand);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0.6em 0 0.5em;
}
.reading h2,
.reading h3 {
  font-family: var(--font-brand);
  font-weight: 700;
  margin: 1.6em 0 0.5em;
}
.reading p,
.reading ul,
.reading table,
.reading pre {
  margin: 0 0 1em;
}
.reading ul {
  padding-left: 1.4em;
}
.vg-site .reading a {
  color: var(--vg-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reading table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 0.92rem;
}
.reading td,
.reading th {
  border: 1px solid var(--vg-border);
  padding: 0.3rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.reading th {
  background: var(--vg-muted);
}
.reading pre {
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: var(--vg-radius-control);
  background: var(--vg-muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card {
    transition: none;
  }
  .card:hover {
    transform: none;
  }
}
