.back-to-top {
  position: fixed;
  z-index: 30;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 38px;
  height: 34px;
  padding: 0;
  border: 1px solid #80808065;
  border-radius: 8px;
  background: #ffffff26;
  backdrop-filter: blur(5px);
  color: #111;
  cursor: pointer;
}
.back-to-top svg { width: 15px; height: 15px; }
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: #ffffff40; }
.back-to-top:focus-visible { outline: 2px solid #315ee8; outline-offset: 3px; }

:root {
  background-color: #f8f5ed;
  --skeleton-base: #ebe5d9;
}

:root.home-root {
  background-color: #315ee8;
  --skeleton-base: #426be8;
}

.study-alt { --skeleton-base: #e3e8de; }
.study-tip { --skeleton-base: #332b1f; }
.study-teenspirit { --skeleton-base: #30283a; }

img.media-pending {
  background-color: var(--skeleton-base) !important;
}

.projects-root { scroll-behavior: auto; }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-group(root) { animation-duration: 220ms; }

  ::view-transition-old(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  ::view-transition-new(root) {
    animation: projects-crossfade 220ms ease-out both;
    mix-blend-mode: normal;
  }
}

@keyframes projects-crossfade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Shared navigation and editorial pages */
.topbar .site-nav { flex-wrap: wrap; justify-content: flex-end; gap: 10px clamp(12px, 2.2vw, 34px); }
.site-nav a { white-space: nowrap; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.nav-toggle { display: none; }
.site-page { padding-bottom: 30px; }
.projects > .archive-heading {
  align-items: flex-end;
  gap: 24px;
  border-bottom: 1px solid #e2dbcc;
}
.projects > .archive-heading + .filter-bar { border-top: 0; }
.projects > .archive-heading h1 { overflow-wrap: anywhere; }
.section-intro .intro-label { font: 11px var(--mono); letter-spacing: .03em; color: #6e6e6e; }
.section-intro .filter-hint { max-width: 72ch; }
@media (max-width: 720px) {
  .section-intro .intro-label { font-size: 10px; }
}
.archive-heading > div { min-width: 0; }
.archive-heading .archive-coordinate { position: static; flex: 0 0 auto; max-width: 24ch; padding-bottom: 0; }
@media (max-width: 560px) {
  .projects > .archive-heading h1 { font-size: clamp(30px, 12vw, 62px); }
}
/* Section headings used by the typography guide and the distribution cards. */
.site-page :is(.competency-heading, .tech-heading) > h2 {
  margin: 0;
  color: var(--ink, #242424);
  font: 400 25px/1.2 var(--mono);
  letter-spacing: -.05em;
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .site-page :is(.competency-heading, .tech-heading) > h2 { font-size: 23px; }
}

.site-page h2:not(.competency-heading h2, .tech-heading h2, .card-heading),
.site-page h2.card-heading { margin: 0 0 12px; font-size: clamp(24px, 3vw, 38px); font-weight: 400; letter-spacing: -.035em; line-height: 1.15; }
.site-page p { max-width: 72ch; }
.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.editorial-grid .case-body { padding-bottom: 24px; }
.site-grid p { margin: 0 0 15px; }
.site-links { display: flex; gap: 8px; flex-wrap: wrap; }
.site-page .site-links > a {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid #dcd4c3;
  border-radius: 4px;
  background: #fffdf8;
  color: #45423c;
  font: 11px/1.45 var(--mono);
  text-decoration: none;
}
.site-page .site-links > a:hover,
.site-page .site-links > a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.site-action-arrow { flex: none; }
.site-page a:not(.brand, .site-links > a) { color: #2449bf; text-decoration: underline; text-underline-offset: 3px; }
.site-callout { margin-top: 42px; padding: 25px; background: #f0ebdf; border-radius: 8px; }
.site-legal { max-width: 82ch; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .topbar:has(.site-nav) { height: auto; min-height: 76px; padding-block: 16px; flex-wrap: wrap; gap: 14px; }
  .topbar nav.site-nav { width: 100%; justify-content: flex-start; gap: 2px 16px; font-size: 12px; }
  .topbar nav.site-nav a { display: inline-flex; align-items: center; min-height: 36px; }
  html:has(.mobile-nav-ready) { scroll-padding-top: 64px; }
  .topbar.mobile-nav-ready {
    --mobile-nav-background: var(--bg, #f8f5ed);
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    max-width: none;
    height: 64px;
    min-height: 64px;
    padding: 0 clamp(16px, 5vw, 28px);
    flex-wrap: nowrap;
    background: var(--mobile-nav-background);
  }
  .home-page .topbar.mobile-nav-ready { --mobile-nav-background: #315ee8; }
  body:has(.mobile-nav-ready)::before {
    content: "";
    position: fixed;
    inset: 64px 0 0;
    z-index: 39;
    background: rgb(22 28 42 / 16%);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility 0s .24s;
  }
  body:has(.mobile-nav-ready .nav-toggle[aria-expanded="true"])::before {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .mobile-nav-ready .nav-toggle {
    display: grid;
    place-items: center;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  .nav-toggle svg {
    grid-area: 1 / 1;
    transition: opacity .22s ease, transform .22s ease;
  }
  .nav-toggle .nav-close { opacity: 0; transform: scale(.8); }
  .nav-toggle[aria-expanded="true"] .nav-open { opacity: 0; transform: scale(.8); }
  .nav-toggle[aria-expanded="true"] .nav-close { opacity: 1; transform: none; }
  .topbar.mobile-nav-ready nav.site-nav {
    display: grid;
    position: absolute;
    inset: 100% 0 auto;
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    padding: 8px clamp(16px, 5vw, 28px) 16px;
    border: 0;
    background: var(--mobile-nav-background);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .24s ease, transform .24s ease, visibility 0s .24s;
  }
  .topbar.mobile-nav-ready .nav-toggle[aria-expanded="true"] + nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition-delay: 0s;
  }
  .topbar.mobile-nav-ready nav.site-nav a {
    min-height: 46px;
    font-size: 14px;
    border: 0;
  }

  .site-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) and (prefers-reduced-motion: reduce) {
  body:has(.mobile-nav-ready)::before,
  .mobile-nav-ready .nav-toggle svg,
  .topbar.mobile-nav-ready nav.site-nav { transition: none; }
}

/* Contacts and footer shared by portfolio and editorial pages */
.contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 60px; padding: 34px 0 45px; border-top: 1px solid #e2dbcc; }
.contacts h2 { margin: 0; font: 23px var(--mono); letter-spacing: -.04em; }
.contact-details { display: grid; justify-items: start; gap: 10px; }
.contact-details a:hover { color: #315ee8; }
.contact-email { font-size: clamp(21px, 3vw, 42px); line-height: 1.12; overflow-wrap: anywhere; }
.contact-address { margin-top: 12px; }
.contact-address address { font-style: normal; margin: 4px 0; }
.contact-address .eyebrow, .contact-address .text-link { font: 10px var(--mono); }
.footer.site-footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; font: 10px/1.5 var(--mono); }
.contact-details .contact-address { justify-self: stretch; }
@media (max-width: 800px) {
  .footer.site-footer { grid-template-columns: 1fr; }
}

.distribution-grid > .case {
  align-items: stretch;
  background: #f3efe5;
  border-color: #e2d9c7;
}
.distribution-logos {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}
.distribution-logos img {
  display: block;
  min-width: 0;
  width: auto;
  max-width: calc((100% - 20px) / 2);
  height: 48px;
  object-fit: contain;
  object-position: left center;
}
.distribution-grid .case-body {
  padding: 23px clamp(20px, 2.3vw, 25px) 24px;
}
.distribution-grid .distribution-card-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding-bottom: 16px;
}
.site-page .distribution-card-heading .card-heading { margin-bottom: 0; }
.distribution-grid .case-body p { color: #68645c; }
.distribution-grid > .distribution-consultation { grid-column: 1 / -1; }
.distribution-consultation .site-links { margin-top: 14px; }
@media (max-width: 720px) {
  .distribution-grid > .case:nth-child(n) { grid-column: auto; }
}
.product-showcase { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.product-card .product-visual { display: grid; }
.product-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-card .product-adepta { align-content: center; gap: clamp(12px,3vw,34px); padding: 7%; background: #152949 !important; color: #f5f7ff; }
.product-wordmark { font: clamp(20px,4vw,52px) var(--mono); letter-spacing: -.065em; }
.product-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 5px; align-items: center; font: clamp(9px,1.15vw,15px)/1.25 var(--mono); }
.product-flow span:nth-child(odd) { padding: 8px 5px; border: 1px solid #8ca7d488; border-radius: 4px; background: #254168; text-align: center; }
.product-copy h2 small { font: 12px var(--mono); color: #57534b; vertical-align: middle; }
.product-copy .site-links { margin-top: 15px; padding-bottom: 12px; }
@media(max-width:800px) {
  .contacts { grid-template-columns: 1fr; margin-top: 40px; padding-block: 26px 35px; }
  .product-showcase { grid-template-columns: 1fr; }
}

.editorial-grid > .case:nth-child(n),
.product-showcase > .case:nth-child(n) { grid-column: auto; }
.editorial-grid .case h2,
.product-showcase .case h2 {
  margin: 0 0 11px;
  font-size: clamp(27px, 3vw, 32px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.15;
}
.editorial-grid .site-links { margin-top: 14px; }

.editorial-grid > .case .case-body,
.product-showcase > .case .case-body { padding-inline: clamp(20px, 2.3vw, 25px); }

.contact-page-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-block: 28px;
  border-bottom: 1px solid var(--line);
}
.contact-page-row h2 { font: clamp(18px, 2vw, 25px) var(--mono); margin: 0; }
.contact-page-list {
  display: grid;
  grid-template-columns: minmax(100px, 30%) minmax(0, 1fr);
  gap: 12px 16px;
  margin: 0;
}
.contact-page-list dt, .contact-page-codes summary, .contact-page-form label {
  font: 12px/1.5 var(--mono);
}
.contact-page-list dd { margin: 0; overflow-wrap: anywhere; }
.contact-page-list address { font-style: normal; }
.contact-page-form, .contact-page-form label { display: grid; gap: 10px; }
.contact-page-form { gap: 16px; }
.contact-page-form input, .contact-page-form textarea {
  width: 100%;
  padding: 10px;
  font: 16px/1.4 Gilroy, Arial, sans-serif;
  color: inherit;
  background: #fffdf8;
  border: 1px solid #dcd4c3;
  border-radius: 4px;
}
.contact-page-form textarea { resize: vertical; }
.contact-page-form button {
  justify-self: start;
  padding: 10px 12px;
  color: #fff;
  background: #315ee8;
  border: 1px solid #315ee8;
  border-radius: 4px;
  font: 12px var(--mono);
  cursor: pointer;
}
.contact-page-form p { margin: 0; color: #68645c; font-size: 14px; }
.contact-page-codes { margin-top: 18px; }
.contact-page-codes summary { cursor: pointer; }
.contact-page-codes dl { margin-top: 12px; grid-template-columns: 74px minmax(0, 1fr); }
@media (max-width: 720px) {
  .contact-page-row { grid-template-columns: 1fr; }
}

.contact-page-row.contact-form-section { border-bottom: 0; }
.site-page .contact-form-section #contact-form-title {
  margin: 0;
  font: 23px var(--mono);
  letter-spacing: -.04em;
}
.contact-consent {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.contact-consent-copy {
  display: grid;
  gap: 4px;
  padding-top: 1px;
}
.contact-page-form .contact-consent label { display: block; cursor: pointer; }
.contact-consent input:focus-visible { outline: 2px solid #315ee8; outline-offset: 3px; }
.contact-page-form .contact-consent input {
  appearance: none;
  position: relative;
  box-sizing: border-box;
  margin: 0;
  width: 34px;
  height: 20px;
  padding: 0;
  border-radius: 20px;
  background: #e3ddd0;
  cursor: pointer;
}
.contact-consent input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  transition: transform .18s ease;
}
.contact-consent input:checked { background: #315ee8; border-color: #315ee8; }
.contact-consent input:checked::before { transform: translateX(14px); }
.contact-consent a { justify-self: start; color: #555b69; font: 12px/1.5 var(--mono); text-decoration: underline; text-underline-offset: 3px; }
.contact-page-form button:disabled { opacity: .65; cursor: wait; }
#contact-status:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .contact-consent input::before { transition: none; }
}


/* One non-blocking indicator for documents that take time to initialize. */
:root.page-loading::after {
  content: "";
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 2px;
  background: #315ee8;
  pointer-events: none;
  opacity: 0;
  transform-origin: left;
  animation: page-load-progress 3.6s 180ms ease-out both;
}
:root.home-root.page-loading::after { background: #edf2ff; }
@keyframes page-load-progress {
  from { opacity: 0; transform: scaleX(.08); }
  8% { opacity: 1; }
  to { opacity: 1; transform: scaleX(.92); }
}
@media (prefers-reduced-motion: reduce) {
  :root.page-loading::after { animation: none; opacity: 1; }
}
.site-nav a.is-current-section { text-decoration: underline; text-underline-offset: 5px; }

