/* ==========================================================================
   WORK PAGES — /work/ (filterable card grid) and /tech-summary/ (table + one
   block per system). Dark hero, light body, dark CTA band, the site's block
   rule. Loads after site.css, system-map.css (.light tokens) and
   home-sections.css (.light component overrides). Generated pages:
   ops/tools/portfolio-work-pages/build.mjs.
   ========================================================================== */

/* ---- hero ---------------------------------------------------------------- */
.wp-hero { padding: 168px 0 64px; }
.wp-hero .lede { color: var(--muted); max-width: 48rem; margin-top: 1.2rem; font-size: 1.05rem; }
.wp-hero .lede b { color: #fff; font-weight: 600; }
.wp-hero .actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.8rem; }
@media (max-width: 480px) {
  /* a long button label wraps instead of running past a phone's edge */
  .wp-hero .actions .btn-ghost, .endcta .btn-ghost { white-space: normal; text-align: left; max-width: 100%; }
}
.wp-hero .note { margin-top: 1.6rem; max-width: 52rem; border-left: 2px solid var(--brand-fuchsia); padding: 2px 0 2px 16px; color: #c9c6d0; font-size: .95rem; line-height: 1.6; }
.wp-hero .note b { color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .wp-hero .note, .wp-hero .lede, .wp-hero .actions { opacity: 0; transform: translateY(26px); filter: blur(6px); animation: fadeup .9s var(--ease) forwards; }
  .wp-hero .lede { animation-delay: .22s; }
  .wp-hero .note { animation-delay: .32s; }
  .wp-hero .actions { animation-delay: .42s; }
}

/* ---- body ---------------------------------------------------------------- */
.light .wp-body { padding: 64px 0 110px; }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 24px; padding: 0; list-style: none; font-size: .9rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; }

/* label pill: one colour per label, text + dot, never colour alone */
.lab { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; border-radius: 999px; padding: .32rem .7rem; border: 1px solid transparent; line-height: 1; white-space: nowrap; }
.lab::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lab-client { color: #6d28d9; background: #f3e8ff; border-color: #d8b4fe; }
.lab-production { color: #047857; background: #ecfdf5; border-color: #86efac; }
.lab-practice { color: #9a3412; background: #fff7ed; border-color: #fdba74; }
.lab-demo { color: #1d4ed8; background: #eff6ff; border-color: #93c5fd; }
.ind { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; color: var(--muted); }

/* group heads */
.grp { margin: 96px 0 22px; }
.grp.first { margin-top: 0; }
.grp .k { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: #7e22ce; font-weight: 600; }
.grp h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-top: .4rem; }
.grp p { color: var(--muted); margin-top: .5rem; max-width: 48rem; }

/* ---- the table ----------------------------------------------------------- */
.tbl-wrap { margin-top: 10px; }
table.sys-table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--text); font-size: .9rem; }
.sys-table th { text-align: left; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 10px 12px; border-bottom: 1px solid rgba(23, 20, 31, .14); vertical-align: bottom; }
.sys-table td { padding: 14px 10px; border-bottom: 1px solid rgba(23, 20, 31, .09); vertical-align: top; color: var(--muted); line-height: 1.5; }
.sys-table tr.grp-row th { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -.01em; text-transform: none; color: var(--text); padding: 26px 10px 10px; background: transparent; }
.sys-table td.sysname { min-width: 170px; }
.sys-table td.sysname a { color: var(--text); font-weight: 600; font-family: var(--font-display); font-size: 1rem; line-height: 1.3; }
.sys-table td.sysname a:hover { color: var(--brand-purple); }
.sys-table td.sysname .lab { margin-top: 8px; }
.sys-table td.type { color: var(--text); min-width: 120px; }
.sys-table td.tools { font-family: var(--font-mono); font-size: .72rem; line-height: 1.6; min-width: 150px; }
.sys-table td.does { min-width: 220px; }
.sys-table td.nums { min-width: 190px; }
.sys-table td.nums b { color: var(--text); font-weight: 600; }
.sys-table td.nums .src { font-size: .78rem; color: #7d7889; }
.sys-table td.nums .sep { color: #b4b0bd; }
.sys-table col.c-sys { width: 17%; }
.sys-table col.c-type { width: 11%; }
.sys-table col.c-tools { width: 15%; }
.sys-table col.c-does { width: 27%; }
.sys-table col.c-nums { width: 22%; }
.sys-table col.c-link { width: 8%; }
.sys-table td.link a { color: #c2410c; font-weight: 600; white-space: nowrap; }
.sys-table td.link a:hover { color: var(--brand-purple); }
.sys-table .none { color: #8a8595; font-style: italic; }
.tbl-note { color: var(--muted); font-size: .88rem; margin-top: 18px; max-width: 60rem; }
@media (max-width: 980px) {
  .sys-table thead { display: none; }
  .sys-table, .sys-table tbody, .sys-table tr, .sys-table td { display: block; width: 100%; min-width: 0; }
  .sys-table tr { padding: 14px 0 16px; border-bottom: 1px solid rgba(23, 20, 31, .12); }
  .sys-table tr.grp-row { padding: 0; border-bottom: 0; }
  .sys-table tr.grp-row th { display: block; padding: 34px 0 6px; border-bottom: 2px solid var(--text); }
  .sys-table td { border: 0; padding: 7px 0; }
  .sys-table td::before { content: attr(data-l); display: block; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: #7d7889; margin-bottom: 3px; }
  .sys-table td.sysname::before { display: none; }
  .sys-table td.sysname a { font-size: 1.1rem; }
  .sys-table td.link a { white-space: normal; }
}

/* ---- system blocks ------------------------------------------------------- */
.sys { background: #fff; border: 1px solid rgba(23, 20, 31, .09); border-radius: 20px; padding: 28px 28px 24px; margin-top: 18px; box-shadow: 0 14px 34px -24px rgba(23, 20, 31, .3); scroll-margin-top: 110px; }
.sys:target { border-color: rgba(126, 34, 206, .45); box-shadow: 0 0 0 4px rgba(126, 34, 206, .1), 0 14px 34px -24px rgba(23, 20, 31, .3); }
.sys-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.sys-head h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); flex: 1 1 260px; min-width: 0; }
.sys-meta { margin-top: 10px; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.sys-meta b { color: var(--text); font-weight: 600; margin-right: 4px; }
.chips.sm { margin-top: 12px; gap: .4rem; }
.chips.sm span { font-size: .68rem; padding: .32rem .75rem; }
.sys-cols { display: grid; gap: 20px 28px; margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(23, 20, 31, .09); }
@media (min-width: 900px) { .sys-cols { grid-template-columns: repeat(3, 1fr); } }
.sys-cols h4, .wcard .panel h4 { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: #7e22ce; font-weight: 600; margin-bottom: 8px; }
.sys-cols p { color: var(--muted); font-size: .93rem; line-height: 1.6; }
.sys-foot { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(23, 20, 31, .09); align-items: baseline; font-size: .9rem; }
.sys-foot .nums { color: var(--muted); flex: 1 1 320px; line-height: 1.55; }
.sys-foot .nums .k { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: #7d7889; margin-right: 6px; }
.sys-foot .nums b { color: var(--text); font-weight: 600; }
.sys-foot .links, .wcard .panel .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.sys-foot .links a, .wcard .panel .links a { color: #c2410c; font-weight: 600; }
.sys-foot .links a:hover, .wcard .panel .links a:hover { color: var(--brand-purple); }
.sys-foot .none { color: #8a8595; font-style: italic; }
@media (max-width: 640px) { .sys { padding: 22px 18px 18px; } }

/* ---- filters ------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.filters button { font: inherit; font-weight: 600; font-size: .88rem; color: var(--text); background: #fff; border: 1px solid rgba(23, 20, 31, .14); border-radius: 999px; padding: .5rem 1rem; cursor: pointer; transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease); }
.filters button:hover { border-color: rgba(126, 34, 206, .5); }
.filters button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.count { margin-top: 14px; color: var(--muted); font-size: .88rem; }

/* ---- cards --------------------------------------------------------------- */
.wgrid { display: grid; gap: 18px; margin-top: 22px; align-items: start; }
@media (min-width: 700px) { .wgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .wgrid { grid-template-columns: repeat(3, 1fr); } }
.wcard { background: #fff; border: 1px solid rgba(23, 20, 31, .09); border-radius: 20px; padding: 22px 22px 18px; box-shadow: 0 14px 34px -24px rgba(23, 20, 31, .3); display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 110px; }
.wcard[hidden] { display: none; }
.wcard:target { border-color: rgba(126, 34, 206, .45); box-shadow: 0 0 0 4px rgba(126, 34, 206, .1), 0 14px 34px -24px rgba(23, 20, 31, .3); }
.wcard .top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.wcard h3 { font-size: 1.15rem; line-height: 1.3; margin-top: 12px; }
.wcard .lines { color: var(--muted); font-size: .92rem; line-height: 1.55; margin-top: 8px; }
.wcard .lines span { display: block; }
.wcard .lines span + span { margin-top: 5px; }
.wcard details { margin-top: 16px; }
.wcard summary { list-style: none; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text); border: 1px solid rgba(23, 20, 31, .16); background: #fff; border-radius: 999px; padding: .4rem .4rem .4rem 1.1rem; transition: border-color .3s var(--ease); }
.wcard summary::-webkit-details-marker { display: none; }
.wcard summary:hover { border-color: rgba(126, 34, 206, .5); }
.wcard summary:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 3px; }
.wcard summary .chip { width: 30px; height: 30px; border-radius: 50%; background: rgba(23, 20, 31, .05); display: flex; align-items: center; justify-content: center; font-size: .9rem; transition: transform .3s var(--ease), background .3s var(--ease); }
.wcard summary:hover .chip { background: rgba(249, 115, 22, .14); }
.wcard details[open] summary .chip { transform: rotate(90deg); }
.wcard details[open] .more, .wcard details:not([open]) .less { display: none; }
.wcard .panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(23, 20, 31, .09); }
.wcard .panel h4 { margin: 14px 0 4px; }
.wcard .panel h4:first-child { margin-top: 0; }
.wcard .panel p { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.wcard .panel .links { margin-top: 14px; font-size: .88rem; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.empty[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .wp-hero .note, .wp-hero .lede, .wp-hero .actions { animation: none; opacity: 1; transform: none; filter: none; }
  .filters button, .wcard summary, .wcard summary .chip { transition: none; }
}
