/* Shared across every page: reset, body defaults, links, page shell, fixed header/nav. */

:root { --header-height: 75px; }
* { box-sizing: border-box; }
/* warm light-grey paper with a fine, slightly coarser grain (average #FBF9F5).
   --accent-text is the brand blue deepened ~5% so small blue text stays at 4.5:1 or better
   even on the darker specks of the grain; the pure brand blue is still used for fills and borders. */
:root {
  --accent-text: #4563D1;
  --paper: #FAF8F4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='.15 0 0 0 .915  .15 0 0 0 .907  .15 0 0 0 .8908  0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 300px 300px repeat;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--paper);
  padding-top: var(--header-height);
}
body, body * { font-weight: 400; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }
a { color: var(--accent-text); }
a:hover { color: var(--accent-hover); }

.wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--side-margin-desktop);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard);
}
.site-header.is-scrolled {
  background: var(--paper);
  border-bottom-color: var(--border-subtle);
}
.header-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.brand {
  justify-self: start;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 300;
  text-decoration: none;
  color: var(--text-heading);
}
.primary-nav { display: flex; gap: var(--space-5); grid-column: 2; }
.primary-nav a {
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  color: var(--text-body);
  transition: color var(--duration-fast) var(--ease-standard);
}
.primary-nav a:hover { color: var(--accent-text); }
.primary-nav a.current { color: var(--accent-text); }

@media (max-width: 900px) {
  .wrap { padding-left: var(--side-margin-tablet); padding-right: var(--side-margin-tablet); }
}
@media (max-width: 560px) {
  .primary-nav { gap: var(--space-3); }
  .wrap { padding-left: var(--side-margin-mobile); padding-right: var(--side-margin-mobile); }
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  display: grid;
  grid-template-columns: 6px 6px;
  grid-template-rows: 6px 6px;
  gap: 2px;
  background: transparent;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: transform;
  align-items: center;
  justify-items: center;
  color: var(--white);
}
/* the pointer is a tight group of four small pixels: three in the brand blue and one in the brand orange */
.cursor-dot .cursor-px { width: 6px; height: 6px; background: var(--accent); transition: opacity 160ms var(--ease-standard); }
.cursor-dot .cursor-px:nth-child(4) { background: #D7642F; }
.cursor-dot.is-view .cursor-px { display: none; }
/* over a case study card the dot becomes a slightly larger "view" (eye) icon in the brand orange */
.cursor-dot .cursor-eye {
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 180ms var(--ease-standard), transform 260ms var(--ease-standard);
}
.cursor-dot {
  transition: opacity var(--duration-fast) var(--ease-standard),
              background-color 220ms var(--ease-standard), color 220ms var(--ease-standard),
              width 220ms var(--ease-standard), height 220ms var(--ease-standard), margin 220ms var(--ease-standard);
}
.cursor-dot.is-view {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;  /* square, to match the pixel pointer */
  background: rgba(215, 100, 47, 0.12);  /* same tint as the headline highlight */
  color: #D7642F;
}
.cursor-dot.is-view .cursor-eye { opacity: 1; transform: none; }
@media (pointer: coarse) {
  .cursor-dot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-dot .cursor-eye { transition: opacity var(--duration-fast) var(--ease-standard); }
}

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s var(--ease-standard), transform 0.7s var(--ease-standard);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}
