/* =========================================================
   Me2You submission hub
   Single design system for every page under /hub/.
   Mobile-first, accessible, low-bandwidth, no build step.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Nunito:wght@400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --brand-orange: #F89A1F;
  --brand-orange-700: #A0530A;
  --brand-orange-50: #FFF6E9;
  --brand-plum: #8E7CA0;
  --brand-plum-50: #ECE6F2;
  --ok-green: #2F9E5A;
  --ok-green-50: #DDF1E4;
  --warn-amber: #B88A00;
  --warn-amber-50: #FFF1CD;
  --bad-red: #D44A3A;
  --bad-red-50: #FCE2DD;
  --info-blue: #2D7AC7;
  --info-blue-50: #DCEAF8;
  --ink-900: #1F1A17;
  --ink-700: #3D342E;
  --ink-500: #6B5E55;
  --ink-300: #B7AFA4;
  --ink-200: #E7DFD5;
  --ink-100: #F1ECE3;
  --ink-50: #FAF6EF;
  --paper: #FFFFFF;
  --paper-warm: #FBF8F1;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(31, 26, 23, 0.06), 0 2px 8px rgba(31, 26, 23, 0.05);
  --shadow-pop: 0 6px 0 -2px rgba(248, 154, 31, 0.18), 0 12px 24px -8px rgba(199, 107, 15, 0.18);
  --font-display: 'Quicksand', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink-50);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--brand-orange-700); }
a:hover, a:focus-visible { color: var(--ink-900); }

.hub-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.hub-wrap--narrow { max-width: 880px; }

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-orange-700);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* =========================================================
   Top nav (used on every hub page)
   ========================================================= */
.hub-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--ink-200);
}
.hub-nav-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hub-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}
.hub-nav-brand img { width: 32px; height: 32px; }
.hub-nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}
.hub-nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-700);
  border: 1px solid transparent;
  min-height: 36px;
  line-height: 20px;
}
.hub-nav-links a:hover,
.hub-nav-links a:focus-visible {
  background: var(--brand-orange-50);
  color: var(--brand-orange-700);
  border-color: var(--ink-200);
  outline: none;
}
.hub-nav-links a.is-active {
  background: var(--brand-orange);
  color: var(--ink-900);
  border-color: var(--brand-orange-700);
}

/* =========================================================
   Page header
   ========================================================= */
.hub-head {
  background: var(--paper);
  border-bottom: 1px solid var(--ink-200);
  padding: 22px 0 24px;
}
.hub-head .hub-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hub-logo { width: 56px; height: 56px; flex: 0 0 auto; }

.hub-eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-orange-700);
}
.hub-h1 {
  margin: 2px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink-900);
}
.hub-sub { margin: 0; font-size: 14px; color: var(--ink-500); }
.hub-back { color: var(--brand-orange-700); text-decoration: none; }
.hub-back:hover, .hub-back:focus-visible { text-decoration: underline; }

.hub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-500);
}
.hub-meta li { display: inline-flex; gap: 6px; }
.hub-meta strong { color: var(--ink-700); font-weight: 700; }

/* =========================================================
   Sections + headings
   ========================================================= */
.hub-h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink-900);
  margin: 28px 0 12px;
}
.hub-h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink-900);
  margin: 18px 0 6px;
}
.hub-p {
  margin: 0 0 12px;
  max-width: 72ch;
  color: var(--ink-700);
}
.hub-p code,
.hub-li code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--ink-100);
  border-radius: 4px;
  padding: 1px 5px;
}

.hub-intro {
  margin: 24px 0 8px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 14px;
}

/* =========================================================
   SDLC journey strip
   ========================================================= */
.sdlc {
  list-style: none;
  margin: 14px 0 4px;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.sdlc-step {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink-900);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 70px;
  box-shadow: var(--shadow-sm);
}
.sdlc-step:hover,
.sdlc-step:focus-visible {
  background: var(--brand-orange-50);
  border-color: var(--brand-orange-700);
  outline: none;
}
.sdlc-step .n {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brand-orange-700);
  letter-spacing: 0.06em;
}
.sdlc-step .t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.sdlc-step .d {
  font-size: 12px;
  color: var(--ink-500);
}

/* =========================================================
   Card grid (overview cards)
   ========================================================= */
.hub-grid {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.hub-card {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hub-card-link {
  display: block;
  padding: 18px 18px 20px;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}
.hub-card-link:hover .hub-card-go,
.hub-card-link:focus-visible .hub-card-go { background: var(--brand-orange-700); color: var(--paper); }
.hub-card-link:focus-visible {
  outline: 3px solid var(--brand-orange-700);
  outline-offset: -3px;
}
.hub-card-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-orange-700);
  background: var(--brand-orange-50);
  border-radius: 999px;
  padding: 4px 10px;
}
.hub-card-h {
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink-900);
}
.hub-card-p { margin: 0 0 16px; font-size: 14px; color: var(--ink-700); }
.hub-card-go {
  display: inline-block;
  background: var(--brand-orange);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  min-height: 40px;
  line-height: 20px;
  text-decoration: none;
  border: 1px solid var(--brand-orange-700);
}

/* mark badges on the overview cards */
.hub-card .marks {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
  margin-left: 6px;
}

/* =========================================================
   Two-up panel grid
   ========================================================= */
.hub-panels {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin: 8px 0 32px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.panel h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.panel ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--ink-700);
  line-height: 1.7;
}
.panel--in { border-top: 4px solid var(--ok-green); }
.panel--out { border-top: 4px solid var(--bad-red); }

/* =========================================================
   Pills, status, callouts
   ========================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ink-200);
  background: var(--ink-100);
  color: var(--ink-700);
}
.pill--orange { background: var(--brand-orange-50); color: var(--brand-orange-700); border-color: var(--brand-orange); }
.pill--plum   { background: var(--brand-plum-50);   color: #4a3866; border-color: var(--brand-plum); }
.pill--ok     { background: var(--ok-green-50);     color: #1f6b3e; border-color: var(--ok-green); }
.pill--warn   { background: var(--warn-amber-50);   color: #6a4f00; border-color: var(--warn-amber); }
.pill--bad    { background: var(--bad-red-50);      color: #8c2a1f; border-color: var(--bad-red); }
.pill--info   { background: var(--info-blue-50);    color: #1b4f86; border-color: var(--info-blue); }
.pill--mono   { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; }

.callout {
  background: var(--brand-orange-50);
  border: 1px solid var(--brand-orange);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 14px 0;
}
.callout strong {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--brand-orange-700);
  margin-bottom: 4px;
}
.callout p { margin: 0; font-size: 14px; color: var(--ink-700); }

/* =========================================================
   Sketch paper page (diagrams page uses this)
   ========================================================= */
.paper {
  background-color: var(--paper-warm);
  background-image:
    linear-gradient(to right, rgba(31, 26, 23, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 26, 23, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.paper-card {
  background: var(--paper);
  border: 1.6px solid var(--ink-900);
  border-radius: 12px 14px 11px 13px / 13px 11px 14px 12px;
  box-shadow: 2px 2px 0 rgba(31, 26, 23, 0.08);
  padding: 16px 18px;
}
.paper-card--orange { background: var(--brand-orange-50); border-color: var(--brand-orange-700); }
.paper-card--plum   { background: var(--brand-plum-50);   border-color: var(--brand-plum); }
.paper-card--blue   { background: var(--info-blue-50);    border-color: var(--info-blue); }
.paper-card--green  { background: var(--ok-green-50);     border-color: var(--ok-green); }

.crc-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 12px 0 24px;
}
.crc {
  background: var(--paper);
  border: 1.6px solid var(--ink-900);
  border-radius: 8px 10px 7px 9px / 9px 7px 10px 8px;
  padding: 12px 14px 14px;
  box-shadow: 2px 2px 0 rgba(31, 26, 23, 0.08);
}
.crc h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1.4px dashed var(--ink-300);
  padding-bottom: 6px;
  color: var(--brand-orange-700);
}
.crc-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
}
.crc-cols h5 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.crc-cols ul { margin: 0; padding-left: 14px; }

/* DFD / context blocks */
.dfd-canvas {
  background: var(--paper);
  border: 1.6px solid var(--ink-900);
  border-radius: 14px;
  padding: 18px;
  margin: 12px 0 24px;
  box-shadow: 2px 2px 0 rgba(31, 26, 23, 0.08);
}
.dfd-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0 0 14px; }
.dfd-node {
  background: var(--paper-warm);
  border: 1.4px solid var(--ink-900);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.dfd-node strong { display: block; font-family: var(--font-display); font-size: 14px; color: var(--ink-900); margin-bottom: 2px; }
.dfd-node small { color: var(--ink-500); }
.dfd-node--ext { background: var(--info-blue-50); border-color: var(--info-blue); }
.dfd-node--proc { background: var(--brand-orange-50); border-color: var(--brand-orange-700); }
.dfd-node--store { background: var(--ok-green-50); border-color: var(--ok-green); border-radius: 999px 10px 999px 10px; }
.dfd-arrow {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--brand-orange-700);
  margin: 4px 0;
  letter-spacing: 0.05em;
}

/* Use case actor block */
.uc-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 12px 0 18px;
}
.uc-actor {
  background: var(--paper);
  border: 1.6px solid var(--ink-900);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.uc-actor h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--brand-orange-700);
  border-bottom: 1px solid var(--ink-200);
  padding-bottom: 6px;
}
.uc-actor ol {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-700);
}
.uc-actor ol li { margin: 2px 0; }

/* =========================================================
   Data tables (schema / KPI listings)
   ========================================================= */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 13px;
  margin: 8px 0 18px;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ink-200);
  vertical-align: top;
}
.tbl th {
  background: var(--ink-100);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--ink-100);
  border-radius: 4px;
  padding: 0 4px;
}
.tbl-scroll { overflow-x: auto; }

/* =========================================================
   Database "domain" group
   ========================================================= */
.db-domain {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin: 14px 0;
}
.db-domain h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--brand-orange-700);
}
.db-domain p { margin: 0 0 10px; font-size: 13px; color: var(--ink-500); }
.db-domain .tags {
  display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0;
}
.db-domain .tags li {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--ink-100);
  color: var(--ink-700);
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  padding: 3px 9px;
}

/* =========================================================
   Screenshot frame
   ========================================================= */
.ss-frame {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ss-frame .placeholder {
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(45deg, var(--ink-100) 0 10px, var(--paper-warm) 10px 18px);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-500);
  text-align: center;
  padding: 14px;
}
.ss-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-100);
}
.ss-frame figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
}
.ss-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 8px 0 18px;
}

/* =========================================================
   Manual TOC + table of contents
   ========================================================= */
.toc-card {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin: 16px 0 26px;
}
.toc-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-orange-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.toc-grid {
  display: grid;
  gap: 4px 24px;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
.toc-grid a { text-decoration: none; color: var(--ink-700); }
.toc-grid a:hover, .toc-grid a:focus-visible { color: var(--brand-orange-700); text-decoration: underline; }

.manual-section {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin: 14px 0;
}
.manual-section h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink-900);
  margin: 0 0 6px;
}
.manual-section h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--brand-orange-700);
  margin: 14px 0 4px;
}
.manual-section .crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.manual-section p { margin: 6px 0 10px; color: var(--ink-700); }
.manual-section ol, .manual-section ul { padding-left: 22px; }

/* step list */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 36px;
  margin: 6px 0 10px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 26px; height: 26px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-orange-700);
}

/* =========================================================
   Code blocks (kept dark, monospace, copy-friendly)
   ========================================================= */
.code-card {
  background: #1F1A17;
  color: #f4eee2;
  border: 1px solid var(--ink-900);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin: 6px 0 12px;
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #2a2520;
  border-bottom: 1px solid #3a342e;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #c8bfb2;
  gap: 8px;
  flex-wrap: wrap;
}
.code-head .file { color: var(--brand-orange); }
.code-card pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #f4eee2;
}
.code-card pre .k { color: #F89A1F; }
.code-card pre .s { color: #9DDD9F; }
.code-card pre .n { color: #7FBEEB; }
.code-card pre .c { color: #8a847d; font-style: italic; }
.code-card pre .v { color: #E8C76A; }
.code-card pre .t { color: #D9A0E0; }

.powers {
  background: var(--brand-orange-50);
  border: 1px solid var(--brand-orange);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--ink-700);
}
.powers strong {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--brand-orange-700);
  margin-bottom: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}

/* =========================================================
   Footer
   ========================================================= */
.hub-foot {
  border-top: 1px solid var(--ink-200);
  background: var(--paper);
  padding: 20px 0;
  margin-top: 40px;
}
.hub-foot p { margin: 0; font-size: 13px; color: var(--ink-500); }
.hub-foot a { color: var(--brand-orange-700); }

/* =========================================================
   Diagram image (when we DO use an image, e.g. the wireframes
   archive). The new diagrams page is HTML/CSS, no images.
   ========================================================= */
.diagram { margin: 0 0 28px; }
.diagram-cap { margin: 0 0 12px; max-width: 70ch; font-size: 14px; color: var(--ink-700); }
.diagram-img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (min-width: 720px) {
  .hub-h1 { font-size: 34px; }
  .hub-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
  .hub-panels { grid-template-columns: 1fr 1fr; }
  .toc-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
  .hub-grid { grid-template-columns: 1fr 1fr 1fr; }
  .toc-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Hub nav v2: dropdown submenu + utility links
   (used on every page in /hub/, including wireframes and prototype)
   ========================================================= */
.hub-nav-links li { position: relative; }
.hub-nav-links details { display: inline-block; }
.hub-nav-links details > summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-700);
  border: 1px solid transparent;
  min-height: 36px;
  line-height: 20px;
}
.hub-nav-links details > summary::-webkit-details-marker { display: none; }
.hub-nav-links details[open] > summary,
.hub-nav-links details > summary:hover,
.hub-nav-links details > summary:focus-visible {
  background: var(--brand-orange-50);
  color: var(--brand-orange-700);
  border-color: var(--ink-200);
  outline: none;
}
.hub-nav-links details > summary.is-active {
  background: var(--brand-orange);
  color: var(--ink-900);
  border-color: var(--brand-orange-700);
}
.hub-submenu {
  position: absolute;
  z-index: 60;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(31, 26, 23, 0.12);
  min-width: 200px;
}
.hub-submenu a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-700);
  text-decoration: none;
  min-height: 36px;
  line-height: 20px;
  border: 1px solid transparent;
}
.hub-submenu a:hover,
.hub-submenu a:focus-visible {
  background: var(--brand-orange-50);
  color: var(--brand-orange-700);
  outline: none;
}
.hub-submenu a.is-active {
  background: var(--brand-orange-50);
  color: var(--brand-orange-700);
  border-color: var(--brand-orange);
}
.hub-nav-util {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--ink-200);
}
.hub-nav-util a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  min-height: 36px;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
}
.hub-nav-util a.is-primary {
  background: var(--brand-orange);
  color: var(--ink-900);
  border-color: var(--brand-orange-700);
}
.hub-nav-util a:hover,
.hub-nav-util a:focus-visible {
  background: var(--brand-orange-50);
  color: var(--brand-orange-700);
  outline: none;
}

/* Continue-the-journey strip at the bottom of each page */
.journey {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  margin: 30px 0 12px;
}
.journey p { margin: 0; font-family: var(--font-display); font-weight: 600; color: var(--ink-700); }
.journey-links { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.journey-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink-100);
  border: 1px solid var(--ink-200);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-900);
  text-decoration: none;
  min-height: 40px;
  line-height: 20px;
}
.journey-links a.is-next {
  background: var(--brand-orange);
  color: var(--ink-900);
  border-color: var(--brand-orange-700);
}
.journey-links a:hover,
.journey-links a:focus-visible {
  background: var(--brand-orange-700);
  color: var(--paper);
  border-color: var(--brand-orange-700);
  outline: none;
}

/* Marks card: shaded numeric chip for D2 mark allocation */
.marks-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 12px 0 6px;
}
.marks-card {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 90px;
}
.marks-card .n {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-orange-700);
}
.marks-card .lbl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-900);
}
.marks-card .sub {
  font-size: 12px;
  color: var(--ink-500);
}

/* EERD entity card */
.eerd-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 12px 0 24px;
}
.entity {
  background: var(--paper);
  border: 1.6px solid var(--ink-900);
  border-radius: 8px 10px 7px 9px / 9px 7px 10px 8px;
  box-shadow: 2px 2px 0 rgba(31, 26, 23, 0.08);
  overflow: hidden;
}
.entity h4 {
  margin: 0;
  padding: 8px 12px;
  background: var(--brand-orange-50);
  color: var(--brand-orange-700);
  border-bottom: 1.4px dashed var(--ink-300);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.entity ul {
  margin: 0;
  padding: 6px 14px 10px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-700);
}
.entity ul li { display: flex; gap: 6px; align-items: baseline; }
.entity .pk { color: var(--brand-orange-700); font-weight: 700; }
.entity .fk { color: var(--info-blue); font-weight: 700; }
.entity .tag {
  font-size: 10px;
  font-family: var(--font-display);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.entity .rel {
  border-top: 1px dashed var(--ink-300);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-500);
  background: var(--ink-100);
}

/* DFD legend chip */
.dfd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 14px;
  font-size: 12px;
}
.dfd-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dfd-legend .swatch {
  width: 18px;
  height: 12px;
  border: 1.4px solid var(--ink-900);
  border-radius: 3px;
}
.dfd-legend .ext   { background: var(--info-blue-50); border-color: var(--info-blue); }
.dfd-legend .proc  { background: var(--brand-orange-50); border-color: var(--brand-orange-700); }
.dfd-legend .store { background: var(--ok-green-50); border-color: var(--ok-green); border-radius: 999px 3px 999px 3px; }

/* Mobile collapse: stack util after links on tight screens */
@media (max-width: 720px) {
  .hub-nav-util {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .hub-nav-links { width: 100%; }
}

/* =========================================================
   Content blocks used by the user manual and presentation
   ========================================================= */

.hub-list {
  margin: 8px 0 18px;
  padding-left: 22px;
  color: var(--ink-700);
}
.hub-list li { margin: 4px 0; }
.hub-list strong { color: var(--ink-900); }

.hub-steps {
  margin: 8px 0 18px;
  padding-left: 22px;
  color: var(--ink-700);
}
.hub-steps li { margin: 6px 0; padding-left: 4px; }

.hub-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 22px;
  font-size: 14px;
}
.hub-table th,
.hub-table td {
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--ink-200);
  vertical-align: top;
}
.hub-table th {
  background: var(--ink-100);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 600;
}
.hub-table tbody tr:nth-child(even) td,
.hub-table tbody tr:nth-child(even) td { background: var(--paper-warm); }

.hub-code {
  display: block;
  margin: 10px 0 18px;
  padding: 14px 16px;
  background: var(--ink-900);
  color: #F4EEE2;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

.hub-cta {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  line-height: 22px;
}
.hub-cta.is-primary {
  background: var(--brand-orange-700);
  color: var(--paper);
}
.hub-cta.is-primary:hover,
.hub-cta.is-primary:focus-visible {
  background: var(--ink-900);
  color: var(--paper);
}

.ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 12px 0 22px;
}
.ship-card {
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.ship-card h3 { margin-top: 0; }
.ship-card p { color: var(--ink-700); margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .hub-cta { transition: none; }
}

/* Live-link grid (code-samples "See it live"): each chip opens the real
   page on the running site. Replaces the self-referential screenshots. */
.hub-live-links {
  list-style: none;
  margin: 12px 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.hub-live-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--ink-700);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.hub-live-links a::after {
  content: '\2192';
  color: var(--brand-orange-700);
  font-weight: 700;
}
.hub-live-links a:hover {
  border-color: var(--brand-orange);
  box-shadow: 0 4px 14px rgba(248, 154, 31, 0.18);
  transform: translateY(-1px);
}

/* Hub landing entrance: the journey steps and deliverable cards rise in
   sequence on load, mirroring the marketplace hero. CSS-only (the hub pages
   ship no JS), opt-in via no-preference so reduced-motion users and the
   documentation screenshots get the settled final state with no animation. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes hubRise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .sdlc-step,
  .hub-grid > li > .hub-card {
    animation: hubRise 0.45s ease-out both;
  }
  .sdlc li:nth-child(1) .sdlc-step { animation-delay: 0.04s; }
  .sdlc li:nth-child(2) .sdlc-step { animation-delay: 0.08s; }
  .sdlc li:nth-child(3) .sdlc-step { animation-delay: 0.12s; }
  .sdlc li:nth-child(4) .sdlc-step { animation-delay: 0.16s; }
  .sdlc li:nth-child(5) .sdlc-step { animation-delay: 0.20s; }
  .sdlc li:nth-child(6) .sdlc-step { animation-delay: 0.24s; }
  .sdlc li:nth-child(7) .sdlc-step { animation-delay: 0.28s; }
  .hub-grid > li:nth-child(1) > .hub-card { animation-delay: 0.10s; }
  .hub-grid > li:nth-child(2) > .hub-card { animation-delay: 0.18s; }
  .hub-grid > li:nth-child(3) > .hub-card { animation-delay: 0.26s; }
  .hub-grid > li:nth-child(4) > .hub-card { animation-delay: 0.34s; }
  .hub-grid > li:nth-child(5) > .hub-card { animation-delay: 0.42s; }
  .hub-grid > li:nth-child(6) > .hub-card { animation-delay: 0.50s; }
}
