/* reset + typography + browser surfaces + primitives + header + footer */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
  color-scheme: dark;
  scrollbar-color: #2B2B38 var(--ink-950);
  scrollbar-width: thin;
}
body {
  margin: 0;
  background: var(--ink-950);
  color: var(--on-dark-1);
  font: 400 var(--fs-body)/1.75 var(--f-sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  caret-color: var(--brand-tint);
  overflow-x: clip;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { margin: 0; font-weight: 700; word-break: keep-all; line-break: strict; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; word-break: keep-all; line-break: strict; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
p a:not([class]) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
figure { margin: 0; }
em { font-style: normal; }

::selection { background: rgba(var(--brand-rgb), .9); color: #FFFFFF; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-950); }
::-webkit-scrollbar-thumb { background: #2B2B38; border-radius: 10px; border: 2px solid var(--ink-950); }
::-webkit-scrollbar-thumb:hover { background: #3A3A4A; }

:focus-visible { outline: 2px solid var(--brand-tint); outline-offset: 3px; border-radius: 6px; }
a, button { -webkit-tap-highlight-color: transparent; }   /* no grey flash on tap: focus rings and hover states do the work */
.section--light :focus-visible { outline-color: var(--brand); }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--brand); color: #FFFFFF; font-weight: 600; transition: top var(--t-fast) var(--ease-out); }
.skip-link:focus-visible { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* words that travel together: a phrase, or a title's last word and its arrow (an inline icon is a break chance of
   its own, and without text-wrap: balance the arrow could drop to a line alone, review 4 L-1) */
.nw { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* layout primitives */
.wrap { width: min(100% - var(--margin) * 2, var(--container)); margin-inline: auto; }
/* phones: the lane runs in the left margin, half a margin left of the content (flow.js), so the content keeps a
   wider margin on that side (owner 09-25: room for the line). The header bar takes the same margins, so the logo
   starts and the burger's lines end on the content's lines, as on the desktop */
@media (max-width: 640px) { .wrap { width: auto; margin-left: var(--margin-l); margin-right: var(--margin); } }
picture { display: contents; }   /* the img inside keeps its own layout rules */
.section { position: relative; padding-block: var(--sec-y); }
.section--dark { background: var(--ink-900); color: var(--on-dark-1); }
.section--light { background: var(--paper-100); color: var(--on-light-1); color-scheme: light; }
.section--light ::selection { background: var(--brand); color: #FFFFFF; }
.h2 { font-size: var(--fs-h2); line-height: 1.14; letter-spacing: -0.035em; }
.lead { font-size: var(--fs-lead); line-height: 1.75; color: var(--on-dark-2); max-width: 36em; }
.section--light .lead { color: var(--on-light-2); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 26px; border-radius: var(--r-pill);
  font: 600 15px/1 var(--f-sans); letter-spacing: -0.01em; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn .arr { display: inline-block; transition: transform 260ms var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #FFFFFF; box-shadow: 0 10px 30px -12px rgba(var(--brand-rgb), .7); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { border: 1px solid var(--line-dark-strong); color: var(--on-dark-1); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .34); background: rgba(255, 255, 255, .04); }
.section--light .btn-ghost { border-color: var(--line-light-strong); color: var(--on-light-1); }
.section--light .btn-ghost:hover { border-color: rgba(12, 12, 18, .34); background: rgba(12, 12, 18, .03); }
.btn-text { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--on-dark-1); }
.btn-text .arr { transition: transform 260ms var(--ease-out); }
.btn-text:hover .arr { transform: translateX(3px); }
.section--light .btn-text { color: var(--on-light-1); }

/* logo colors */
.aiscope-ai { fill: var(--brand); }
.aiscope-scope { fill: currentColor; }

/* ============ header ============ */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  /* the bar and its type change together when it crosses into a light section (400ms, see .on-light) */
  transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out), backdrop-filter var(--t-med) var(--ease-out);
  border-bottom: 1px solid transparent;
}
/* dense enough that a section edge passing under the bar does not smear through it (09-24 detail audit 11) */
.site-header.is-scrolled {
  background: rgba(var(--ink-950-rgb), .92);   /* the ground: a darker bar over the charcoal reads as a stain */
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--line-dark);
}
.site-header .bar { height: 100%; display: flex; align-items: center; gap: 40px; }
.site-header .logo { display: block; color: var(--on-dark-1); flex-shrink: 0; transition: color 400ms var(--ease-out); }
.site-header .logo svg { height: 19px; width: auto; }
.site-header .nav { margin-left: auto; display: flex; align-items: center; gap: 34px; }
.site-header .nav-links { display: flex; align-items: center; gap: 30px; }
.site-header .nav-links > li { position: relative; }
.site-header .nav a:not(.nav-cta) {
  position: relative; display: inline-block; padding: 8px 0;
  color: var(--on-dark-2); font-size: 14px; font-weight: 500; letter-spacing: 0;
  transition: color 400ms var(--ease-out);   /* with the bar when it changes theme; a hover answers faster */
}
.site-header .nav-links > li > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 320ms var(--ease-out);
}
.site-header .nav a:not(.nav-cta):hover,
.site-header .nav-links > li:focus-within > a { color: var(--on-dark-1); transition-duration: var(--t-fast); }
.site-header .nav-links > li > a:hover::after { transform: scaleX(1); transform-origin: left; }
.site-header .nav a.nav-cta {
  display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: var(--r-pill);
  background: var(--brand); color: #FFFFFF; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease-out);
}
.site-header .nav a.nav-cta:hover { background: var(--brand-hover); }

.site-header .subnav {
  position: absolute; left: -18px; top: calc(100% + 10px); min-width: 250px; padding: 8px;
  background: rgba(12, 12, 18, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line-dark); border-radius: 16px; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s linear 220ms;
}
.site-header .has-sub:hover .subnav,
.site-header .has-sub:focus-within .subnav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.site-header .nav .subnav a:not(.nav-cta) { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; }
.site-header .nav .subnav a:not(.nav-cta):hover { background: rgba(255, 255, 255, .05); }
.site-header .subnav b { color: var(--on-dark-1); font-weight: 600; font-size: 14px; }
.site-header .subnav span { color: var(--on-dark-2); font-size: 12.5px; }
/* over a light section (About, Works, Blog) the bar turns light with dark type: nav.js sets .on-light
   from the section under the header's middle line. The brand A and the purple button stay as they are */
.site-header.on-light.is-scrolled { background: rgba(246, 246, 249, .95); border-bottom-color: var(--line-light); }
.site-header.on-light .logo { color: var(--on-light-1); }
.site-header.on-light .nav a:not(.nav-cta) { color: var(--on-light-2); }
.site-header.on-light .nav a:not(.nav-cta):hover,
.site-header.on-light .nav-links > li:focus-within > a { color: var(--on-light-1); }
.site-header.on-light .subnav { background: rgba(251, 251, 253, .97); border-color: var(--line-light); box-shadow: 0 24px 60px -24px rgba(12, 12, 18, .28); }
.site-header.on-light .nav .subnav a:not(.nav-cta):hover { background: rgba(12, 12, 18, .05); }
.site-header.on-light .subnav b { color: var(--on-light-1); }
.site-header.on-light .subnav span { color: var(--on-light-3); }
.site-header.on-light .burger span, .site-header.on-light .burger span::before { background: var(--on-light-1); }
.site-header.on-light :focus-visible { outline-color: var(--brand); }   /* as in the light sections */
/* the menu sheet is dark: while it is open the bar goes with it, whatever lies under the header */
[data-nav-open] .site-header, [data-nav-open] .site-header.on-light.is-scrolled { background: var(--ink-950); border-bottom-color: var(--line-dark); }
[data-nav-open] .site-header.on-light .logo { color: var(--on-dark-1); }
[data-nav-open] .site-header.on-light .burger span, [data-nav-open] .site-header.on-light .burger span::before { background: var(--on-dark-1); }
[data-nav-open] .site-header.on-light :focus-visible { outline-color: var(--brand-tint); }   /* the sheet is a dark surface */

/* the lines sit 12px inside the 44px button: the negative margin puts them on the content's right line, where the
   burger shows (900px and down): 48px from the edge to 641px, 20px on phones; the logo starts on the left line */
.burger { display: none; margin-left: auto; margin-right: -12px; width: 44px; height: 44px; border-radius: 12px; position: relative; }
.burger span, .burger span::before { position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--on-dark-1); border-radius: 2px; transition: transform 300ms var(--ease-out), background-color 400ms var(--ease-out); }
.burger span { top: 18px; }
.burger span::before { content: ""; left: 0; right: 0; top: 7px; }
[data-nav-open] .burger span { transform: translateY(3.5px) rotate(45deg); }
[data-nav-open] .burger span::before { transform: translateY(-7px) rotate(-90deg); }

/* sized from the screen, not from its containing block: once the page scrolls, the header's backdrop blur
   makes the header that block, and `inset: header 0 0` then left a 68px strip */
.mobile-sheet {
  position: fixed; top: var(--header-h); left: 0; right: 0; height: calc(100vh - var(--header-h));
  z-index: 49; padding: 28px var(--margin) 40px;
  overscroll-behavior: contain;   /* it scrolls by itself on short screens (data-lenis-prevent lets it) and never hands the scroll to the page */
  background: var(--ink-950); display: flex; flex-direction: column; gap: 28px; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity 260ms var(--ease-out), visibility 0s linear 260ms;
}
/* the dynamic height where the browser knows dvh. A declaration with a var() is only checked once computed, so a
   dvh line beside the vh one was kept by a browser without dvh (Chrome 107, Safari 15.3 and older) and then dropped
   to auto: the sheet ended at its content, or ran on past the screen with nothing to scroll (review 9 LOW 4) */
@supports (height: 100dvh) {
  .mobile-sheet { height: calc(100dvh - var(--header-h)); }
}
[data-nav-open] .mobile-sheet { opacity: 1; visibility: visible; transition-delay: 0s; }
.mobile-sheet ul { display: flex; flex-direction: column; }
.mobile-sheet a.m-main { display: block; padding: 14px 0; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; border-bottom: 1px solid var(--line-dark); }
.mobile-sheet a.m-sub { display: flex; justify-content: space-between; padding: 12px 0 12px 14px; font-size: 16px; color: var(--on-dark-2); border-bottom: 1px solid var(--line-dark); }
.mobile-sheet a.m-sub b { color: var(--on-dark-1); font-weight: 600; }
.mobile-sheet .btn { width: 100%; margin-top: auto; flex: none; }   /* a fixed-height column: without flex none the button was the one item that shrank (to 15px) */
/* shorter phones: the main links a little smaller, so the whole sheet fits 390x844; still shorter screens scroll */
@media (max-height: 860px) { .mobile-sheet a.m-main { padding-block: 11px; font-size: 24px; } }

@media (max-width: 900px) {
  .site-header .nav { display: none; }
  .burger { display: block; }
}
@media (min-width: 901px) {
  .mobile-sheet { display: none; }
}
[data-nav-open] body, body[data-nav-open] { overflow: hidden; }

/* ============ footer ============ */
.site-footer { position: relative; background: var(--ink-950); color: var(--on-dark-2); padding-top: 120px; overflow: hidden; border-top: 1px solid var(--line-dark); }   /* the contact section and the footer share one black */
.site-footer .footer-top { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--gutter); padding-bottom: 64px; border-bottom: 1px solid var(--line-dark); }
.site-footer .footer-mark .logo { display: inline-block; color: var(--on-dark-1); }
.site-footer .footer-mark .logo svg { height: 24px; width: auto; }
.site-footer .footer-mark p { margin-top: 26px; font-size: 22px; line-height: 1.5; font-weight: 600; letter-spacing: -0.025em; color: var(--on-dark-1); word-break: keep-all; }
.site-footer .footer-mark em { display: block; color: var(--brand-tint); }
.site-footer .footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px var(--gutter); align-content: start; justify-self: end; width: min(100%, 420px); }
.site-footer .footer-nav a { color: var(--on-dark-2); font-size: 15px; transition: color var(--t-fast) var(--ease-out); }
.site-footer .footer-nav a:hover { color: var(--on-dark-1); }
.site-footer .legal { padding-block: 40px 28px; display: grid; gap: 8px; font-size: 13px; line-height: 1.7; }
.site-footer .legal .row { display: flex; flex-wrap: wrap; column-gap: 10px; row-gap: 2px; }
.site-footer .legal .sep { color: var(--on-dark-3); }
.site-footer .legal b { color: var(--on-dark-1); font-weight: 500; }
.site-footer .policy { display: flex; gap: 18px; margin-top: 10px; }
.site-footer .policy a { color: var(--on-dark-1); font-size: 13px; font-weight: 500; }
.site-footer .copy { margin-top: 6px; font-size: 12.5px; color: var(--on-dark-3); }
.site-footer .footer-wordmark { margin-top: 36px; padding-bottom: 28px; }
.site-footer .footer-wordmark svg { width: 100%; height: auto; }

/* the separators would end a line at tablet widths: gaps alone set the items apart */
@media (max-width: 1024px) { .site-footer .legal .sep { display: none; } .site-footer .legal .row { column-gap: 18px; } }
@media (max-width: 900px) {
  .site-footer .footer-top { grid-template-columns: 1fr; gap: 40px; }
  .site-footer .footer-nav { justify-self: start; }
}
/* touch screens: small links get a 44px target. The padding is taken back by a negative margin where the link
   sits in running layout, so nothing moves; the footer menu rows become 44px apart instead (no overlapping targets) */
@media (pointer: coarse) {
  .site-header .logo { padding-block: 12.5px; }
  .site-footer .footer-mark .logo { padding-block: 10px; margin-block: -10px; }
  .btn-text { padding-block: 9px; margin-block: -9px; }
  .site-footer .footer-nav { row-gap: 0; }
  .site-footer .footer-nav a { padding-block: 9px; }
  .site-footer .policy a { padding-block: 11px; margin-block: -11px; min-width: 44px; text-align: center; }
}
@media (max-width: 640px) {
  .site-footer { padding-top: 88px; }
  .site-footer .footer-mark p { font-size: 19px; }
  .site-footer .legal .sep { display: none; }
  .site-footer .legal .row { flex-direction: column; }
  /* the wordmark reaches back over the wider left margin, so it sits in the middle of the screen */
  .site-footer .footer-wordmark { margin-left: calc(var(--margin) - var(--margin-l)); }
  /* the menu's links start on the logo's line */
  .mobile-sheet { padding-left: var(--margin-l); }
}

/* smooth scrolling (Lenis, motion build only) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }
/* while a section is pinned the page-long lane would slide over it: hide it until the section moves on */
svg.lane { transition: opacity 240ms var(--ease-out); }
.pin-lane-off svg.lane { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
