/* ===========================================================================
   cuak-design-system.css — what Cuak's design system page does differently
   from the other one: its own :root of brand colours, its state swatches,
   its zoning bars, its before/after cards. The 50 rules the two pages
   draw the same way are in design-system.css.
   =========================================================================== */

:root {
  --muted: rgba(242,239,232,.78);
  --faint: rgba(242,239,232,.6);
  --accent: var(--brand-cuak);
  --accent-text: var(--brand-cuak-text);
  --accent-soft: var(--brand-cuak-soft);
}
.pill.accent { border-color: rgba(111,186,150,.3); color: var(--accent-text); background: var(--accent-soft); }
@media (max-width: 768px) { .states-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .states-grid { grid-template-columns: 1fr; } }
.state-img {
  width: 80px; height: 80px; object-fit: contain;
  background: var(--bg-elevated); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin-bottom: var(--s-4);
}
.state-img-placeholder {
  width: 80px; height: 80px;
  background: var(--bg-elevated); border-radius: var(--r-md);
  border: 2px dashed var(--stroke-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: var(--s-4);
}
@media (max-width: 700px) { .zone-diagram { grid-template-columns: 1fr; } }
.zone-data-bar {
  flex: 60; background: rgba(111,186,150,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--accent);
}
.zone-emotional-bar {
  flex: 40; background: rgba(155,143,212,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--accent); border-radius: 0 6px 6px 0;
}
@media (max-width: 700px) { .ref-sheet-grid { grid-template-columns: 1fr; } }

/* BEFORE / AFTER */
.ba-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-16);
  align-items: center;
  margin-top: var(--s-32);
}
@media (max-width: 640px) {
  .ba-grid { grid-template-columns: 1fr; }
  .ba-arrow { transform: rotate(90deg); }
}
.ba-card {
  border-radius: var(--r);
  border: 1px solid var(--stroke-light);
  overflow: hidden;
}
.ba-card-body {
  padding: var(--s-20);
  min-height: 180px;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
}
.ba-annotation strong { color: var(--accent); }

/* ANNOTATED SCREEN */
.annotated-wrap {
  position: relative;
  display: inline-block;
  margin-top: var(--s-32);
  width: 100%;
}
.annotated-wrap img {
  width: 100%; border-radius: var(--r);
  border: 1px solid var(--stroke-light);
  display: block;
}
.annotated-placeholder {
  width: 100%; min-height: 400px;
  background: var(--bg-card);
  border-radius: var(--r);
  border: 2px dashed var(--stroke-light);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--s-12); color: var(--faint); font-size: 14px;
}
@media (max-width: 600px) { .component-grid { grid-template-columns: 1fr; } }

/* Progress bar */
.progress-demo { margin: var(--s-16) 0; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: var(--s-8); }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #a8d8be); }

/* Badge */
.badge-demo { display: flex; flex-wrap: wrap; gap: var(--s-8); margin: var(--s-16) 0; }
.badge-neutral { background: var(--bg-elevated); border-color: var(--stroke-light); color: var(--muted); }
.badge-happy { background: rgba(111,186,150,.1); border-color: rgba(111,186,150,.3); color: var(--accent); }
.badge-worried { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.25); color: var(--accent-warn); }
.badge-sad { background: rgba(155,143,212,.1); border-color: rgba(155,143,212,.3); color: var(--accent); }

/* FOOTER */
  
/* --- SHARED CARD LANGUAGE ---------------------------------------- */
/* Cards that stand on their own carry the card language. The three that
   used to be in this list — .swatch-info, .zone-header, .ba-card-body —
   sit INSIDE a card that already clips with overflow: hidden, so their
   own 18px radius fought the parent's 14px clip and drew a second,
   mismatched corner. A child on its parent's corner takes the parent's
   radius minus its inset; at an inset of 1px that is simply the
   parent's own clip, so they carry none. */
.state-card, .ref-sheet-card, .annotation-item, .component-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.32);
}
  

/* --- SYSTEM WORKFLOW (sections 08-12) ------------------------------------
   The technical story: Figma + Claude + one JSON file. Specs, tables and
   code are dark cards (the thing speaks for itself); Jose's readings of the
   numbers and the honest limits are paper sheets. */
.wf-lead-note { font-size: 12px; color: var(--faint); margin-top: var(--s-16); max-width: 640px; line-height: 1.6; }
.wf-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-16); margin-top: var(--s-32);
}
.wf-stat {
  padding: var(--s-20); background: var(--bg-card);
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .32);
}
.wf-stat-fig { display: block; font-family: var(--serif); font-size: 38px; font-weight: 700; line-height: 1; color: var(--accent-amber); }
.wf-stat p { margin-top: var(--s-8); font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.wf-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-16); }
.wf-chips li {
  padding: 3px 9px; border: 1px solid var(--stroke); border-radius: var(--r-sm);
  font-family: monospace; font-size: 12px; color: var(--muted);
}
.wf-rules { margin-top: var(--s-16); padding-left: var(--s-20); font-size: 14px; line-height: 1.7; color: var(--muted); }
.wf-rules li + li { margin-top: var(--s-4); }
.wf-rules strong { color: var(--text); }
.wf-beside {
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: var(--s-32); align-items: start; margin-top: var(--s-32);
}
@media (max-width: 800px) { .wf-beside { grid-template-columns: 1fr; } }
.wf-fig { margin: 0; }
.wf-fig img { display: block; width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--stroke); }
.wf-fig figcaption { margin-top: var(--s-8); font-size: 12px; color: var(--faint); letter-spacing: .02em; line-height: 1.5; }
.wf-table-wrap {
  margin-top: var(--s-24); overflow-x: auto;
  background: var(--bg-card); border: 1px solid var(--stroke);
  border-radius: var(--r-lg); box-shadow: inset 0 0 70px rgba(0, 0, 0, .32);
}
.wf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wf-table th {
  text-align: left; padding: var(--s-12) var(--s-16); font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--stroke);
}
.wf-table td { padding: 10px var(--s-16); color: var(--muted); line-height: 1.55; vertical-align: top; border-bottom: 1px solid var(--stroke); }
.wf-table tr:last-child td { border-bottom: 0; }
.wf-table td:first-child { color: var(--text); font-family: monospace; font-size: 12px; white-space: nowrap; }
.wf-tag { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; }
.wf-tag--error { background: rgba(239,68,68,.12); color: var(--accent-red-text); }
.wf-tag--warn { background: rgba(251,191,36,.1); color: var(--accent-amber); }
.wf-code {
  margin-top: var(--s-16); padding: var(--s-16) var(--s-20); overflow-x: auto;
  background: var(--bg-card); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .32);
  font-family: monospace; font-size: 12.5px; line-height: 1.7; color: var(--muted);
  white-space: pre; tab-size: 2;
}
.wf-steps { list-style: none; counter-reset: wf; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-16); margin-top: var(--s-28); }
@media (max-width: 760px) { .wf-steps { grid-template-columns: 1fr; } }
.wf-steps li {
  counter-increment: wf; padding: var(--s-20); background: var(--bg-card);
  border: 1px solid var(--stroke); border-radius: var(--r-lg);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .32); font-size: 13.5px; line-height: 1.6; color: var(--muted);
}
.wf-steps li::before { content: "0" counter(wf); display: block; margin-bottom: 10px; font-family: monospace; font-size: 11px; letter-spacing: .12em; color: var(--accent-text); }
.wf-sheets { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-24); margin-top: var(--s-32); align-items: start; }
@media (max-width: 800px) { .wf-sheets { grid-template-columns: 1fr; } }

/* --- CUAK'S OWN SURFACE ---------------------------------------------------
   The page wears the portfolio's dark theme. Anything shown as part of Cuak
   uses the values of cuak-ds/tokens/tokens.json, prefixed --ck- here. */
.cuak-ui {
  --ck-purple: #6B43D9; --ck-lavender: #EDE9FD;
  --ck-cream: #FFF8F1; --ck-white: #FFFFFF; --ck-sand: #EADFD5;
  --ck-text: #111827; --ck-text-2: #374151;
  --ck-success: #16A34A; --ck-success-soft: #E7F6EC;
  --ck-warning: #D97706; --ck-warning-soft: #FDF1DC;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ck-text);
}
.badge-demo.cuak-ui, .progress-demo.cuak-ui { background: var(--ck-cream); border-radius: 16px; padding: 14px; }
.cuak-ui .badge { display: inline-flex; align-items: center; gap: 6px; color: var(--ck-text); border-color: transparent; }
.cuak-ui .badge::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--ck-text-2); }
.cuak-ui .badge-neutral { background: var(--ck-white); border-color: var(--ck-sand); }
.cuak-ui .badge-happy { background: var(--ck-success-soft); }
.cuak-ui .badge-happy::before { background: var(--ck-success); }
.cuak-ui .badge-worried { background: var(--ck-warning-soft); }
.cuak-ui .badge-worried::before { background: var(--ck-warning); }
.cuak-ui .badge-sad { background: var(--ck-lavender); }
.cuak-ui .badge-sad::before { background: var(--ck-purple); }
.cuak-ui .progress-label { color: var(--ck-text-2); }
.cuak-ui .progress-track { background: var(--ck-sand); }
.cuak-ui .progress-fill.is-success { background: var(--ck-success); }
.cuak-ui .progress-fill.is-warning { background: var(--ck-warning); }
.cuak-note { margin: var(--s-16) 0; padding: var(--s-16); background: var(--ck-white); border: 1px solid var(--ck-sand); border-radius: 16px; }
.cuak-note--warning { background: var(--ck-warning-soft); border-color: var(--ck-warning); }
.cuak-ui .cuak-note-kicker { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--ck-text-2); }
.cuak-ui .cuak-note-title { margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--ck-text); }
.cuak-ui .cuak-note-link { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--ck-purple); }
.cuak-ui .cuak-note-figure { margin: 6px 0 4px; font-size: 28px; font-weight: 700; color: var(--ck-text); }
.cuak-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ck-warning); }
.cuak-ui.cuak-type { margin: 0; padding: 14px 16px; background: var(--ck-cream); border-radius: 12px; color: var(--ck-text); }
.cuak-ui.cuak-type--display { font-size: 42px; font-weight: 700; line-height: 47px; color: var(--ck-purple); }
.cuak-ui.cuak-type--title { font-size: 24px; font-weight: 700; line-height: 26.88px; }
.cuak-ui.cuak-type--heading { font-size: 17px; font-weight: 700; }
.cuak-ui.cuak-type--body { font-size: 15px; font-weight: 400; line-height: 1.3; }
.cuak-ui.cuak-type--label { font-size: 13px; font-weight: 400; line-height: 18px; color: var(--ck-text-2); }
.cuak-ui.cuak-type--meta { font-size: 11px; font-weight: 700; letter-spacing: 1.1px; }

@media (max-width: 480px) { .color-grid { grid-template-columns: 1fr 1fr; gap: var(--s-12); } }
.swatch-token { overflow-wrap: anywhere; }
@media (min-width: 700px) { .color-grid { grid-template-columns: repeat(4, 1fr); } }
