/* Reset, layout primitives, typography. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: var(--lh-tight); }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- App scaffold --- */
#ribbon {
  height: var(--ribbon-h);
  background: var(--synth-bg);
  color: var(--synth);
  border-bottom: 1px solid var(--synth-ring);
  display: flex; align-items: center; justify-content: center;
  gap: var(--s2);
  font-size: var(--fs-12); font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase;
  position: sticky; top: 0; z-index: 50;
}
#ribbon .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--synth); }

#header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center;
  gap: var(--s4);
  padding: 0 var(--s6);
  position: sticky; top: var(--ribbon-h); z-index: 40;
}
#header .brandmark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  flex: none;
}
#header .product { font-weight: 600; font-size: var(--fs-14); min-width: 0; }
#header .product .sub { color: var(--muted); font-weight: 400; }
#header .spacer { flex: 1; }
.nav-toggle {
  display: none; flex: none; border: 1px solid var(--hairline); background: var(--surface);
  border-radius: var(--r-sm); padding: 4px 10px; font-size: 18px; line-height: 1; color: var(--ink);
}

.layout { display: flex; max-width: 100%; }
#nav {
  width: var(--nav-w); flex: none;
  border-right: 1px solid var(--hairline);
  background: var(--surface);
  padding: var(--s5) var(--s3);
  height: calc(100vh - var(--header-h) - var(--ribbon-h));
  position: sticky; top: calc(var(--header-h) + var(--ribbon-h));
  overflow-y: auto;
}
#nav .nav-group-label {
  font-size: var(--fs-12); color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.04em; padding: var(--s3) var(--s3) var(--s2);
}
#nav a.nav-item {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; margin-bottom: 2px;
}
#nav a.nav-item:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
#nav a.nav-item.active { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
#nav a.nav-item .ni-ico { width: 16px; text-align: center; opacity: 0.85; flex: none; }
#nav .nav-note {
  margin-top: var(--s5); padding: var(--s3);
  font-size: var(--fs-12); color: var(--muted); line-height: 1.4;
  border-top: 1px solid var(--hairline);
}

#main { flex: 1; min-width: 0; padding: var(--s7) var(--s8) var(--s10); }
.page { width: 100%; min-width: 0; max-width: var(--maxw); margin: 0 auto; }

/* --- Page header block --- */
.page-head { margin-bottom: var(--s6); }
.page-head .title-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-28); letter-spacing: -0.01em; min-width: 0; overflow-wrap: anywhere; }
.page-head .desc { color: var(--ink-2); margin-top: var(--s2); max-width: 70ch; }
.page-head .meta { color: var(--muted); font-size: var(--fs-12); margin-top: var(--s3); }

/* --- Section --- */
.section { margin-top: var(--s7); }
.section > .section-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; min-width: 0; }
.section > .section-head h2 { font-size: var(--fs-16); min-width: 0; }
.section > .section-head .section-sub { color: var(--muted); font-size: var(--fs-13); min-width: 0; }

/* --- Generic grids --- */
.grid { display: grid; gap: var(--s4); }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1180px) {
  .grid-5, .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: 1 / -1; }
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-full { grid-column: 1 / -1; }

/* --- Enhanced-service tiers (P3): priority → catalogue emphasis --- */
.service-grid { align-items: start; }
.service-panel { align-self: start; }
.service-grid.tier-B .service-panel, .service-grid.tier-C .service-panel { padding: var(--s5); }
.service-grid.tier-B .service-panel .tile, .service-grid.tier-C .service-panel .tile {
  box-shadow: none; border-color: transparent; background: var(--surface-2);
}

.row { display: flex; gap: var(--s4); }
.row > * { min-width: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: var(--s2); } .gap-3 { gap: var(--s3); }

/* --- Responsive: mobile scaffold --- */
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }
  #nav {
    position: fixed; left: 0; top: 0; z-index: 80;
    height: calc(100dvh - var(--header-h) - var(--ribbon-h));
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow-pop);
  }
  #nav.open { transform: translateX(0); }
}
@media (max-width: 900px) {
  #header { padding: 0 var(--s4); gap: var(--s3); }
  #header .product .sub { display: none; }
  .synth-pill .pill-text { display: none; }
  #main { padding: var(--s5) var(--s4) var(--s8); }
}
@media (max-width: 640px) {
  #header .product { display: none; }
  .persona .persona-btn .p-kind { display: none; }
  #ribbon .ribbon-extra { display: none; }
  .row { flex-wrap: wrap; }
  .row.nowrap { flex-wrap: nowrap; }
  .section > .section-head .section-sub { flex-basis: 100%; }
  .page-head h1 { font-size: 22px; }
  .page-head .desc { font-size: var(--fs-13); }
}
@media (max-width: 480px) {
  #main { padding: var(--s4) var(--s3) var(--s7); }
  .card { padding: var(--s4); }
}
