/* ============================================================
   Huchu DS — Shared chrome for hub & detail pages
   Used by /verticals/, /portals/, /kits/, /shared/ pages.
   Differs from system.css (docs chrome): this is the marketing-
   style chrome around product mockups.
   ============================================================ */

/* ── Top nav ───────────────────────────────────────────── */
.hx-topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.hx-topbar .brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--font-sans);
  letter-spacing: -0.015em;
  color: var(--text-strong);
  text-decoration: none;
}
.hx-topbar .brand .mark { width: 22px; height: 22px; color: var(--brand); flex: none; }
.hx-topbar .brand .badge {
  margin-left: 4px;
  padding: 3px 7px;
  background: var(--surface-muted);
  border-radius: 9999px;
  font: 500 10px/1 var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hx-topbar nav { display: flex; gap: 2px; }
.hx-topbar nav a {
  padding: 6px 10px;
  border-radius: 6px;
  font: 500 13.5px/1 var(--font-sans);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.hx-topbar nav a:hover { color: var(--text-strong); background: var(--surface-muted); }
.hx-topbar nav a.current { color: var(--brand-strong); background: var(--brand-soft); }
.hx-topbar .spacer { flex: 1; }
.hx-topbar .cta {
  font: 500 13.5px/1 var(--font-sans);
  color: var(--text-strong);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
}
.hx-topbar .cta:hover { background: var(--surface-muted); }
.hx-topbar .cta.primary {
  background: var(--brand);
  color: #fff;
}
.hx-topbar .cta.primary:hover { background: var(--brand-strong); }

/* Mobile hamburger button — hidden on desktop, shown via media query below */
.hx-topbar .hx-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  align-items: center; justify-content: center;
  cursor: pointer; flex: none;
}
.hx-topbar .hx-menu-btn:hover { background: var(--surface-muted); }

/* === Floating "Huchu" pill (injected by hx-nav.js on demo/kit pages
       that have no recognized topbar so users still have a way back to
       the global site navigation drawer). === */
.hx-float-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 10px;
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 9999px;
  font: 600 12px/1 var(--font-sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 18px -4px rgba(22,24,29,0.22);
  transition: transform 120ms, background 120ms;
}
.hx-float-btn:hover { background: var(--ink-2, #232730); transform: translateY(-1px); }
.hx-float-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hx-float-btn .lbl { font: 600 12px/1 var(--font-sans); }
body.is-fullscreen .hx-float-btn { display: none; }
body.no-hx-float-btn .hx-float-btn { display: none; }
@media (max-width: 500px) {
  .hx-float-btn { padding: 7px 9px; }
  .hx-float-btn .lbl { display: none; }
}

/* === Mobile nav drawer (injected by hx-nav.js) === */
.hx-drawer-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(22,24,29,0.55);
  z-index: 80;
  animation: hxScrimIn 160ms ease;
}
.hx-drawer-scrim.open { display: block; }
@keyframes hxScrimIn { from { opacity: 0; } to { opacity: 1; } }
.hx-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(86vw, 320px);
  z-index: 81;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 260ms cubic-bezier(0.2, 0, 0.1, 1);
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}
.hx-drawer.open { transform: translateX(0); }
.hx-drawer .hx-d-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.hx-drawer .hx-d-head .brand {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px/1 var(--font-sans); color: var(--text-strong); text-decoration: none;
}
.hx-drawer .hx-d-head .brand .mark { width: 20px; height: 20px; color: var(--brand); }
.hx-drawer .hx-d-head .close {
  margin-left: auto; width: 30px; height: 30px;
  border-radius: 7px; background: var(--surface-muted);
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-strong);
}
.hx-drawer h4 {
  font: 500 10.5px/1 var(--font-sans);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-subtle);
  margin: 16px 16px 6px;
}
.hx-drawer h4:first-of-type { margin-top: 14px; }
.hx-drawer a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  font: 500 14px/1.3 var(--font-sans);
  color: var(--text-body);
  text-decoration: none;
}
.hx-drawer a:hover { background: var(--surface-muted); color: var(--text-strong); }
.hx-drawer a.current { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
.hx-drawer a .ic {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--surface-muted);
  display: grid; place-items: center;
  color: var(--text-strong);
  flex: none;
}
.hx-drawer a.current .ic { background: var(--brand); color: #fff; }
.hx-drawer .hx-d-foot {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font: 12px/1.4 var(--font-sans); color: var(--text-muted);
}

@media (max-width: 900px) {
  .hx-topbar, .ds-slim-nav { padding: 10px 14px !important; gap: 12px !important; }
  .hx-topbar .brand .badge, .ds-slim-nav .brand .badge { display: none !important; }
  .hx-topbar nav, .ds-slim-nav nav { display: none !important; }
  .hx-topbar .cta:not(.primary), .ds-slim-nav .cta:not(.primary) { display: none !important; }
  .hx-topbar .search, .ds-slim-nav .search { display: none !important; }
  .hx-topbar .actions, .ds-slim-nav .actions { display: none !important; }
  .hx-topbar .hx-menu-btn, .ds-slim-nav .hx-menu-btn { display: inline-flex !important; }
  .hx-topbar .cta.primary, .ds-slim-nav .cta.primary { padding: 6px 10px; font-size: 12.5px; }

  .hub-wrap { padding: 0 16px; }
  .hub-hero { padding: 28px 16px 18px !important; max-width: 100% !important; }
  .hub-hero h1 { font-size: 28px !important; }
  .hub-hero .lede { font-size: 14.5px !important; }
  .hub-section { padding: 24px 16px 32px !important; max-width: 100% !important; }
  .surface-grid { grid-template-columns: 1fr !important; }
  .modules-grid { grid-template-columns: 1fr !important; }
  /* CTA banner stacks vertically on mobile so the button doesn't overflow */
  .hub-cta { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
  .hub-cta .btn-link-light { width: 100%; justify-content: center; }
  .meta-pills { gap: 6px; }
}

/* Prevent any hub page from overflowing horizontally on small screens */
@media (max-width: 600px) {
  .hub-wrap, .hub-hero, .hub-section { max-width: 100%; overflow-x: clip; }
  .hub-hero h1 { word-break: break-word; }
}

/* ── Hub hero (used by /verticals/<x>/index.html etc.) ─── */
.hub-wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

.hub-hero { padding: 64px 0 32px; }
.hub-hero .breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font: var(--type-body-sm); color: var(--text-muted);
  margin-bottom: 18px;
}
.hub-hero .breadcrumb a { color: inherit; text-decoration: none; }
.hub-hero .breadcrumb a:hover { color: var(--text-strong); }
.hub-hero .breadcrumb .sep { color: var(--text-subtle); }
.hub-hero h1 {
  font: 700 clamp(40px, 4.5vw, 56px)/1.05 var(--font-sans);
  letter-spacing: -0.025em; margin: 0 0 12px; color: var(--text-strong);
  max-width: 22ch; text-wrap: balance;
}
.hub-hero h1 em { font-style: normal; color: var(--text-muted); }
.hub-hero .lede {
  font: 400 18px/1.55 var(--font-sans);
  color: var(--text-muted); max-width: 60ch; margin: 0;
}
.hub-hero .meta-pills { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.hub-hero .meta-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 9999px;
  background: var(--surface); border: 1px solid var(--border);
  font: var(--type-caption); color: var(--text-muted);
}
.hub-hero .meta-pill.brand { background: var(--brand-soft); color: var(--brand-strong); border-color: var(--brand-100); }
.hub-hero .meta-pill.tone-success { background: var(--tone-success-bg); color: var(--tone-success); border-color: var(--tone-success-bd); }

/* Area icon (the big circular emblem at top of a hub page) */
.area-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 24px;
  background: var(--brand-soft); color: var(--brand-strong);
}
.area-icon.gold      { background: linear-gradient(135deg, #FEF4DA, #F4C15B); color: #6B5119; }
.area-icon.scrap     { background: linear-gradient(135deg, #FFE5C8, #E2A458); color: #6B3F19; }
.area-icon.retail    { background: linear-gradient(135deg, #D9F1E0, #4ADE80); color: #166534; }
.area-icon.schools   { background: linear-gradient(135deg, #F0E4FF, #A78BFA); color: #4C1D95; }
.area-icon.auto      { background: linear-gradient(135deg, #DEEAFE, #6FA0FF); color: #1E40AF; }
.area-icon.ms        { background: linear-gradient(135deg, #E5F0FF, #80B0FF); color: #1E3A8A; }
.area-icon.hr        { background: linear-gradient(135deg, #FEE2E5, #F87171); color: #7F1D1D; }
.area-icon.cctv      { background: linear-gradient(135deg, #E0E5EA, #6B7280); color: #1F2937; }
.area-icon.warehouse { background: linear-gradient(135deg, #FFE5C8, #C97817); color: #6B3F19; }
.area-icon.thrift    { background: linear-gradient(135deg, #FEDCEA, #EC4899); color: #831843; }
.area-icon.compliance{ background: linear-gradient(135deg, #FFF1B3, #EAB308); color: #713F12; }
.area-icon.maint     { background: linear-gradient(135deg, #DCEEFF, #38BDF8); color: #075985; }
.area-icon.accounting{ background: linear-gradient(135deg, var(--brand-50), var(--brand-200)); color: var(--brand-strong); }
.area-icon.shared    { background: var(--gray-100); color: var(--gray-700); }
.area-icon.portal-pos     { background: linear-gradient(135deg, #DDEAFE, #6FA0FF); color: #1E40AF; }
.area-icon.portal-parent  { background: linear-gradient(135deg, #DDF6E5, #4ADE80); color: #166534; }
.area-icon.portal-student { background: linear-gradient(135deg, #FFE4D3, #FB923C); color: #7C2D12; }
.area-icon.portal-teacher { background: linear-gradient(135deg, #EDE0FF, #A78BFA); color: #4C1D95; }
.area-icon.portal-staff   { background: linear-gradient(135deg, #FEE2E5, #F87171); color: #7F1D1D; }
.area-icon.portal-admin   { background: var(--ink); color: #fff; }

/* ── Section blocks ────────────────────────────────────── */
.hub-section { padding: 32px 0 48px; }
.hub-section .label {
  display: inline-block;
  font: 500 12px/1 var(--font-sans);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-strong); margin-bottom: 10px;
}
.hub-section h2 {
  font: 600 28px/1.18 var(--font-sans);
  letter-spacing: -0.02em; color: var(--text-strong);
  margin: 0 0 8px;
}
.hub-section .sub { font: 400 16px/1.55 var(--font-sans); color: var(--text-muted); margin: 0 0 24px; max-width: 60ch; }

/* Surface grid (pages inside a kit) */
.surface-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .surface-grid { grid-template-columns: 1fr; } }

.surface-card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none; color: inherit;
  display: grid; gap: 8px;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.surface-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.surface-card .num { font: 500 11px/1 var(--font-mono); color: var(--text-subtle); letter-spacing: 0.08em; }
.surface-card .nm { font: 600 16px/1.3 var(--font-sans); color: var(--text-strong); }
.surface-card .ds { font: var(--type-body-sm); color: var(--text-muted); margin-top: 2px; }
.surface-card .arrow { color: var(--brand-strong); font: 500 13px/1 var(--font-sans); margin-top: 4px; }
.surface-card.coming { opacity: 0.55; }
.surface-card.coming .arrow { color: var(--text-subtle); }

/* ── Device size tabs (responsive previews) ────────────── */
.device-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-muted); border-radius: 8px;
}
.device-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px;
  font: 500 13px/1 var(--font-sans); color: var(--text-muted);
  cursor: pointer; background: transparent; border: none;
}
.device-tabs button:hover { color: var(--text-strong); }
.device-tabs button.active {
  background: var(--surface); color: var(--text-strong);
  box-shadow: 0 1px 2px rgba(22,24,29,.06), 0 0 0 1px var(--border);
}

/* Device frames — used to host responsive previews */
.device-stage { display: grid; place-items: center; padding: 40px 24px; background: var(--canvas); border: 1px solid var(--border); border-radius: 14px; overflow: clip; min-height: 600px; }
.device-stage.dark { background: var(--gray-900); }

.frame-phone {
  width: 360px; height: 740px;
  border-radius: 44px;
  background: #0F1115;
  padding: 10px;
  box-shadow: 0 30px 60px -20px rgba(22,24,29,0.25), 0 0 0 1px rgba(22,24,29,0.08);
  position: relative;
  flex: none;
}
.frame-phone::before {
  content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 28px; background: #0F1115; border-radius: 0 0 18px 18px; z-index: 2;
}
.frame-phone .screen { width: 100%; height: 100%; background: var(--canvas); border-radius: 34px; overflow: hidden; position: relative; }

.frame-tablet {
  width: 820px; height: 600px;
  border-radius: 24px;
  background: #0F1115;
  padding: 10px;
  box-shadow: 0 30px 60px -20px rgba(22,24,29,0.25), 0 0 0 1px rgba(22,24,29,0.08);
  flex: none;
}
.frame-tablet .screen { width: 100%; height: 100%; background: var(--canvas); border-radius: 16px; overflow: hidden; position: relative; }

.frame-desktop {
  width: 1100px; max-width: 100%;
  border-radius: 12px;
  background: #1A1D24;
  padding: 0;
  box-shadow: 0 30px 60px -20px rgba(22,24,29,0.25), 0 0 0 1px rgba(22,24,29,0.1);
  overflow: hidden;
  flex: none;
}
.frame-desktop .chrome {
  height: 32px;
  background: #1A1D24;
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px;
}
.frame-desktop .chrome .dot { width: 10px; height: 10px; border-radius: 50%; background: #444; }
.frame-desktop .chrome .dot.r { background: #FF5F57; }
.frame-desktop .chrome .dot.y { background: #FEBC2E; }
.frame-desktop .chrome .dot.g { background: #28C840; }
.frame-desktop .chrome .url { margin-left: 14px; padding: 3px 10px; background: rgba(255,255,255,0.06); border-radius: 4px; color: #999; font: 11px/1 var(--font-mono); }
.frame-desktop .screen { background: var(--canvas); height: 660px; overflow: hidden; }

/* Status bar atop a phone screen */
.status-bar {
  height: 32px; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
  font: 600 13px/1 var(--font-sans);
  color: var(--text-strong);
}
.status-bar .right { display: inline-flex; align-items: center; gap: 6px; color: var(--text-strong); }
.status-bar .right svg { width: 14px; height: 14px; }

/* ── Hub CTA at bottom of hub pages ─────────────────────── */
.hub-cta {
  padding: 24px 28px;
  background: var(--ink); color: rgba(255,255,255,0.85);
  border-radius: 14px; margin-top: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.hub-cta h3 { color: #fff; font: 600 18px/1.3 var(--font-sans); margin: 0 0 4px; }
.hub-cta p  { margin: 0; font: var(--type-body-sm); color: rgba(255,255,255,0.7); max-width: 60ch; }
.hub-cta .btn-link-light {
  color: #fff; padding: 10px 18px;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 8px;
  text-decoration: none; font: 500 14px/1 var(--font-sans); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background var(--dur-fast) var(--ease-out);
}
.hub-cta .btn-link-light:hover { background: rgba(255,255,255,0.1); }

/* ── Footer (slim, used across hub pages) ───────────────── */
.hx-footer {
  margin-top: 48px;
  padding: 32px;
  border-top: 1px solid var(--border);
  background: var(--canvas);
}
.hx-footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font: var(--type-caption); color: var(--text-muted);
}
.hx-footer a { color: var(--text-muted); text-decoration: none; }
.hx-footer a:hover { color: var(--text-strong); }
.hx-footer .links { display: flex; gap: 18px; }

/* ── Page strip (small preview card with frame + label) ─── */
.shell-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.shell-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: clip;
  display: flex; flex-direction: column;
}
.shell-preview .stage { padding: 20px; background: var(--canvas); display: grid; place-items: center; min-height: 240px; }
.shell-preview .label { padding: 14px 18px; border-top: 1px solid var(--border-subtle); }
.shell-preview .label .nm { font: var(--type-label); color: var(--text-strong); }
.shell-preview .label .ds { font: var(--type-caption); color: var(--text-muted); margin-top: 2px; }

/* Mini phone (240x500) for preview thumbnails */
.mini-phone { width: 220px; height: 460px; border-radius: 28px; background: #0F1115; padding: 6px; box-shadow: 0 12px 28px -10px rgba(22,24,29,0.3); position: relative; }
.mini-phone::before { content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 70px; height: 18px; background: #0F1115; border-radius: 0 0 12px 12px; z-index: 2; }
.mini-phone .screen { width: 100%; height: 100%; background: var(--canvas); border-radius: 22px; overflow: hidden; }

/* ============================================================
   Mobile responsiveness — collapse inline multi-column grids and
   force 2-col CTA panels to stack. Several portal hub pages set
   grid-template-columns via inline style (e.g. "1.4fr 1fr" for the
   live-demo CTA + What's-inside panel) which would never collapse
   without per-page media queries. One global rule fixes all of them.
   ============================================================ */
@media (max-width: 720px) {
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: repeat(2,"],
  [style*="grid-template-columns: repeat(3,"] {
    grid-template-columns: 1fr !important;
  }
}
