/* Satoshi, the home page's typeface (same files the home page uses) */
@font-face {
  font-family: "Satoshi";
  src: url("/portfolio/asset-0-09c176fbb5fd.ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* previous / next project, on the home page's dotted cream paper */
.ip-project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px max(24px, calc((100% - 1360px) / 2)) 36px;
  border-top: 1px solid #e4e0d7;
  background: #faf8f3 radial-gradient(circle, rgba(21, 20, 19, 0.11) 1px, transparent 1.4px) 0 0 / 22px 22px;
  color: #151413;
  font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.ip-project-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 0 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.ip-project-next {
  margin-left: auto;
  text-align: right;
}

.ip-project-arrow {
  flex: none;
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: transform 0.22s cubic-bezier(0.22, 1.3, 0.36, 1);
}

.ip-project-previous:hover .ip-project-arrow {
  transform: translateX(-4px);
}

.ip-project-next:hover .ip-project-arrow {
  transform: translateX(4px);
}

.ip-project-link:focus-visible {
  outline: 2px solid #1b7590;
  outline-offset: 5px;
  border-radius: 8px;
}

/* label and title share one line; the links size to their text, and only a window
   too narrow for both trims with an ellipsis (phones wrap instead, below) */
.ip-project-text {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ip-project-direction {
  color: #66625c;
  font-size: 15px;
  font-weight: 500;
}

.ip-project-direction::after {
  content: " · ";
}

.ip-project-title {
  font-size: 17px;
  font-weight: 700;
}

.ip-project-link:hover .ip-project-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 720px) {
  .ip-project-nav {
    gap: 12px;
    padding: 20px 14px 26px;
  }

  .ip-project-link {
    gap: 8px;
  }

  .ip-project-arrow {
    width: 36px;
    height: 36px;
  }

  /* phones: the arrow already says which way, so only the project name stays */
  .ip-project-direction {
    display: none;
  }

  .ip-project-title {
    font-size: 14px;
  }

  /* phones: no room for one line, so the title wraps and still shows in full */
  .ip-project-text {
    white-space: normal;
    text-wrap: pretty;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ip-project-arrow {
    transition: none;
  }
}

/* the house from the home page, pinned top-left on every case study so home is one click away.
   It copies the home page's nav frame exactly (.nav > .wrap > .home-corner in portfolio.css):
   a bar 40px from the top, a centred wrap as wide as the hero and as tall as the nav pill (58px),
   and the house centred on it. 34px wide, 38px and 48px from the window's edge on wide desktops,
   and on phones a 46px tap area with 6px padding so the drawing itself stays 34px */
.ip-home-bar {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 1000;
  padding-block: 40px 16px;
  pointer-events: none;
}

.ip-home-wrap {
  position: relative;
  box-sizing: border-box;
  height: 58px;
  max-width: calc(540px + 340px + clamp(16px, 2vw, 32px) + 32px);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.ip-home {
  pointer-events: auto;
  position: absolute;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: 50%;
  transform: translateY(-50%);
  display: block;
  box-sizing: border-box;
  width: 34px;
  transition: transform 0.2s ease;
}

.ip-home img {
  display: block;
  width: 100%;
  height: auto;
  filter: url(#ipHomeSticker) drop-shadow(0 2px 3px rgba(21, 20, 19, 0.16));
}

.ip-home-back {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #24384a;
  text-decoration: none;
}

.ip-home-back .ip-project-arrow {
  width: 44px;
  height: 44px;
  filter: none;
}

.ip-home-back:hover .ip-project-arrow {
  transform: translateX(-4px);
}

.ip-home:hover {
  transform: translateY(-50%) rotate(-6deg) scale(1.08);
}

.ip-home:focus-visible {
  outline: 2px solid #1b7590;
  outline-offset: 4px;
  border-radius: 8px;
}

/* Worth the Wait: inside its own sticky top bar instead of floating over its title */
.ip-home-inline {
  position: static;
  flex: none;
  transform: none;
}

.ip-home-inline:hover {
  transform: rotate(-6deg) scale(1.08);
}

@media (min-width: 1025px) {
  .ip-home {
    left: calc(50% - 50vw + 48px);
    width: 38px;
  }
}

@media (max-width: 820px) {
  .ip-home-bar {
    padding-block: 16px 12px;
  }

  .ip-home-wrap {
    height: 46px;
  }

  .ip-home {
    width: 46px;
    height: 46px;
    padding: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ip-home {
    transition: none;
  }
}

/* no lone word on the last line: paragraphs wrap "pretty", short labels and headings "balance" */
html{text-wrap-style:pretty}
:where(h1,h2,h3,h4,h5,h6,q,b,strong,em,small,span,figcaption,label,button,a,li,dt,th,td,div){text-wrap-style:balance}
:where(p,blockquote,dd){text-wrap-style:pretty}
