/* Making Data Sing: shared styles for the site and the slides */
:root {
  color-scheme: light;
  --bg: #f8f6f1;
  --card: #ffffff;
  --card-2: #f1eee6;
  --ink: #1b1d2a;
  --ink-2: #4d4f5c;
  --muted: #7a7b84;
  --line: #e3dfd5;
  --grid: #ebe8e0;
  --accent: #b5361b;
  /* categorical slots (validated reference palette, light) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --s1-soft: #e3eefb; --s2-soft: #fde9e0; --s3-soft: #dff5ec; --s4-soft: #fdf1d6; --s5-soft: #fbe7ef;
  --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 4px 16px rgba(20, 20, 40, .05);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14151b; --card: #1c1e26; --card-2: #23252f; --ink: #efede7; --ink-2: #c4c2b9;
    --muted: #8f8e88; --line: #2f313c; --grid: #282a34; --accent: #f08a6c;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --s1-soft: #1c2a3d; --s2-soft: #38231b; --s3-soft: #15302a; --s4-soft: #352b15; --s5-soft: #35202a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14151b; --card: #1c1e26; --card-2: #23252f; --ink: #efede7; --ink-2: #c4c2b9;
  --muted: #8f8e88; --line: #2f313c; --grid: #282a34; --accent: #f08a6c;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --s1-soft: #1c2a3d; --s2-soft: #38231b; --s3-soft: #15302a; --s4-soft: #352b15; --s5-soft: #35202a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: .88em; background: var(--card-2); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 5vw, 44px); }
h3 { font-size: 18px; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { font-family: var(--serif); font-size: 22px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav { margin-left: auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.nav a:hover { background: var(--card-2); color: var(--ink); }
.nav a.cta { background: var(--ink); color: var(--bg); }
@media (max-width: 760px) { .nav .hide-sm { display: none; } }

/* hero */
.hero { padding: 56px 0 24px; }
.eyebrow { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.hero h1 { font-size: clamp(44px, 8vw, 84px); max-width: 14ch; }
.hero h1 em { color: var(--accent); }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-2); max-width: 46ch; }

/* sections */
section.block { padding: 56px 0; border-top: 1px solid var(--line); }
.step-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.step-tag .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; letter-spacing: 0; }
.intro { max-width: 62ch; color: var(--ink-2); font-size: 17px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.fig { margin: 24px 0; }
.fig-cap { font-size: 14px; color: var(--muted); margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

/* model figure */
.model svg { width: 100%; height: auto; display: block; }
.model-legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 8px; }
.model-legend a { text-decoration: none; color: inherit; border-top: 3px solid var(--c); padding-top: 8px; }
.model-legend b { display: block; font-size: 15px; }
.model-legend span { font-size: 13px; color: var(--ink-2); line-height: 1.4; display: block; }
@media (max-width: 700px) { .model-legend { grid-template-columns: 1fr 1fr; } }

/* types */
.types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 860px) { .types { grid-template-columns: repeat(2, 1fr); } }
.type { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.type .ico { font-size: 30px; line-height: 1; }
.type b { display: block; margin-top: 8px; font-size: 17px; }
.type .q { font-family: var(--serif); font-size: 20px; color: var(--ink-2); font-style: italic; }
.type .eg { font-size: 13px; color: var(--muted); margin-top: 6px; }
.type .col { margin-top: 10px; font-family: var(--mono); font-size: 13px; background: var(--card-2); border-radius: 6px; padding: 4px 0; }

/* pairs matrix */
.pairs-wrap { overflow-x: auto; }
.pairs { display: grid; grid-template-columns: 88px repeat(5, minmax(120px, 1fr)); gap: 6px; min-width: 700px; }
.pairs .h { font-size: 13px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; text-align: center; }
.pairs .rh { justify-content: flex-start; }
.pairs .cell { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 13px; line-height: 1.35; color: var(--ink-2); min-height: 76px; }
.pairs .cell.diag { background: var(--card-2); }
.pairs .cell.hot { border-color: var(--accent); color: var(--ink); }
.pairs .cell.empty { background: transparent; border: 1px dashed var(--line); }
.pairs .cell b { color: var(--ink); display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }

/* moves */
.family { border-top: 4px solid var(--c); }
.family h3 { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.family .why { color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }
.move { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.move svg { width: 64px; height: 44px; }
.move b { font-size: 15px; display: block; }
.move span { font-size: 13px; color: var(--ink-2); line-height: 1.4; display: block; }

.flat-sing { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 760px) { .flat-sing { grid-template-columns: 1fr; } .flat-sing .arrow { transform: rotate(90deg); justify-self: center; } }
.flat-sing .arrow { align-self: center; font-size: 28px; color: var(--accent); }
.quote { font-family: var(--serif); font-size: 24px; line-height: 1.3; }
.label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 650; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--c-soft, var(--card-2)); color: var(--ink); border: 1px solid var(--line); }

/* charts */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart h4 { margin: 0 0 2px; font-size: 16px; }
.chart .sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .1s; z-index: 5; box-shadow: var(--shadow); }
.tip.on { opacity: 1; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.axis text { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.axis line, .gridline { stroke: var(--grid); }
.baseline { stroke: var(--muted); }
.tag-move { font-size: 12px; font-weight: 650; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }

/* doors */
.door svg { width: 100%; height: auto; display: block; margin: 4px 0 12px; }
.door h3 { font-size: 21px; }
.door .ask { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--ink-2); margin-bottom: 10px; line-height: 1.3; }
.door ul { margin: 0 0 10px; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.door .tool { font-size: 13px; border-top: 1px solid var(--line); padding-top: 10px; }

/* sharpen */
.sharpen { display: grid; grid-template-columns: 1fr 1.5fr 1.4fr; gap: 14px; align-items: center; }
@media (max-width: 860px) { .sharpen { grid-template-columns: 1fr; } }
.seed { text-align: center; }
.seed .s { font-family: var(--serif); font-size: 28px; font-style: italic; }
.parts { display: flex; flex-direction: column; gap: 8px; }
.part { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.part b { font-size: 14px; }
.part span { color: var(--ink-2); }
.full .quote { font-size: 22px; }
.test { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--s5-soft); font-size: 15px; }

/* checklist */
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: c; }
.check li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 56px; position: relative; counter-increment: c; }
.check li::before { content: counter(c); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
footer { padding: 40px 0 60px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer ul { padding-left: 18px; }
