/* ============================================================
   Content HQ — Base / reset / app shell layout
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
/* Fraunces for h1/h2 (site headings); Hanken Grotesk 600 for the smaller UI headings */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; line-height: 1.1; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(var(--accent-rgb),.28); }
:focus-visible { outline: none; box-shadow: var(--ring); }
[hidden] { display: none !important; }
/* Inline icons default to text size unless a component rule sizes them */
svg[data-icon] { width: 1em; height: 1em; flex: none; vertical-align: -0.15em; }
h1 svg[data-icon], h2 svg[data-icon], h3 svg[data-icon], h4 svg[data-icon] { width: 1.05em; height: 1.05em; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Ambient gradient blobs behind the glass */
.bg-blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: var(--blob-opacity); }
.bg-blobs i {
  position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform;
  animation: blob-drift 26s ease-in-out infinite alternate;
}
.bg-blobs i:nth-child(1) { width: 60vw; height: 60vw; left: -20vw; top: -25vw; background: radial-gradient(circle at 30% 30%, var(--blob-1), transparent 60%); }
.bg-blobs i:nth-child(2) { width: 50vw; height: 50vw; right: -15vw; top: 10vh; background: radial-gradient(circle at 60% 40%, var(--blob-2), transparent 60%); animation-delay: -8s; }
.bg-blobs i:nth-child(3) { width: 45vw; height: 45vw; left: 25vw; bottom: -30vw; background: radial-gradient(circle at 50% 50%, var(--blob-3), transparent 60%); animation-delay: -16s; }
@keyframes blob-drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(4vw, 3vh, 0) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .bg-blobs i { animation: none; } }

/* ---------- App shell ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
/* mobile-only backdrop: fixed so it never takes a grid cell */
.sidebar-backdrop { position: fixed; inset: 0; z-index: 39; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity var(--t-med); }

.sidebar {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px; border-right: 1px solid var(--border);
  background: var(--glass); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  overflow-y: auto; overflow-x: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad-accent); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 18px -6px rgba(var(--accent-rgb),.8); flex: none; }
.brand .name { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; font-size: 15px; line-height: 1.1; }
.brand .sub { font-size: 11px; color: var(--text-3); font-weight: 500; }

/* Eyebrow section label (site's .eyebrow: uppercase, letter-spaced) */
.nav-section { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); padding: 12px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px; text-align: left; position: relative;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
/* Active = rose-soft pill with rose text + rose bar */
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad-accent); }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item.active svg { opacity: 1; }
.nav-item .kbd { margin-left: auto; }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav-item.active .count { color: var(--accent-ink); }
.sidebar-footer { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 22px;
  border-bottom: 1px solid var(--border); background: var(--glass); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  position: sticky; top: 0; z-index: 5;
}
.topbar .title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.topbar .title h1 { font-size: 18px; font-family: var(--font-display); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .sub { font-size: 12px; color: var(--text-3); }
.topbar .spacer { flex: 1; }
.topbar .search { width: min(360px, 34vw); }
.topbar .menu-btn { display: none; }

.view { flex: 1; min-height: 0; overflow: auto; padding: 22px; scroll-behavior: smooth; position: relative; }
.view > .view-inner { max-width: var(--content-max); margin: 0 auto; animation: view-in var(--t-slow) var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.view-header .desc { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.view-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 40; transform: translateX(-105%); transition: transform var(--t-med) var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .search { width: 100%; }
  .view { padding: 14px; }
  :root { --drawer-w: 100vw; }
}
