:root {
  --stage: #17181b;
  --liner: #e8e4dc;
  --concrete: #3a3d42;
  --highlighter: #d9f266;
  --cobalt: #1e3a8a;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--stage);
  background: var(--liner);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.display { font-family: 'Archivo Black', Impact, sans-serif; letter-spacing: -0.03em; line-height: 0.96; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.mono-label { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }

/* Grain noise overlay */
.grain::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%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");
  mix-blend-mode: multiply;
}

/* Hero: layered radial gradients */
.hero-bg {
  background:
    radial-gradient(ellipse 65% 55% at 88% 18%, rgba(217,242,102,0.28), transparent 62%),
    radial-gradient(ellipse 55% 45% at 8% 92%, rgba(30,58,138,0.10), transparent 60%),
    radial-gradient(ellipse 40% 35% at 45% 55%, rgba(23,24,27,0.04), transparent 72%),
    var(--liner);
}

/* Dark section gradients */
.dark-bg {
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(217,242,102,0.10), transparent 60%),
    radial-gradient(ellipse 50% 45% at 90% 90%, rgba(30,58,138,0.22), transparent 60%),
    var(--stage);
}

/* Signature letter — sits inline at rest, jumps on hover */
.jump-j {
  display: inline-block;
  color: var(--highlighter);
  -webkit-text-stroke: 2px var(--stage);
  paint-order: stroke fill;
  transform: translateY(0) rotate(0);
  filter: drop-shadow(0 0 0 rgba(23,24,27,0));
  transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 320ms ease;
  will-change: transform;
}
.jump-j:hover, .jump-j:focus-visible {
  transform: translateY(-0.22em) rotate(-6deg);
  filter: drop-shadow(3px 4px 0 rgba(23,24,27,0.22));
}

/* Nav wordmark J — sits inline at rest, jumps on link hover */
.nav-j {
  display: inline-block;
  color: var(--highlighter);
  -webkit-text-stroke: 1.5px var(--stage);
  paint-order: stroke fill;
  transform: translateY(0) rotate(0);
  transition: transform 340ms cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
a:hover .nav-j, a:focus-visible .nav-j { transform: translateY(-0.2em) rotate(-7deg); }

/* Primary CTA */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--highlighter);
  color: var(--stage);
  border: 2px solid var(--stage);
  padding: 0.85rem 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 3px 3px 0 var(--stage), 0 12px 28px rgba(217,242,102,0.3);
  transition: transform 240ms cubic-bezier(0.34, 1.45, 0.64, 1), box-shadow 240ms ease;
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--stage), 0 18px 36px rgba(217,242,102,0.42); }
.btn-primary:active { transform: translate(0, 0); box-shadow: 2px 2px 0 var(--stage), 0 6px 14px rgba(217,242,102,0.28); }
.btn-primary:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 4px; }

.btn-primary-sm { padding: 0.65rem 1.1rem; font-size: 13px; min-height: 44px; box-shadow: 2px 2px 0 var(--stage), 0 8px 18px rgba(217,242,102,0.28); }
.btn-primary-sm:hover { box-shadow: 3px 3px 0 var(--stage), 0 12px 24px rgba(217,242,102,0.4); }

/* Secondary CTA */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--stage);
  border-bottom: 2px solid var(--stage);
  padding: 0.35rem 0;
  font-weight: 600;
  transition: transform 220ms ease, border-color 220ms ease, color 220ms ease;
}
.btn-secondary:hover { transform: translateY(-2px); border-color: var(--highlighter); }
.btn-secondary:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 4px; }

/* Nav link underline reveal (Cobalt) */
.link-underline {
  background-image: linear-gradient(var(--cobalt), var(--cobalt));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 260ms ease, color 200ms ease;
  padding: 0.25rem 0;
}
.link-underline:hover, .link-underline:focus-visible { background-size: 100% 2px; color: var(--cobalt); outline: none; }
.link-underline.is-active { background-size: 100% 2px; color: var(--cobalt); }

/* Service card */
.service-card {
  background: var(--liner);
  border: 1px solid rgba(23,24,27,0.14);
  box-shadow: 0 1px 0 rgba(23,24,27,0.04), 0 10px 26px rgba(23,24,27,0.05);
  transition: transform 300ms cubic-bezier(0.34, 1.25, 0.64, 1), box-shadow 300ms ease, border-color 300ms ease;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 2px 0 rgba(23,24,27,0.06), 0 22px 42px rgba(23,24,27,0.1), 0 0 0 1px rgba(217,242,102,0.35) inset;
  border-color: var(--stage);
}
.service-card:focus-within { outline: 2px solid var(--cobalt); outline-offset: 4px; }

/* Case card (home preview + hub listing) */
.case-card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--liner);
  border: 1px solid rgba(23,24,27,0.18);
  box-shadow: 0 1px 0 rgba(23,24,27,0.04), 0 10px 26px rgba(23,24,27,0.06);
  overflow: hidden;
  transition: transform 320ms cubic-bezier(0.34, 1.25, 0.64, 1), box-shadow 320ms ease, border-color 320ms ease;
}
.case-card:hover {
  transform: translateY(-6px);
  box-shadow: 6px 6px 0 var(--stage), 0 22px 42px rgba(23,24,27,0.12);
  border-color: var(--stage);
}
.case-card:focus-within { outline: 2px solid var(--cobalt); outline-offset: 4px; }
/* Stretched link — makes the whole card clickable while keeping inner a11y text */
.case-card a.stretched::after {
  content: '';
  position: absolute; inset: 0;
  z-index: 1;
}

/* Category chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--stage);
  color: var(--liner);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border: 1.5px solid var(--stage);
}
.chip-light {
  background: var(--liner);
  color: var(--stage);
  border-color: var(--stage);
}
.chip-hl {
  background: var(--highlighter);
  color: var(--stage);
}

/* Case study big stat */
.stat-block {
  background: var(--liner);
  border: 1px solid rgba(23,24,27,0.18);
  padding: 1.75rem 1.5rem;
  box-shadow: 4px 4px 0 var(--stage);
  transition: transform 260ms ease;
}
.stat-block:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--stage); }
.stat-block .stat-num { font-family: 'Archivo Black', Impact, sans-serif; font-size: clamp(2.5rem, 5vw, 3.75rem); letter-spacing: -0.03em; line-height: 0.95; color: var(--stage); }
.stat-block .stat-label { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--concrete); margin-top: 0.65rem; }

/* Case study numbered approach list */
.approach-list { counter-reset: approach; }
.approach-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(23,24,27,0.14);
}
.approach-item:last-child { border-bottom: 1px solid rgba(23,24,27,0.14); }
.approach-item::before {
  counter-increment: approach;
  content: counter(approach, decimal-leading-zero);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--concrete);
  padding-top: 0.15rem;
}

/* Pull quote */
.pull-quote { border-left: 4px solid var(--highlighter); }

/* Portrait: duotone treatment */
.portrait-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23,24,27,0.18);
  background: var(--cobalt);
  box-shadow:
    0 2px 0 rgba(23,24,27,0.06),
    6px 6px 0 var(--stage),
    0 24px 56px rgba(23,24,27,0.16);
}
.portrait-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: url(#duotone-cobalt) contrast(1.05);
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), filter 500ms ease;
}
.portrait-wrap:hover img { transform: scale(1.04); }
.portrait-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.22;
  pointer-events: none;
  z-index: 2;
}
.portrait-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(23,24,27,0.55), rgba(23,24,27,0) 55%);
  pointer-events: none;
  z-index: 3;
}

/* Icon link — muted-by-default, brightens on hover/focus */
.icon-link {
  display: inline-flex;
  color: var(--stage);
  opacity: 0.5;
  transition: opacity 200ms ease;
}
.icon-link:hover { opacity: 1; }
.icon-link:focus-visible {
  opacity: 1;
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}
.icon-link:active { transform: scale(0.94); }

/* Mobile menu — native <details>/<summary> toggle */
.mobile-menu { position: relative; }
.mobile-menu summary {
  list-style: none;
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--stage);
  background: transparent;
  border: 2px solid var(--stage);
  padding: 0.65rem 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  transition: background 200ms ease, color 200ms ease;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary::after {
  content: '';
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}
.mobile-menu[open] summary { background: var(--stage); color: var(--liner); }
.mobile-menu summary:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

.mobile-menu-panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 220px;
  background: var(--liner);
  border: 2px solid var(--stage);
  box-shadow: 4px 4px 0 var(--stage), 0 18px 36px rgba(23,24,27,0.16);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.mobile-menu-panel a {
  display: block;
  padding: 0.85rem 0.9rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--stage);
  border-bottom: 1px solid rgba(23,24,27,0.08);
  transition: background 160ms ease, color 160ms ease;
}
.mobile-menu-panel a:last-of-type { border-bottom: 0; }
.mobile-menu-panel a:hover,
.mobile-menu-panel a:focus-visible {
  background: var(--stage);
  color: var(--liner);
  outline: none;
}
.mobile-menu-panel .btn-primary {
  margin-top: 0.5rem;
  justify-content: center;
  align-self: stretch;
  border-bottom: 2px solid var(--stage);
}

/* Service icon: sits next to the 01-06 number */
.service-icon {
  width: 28px;
  height: 28px;
  color: var(--stage);
  flex-shrink: 0;
  transition: transform 260ms cubic-bezier(0.34, 1.25, 0.64, 1), color 260ms ease;
}
.service-card:hover .service-icon {
  transform: translateY(-2px) rotate(-4deg);
  color: var(--cobalt);
}

/* Highlighter inline marker */
.mark-hl {
  background: linear-gradient(transparent 58%, var(--highlighter) 58%, var(--highlighter) 92%, transparent 92%);
  padding: 0 0.08em;
}

/* Dividers */
.rule { height: 1px; background: rgba(23,24,27,0.14); }
.rule-light { height: 1px; background: rgba(232,228,220,0.14); }

/* Layering */
main, header, footer { position: relative; z-index: 2; }

/* Ticker */
.ticker { overflow: hidden; border-top: 1px solid rgba(23,24,27,0.14); border-bottom: 1px solid rgba(23,24,27,0.14); }
.ticker-track {
  display: flex;
  gap: 3rem;
  animation: ticker 42s linear infinite;
  white-space: nowrap;
  padding: 0.85rem 0;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item { display: inline-flex; align-items: center; gap: 0.9rem; }
.ticker-dot { width: 6px; height: 6px; background: var(--highlighter); border: 1.5px solid var(--stage); border-radius: 9999px; display: inline-block; }

/* Prose block for case study body copy */
.prose-body { color: var(--concrete); line-height: 1.65; font-size: 1.0625rem; }
.prose-body p + p { margin-top: 1rem; }
.prose-body strong { color: var(--stage); font-weight: 700; }
.prose-body ul { list-style: none; padding-left: 0; margin-top: 1rem; }
.prose-body ul li { position: relative; padding-left: 1.75rem; margin-top: 0.5rem; }
.prose-body ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.65em;
  width: 12px; height: 2px;
  background: var(--cobalt);
}

/* Breadcrumb */
.crumb {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--concrete);
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.crumb a { color: var(--concrete); transition: color 180ms ease; }
.crumb a:hover, .crumb a:focus-visible { color: var(--stage); outline: none; }
.crumb .sep { opacity: 0.5; margin: 0 0.4rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .ticker-track { animation: none; }
}

/* Display sizing */
.display-xl { font-size: clamp(3rem, 8.5vw, 7rem); }
.display-l { font-size: clamp(2.25rem, 5.5vw, 3.75rem); }
.display-m { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
