/* Blue Fig Software. Palette from the brand board: ink, blue, chalk; sand is the studio backdrop of the photographs. */

/* Figtree, served from this site. One variable file per alphabet covers every weight; the browser fetches the second only if a page needs it. */
@font-face {
  font-family: Figtree; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Figtree; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --ink: #111C30;
  --blue: #335CDB;
  --chalk: #F4F2ED;
  --sand: #EAE0D7;
  --rule: #D6CABF;
  --pad: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.55;
}
img, video { max-width: 100%; }
picture { display: contents; }
a { color: var(--ink); }
a:hover { color: var(--blue); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 6px; }
.wrap { max-width: 1296px; margin: 0 auto; }

.skip { position: absolute; left: 16px; top: -80px; z-index: 10; background: var(--ink); color: var(--chalk); padding: 12px 18px; border-radius: 999px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 16px; color: var(--chalk); }

/* Full-bleed stages: the hero and the About band */
.stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.media { position: absolute; inset: 0; }
.media img, .media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.copy { position: absolute; z-index: 1; left: var(--pad); top: 21%; width: 54%; display: flex; flex-direction: column; align-items: flex-start; }

/* Hero */
.hero { background: var(--sand); }
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: 28px var(--pad); display: flex; flex-wrap: wrap; gap: 12px 48px; align-items: center; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { width: auto; fill: var(--ink); fill-rule: evenodd; transition: fill .2s; }
.brand:hover svg { fill: var(--blue); }
.brand-mark { height: 46px; }
.brand-word { height: 44px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; font-weight: 500; font-size: 17px; }
.nav a { text-decoration: none; padding: 10px 0; }
.hero-copy { gap: 26px; }
.hero h1 { margin: 0; font-size: clamp(40px, 6.6vw, 96px); line-height: .98; letter-spacing: -0.04em; font-weight: 500; }
.dot { color: var(--blue); }
.lede { margin: 0; font-size: 21px; max-width: 29em; color: #2C3852; }
.btn { text-decoration: none; background-color: var(--ink); color: var(--chalk); font-weight: 600; padding: 15px 28px; border-radius: 999px; transition: background-color .2s, transform .2s; }
.btn:hover { background-color: var(--blue); color: var(--chalk); transform: translateY(-2px); }
.hero video { object-position: 82% 50%; }
.media-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 5%; background: linear-gradient(to top, var(--sand), rgba(234, 224, 215, 0)); }

.rise { animation: rise 1s var(--ease) backwards; }
.lede.rise { animation-delay: .12s; }
.btn.rise { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

/* What I build */
.services { background: var(--sand); padding: clamp(40px, 8vw, 110px) var(--pad) clamp(56px, 9.5vw, 130px); overflow-x: clip; }
.kicker { margin: 0 0 36px; font-size: 21px; font-weight: 500; color: #3A4660; }
.svc { padding: 0 0 26px; }
.svc h3 { margin: 22px 0 0; font-size: clamp(26px, 2.2vw, 32px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 500; }
.svc p { margin: 8px 0 0; font-size: 18px; color: #2C3852; max-width: 30em; }
.svc button { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; color: inherit; text-align: left; cursor: pointer; }
.bar { display: block; position: relative; height: 1px; background: var(--rule); }
.bar::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: 0 50%; transition: transform .5s var(--ease); }
.shot { overflow: hidden; pointer-events: none; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Desktop: the list on the left, one object on the right that swaps with the active service */
@media (min-width: 821px) {
  .lede { max-width: min(29em, 46vw); } /* keeps the line clear of the fig on narrower desktop windows */
  .svcs { position: relative; }
  .svc { width: 42%; }
  .svc h3 { color: #6E7A8E; transition: color .35s; }
  .svc p { color: #55627A; transition: color .35s; }
  .shot {
    position: absolute; left: 45%; right: calc(-1 * var(--pad)); top: 50%; aspect-ratio: 4 / 3; transform: translateY(-50%);
    opacity: 0; transition: opacity .7s;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 6%, #000 88%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 16%, #000 96%, transparent), linear-gradient(to bottom, transparent, #000 6%, #000 88%, transparent);
    mask-composite: intersect;
  }
  .shot img { transform: scale(1.045); transition: transform 1.6s var(--ease); }

  /* Active row. With the script running (.live) it is the row marked .on; without it, hover and keyboard focus pick the row. */
  .svcs.live .svc.on h3,
  .svcs:not(.live):not(:has(.svc:hover, button:focus-visible)) .svc.on h3,
  .svcs:not(.live) .svc:is(:hover, :has(button:focus-visible)) h3 { color: var(--ink); }
  .svcs.live .svc.on p,
  .svcs:not(.live):not(:has(.svc:hover, button:focus-visible)) .svc.on p,
  .svcs:not(.live) .svc:is(:hover, :has(button:focus-visible)) p { color: #2C3852; }
  .svcs.live .svc.on .shot,
  .svcs:not(.live):not(:has(.svc:hover, button:focus-visible)) .svc.on .shot,
  .svcs:not(.live) .svc:is(:hover, :has(button:focus-visible)) .shot { opacity: 1; }
  .svcs.live .svc.on .shot img,
  .svcs:not(.live):not(:has(.svc:hover, button:focus-visible)) .svc.on .shot img,
  .svcs:not(.live) .svc:is(:hover, :has(button:focus-visible)) .shot img { transform: none; }
  .svcs.live .svc.on .bar::after,
  .svcs:not(.live):not(:has(.svc:hover, button:focus-visible)) .svc.on .bar::after,
  .svcs:not(.live) .svc:is(:hover, :has(button:focus-visible)) .bar::after { transform: scaleX(1); }

  /* Pinned: the section holds still for five steps of scrolling, one per service. Set by the script when the window is tall enough. */
  .services.pinned { height: 330vh; height: 330svh; padding-top: 0; padding-bottom: 0; }
  .services.pinned .services-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; }
  .services.pinned .wrap { width: 100%; }
  .services.pinned .kicker { margin-bottom: clamp(14px, 3vh, 36px); }
  .services.pinned .svc { padding-bottom: clamp(12px, 2.8vh, 26px); }
  .services.pinned .svc h3 { margin-top: clamp(10px, 2.4vh, 22px); }
  .services.pinned .shot { max-height: 86vh; }
  .services.pinned .svc.on .bar::after { transform: scaleX(var(--fill, 0)); transition: none; }
}

/* Phone: every service gets its own image band */
@media (max-width: 820px) {
  .svc { display: flex; flex-direction: column; padding-bottom: 40px; }
  .svc h3 { margin-top: 14px; }
  .bar { display: none; }
  .shot {
    order: -1; margin: 0 calc(-1 * var(--pad)); aspect-ratio: 16 / 10;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 88%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 88%, transparent);
  }
}

/* About */
.about { background: #1A52BA; color: var(--chalk); }
.about-copy { top: 24%; gap: 24px; }
.about h2 { margin: 0; max-width: 520px; font-size: clamp(32px, 4.2vw, 60px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 500; }
.about p { margin: 0; max-width: 460px; font-size: 20px; color: #EEF1F8; }
.about img { object-position: 72% 100%; transform-origin: 70% 85%; }
.drift { animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.07); } }

/* Contact */
.contact { padding: clamp(72px, 10vw, 140px) var(--pad) clamp(64px, 9.5vw, 130px); }
.contact-inner { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.contact p { margin: 0; font-size: 21px; color: #3A4660; }
.mail {
  text-decoration: none; font-size: clamp(26px, 6vw, 90px); line-height: 1.15; letter-spacing: -0.045em; font-weight: 500; padding: 2px 8px 10px 0; overflow-wrap: anywhere;
  background-image: linear-gradient(var(--blue), var(--blue)); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 4px;
  transition: background-size .4s var(--ease), color .3s;
}
.mail:hover { background-size: 100% 100%; color: var(--chalk); }

/* Footer */
.foot { padding: 0 var(--pad) 48px; }
.foot-inner { border-top: 1px solid #D3CEC8; padding-top: 28px; display: flex; flex-wrap: wrap; gap: 16px 48px; justify-content: space-between; font-size: 15px; color: #55627A; }
.foot p { margin: 0; max-width: 46em; }

/* Phone layout for the two stages: copy above, picture below */
@media (max-width: 820px) {
  .stage { aspect-ratio: auto; }
  .top { position: static; }
  .copy { position: static; width: auto; padding: 16px 20px 28px; }
  .about-copy { padding-top: 40px; }
  .media { position: relative; inset: auto; height: 66vw; }
}

/* Motion that only runs when the visitor has not asked for less of it */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .about p.reveal { transition-delay: .12s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
