/* Raven Labs: shared styles for the homepage, the blog index and posts.
   Paper and ember are sampled from the FABench figures so the illustrations sit on the page without a frame. */
:root {
  --paper: #F8F2EC;
  --paper-2: #F2EAE1;
  --card: #FFFDFA;
  --ink: #1C1A17;
  --ink-2: #4D473F;
  --ink-3: #867E73;
  --rule: rgba(28, 26, 23, .13);
  --ember: #B45028;
  --ember-2: #CF6533;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 64px);
  --max: 1520px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
h1, h2, h3 { font-weight: 500; }
::selection { background: rgba(180, 80, 40, .2); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 12px; z-index: 100; padding: 8px 12px; border-radius: 6px;
  background: var(--ink); color: var(--paper); font: 500 14px/1 var(--sans); text-decoration: none; }
.skip:focus { left: 16px; }
.arrow { display: inline-block; transition: transform .35s var(--ease); }
a:hover .arrow { transform: translateX(4px); }

/* ---------- brand ---------- */
.quill { display: block; flex: none; overflow: visible; }
.quill__body { fill: currentColor; }
.quill__sheen { fill: var(--ember); transition: fill .3s; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand .quill { width: 17px; height: 25px; transform-origin: 40% 95%; transition: transform .55s var(--ease); }
.brand:hover .quill { transform: rotate(-14deg) translateY(-1px); }
.brand:hover .quill__sheen { fill: var(--ember-2); }
.wordmark { font: 500 13px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; white-space: nowrap; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(248, 242, 236, .86);
  -webkit-backdrop-filter: saturate(1.3) blur(14px); backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.is-scrolled { border-bottom-color: var(--rule); }
.nav__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.nav .brand .quill { animation: quill-in 1.1s var(--ease) .15s backwards; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 2.8vw, 36px);
  font: 500 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.nav__opt { color: var(--ink-2); text-decoration: none; padding: 8px 0; transition: color .2s; }
.nav__opt:hover, .nav__opt[aria-current] { color: var(--ink); }
.pill { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid rgba(28, 26, 23, .22);
  border-radius: 999px; color: var(--ink); text-decoration: none; transition: background .25s, color .25s, border-color .25s; }
.pill:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@keyframes quill-in { from { opacity: 0; transform: translate(6px, -9px) rotate(20deg); } }

/* ---------- shared bits ---------- */
.section { padding-block: clamp(80px, 11vw, 156px); }
.section--band { background: var(--paper-2); }
.label { display: flex; align-items: center; gap: 14px; margin: 0 0 clamp(28px, 4vw, 44px);
  font: 500 12px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.label::before { content: ""; width: 24px; height: 1px; background: var(--ember); }
.label a { color: inherit; text-decoration: none; }
.label a:hover { color: var(--ink); }
.label--center { justify-content: center; }
.meta { font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.more { display: inline-flex; gap: .5em; margin-top: 22px; font: 500 14px/1 var(--sans); color: var(--ink);
  padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; font: 500 13px/1 var(--sans); }
.links a { color: var(--ink); text-decoration: none; padding-bottom: 5px; border-bottom: 1px solid var(--rule); transition: color .2s, border-color .2s; }
.links a:hover { color: var(--ember); border-color: var(--ember); }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid rgba(28, 26, 23, .18);
  border-radius: 999px; background: var(--card); font: 500 13px/1 var(--sans); color: var(--ink); text-decoration: none;
  transition: background .25s, color .25s, border-color .25s; }
.chip:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- home: hero ---------- */
.hero { position: relative; }
.hero__text { position: relative; z-index: 2; text-align: center; padding-top: clamp(56px, 10vh, 128px); }
/* "Scaling the decision intelligence" is about 12.5em wide, so 7vw keeps it on one line inside the 92vw column */
.display { margin: 0 auto; font: 500 clamp(34px, 11vw, 64px)/1.02 var(--serif);
  letter-spacing: -.026em; text-wrap: balance; animation: rise 1.1s var(--ease) .1s backwards; }
.display em { font-style: italic; font-weight: 400; color: var(--ember); white-space: nowrap; }
@media (min-width: 720px) { .display { font-size: min(7vw, 116px); } }
.hero__link { display: inline-flex; gap: .5em; margin-top: clamp(24px, 3vw, 36px); padding-bottom: 6px;
  border-bottom: 1px solid rgba(28, 26, 23, .3); font: 500 15px/1 var(--sans); color: var(--ink); text-decoration: none;
  animation: rise 1.1s var(--ease) .35s backwards; transition: border-color .25s; }
.hero__link:hover { border-color: var(--ink); }
.hero__art { position: relative; z-index: 1; margin: calc(-1 * clamp(8px, 3vw, 56px)) 0 0; overflow: hidden; }
/* the clay diorama shares the page's cream, so it is shown whole and its edges are feathered into the paper */
.hero__art img { width: min(1672px, 100%); margin-inline: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 12%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent), linear-gradient(180deg, transparent, #000 12%, #000 92%, transparent);
  mask-composite: intersect;
  animation: art-in 1.8s var(--ease) backwards; }
@keyframes rise { from { opacity: 0; translate: 0 18px; } }
@keyframes art-in { from { opacity: 0; transform: scale(1.035); } }

/* ---------- home: latest post ---------- */
.feature { display: block; color: var(--ink); text-decoration: none; }
.feature__img { width: 100%; transition: transform .8s var(--ease); }
.feature:hover .feature__img { transform: scale(1.012); }
.feature__text { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px 64px; align-items: end;
  margin-top: clamp(24px, 3vw, 40px); padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--rule); }
.feature__title { margin: 16px 0 0; font: 500 clamp(28px, 3.5vw, 46px)/1.1 var(--serif); letter-spacing: -.016em; text-wrap: balance; }
.feature:hover .feature__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; }
.feature__dek { margin: 0; font: 400 clamp(18px, 1.6vw, 21px)/1.5 var(--serif); color: var(--ink-2); }

/* ---------- home: mission ---------- */
.statement { margin: 0; max-width: 17em; font: 400 clamp(32px, 4.4vw, 72px)/1.12 var(--serif); letter-spacing: -.018em; text-wrap: balance; }
@media (min-width: 640px) { .statement .keep { white-space: nowrap; } }
.stages { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(56px, 8vw, 104px) 0 0;
  padding: 0; list-style: none; border-top: 1px solid rgba(28, 26, 23, .2); }
.stages::after { content: ""; position: absolute; left: 0; top: -1px; width: 0; height: 2px; background: var(--ember);
  transition: width 1.6s var(--ease) .5s; }
.stages.is-in::after, html:not(.js) .stages::after { width: 33.333%; }
.stages li { position: relative; padding: 30px 28px 0 0; }
.stages li::before { content: ""; position: absolute; left: 0; top: -6px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper-2); border: 1px solid rgba(28, 26, 23, .35); }
.stages li:first-child::before { background: var(--ember); border-color: var(--ember); }
.stages li.is-next::before { border-color: var(--ember); }
.stages.is-in li.is-next::before { animation: pulse 2.8s ease-out 2.1s infinite; }
.stages__n { font: 500 12px/1 var(--sans); letter-spacing: .14em; color: var(--ember); }
.stages b { display: block; margin: 16px 0 8px; font: 500 clamp(26px, 2.8vw, 36px)/1.1 var(--serif); letter-spacing: -.012em; }
.stages li > span:last-child { font: 400 18px/1.45 var(--serif); color: var(--ink-2); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180, 80, 40, .45); } 70%, 100% { box-shadow: 0 0 0 12px rgba(180, 80, 40, 0); } }

/* ---------- home: work ---------- */
.work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.work__item { padding-top: 24px; border-top: 1px solid var(--ink); }
.work__item h3 { margin: 0 0 12px; font: 500 clamp(26px, 2.4vw, 32px)/1.15 var(--serif); letter-spacing: -.01em; }
.work__item p:not(.links) { margin: 0 0 22px; max-width: 30ch; font: 400 18px/1.5 var(--serif); color: var(--ink-2); }

/* ---------- home: contact ---------- */
.contact { padding-block: clamp(24px, 4vw, 64px) clamp(64px, 8vw, 112px); }
.contact__row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 24px 48px; align-items: center; }
.contact__title { margin: 0 0 28px; font: 500 clamp(44px, 6.8vw, 116px)/1 var(--serif); letter-spacing: -.026em; }
.email { font: 400 clamp(20px, 2.3vw, 30px)/1.25 var(--serif); color: var(--ember); text-decoration: none;
  border-bottom: 1px solid rgba(180, 80, 40, .4); overflow-wrap: anywhere; transition: border-color .25s; }
.email:hover { border-color: var(--ember); }
.mascot { justify-self: end; width: min(400px, 100%); animation: bob 4.8s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-9px) rotate(-1.5deg); } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); padding-block: 32px 44px; font: 400 13px/1.5 var(--sans); color: var(--ink-3); }
.foot__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 36px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot__links a { color: var(--ink-2); text-decoration: none; }
.foot__links a:hover { color: var(--ink); }
.foot__copy { margin: 0; }

/* ---------- blog index ---------- */
.page-head { padding-block: clamp(56px, 9vw, 120px) clamp(28px, 4vw, 48px); }
.page-title { margin: 0; font: 500 clamp(44px, 6.4vw, 84px)/1 var(--serif); letter-spacing: -.026em; }
.posts { margin: 0 0 clamp(80px, 10vw, 140px); padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.post-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) minmax(0, 440px); gap: 16px 40px; align-items: start;
  padding-block: 32px; border-bottom: 1px solid var(--rule); }
.post-row__date { padding-top: 9px; font: 500 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.post-row__title { font: 500 clamp(24px, 2.4vw, 32px)/1.18 var(--serif); letter-spacing: -.012em; color: var(--ink); text-decoration: none; text-wrap: balance; }
.post-row__title:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; }
.post-row__dek { margin: 12px 0 0; font: 400 18px/1.5 var(--serif); color: var(--ink-2); }
.post-row__by { margin: 14px 0 0; font: 400 13px/1 var(--sans); color: var(--ink-3); }
.post-row__thumb img { width: 100%; }

/* ---------- post ---------- */
.post__date, .post__dek, .post__by, .post-row__more, .page-title__pre { display: none; }
.post__head { text-align: center; padding-top: clamp(48px, 8vw, 112px); }
.post__title { margin: 0 auto; max-width: 19ch; font: 500 clamp(36px, 4.9vw, 62px)/1.07 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.post__meta { margin: 26px 0 0; font: 400 14px/1.4 var(--sans); color: var(--ink-3); }
.post__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 0; }
.post__cover { width: min(var(--max), 100% - 2 * var(--gutter)); margin: clamp(28px, 4.5vw, 56px) auto 0; }
.post__body { position: relative; padding-top: clamp(40px, 6vw, 76px); }
.toc { display: none; }
.prose { width: min(680px, 100% - 2 * var(--gutter)); margin-inline: auto; font: 400 19.5px/1.68 var(--serif); color: var(--ink); }
.prose > p:first-child { font-size: 1.13em; line-height: 1.6; }
.prose p { margin: 0 0 1.12em; }
.prose h2 { margin: 2.5em 0 .75em; font: 600 clamp(26px, 2.5vw, 32px)/1.2 var(--serif); letter-spacing: -.012em; scroll-margin-top: 96px; }
.prose strong { font-weight: 600; }
.prose a { color: var(--ember); }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul { margin: 0 0 1.2em; padding-left: 1.15em; }
.prose li { margin: .55em 0; padding-left: .35em; }
.prose li::marker { color: var(--ember); }
.prose sub { font-size: .66em; line-height: 0; vertical-align: -.2em; }
.fig { margin: 2.3em 0 2.5em; }
.fig img { width: 100%; border-radius: 12px; cursor: zoom-in; }
.fig.wide, .fig.mid { --w: min(960px, 100vw - 2 * var(--gutter)); width: var(--w); margin-left: calc(50% - var(--w) / 2); }
.fig.mid { --w: min(820px, 100vw - 2 * var(--gutter)); }
.fig.plate img { padding: clamp(8px, 1.8vw, 24px); background: #fff; border: 1px solid rgba(28, 26, 23, .08); border-radius: 16px; }
.post__end { display: flex; flex-direction: column; align-items: center; gap: 22px; padding-block: clamp(56px, 8vw, 96px) clamp(72px, 9vw, 120px); }
.post__end .quill { width: 26px; height: 38px; color: var(--ink); }
.post__more { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin: 0; font: 500 14px/1.4 var(--sans); }
.post__more a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 4px; }
.post__more a:hover { color: var(--ink); border-color: var(--ink); }

@media (min-width: 1380px) {
  .toc { display: block; position: absolute; top: 0; bottom: 0; left: 0; }
  .toc__inner { position: sticky; top: 112px; display: flex; flex-direction: column; width: calc(var(--gutter) + 168px); padding: 4px 0 0 var(--gutter); }
  .toc a { padding: 7px 0 7px 14px; border-left: 1px solid var(--rule); font: 400 13px/1.35 var(--sans); color: var(--ink-3);
    text-decoration: none; transition: color .2s, border-color .2s; }
  .toc a:hover { color: var(--ink); }
  .toc a.is-active { color: var(--ink); border-left-color: var(--ember); }
}

/* Warm illustrations share the page colour; feather their edges so they sit on the paper without a box. */
.soft img, .feature__img, .post__cover img {
  border-radius: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent), linear-gradient(180deg, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent), linear-gradient(180deg, transparent, #000 3%, #000 97%, transparent);
  mask-composite: intersect; }

/* ---------- 404 ---------- */
.lost { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; padding-block: clamp(96px, 16vh, 200px); }
.lost .quill { width: 40px; height: 58px; animation: bob 4.8s ease-in-out infinite; }

/* ---------- zoom overlay ---------- */
.zoom { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: clamp(12px, 3vw, 40px);
  background: rgba(248, 242, 236, .97); cursor: zoom-out; opacity: 0; transition: opacity .25s; }
.zoom.is-open { opacity: 1; }
.zoom img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 10px;
  box-shadow: 0 30px 80px -30px rgba(28, 26, 23, .35); }

/* ---------- reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; translate: 0 16px; transition: opacity .9s var(--ease), translate .9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .feature__text, .contact__row { grid-template-columns: minmax(0, 1fr); }
  .work { grid-template-columns: minmax(0, 1fr); }
  .post-row { grid-template-columns: minmax(0, 1fr); }
  .post-row__date { padding-top: 0; }
  .post-row__thumb { order: -1; }
  .mascot { justify-self: start; width: min(240px, 60%); }
}
@media (max-width: 640px) {
  .nav__opt:not(:first-child) { display: none; }
  .wordmark { font-size: 12px; letter-spacing: .22em; }
  .stages { grid-template-columns: minmax(0, 1fr); border-top: 0; border-left: 1px solid rgba(28, 26, 23, .2); margin-left: 5px; }
  .stages::after { display: none; }
  .stages li { padding: 0 0 34px 28px; }
  .stages li:last-child { padding-bottom: 0; }
  .stages li::before { left: -6px; top: 2px; }
  .stages b { margin-top: 10px; }
  .prose { font-size: 18px; }
  .fig.plate img { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; translate: none; }
  .stages::after { width: 33.333%; }
}
