/* Insite Works — company portfolio (Synthesis) */
:root {
  --ink: #1e3540;
  --ink-deep: #15252c;
  --mist: #e8f3f6;
  --blue: #3f7890;
  --blue-mid: #7fb0c0;
  --panel-dark: #529cbf;
  --panel-light: #7fb0c0;
  /* One continuous wash across photo + copy columns (no hard vertical seam). */
  --stage-grad: linear-gradient(
    105deg,
    #edf5f8 0%,
    #d4e8ef 38%,
    #8ebed0 68%,
    #529cbf 100%
  );
  --stage-grad-mist: linear-gradient(
    105deg,
    #f2f8fa 0%,
    #dceef3 38%,
    #a9cdd9 68%,
    #7fb0c0 100%
  );
  --stage-grad-flip: linear-gradient(
    255deg,
    #edf5f8 0%,
    #d4e8ef 38%,
    #8ebed0 68%,
    #529cbf 100%
  );
  --stage-grad-mist-flip: linear-gradient(
    255deg,
    #f2f8fa 0%,
    #dceef3 38%,
    #a9cdd9 68%,
    #7fb0c0 100%
  );
  /* Shared mid-tone so stacked projects blend while scrolling between them. */
  --project-bridge: #c5dde8;
  --white: #fff;
  --font-d: "Syne", system-ui, sans-serif;
  --font-b: "Manrope", system-ui, sans-serif;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* clip (not hidden): hidden forces a scroll container and kills project-stage sticky */
  overflow-x: clip;
  scroll-padding-top: var(--header-h);
}
body {
  margin: 0;
  font-family: var(--font-b);
  color: var(--ink);
  background: var(--mist);
  line-height: 1.55;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-h);
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--mist) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 35;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
body.is-projects .site-header {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
body:not(.is-projects) { --header-h: 0px; }

.logo {
  font-family: var(--font-d);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.logo img { display: block; border-radius: 8px; }
.site-header nav {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.quiet { opacity: 0.55; }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  background: var(--ink);
}
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--ink) 82%, transparent) 0%, color-mix(in srgb, var(--ink) 35%, transparent) 48%, transparent 72%),
    linear-gradient(to top, color-mix(in srgb, var(--ink) 70%, transparent), transparent 42%);
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 6vw, 4rem);
  max-width: 40rem;
  color: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand-lockup {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3.35rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--white);
}
.brand-mark {
  display: block;
  width: clamp(88px, 14vw, 128px);
  height: clamp(88px, 14vw, 128px);
  border-radius: 22px;
  box-shadow: 0 12px 40px color-mix(in srgb, #000 40%, transparent);
}
.lede {
  margin: 1.25rem 0 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.92;
  max-width: 36rem;
  text-wrap: balance;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
  padding: 0.75rem 1.25rem;
  min-height: 2.75rem;
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}

.company {
  background: var(--mist);
  scroll-margin-top: var(--header-h);
}
.company-stage {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  grid-template-areas: "copy visual";
  overflow: hidden;
}
.company-visual {
  grid-area: visual;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--blue);
}
.company-copy {
  grid-area: copy;
  min-width: 0;
  min-height: 0;
  padding: clamp(1.75rem, 4.5vw, 3.25rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  background: var(--panel-light);
  color: var(--ink);
  overflow-y: auto;
}
.company-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}
.geo {
  position: absolute;
  pointer-events: none;
}
.geo-a {
  right: 0;
  top: 0;
  width: 46%;
  height: 42%;
  background: color-mix(in srgb, var(--blue-mid) 90%, var(--white));
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}
.geo-b {
  left: 0;
  top: 0;
  width: 32%;
  height: 24%;
  background: color-mix(in srgb, var(--blue) 62%, transparent);
  clip-path: polygon(0 0, 0 100%, 100% 0);
}
.geo-c {
  right: 0;
  bottom: 0;
  width: 28%;
  height: 26%;
  background: color-mix(in srgb, var(--ink) 58%, var(--blue));
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.company-copy h2 {
  margin: 0;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.45rem);
  letter-spacing: -0.02em;
}
.standfirst {
  margin: 0.85rem 0 0;
  max-width: 28rem;
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  font-weight: 500;
  line-height: 1.45;
}
.founder {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  max-width: 28rem;
}
.founder-role {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}
.founder-name {
  margin: 0.2rem 0 0;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
}
.founder-name + .body { margin-top: 0.7rem; }
.company-cta {
  align-self: flex-start;
  margin-top: 1.6rem;
  background: var(--ink);
  color: var(--white);
}
.company-cta:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
.company-copy .body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.company-copy .body a:hover { opacity: 0.75; }

#work,
#contact {
  scroll-margin-top: var(--header-h);
}
/* One viewport per project — snap to base, then JS cycles photos while docked. */
.project {
  position: relative;
  background: var(--project-bridge);
}
.project-scrub {
  position: relative;
  height: calc(100svh - var(--header-h));
  min-height: calc(100vh - var(--header-h));
}
@media (min-width: 861px) {
  html {
    scroll-snap-type: y mandatory;
  }
  .project-scrub {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-top: var(--header-h);
  }
  #company,
  #contact {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-top: var(--header-h);
  }
}
.project-stage {
  position: relative;
  top: auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  overflow: hidden;
  background: var(--stage-grad);
}
.project-stage::before,
.project-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(4.5rem, 18vh, 9rem);
  z-index: 2;
  pointer-events: none;
}
.project-stage::before {
  top: 0;
  background: linear-gradient(
    180deg,
    var(--project-bridge) 0%,
    color-mix(in srgb, var(--project-bridge) 55%, transparent) 42%,
    transparent 100%
  );
}
.project-stage::after {
  bottom: 0;
  background: linear-gradient(
    0deg,
    var(--project-bridge) 0%,
    color-mix(in srgb, var(--project-bridge) 55%, transparent) 42%,
    transparent 100%
  );
}
.project-flip .project-stage {
  grid-template-columns: 0.7fr 1.3fr;
  background: var(--stage-grad-flip);
}
.project-mist .project-stage { background: var(--stage-grad-mist); }
.project-mist.project-flip .project-stage { background: var(--stage-grad-mist-flip); }
.project-viewport {
  position: relative;
  min-width: 0;
  background: transparent;
  container-type: size;
  overflow: hidden;
  order: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-flip .project-viewport {
  order: 2;
}
.project-film {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
}
.project-slide {
  grid-area: 1 / 1;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 1.8vw, 1.35rem);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}
.project-slide.is-active { opacity: 1; z-index: 1; }
.project-slide img {
  width: auto;
  height: auto;
  max-width: min(80cqi, calc(100cqi - 2.5rem));
  max-height: min(75cqh, calc(100cqh - 4.5rem));
  object-fit: contain;
  display: block;
  box-sizing: border-box;
  background: #ffffff;
  padding: clamp(0.45rem, 1vw, 0.75rem);
  border: 1px solid color-mix(in srgb, #1e3540 18%, transparent);
  box-shadow:
    0 1px 0 color-mix(in srgb, #ffffff 80%, transparent) inset,
    0 10px 28px color-mix(in srgb, #1e3540 16%, transparent);
}
.project-slide--stack { flex-direction: column; gap: 0.55rem; }
.project-slide--stack img {
  max-height: calc((min(75cqh, 100cqh - 4.5rem) - 0.55rem) / 2);
}
.counter {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  right: auto;
  width: min(11rem, calc(100% - 2rem));
  z-index: 3;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #1e3540;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.counter i[data-progress] {
  flex: 1;
  height: 2px;
  display: block;
  background: #3f7890;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 0 1px color-mix(in srgb, #1e3540 14%, transparent);
}

.panel {
  order: 2;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow-y: auto;
  background: transparent;
  color: #1e3540;
}
/* Equal flex spacers: text block midpoint lines up with photo midpoint. */
.panel::before,
.panel::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
  pointer-events: none;
}
.project-flip .panel { order: 1; }
.project-mist .panel { background: transparent; }
.titleblock { margin: 1.25rem 0 0; padding: 0; max-width: 22rem; }
.titleblock div {
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.titleblock dt {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, #1e3540 70%, transparent);
  padding-top: 0.12rem;
}
.titleblock dd { margin: 0; }
.panel h2 {
  margin: 0;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  letter-spacing: -0.02em;
  color: #1e3540;
}
.body {
  margin: 1.15rem 0 0;
  max-width: 28rem;
  font-size: 0.95rem;
  color: color-mix(in srgb, #1e3540 88%, transparent);
}

.mobile-rail { display: none; }
.mobile-gallery { display: none; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 2.5rem clamp(1.25rem, 4vw, 3rem);
  background: var(--ink-deep);
  color: color-mix(in srgb, var(--mist) 70%, transparent);
  font-size: 0.9rem;
}
footer strong {
  display: block;
  color: var(--white);
  font-family: var(--font-d);
  margin-bottom: 0.35rem;
}
footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--blue-mid);
}
.page-next {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  left: auto;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 30;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  background: color-mix(in srgb, var(--white) 88%, transparent);
  color: var(--ink);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 18%, transparent);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.is-projects .page-next {
  opacity: 0.9;
  pointer-events: auto;
}
.page-next:hover { opacity: 1; }

@media (min-width: 861px) and (max-height: 820px) {
  .panel {
    padding-top: 1.35rem;
    padding-bottom: 1.35rem;
  }
  .panel h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
  .titleblock { margin-top: 0.9rem; }
  .titleblock div { padding: 0.28rem 0; }
  .body { margin-top: 0.85rem; font-size: 0.9rem; }
}

@media (max-width: 860px) {
  .site-header {
    top: 0;
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 1rem 0;
    align-items: center;
  }
  .site-header nav { gap: 0.85rem; font-size: 0.82rem; }
  .site-header nav a { flex-shrink: 0; }
  .logo { font-size: 0; gap: 0; }
  .logo img { width: 28px; height: 28px; }

  .hero {
    min-height: 100svh;
    align-items: end;
    justify-items: stretch;
  }
  .hero-photo { object-position: center 35%; }
  .hero-scrim {
    background:
      linear-gradient(to top, color-mix(in srgb, var(--ink) 92%, transparent) 0%, color-mix(in srgb, var(--ink) 62%, transparent) 42%, color-mix(in srgb, var(--ink) 28%, transparent) 72%, color-mix(in srgb, var(--ink) 18%, transparent) 100%),
      linear-gradient(to bottom, color-mix(in srgb, var(--ink) 40%, transparent), transparent 28%);
  }
  .hero-copy {
    width: 100%;
    max-width: none;
    padding:
      max(4.5rem, calc(env(safe-area-inset-top) + 3rem))
      1.25rem
      max(2.25rem, calc(env(safe-area-inset-bottom) + 1.5rem));
    align-items: center;
  }
  .brand-lockup {
    font-size: clamp(1.45rem, 6.8vw, 2rem);
    letter-spacing: 0.045em;
    gap: 0.85rem;
  }
  .brand-mark {
    width: 84px;
    height: 84px;
    border-radius: 18px;
  }
  .lede {
    font-size: 1.05rem;
    max-width: 22rem;
  }
  .cta {
    width: min(100%, 20rem);
    margin-top: 1.5rem;
  }

  .company-stage {
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .company-visual {
    min-height: min(48vh, 22rem);
    height: min(48vh, 22rem);
  }
  .company-visual img { object-position: 50% 40%; }
  .company-copy {
    padding: 1.5rem 1.25rem max(2.5rem, calc(env(safe-area-inset-bottom) + 4.75rem));
  }
  .company-copy h2 { font-size: clamp(1.45rem, 6vw, 1.85rem); }
  .standfirst,
  .founder,
  .company-copy .body {
    max-width: none;
  }
  .company-cta { width: min(calc(100% - 4.5rem), 20rem); }

  .project-scrub { height: auto !important; scroll-snap-align: none; }
  .project-stage {
    position: static;
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .project-stage::before,
  .project-stage::after {
    display: none;
  }
  .project-viewport,
  .project-film,
  .counter {
    display: none;
  }
  .panel,
  .project-flip .panel {
    order: 0;
    padding: 1.5rem 1.25rem 1.15rem;
  }
  .panel::before,
  .panel::after {
    display: none;
  }
  .panel h2 { font-size: clamp(1.45rem, 6vw, 1.85rem); }
  .titleblock { max-width: none; }
  .titleblock div { grid-template-columns: 4.75rem 1fr; }
  .body { max-width: none; font-size: 0.94rem; }

  .mobile-rail {
    display: block;
    background: #e8f3f6;
    border-top: 1px solid color-mix(in srgb, #1e3540 10%, transparent);
  }
  .mobile-gallery {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem 0.65rem;
    scrollbar-width: none;
  }
  .mobile-gallery::-webkit-scrollbar { display: none; }
  .mobile-gallery img {
    flex: 0 0 auto;
    width: min(78vw, 22rem);
    height: auto;
    max-height: min(58vh, 28rem);
    aspect-ratio: auto;
    object-fit: contain;
    scroll-snap-align: center;
    display: block;
    background: #ffffff;
    padding: 0.5rem;
    border: 1px solid color-mix(in srgb, #1e3540 18%, transparent);
    box-shadow:
      0 1px 0 color-mix(in srgb, #ffffff 80%, transparent) inset,
      0 10px 28px color-mix(in srgb, #1e3540 16%, transparent);
  }
  .mobile-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0 1.25rem 1.1rem;
    color: #1e3540;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
  }
  .mobile-meta i[data-mobile-progress] {
    flex: 1;
    height: 2px;
    display: block;
    background: #3f7890;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 0 1px color-mix(in srgb, #1e3540 14%, transparent);
  }

  footer {
    flex-direction: column;
    padding: 2rem 1.25rem max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
  }
  .page-next {
    width: 3rem;
    height: 3rem;
    font-size: 1.1rem;
  }
}
