/* lawsofux-motion-lab — site.css
   Editorial palette, IBM Plex stack, hairline rules.
   Voice cue: lab notebook. Chrome stays still; SVGs animate. */

:root {
  --bg:        #FAF8F5;
  --bg-deep:   #F2EEE3;
  --ink:       #1A1A1A;
  --muted:     #5C5C5C;
  --hairline:  #E5DFD0;
  --rule:      #D4CDB7;
  --link:      #8E3322;       /* terracotta accent */
  --link-hover:#5C2A23;
  --accent-warm:#C9B477;
  --accent-cobalt:#1E5C8C;
  --accent-forest:#2D5A3F;
  --accent-magenta:#5A1E4D;
  --accent-cream:#D6CDB0;
  --code-bg:   #1F1B14;
  --code-ink:  #EFEAD8;
  --code-muted:#9C9479;
  --code-keyword:#D6CDB0;
  --code-string:#C9B477;
  --code-comment:#7F7860;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ Typography ============ */
h1, h2, h3, h4 {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 16px;
}
h1 { font-size: 52px; line-height: 1.08; }
h2 { font-size: 32px; line-height: 1.18; margin-top: 56px; }
h3 { font-size: 22px; line-height: 1.28; margin-top: 36px; }
h4 { font-size: 16px; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.08em; font-family: 'IBM Plex Sans', sans-serif; font-weight: 500; color: var(--muted); margin-top: 28px; }
p { margin: 0 0 18px; }

a { color: var(--link); text-decoration: none; border-bottom: 1px solid currentColor; }
a:hover { color: var(--link-hover); }

code, pre, .mono {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
}

code {
  font-size: 0.9em;
  padding: 1px 5px;
  background: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: 2px;
}

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 22px 24px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  margin: 24px 0;
}
pre code { background: transparent; border: none; padding: 0; color: inherit; }

hr { border: none; border-top: 1px solid var(--rule); margin: 48px 0; }

/* ============ Top nav ============ */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
}
.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.topnav .brand {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  color: var(--ink);
  border: none;
  letter-spacing: 0.04em;
}
.topnav .brand .glyph { color: var(--link); margin-right: 8px; }
.topnav nav { display: flex; gap: 28px; }
.topnav nav a {
  color: var(--muted);
  border: none;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.topnav nav a:hover, .topnav nav a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ============ Layouts ============ */
.wrap, main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.read {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}
.read p, .read li { font-size: 17px; }

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 32px 48px;
  border-bottom: 1px solid var(--rule);
}
.hero .eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: 64px;
  max-width: 920px;
  line-height: 1.04;
  margin-bottom: 22px;
}
.hero p.lede {
  font-size: 19px;
  color: var(--ink);
  max-width: 720px;
  line-height: 1.55;
  margin-bottom: 0;
}

/* ============ Gallery grid ============ */
.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 56px 32px 96px;
  max-width: 1280px;
  margin: 0 auto;
}
@media (max-width: 1180px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 920px)  { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .gallery { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease;
}
.card:hover { border-color: var(--ink); transform: translateY(-1px); }
.card .svg-frame {
  aspect-ratio: 4 / 3;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.card .svg-frame svg { width: 100%; height: 100%; display: block; }
.card .meta {
  padding: 14px 16px 18px;
}
.card .name {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  line-height: 1.2;
  color: var(--ink);
}
.card .family-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.card .one-liner {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

/* ============ Concept page ============ */
.concept-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 24px;
}
.concept-header .eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.concept-header h1 { font-size: 56px; line-height: 1.05; max-width: 880px; }
.concept-header .badges {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin: 22px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.badge {
  background: var(--bg-deep);
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.badge.warm    { color: #8E5400; border-color: #E5D5A8; background: #FCF3DC; }
.badge.cobalt  { color: #114B7A; border-color: #BBD2E5; background: #E8F1F8; }
.badge.forest  { color: #1F4831; border-color: #C5D9CC; background: #ECF3EE; }
.badge.magenta { color: #4F1843; border-color: #DCC4D6; background: #F4E9F1; }

.concept-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 64px;
}
@media (max-width: 980px) {
  .concept-body { grid-template-columns: 1fr; gap: 32px; }
}

.concept-svg {
  margin: 0 0 40px;
  background: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.concept-svg svg { width: 100%; height: 100%; }

.concept-prose h4 { margin-top: 36px; }
.concept-prose ul { padding-left: 22px; margin: 0 0 18px; }
.concept-prose li { margin-bottom: 8px; }
.concept-prose .definition {
  font-size: 19px;
  line-height: 1.55;
  border-left: 2px solid var(--rule);
  padding-left: 22px;
  color: var(--ink);
  margin: 24px 0 36px;
}

aside.sidebar {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  border-left: 1px solid var(--hairline);
  padding-left: 24px;
  align-self: start;
  position: sticky;
  top: 80px;
}
aside.sidebar h4 { margin-top: 0; }
aside.sidebar h4:not(:first-child) { margin-top: 32px; }
aside.sidebar a { color: var(--ink); }
aside.sidebar ul { padding-left: 0; list-style: none; margin: 0; }
aside.sidebar li { margin-bottom: 6px; }
aside.sidebar .source-link {
  display: inline-block;
  margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  border: 1px solid var(--hairline);
  padding: 6px 10px;
  border-radius: 2px;
  color: var(--ink);
}

/* ============ Footer ============ */
footer.colophon {
  border-top: 1px solid var(--hairline);
  padding: 36px 32px;
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--muted);
  letter-spacing: 0.02em;
}
footer.colophon .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
footer.colophon a { color: var(--muted); border-bottom-color: var(--hairline); }
footer.colophon a:hover { color: var(--ink); }

/* ============ Rubric page ============ */
.rubric-rule {
  border: 1px solid var(--hairline);
  background: var(--bg);
  padding: 24px 28px;
  margin: 18px 0;
  border-radius: 3px;
}
.rubric-rule h3 { margin-top: 0; }
.rubric-rule .crit-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px 16px;
  font-size: 14px;
  margin: 12px 0;
}
.rubric-rule .crit-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding-top: 2px;
}
.rubric-rule .score-row {
  display: flex; align-items: center; gap: 24px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--rule);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}
.rubric-rule .score-input {
  display: inline-flex; gap: 8px; align-items: center;
}
.rubric-rule .score-input input[type=radio] { accent-color: var(--link); }

/* ============ Misc ============ */
.related {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.related a {
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.04em;
  border: 1px solid var(--hairline);
  padding: 4px 10px;
  border-radius: 2px;
  color: var(--ink);
  background: var(--bg);
}
.related a:hover { background: var(--bg-deep); border-color: var(--ink); }

.section-rule {
  border: 0; border-top: 1px solid var(--rule);
  margin: 48px 0;
}

.callout {
  background: var(--bg-deep);
  border-left: 3px solid var(--link);
  padding: 18px 22px;
  margin: 28px 0;
  font-size: 15px;
  line-height: 1.6;
}

.fig {
  margin: 36px 0;
  border: 1px solid var(--hairline);
  background: var(--bg-deep);
  border-radius: 4px;
  overflow: hidden;
}
.fig .figbox { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.fig .figbox svg { width: 100%; height: 100%; }
.fig .figcaption {
  border-top: 1px solid var(--hairline);
  padding: 12px 18px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg);
}

.tworow {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 32px 0;
}
@media (max-width: 720px) { .tworow { grid-template-columns: 1fr; } }
