/* AREA — project page. Editorial, monochromatic, cool-toned. Extends charlesnjoku.com. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:       #f5f7f9;
  --paper-panel: #eaedf1;
  --ink:         #14181d;
  --ink-soft:    #4a525b;
  --ink-dim:     #838b95;
  --rule:        #dfe3e8;
  --rule-strong: #c5ccd4;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --measure: 40rem;
  --page: 68rem;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration: none; }

.eyebrow, .section-num, .label, .nav-links a, .nav-name,
.meta-key, .fig-tag, .fig-cap, .tag, .btn, .foot a, .foot-copy,
.stage-k, .meta-val, .scene-tool, .scene-legend, .tip, table.aoi {
  font-family: var(--sans);
}

/* ── NAV ── */
header {
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
  background: rgba(245,247,249,0.9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
nav {
  max-width: var(--page); margin: 0 auto; padding: 0 2rem;
  height: 3.25rem; display: flex; align-items: center; justify-content: space-between;
}
.nav-name { font-weight: 600; font-size: 0.9rem; color: var(--ink); letter-spacing: 0.01em; }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a { font-size: 0.85rem; color: var(--ink-soft); transition: color .15s; }
.nav-links a:hover { color: var(--ink); }

/* ── WRAPPER ── */
main { max-width: var(--page); margin: 0 auto; padding: 0 2rem; }
.wrap { max-width: var(--measure); }

section { padding: 3.25rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }

/* ── MASTHEAD ── */
.masthead { padding: 4.5rem 0 3rem; border-bottom: 1px solid var(--rule); }
.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 1.6rem;
}
.eyebrow span { color: var(--rule-strong); margin: 0 0.55rem; }
.masthead h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 6.5rem); line-height: 0.9;
  letter-spacing: -0.02em; margin-bottom: 0.5rem;
}
.masthead .expand {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.35rem, 4vw, 1.9rem); color: var(--ink-soft);
  letter-spacing: -0.01em; margin-bottom: 1.75rem;
}
.dek {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem); line-height: 1.5;
  color: var(--ink); max-width: 36rem; margin-bottom: 2.25rem;
}

/* meta row */
.meta {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.5rem 1.75rem; border-top: 1px solid var(--rule);
  padding-top: 1.5rem; margin-bottom: 2rem; max-width: 44rem;
}
.meta-key {
  display: block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.4rem;
}
.meta-val { font-size: 0.9rem; line-height: 1.45; color: var(--ink); }

/* buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.btn {
  font-size: 0.85rem; border-radius: 2px; transition: background .15s, color .15s, border-color .15s, opacity .15s;
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); padding: 0.55rem 1.1rem; }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.text { background: none; border: none; color: var(--ink-soft); padding: 0.55rem 0.15rem; }
.btn.text:hover { color: var(--ink); }
.btn .arw { font-family: var(--serif); }

/* ── FIGURE ── */
figure { margin: 0; }
.fig-hero { padding: 2.5rem 0; border-bottom: 1px solid var(--rule); }
.fig-frame { border: 1px solid var(--rule); background: #fff; padding: 0.5rem; border-radius: 2px; }
.fig-frame img { display: block; width: 100%; height: auto; border-radius: 1px; }
.fig-cap {
  display: flex; gap: 0.9rem; margin-top: 0.9rem; font-size: 0.8rem;
  color: var(--ink-dim); line-height: 1.55; max-width: 46rem;
}
.fig-tag {
  flex: none; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-soft); font-size: 0.7rem; padding-top: 0.06rem;
}

/* ── SECTION HEADS ── */
.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.75rem; }
.section-num { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; color: var(--ink-dim); padding-top: 0.35rem; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.01em; color: var(--ink); }

.prose p { margin-bottom: 1.15rem; }
.prose p:last-child { margin-bottom: 0; }
.prose a { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.lead { font-size: 1.22rem; line-height: 1.6; }

/* ── PULLQUOTE ── */
.pullquote { padding: 3.25rem 0; border-bottom: 1px solid var(--rule); }
.pullquote blockquote {
  font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.15rem); line-height: 1.32;
  letter-spacing: -0.015em; color: var(--ink); max-width: 48rem; text-indent: -0.4em;
}
.pullquote .attr {
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-dim);
  margin-top: 1.5rem;
}

/* ── METHOD STAGES ── */
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.stage { padding: 1.75rem 1.75rem 1.75rem 0; border-right: 1px solid var(--rule); }
.stage:last-child { border-right: none; padding-right: 0; }
.stage:not(:first-child) { padding-left: 1.75rem; }
.stage-k { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.6rem; }
.stage h3 { font-family: var(--serif); font-weight: 500; font-size: 1.18rem; margin-bottom: 0.6rem; }
.stage p { font-size: 0.98rem; line-height: 1.6; color: var(--ink-soft); }
.stage .sub { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-dim); margin-top: 0.75rem; line-height: 1.5; }

/* ── MEASURES (definition list) ── */
.deflist { border-top: 1px solid var(--rule); }
.def { display: grid; grid-template-columns: 13rem 1fr; gap: 1.5rem; padding: 1.15rem 0; border-bottom: 1px solid var(--rule); }
.def dt { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.def dd { font-size: 0.98rem; line-height: 1.6; color: var(--ink-soft); }

/* ── INTERACTIVE SCENE ── */
.scene-fig { margin-top: 2.75rem; }
.scene-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.scene-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; }
.scene-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.scene-tool {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 999px;
  padding: 0.28rem 0.75rem; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 0.4rem; transition: all .15s;
}
.scene-tool .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink); opacity: 0.25; }
.scene-tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.scene-tool[aria-pressed="true"] .dot { opacity: 1; background: var(--paper); }
.scene-stage {
  position: relative; border: 1px solid var(--rule); background: #fbfcfd; border-radius: 2px;
  overflow: hidden;
}
.scene-stage svg { display: block; width: 100%; height: auto; }
.tip {
  position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, -120%);
  background: var(--ink); color: var(--paper); font-size: 0.72rem; line-height: 1.35;
  padding: 0.4rem 0.6rem; border-radius: 3px; white-space: nowrap; transition: opacity .12s; z-index: 3;
}
.tip b { font-weight: 600; }
.tip .k { color: #aeb6c0; }
.scene-legend { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 0.85rem; font-size: 0.75rem; color: var(--ink-dim); }
.scene-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.lg { width: 0.75rem; height: 0.75rem; border-radius: 2px; flex: none; }

/* ── TABLE ── */
.table-fig { margin-top: 2.75rem; }
table.aoi { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.aoi th, table.aoi td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rule); text-align: right; }
table.aoi th:first-child, table.aoi td:first-child { text-align: left; }
table.aoi th:nth-child(2), table.aoi td:nth-child(2) { text-align: left; color: var(--ink-dim); }
table.aoi thead th { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); border-bottom: 1px solid var(--rule-strong); }
table.aoi tbody tr:hover { background: var(--paper-panel); }
.bar span { display: inline-block; height: 0.5rem; background: var(--ink); vertical-align: middle; margin-right: 0.5rem; }

/* tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2.5rem; }
.tag { font-size: 0.7rem; padding: 0.22rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-soft); background: var(--paper); }

/* ── FOOTER ── */
footer { max-width: var(--page); margin: 0 auto; padding: 2.5rem 2rem 3.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; border-top: 1px solid var(--rule); }
.foot-copy { font-size: 0.8rem; color: var(--ink-dim); }
.foot { display: flex; gap: 1.5rem; }
.foot a { font-size: 0.8rem; color: var(--ink-soft); transition: color .15s; }
.foot a:hover { color: var(--ink); }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  .stages { grid-template-columns: 1fr; }
  .stage { border-right: none; border-bottom: 1px solid var(--rule); padding: 1.5rem 0 !important; }
  .stage:last-child { border-bottom: none; }
  .meta { grid-template-columns: 1fr 1fr; }
  .def { grid-template-columns: 1fr; gap: 0.35rem; }
}
@media (max-width: 560px) {
  main, nav, footer { padding-left: 1.25rem; padding-right: 1.25rem; }
  .nav-links { gap: 1.1rem; }
  .masthead { padding-top: 3rem; }
}

/* ── QUICKSTART ── */
#quickstart .qs-lede {
  font-family: var(--serif); font-weight: 500; font-size: clamp(1.5rem, 3.4vw, 2rem);
  letter-spacing: -0.015em; margin-bottom: 1rem;
}
.qs-points { list-style: none; margin: 0 0 2rem; padding: 0; }
.qs-points li {
  position: relative; padding-left: 1.35rem; margin-bottom: 0.6rem;
  font-size: 1rem; color: var(--ink-soft); line-height: 1.6;
}
.qs-points li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 0.5rem; height: 1px; background: var(--ink);
}
code, .code, .cite code { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; }
:not(pre) > code { font-size: 0.86em; background: var(--paper-panel); padding: 0.08em 0.35em; border-radius: 3px; }

.code-wrap {
  border: 1px solid var(--rule); border-radius: 3px; background: #0f1216;
  overflow-x: auto; margin-bottom: 2.5rem;
}
pre.code {
  margin: 0; padding: 1.25rem 1.4rem; color: #cdd3da; font-size: 0.82rem; line-height: 1.85;
  white-space: pre; min-width: max-content;
}
pre.code .c { color: #6f7b88; }              /* comment */
pre.code .s { color: #9db8c8; }              /* string  */
pre.code .k { color: #e7ad6b; font-weight: 500; } /* command */

/* dependencies */
.deps { border-top: 1px solid var(--rule); padding-top: 1.75rem; margin-bottom: 2.75rem; }
.deps-head {
  font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.9rem;
}
.deps-note { font-size: 0.98rem; color: var(--ink-soft); max-width: 44rem; margin-bottom: 1.25rem; }
.deps-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; }
.dep { padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.dep dt { font-family: var(--serif); font-weight: 500; font-size: 1.02rem; margin-bottom: 0.3rem; }
.dep dd { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }

/* quickstart footer: blurb + citation + resource links */
.qs-foot {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 2.5rem;
  border-top: 1px solid var(--rule-strong); padding-top: 2rem;
}
.qs-foot-k {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.9rem;
}
.qs-blurb { font-size: 0.98rem; color: var(--ink-soft); line-height: 1.6; margin-bottom: 1.25rem; max-width: 34rem; }
.cite {
  display: flex; align-items: stretch; gap: 0; border: 1px solid var(--rule-strong); border-radius: 3px;
  overflow: hidden; max-width: 38rem;
}
.cite code {
  flex: 1; padding: 0.7rem 0.85rem; font-size: 0.74rem; line-height: 1.5; color: var(--ink);
  background: var(--paper-panel); word-break: break-word;
}
.cite-copy {
  flex: none; border: none; border-left: 1px solid var(--rule-strong); background: var(--ink);
  color: var(--paper); font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  padding: 0 1rem; cursor: pointer; transition: background .15s;
}
.cite-copy:hover { background: #000; }
.qs-links { display: flex; flex-direction: column; gap: 0.7rem; }
.qs-links a {
  font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule); padding-bottom: 0.6rem; transition: color .15s;
}
.qs-links a:hover { color: var(--ink); }
.qs-links .arw { color: var(--ink-dim); }

@media (max-width: 820px) {
  .deps-list { grid-template-columns: 1fr; }
  .qs-foot { grid-template-columns: 1fr; gap: 1.75rem; }
}
