/* ============================================================
   sidebar.css — persistent spine for case study pages
   Mirrors the sidebar in styles.css (index). If you change one,
   change the other. Adds: body offset, mobile topbar + drawer.
   ============================================================ */
:root {
  --spine-w: 248px;
  --pad: clamp(24px, 3.6vw, 64px);
  --font-mono: "Schibsted Grotesk", system-ui, sans-serif;
}

/* content sits to the right of the fixed spine */
body { margin-left: var(--spine-w); }

/* ---- spine ---- */
.spine {
  position: fixed;
  top: 0; left: 0;
  width: var(--spine-w);
  height: 100vh;
  padding: clamp(30px, 3.2vw, 44px) 32px 28px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg);
  z-index: 40;
  overflow-y: auto;
}
.spine::-webkit-scrollbar { width: 0; }

.spine-id { margin-bottom: 28px; }
.spine-id .brand {
  font-family: var(--font-display);
  font-weight: 600; font-size: 21px;
  letter-spacing: -0.03em; line-height: 1; display: block;
}
.spine-id .descriptor { font-size: 13.5px; color: var(--steel); margin-top: 8px; display: block; }

.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a.toc-item {
  display: flex; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--steel);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.toc a.toc-item:hover { background: var(--surface); color: var(--ink); }
.toc a.toc-item.active { background: var(--surface); color: var(--ink); }
.toc a.toc-proj {
  font-size: 13px; color: var(--silver);
  padding: 6px 10px 6px 22px;
}
.toc a.toc-proj:hover { color: var(--ink); }
.toc a.toc-proj.active { color: var(--ink); }

.spine-foot { margin-top: auto; padding-top: 28px; }
.spine-links { display: flex; flex-direction: column; gap: 2px; }
.spine-links a {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px; font-weight: 500; color: var(--graphite);
  padding: 7px 10px; border-radius: 8px;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.spine-links a .ar { color: var(--faint); transition: transform 0.3s var(--ease), color 0.3s var(--ease); }
.spine-links a:hover { background: var(--surface); color: var(--ink); }
.spine-links a:hover .ar { transform: translate(2px,-2px); color: var(--ink); }
.spine-copy { margin-top: 18px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--faint); display: flex; justify-content: space-between; }

/* ---- mobile topbar + drawer ---- */
.topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 45;
  padding: 14px var(--pad);
  align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.03em; }
.menu-btn {
  appearance: none; border: 1px solid var(--line-2); background: var(--bg);
  border-radius: 100px; padding: 8px 14px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.menu-btn .bars { display: inline-flex; flex-direction: column; gap: 3px; }
.menu-btn .bars span { width: 14px; height: 1.5px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.3s; }
.backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--ink) 22%, transparent); opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease); z-index: 39; }

@media (max-width: 1040px) {
  :root { --spine-w: 0px; }
  body { margin-left: 0; padding-top: 64px; }
  .topbar { display: flex; }
  .spine {
    width: min(86vw, 340px); transform: translateX(-102%);
    transition: transform 0.5s var(--ease);
    box-shadow: 0 0 60px -10px color-mix(in srgb, var(--ink) 30%, transparent);
  }
  body.nav-open .spine { transform: translateX(0); }
  body.nav-open .backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open .menu-btn .bars span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
  body.nav-open .menu-btn .bars span:nth-child(2) { opacity: 0; }
  body.nav-open .menu-btn .bars span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }
}
@media print {
  .spine, .topbar, .backdrop { display: none !important; }
  body { margin-left: 0 !important; }
}
