/* SYSTEM — shared reset + header/nav/hamburger + container used by every
   sub-page (case studies, design systems, craft, methodology). Pulled out of
   per-page inline <style> blocks to stop re-declaring the same rules on every
   page. Page-specific tokens (:root) and page-specific styling still live in
   each page's own <style> block — this file only owns structure that is
   identical everywhere. */

/* `clip`, not `hidden`: hidden turns html into a scroll container, which
   stops <body>'s overflow propagating to the viewport and leaves every
   sticky header anchored to a box that never scrolls. */
html { overflow-x: clip; }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Subtle film-grain texture, matches styles.css so the whole site feels
   consistent instead of the flat dark bg reading as a template default. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

/* HEADER / NAV */
/* The header is owned by paper.css now — sticky, frosted, masked at the
   bottom edge. Pages that have not adopted paper.css yet still need these,
   so they stay until the last one migrates. */
.site-header:not(.is-shared) {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 20px 24px;
  background: rgba(30, 26, 46, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke);
}

.nav {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-text {
  line-height: 1.05;
}

.brand-name {
  display: block;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.brand-sub {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 38px;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.9;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
}

.nav-links a.active::after {
  transform: scaleX(1);
}

/* HAMBURGER MENU */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  z-index: 1001;
}
.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 640px) {
  .hamburger {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    font-size: 18px;
    transform: translateX(100%);
    transition: transform 300ms ease;
    z-index: 1000;
  }
  .nav-links.active {
    transform: translateX(0);
  }
}

/* LAYOUT */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Minimal sub-page header (design system pages): brand + a single
   "back to case study" link instead of the full nav-links/hamburger. */
