/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --ink: #173053;
  --navy: #325279;
  --slate: #5f7ea0;
  --muted: #797b7d;
  --text: #151515;
  --line: #ededed;
  --brown: #644321;
  --sky: #a9bada;
  --paper: #ffffff;

  --font: "Switzer", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-pixel: "Silkscreen", "Courier New", monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-bg: rgba(255, 255, 255, 0.78);
  --nav-border: rgba(255, 255, 255, 0.82);
  --nav-text: rgba(23, 48, 83, 0.7);
  --nav-text-hover: rgba(23, 48, 83, 1);
  --star-fill: #a9bada;
  --gutter: clamp(20px, 5.4vw, 82px);
  --z: 0.9;                 /* global content scale: 1 = exact Figma size, 0.9 = 10% smaller */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3, h4, figure { margin: 0; }
::selection { background: rgba(108, 143, 193, 0.28); }
:focus-visible { outline: 2px solid #6c8fc1; outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ───────────────────────── Navigation ───────────────────────── */
.nav {
  position: fixed; top: 18px; left: 50%; z-index: 100; zoom: 0.8;
  width: max-content; max-width: calc(100vw / 0.8 - 16px);
  transform: translateX(-50%);
  transition: left 0.7s var(--ease-out), transform 0.7s var(--ease-out), opacity 0.5s ease;
}
.nav[data-pos="left"] { left: calc((max(0px, (100vw / var(--z) - 1512px) / 2) + var(--gutter)) * var(--z) / 0.8); transform: translateX(0); }   /* same left margin as the page content */
.nav[data-away="true"] { opacity: 0; pointer-events: none; }
.nav[data-away="true"][data-pos="center"] { transform: translate(-50%, -14px); }
.nav[data-away="true"][data-pos="left"] { transform: translate(0, -14px); }
.nav[data-hidden="true"] { opacity: 0; pointer-events: none; }
.nav[data-hidden="true"][data-pos="center"] { transform: translate(-50%, -16px); }
.nav__pill {
  display: flex; align-items: center;
  padding: 10px 20px 10px 15px;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: 29px;
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 8px 30px rgba(35, 60, 110, 0.08);
  transition: box-shadow 0.5s var(--ease-out), background 0.4s;
}
.nav__star {
  width: 35px; height: 34px; flex: none; perspective: 200px;
  display: grid; place-items: center; border-radius: 50%;
}
.nav__star svg {
  width: 25px; height: 24px; overflow: visible;
  transform-style: preserve-3d;
  transition: transform 0.9s var(--ease-out), filter 0.4s;
}
.nav__star svg path:first-child { fill: #d9d9d9; }
.nav__star svg path:last-child { fill: var(--star-fill); fill-opacity: 0.6; }
.nav__star:hover svg { filter: drop-shadow(0 2px 6px rgba(108, 143, 193, 0.5)); }
.nav__collapse {
  display: grid; grid-template-columns: 1fr;
  transition: grid-template-columns 0.65s var(--ease-out), opacity 0.4s var(--ease-out);
}
.nav__clip { overflow: hidden; min-width: 0; }
.nav__links {
  display: flex; gap: 30px; padding-left: 30px; white-space: nowrap;
  font-size: 16px; color: var(--nav-text);
}
.nav__links a { position: relative; padding: 4px 0; transition: color 0.25s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--nav-text-hover); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ───────────────────────── Page transitions ───────────────────────── */
.curtain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: linear-gradient(180deg, #dbe6f7 0%, #f5f8fd 60%, #fff 100%);
  opacity: 0; transition: opacity 0.4s var(--ease-io);
}
html.js .curtain { opacity: 1; }
html.js.is-ready .curtain { opacity: 0; transition-duration: 0.8s; }
html.js.is-leaving .curtain { opacity: 1; pointer-events: all; transition-duration: 0.35s; }

/* ───────────────────────── Scroll reveal ───────────────────────── */
html.js [data-reveal] {
  opacity: 0; transform: translateY(var(--reveal-y, 8px));
  transition: opacity var(--reveal-dur, 0.7s) ease-out var(--d, 0s), transform var(--reveal-dur, 0.7s) ease-out var(--d, 0s);
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ───────────────────────── Toast ───────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 300;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  padding: 11px 20px; border-radius: 39px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid #e5e5e5;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  font-size: 15px; font-weight: 500; color: #4e4e4e; letter-spacing: -0.02em;
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--spring);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ───────────────────────── Contact footer (case studies) ───────────────────────── */
.contact {
  position: relative; overflow: hidden; margin-top: 120px;
  padding: 88px var(--gutter) 56px;
  background: linear-gradient(180deg, #fff 0%, #eef4ff 46%, #f8e9ee 100%);
  border-top: 1px dashed #d3d3d3;
}
.contact::before, .contact::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.7; pointer-events: none;
}
.contact::before { width: 520px; height: 200px; left: 4%; top: 14%; background: #cfe0fb; }
.contact::after { width: 460px; height: 170px; right: 6%; bottom: -6%; background: #fbd9e3; }
.contact__inner {
  position: relative; z-index: 1; max-width: 1350px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap;
}
.contact__mail {
  font-size: clamp(30px, 4.4vw, 56px); font-weight: 600; letter-spacing: -0.05em; color: var(--navy);
  line-height: 1.05; display: inline-block; position: relative;
}
.contact__mail::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease-out);
}
.contact__mail:hover::after { transform: scaleX(1); }
.contact__lede { margin-top: 22px; font-size: 18px; color: #4e4e4e; letter-spacing: -0.03em; line-height: 1.4; }
.contact__lede b { display: block; font-weight: 500; color: var(--navy); }
.contact__icons { margin-top: 28px; display: flex; gap: 14px; }
.contact__icons a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.7); border: 1px solid #e3e8f2; color: var(--navy);
  transition: transform 0.5s var(--spring), background 0.3s, color 0.3s;
}
.contact__icons a:hover { transform: translateY(-4px) rotate(-6deg); background: var(--navy); color: #fff; }
.contact__icons svg { width: 20px; height: 20px; }
.contact__nav { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; min-width: 150px; }
.contact__nav a { font-size: 20px; letter-spacing: -0.04em; color: rgba(9, 9, 9, 0.5); transition: color 0.25s, transform 0.4s var(--ease-out); }
.contact__nav a:hover { color: var(--navy); transform: translateX(6px); }
.contact__top {
  margin-top: 14px; padding: 8px 18px; border-radius: 39px; background: rgba(255,255,255,.75);
  border: 1px solid #e5e5e5; font-size: 16px; letter-spacing: -0.02em; color: #4e4e4e;
  transition: transform 0.5s var(--spring), background 0.3s;
}
.contact__top:hover { transform: translateY(-3px); background: #fff; }
.contact__legal { position: relative; z-index: 1; max-width: 1350px; margin: 72px auto 0; font-size: 14px; color: rgba(9,9,9,.4); letter-spacing: -0.02em; }

@media (max-width: 720px) {
  .nav { top: 10px; }
  .nav__links { gap: 20px; padding-left: 20px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html.js [data-reveal] { opacity: 1; transform: none; filter: none; }
}


/* ── cursor ── */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor {
  position: fixed; left: -13px; top: -13px; width: 26px; height: 26px; z-index: 10000; pointer-events: none; opacity: 0; border-radius: 50%;
  background: rgba(150, 168, 210, 0.28); border: 1px solid rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1px rgba(60, 80, 130, 0.14), 0 4px 14px rgba(40, 60, 110, 0.12);
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  transition: opacity 0.3s ease, width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), background 0.3s;
}
.cursor.is-on { opacity: 1; }
.cursor.is-link { width: 40px; height: 40px; margin: -7px 0 0 -7px; background: rgba(150, 168, 210, 0.2); }
.cursor.is-down { width: 20px; height: 20px; margin: 3px 0 0 3px; }
@media (hover: none) { .cursor { display: none; } }
