.portfolio {
  --gallery-bg: var(--blue);
  --gallery-text: #fff;
  --gallery-muted: #e1e9ff;
  --gallery-line: #ffffff45;
  background: var(--gallery-bg);
  color: var(--gallery-text);
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: 105px 90px;
}
.portfolio:before {
  content: "↗";
  position: absolute;
  top: 50px;
  right: 3%;
  font-size: 260px;
  line-height: 1;
  color: #ffffff10;
  z-index: -1;
}
.portfolio-intro {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 32px 70px;
}
.portfolio-heading .eyebrow {
  color: #e1e9ff;
}
.portfolio-heading h2 {
  font-size: clamp(42px, 5vw, 74px);
  font-weight: 600;
  line-height: 1.08;
  margin-top: 25px;
}
.portfolio-heading h2 em {
  display: block;
  font-style: normal;
  color: var(--gold);
  font-size: 1.07em;
  margin-top: 8px;
}
.portfolio-description {
  align-self: end;
  max-width: 340px;
  margin-left: auto;
}
.portfolio-description > p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--gallery-muted);
  margin-top: 19px;
}
.portfolio-count {
  display: flex;
  align-items: center;
  gap: 17px;
  font-size: 12px;
  color: var(--gallery-muted);
}
.portfolio-count b {
  font-size: 62px;
  line-height: 1;
  font-weight: 400;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.portfolio-scenes {
  margin-top: 56px;
  margin-bottom: 65px;
}








.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  row-gap: 76px;
}
.portfolio-card {
  min-width: 0;
  position: relative;
}
.portfolio-browser {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid #ffffff80;
  border-radius: 11px;
  background: #f9f8fa;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px #07287840;
  text-align: left;
  transition: border-color 0.18s ease-out;
}
.portfolio-browser:hover {
  border-color: var(--gallery-muted);
}
.portfolio-browser:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 6px;
}
.portfolio-browserbar {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 14px;
  color: #52617b;
  background: #f5f7fc;
  font-size: 12px;
  font-weight: 600;
}
.portfolio-dots {
  display: flex;
  gap: 4px;
}
.portfolio-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ccd5e5;
}
.portfolio-dots i:first-child {
  background: var(--project-accent);
}
.portfolio-browserbar > span:last-child {
  font-size: 14px;
}
.portfolio-screen {
  display: block;
  position: relative;
  height: clamp(280px, 52svh, 520px);
  overflow: hidden;
  background: #fff;
  container-type: size;
}
.portfolio-shot {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  transform: translateY(0);
}
.portfolio-expand {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  background: var(--navy);
  color: white;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  border-radius: 30px;
  opacity: 0;
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out;
  box-shadow: 0 4px 6px -1px #0003;
}
.portfolio-expand svg {
  width: 16px;
  height: 16px;
}
.portfolio-browser:hover .portfolio-expand,
.portfolio-browser:focus-visible .portfolio-expand {
  opacity: 1;
  transform: translate(-50%, 0);
}
.portfolio-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 5px 5px;
  gap: 20px;
}
.portfolio-category {
  display: block;
  color: var(--gallery-muted);
  font-size: 12px;
  margin-bottom: 7px;
}
.portfolio-caption h3 {
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
}
.portfolio-caption > a {
  border: 1px solid var(--gallery-line);
  width: 39px;
  height: 39px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  transition: transform 0.18s ease-out;
}
.portfolio-caption > a:hover {
  transform: rotate(-35deg);
}
.portfolio-caption > a svg {
  width: 18px;
  height: 18px;
}
.portfolio-outro {
  padding-top: 45px;
  text-align: center;
}
.portfolio-outro h3 {
  max-width: 850px;
  margin-inline: auto;
  text-wrap: balance;
  font-size: 37px;
  line-height: 1.3;
  font-weight: 600;
  margin-block: 28px;
}
.portfolio-outro h3 em {
  font-style: normal;
  display: block;
  color: var(--gold);
  font-size: 1.1em;
}
.portfolio-outro .button {
  width: auto;
  min-width: 250px;
  gap: 35px;
  display: inline-flex;
}
#portfolio-dialog {
  width: min(1160px, calc(100% - 40px));
  height: calc(100dvh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  border-radius: 13px;
}
#portfolio-dialog::backdrop {
  background: #102044db;
}
.portfolio-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
  height: 86px;
}
.portfolio-dialog-head h2 {
  font-size: 19px;
  margin: 0;
  padding: 0;
}
.portfolio-dialog-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.portfolio-dialog-head > a {
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
  margin-left: auto;
}
.portfolio-dialog-head > button {
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--light);
}
.portfolio-dialog-head > button svg {
  width: 18px;
  height: 18px;
}
.portfolio-dialog-body {
  height: calc(100% - 86px);
  overflow: auto;
  overscroll-behavior: contain;
  background: white;
}
.portfolio-dialog-body:focus-visible {
  outline-offset: -3px;
}
.portfolio-dialog-body img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 1100px) {
  .portfolio {
    padding-top: 85px;
  }
  .portfolio-intro {
    gap: 35px 40px;
    grid-template-columns: 1.5fr 1fr;
  }
  .portfolio-heading h2 {
    font-size: 52px;
  }
  .portfolio-description > p {
    font-size: 12px;
  }
  .portfolio-count b {
    font-size: 50px;
  }
  .portfolio-count {
    font-size: 12px;
  }
  
  .portfolio-grid {
    gap: 48px;
  }
  .portfolio-caption h3 {
    font-size: 20px;
  }
  .portfolio-browserbar {
    font-size: 11px;
  }
  .portfolio-screen {
    height: clamp(280px, 52svh, 520px);
  }
}
@media (max-width: 760px) {
  .portfolio {
    padding-block: 60px 55px;
  }
  .portfolio:before {
    font-size: 170px;
    top: 60px;
    right: 0;
  }
  .portfolio-intro {
    grid-template-columns: 1fr;
    gap: 27px;
  }
  .portfolio-heading h2 {
    font-size: clamp(36px, 7.5vw, 53px);
  }
  .portfolio-heading h2 em {
  display: block;
  font-style: normal;
    max-width: 100%;
  }
  .portfolio-description {
    margin-left: 0;
    max-width: 430px;
    display: flex;
    gap: 20px;
    align-items: center;
  }
  .portfolio-count {
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    align-items: flex-start;
    flex: none;
    max-width: 80px;
    line-height: 1.5;
  }
  .portfolio-count b {
    font-size: 45px;
  }
  .portfolio-description > p {
    margin-top: 0;
    font-size: 12px;
  }
  .portfolio-scenes {
    margin-top: 40px;
  }
  
  
  
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  
  .portfolio-screen {
    height: clamp(240px, 48svh, 440px);
  }
  .portfolio-browserbar {
    height: 32px;
    font-size: 12px;
    padding-inline: 12px;
  }
  .portfolio-caption {
    padding: 16px 3px 0;
  }
  .portfolio-caption h3 {
    font-size: 21px;
  }
  .portfolio-category {
    font-size: 12px;
  }
  .portfolio-caption > a {
    width: 36px;
    height: 36px;
  }
  .portfolio-expand {
    opacity: 1;
    transform: translate(-50%, 0);
    font-size: 12px;
    padding: 10px 14px;
    bottom: 16px;
  }
  .portfolio-outro {
    padding-top: 32px;
  }
  .portfolio-outro h3 {
    font-size: 30px;
    margin-block: 25px;
  }
  .portfolio-outro .button {
    font-size: 12px;
  }
  .portfolio-dialog-head {
    height: 110px;
    padding: 15px;
    flex-wrap: wrap;
    gap: 7px 12px;
  }
  .portfolio-dialog-head > div {
    width: calc(100% - 48px);
  }
  .portfolio-dialog-head h2 {
    font-size: 16px;
  }
  .portfolio-dialog-head p {
    font-size: 11px;
  }
  .portfolio-dialog-head > a {
    font-size: 12px;
    order: 3;
    margin-left: 0;
  }
  .portfolio-dialog-head > button {
    margin-left: auto;
  }
  .portfolio-dialog-body {
    height: calc(100% - 110px);
  }
  #portfolio-dialog {
    width: calc(100% - 18px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 9px;
  }
}


.portfolio :focus-visible{outline-color:var(--gold)}
.portfolio-heading .eyebrow:before{background:var(--gold)}
@media(max-width:760px){.portfolio-heading h2{overflow-wrap:break-word}}

/* A pinned viewport makes the travel visible independently of the document scroll. */
.portfolio{--flight-top:110px}
/* Screen-space spacing stays constant while each card independently changes depth. */
@keyframes portfolio-fly-past {
  from {transform:translateY(calc(200% + 64px))}
  to {transform:translateY(calc(-200% - 64px))}
}
@keyframes portfolio-depth {
  0% {transform:perspective(900px) translateZ(-1000px) rotateX(-30deg)}
  40% {transform:perspective(900px) translateZ(0) rotateX(-6deg)}
  60% {transform:perspective(900px) translateZ(0) rotateX(6deg)}
  100% {transform:perspective(900px) translateZ(-450px) rotateX(30deg)}
}
@keyframes portfolio-inner-scroll {
  0%, 50% {transform:translateY(0)}
  to {transform:translateY(clamp(-210px,calc(-100% + 100cqh),0px))}
}
.portfolio.is-flight .portfolio-scenes{
  height:calc(252svh + var(--stage-height,600px));position:relative;view-timeline:--portfolio-flight block;
  margin-bottom:24px;
  view-timeline-inset:var(--flight-top) calc(100svh - var(--flight-top) - var(--stage-height,600px));
}
.portfolio.is-flight .portfolio-stage{
  position:sticky;top:var(--flight-top);height:var(--stage-height,600px);
  display:grid;align-items:start;overflow:visible;
}
.portfolio.is-flight .portfolio-grid{width:min(1195px,calc(106.25% - 155px));margin-inline:auto;gap:0 45px}
.portfolio.is-flight .portfolio-card{
  --start:var(--row-start);--end:var(--row-end);
  grid-row:1;grid-column:var(--column);
  animation:portfolio-fly-past linear both;animation-timeline:--portfolio-flight;
  animation-range:contain var(--start) contain var(--end);
}
.portfolio.is-flight .portfolio-card-surface{
  animation:portfolio-depth linear both;animation-timeline:--portfolio-flight;
  animation-range:contain var(--start) contain var(--end);
}
.portfolio.is-flight .portfolio-screen{height:clamp(262px,45svh,475px)}
/* Render at the closest size; never magnify a lower-resolution composited surface. */
.portfolio.is-flight .portfolio-browserbar{height:45px}
.portfolio.is-flight .portfolio-shot{
  animation:portfolio-inner-scroll linear both;animation-timeline:--portfolio-flight;
  animation-range:contain var(--start) contain var(--end);
}
@media(max-width:760px){
  .portfolio{--flight-top:85px}
  .portfolio.is-flight .portfolio-scenes{height:calc(490svh + var(--stage-height,600px))}
  .portfolio.is-flight .portfolio-grid{width:96.25%;grid-template-columns:1fr;gap:0}
  .portfolio.is-flight .portfolio-card{--start:var(--item-start);--end:var(--item-end);grid-column:1}
}
@media(prefers-reduced-motion:reduce){
 .portfolio.is-flight .portfolio-scenes{height:auto}
 .portfolio.is-flight .portfolio-stage{position:static;height:auto;display:block;overflow:visible}
 .portfolio.is-flight .portfolio-grid{width:100%;gap:36px}
 .portfolio.is-flight .portfolio-card{grid-row:auto;grid-column:auto;transform:none}
}

/* The leading row is visible directly under the intro before the scene pins. */
@keyframes portfolio-first-travel {
  from {transform:translateY(0)}
  to {transform:translateY(calc(-200% - 64px))}
}
@keyframes portfolio-first-depth {
  0% {transform:perspective(900px) translateZ(0) rotateX(0)}
  20% {transform:perspective(900px) translateZ(0) rotateX(6deg)}
  100% {transform:perspective(900px) translateZ(-450px) rotateX(30deg)}
}
@keyframes portfolio-first-scroll {
  from {transform:translateY(0)}
  to {transform:translateY(clamp(-210px,calc(-100% + 100cqh),0px))}
}
.portfolio.is-flight .portfolio-card:first-child{--start:0%;--end:28.5714285714%;animation-name:portfolio-first-travel}
.portfolio.is-flight .portfolio-card:first-child .portfolio-card-surface{animation-name:portfolio-first-depth}
.portfolio.is-flight .portfolio-card:first-child .portfolio-shot{animation-name:portfolio-first-scroll}
@media(min-width:761px){
 .portfolio.is-flight .portfolio-card:nth-child(-n+2){--start:0%;--end:66.6666666667%;animation-name:portfolio-first-travel}
 .portfolio.is-flight .portfolio-card:nth-child(-n+2) .portfolio-card-surface{animation-name:portfolio-first-depth}
 .portfolio.is-flight .portfolio-card:nth-child(-n+2) .portfolio-shot{animation-name:portfolio-first-scroll}
}

/* The last row lands in normal document flow, so the outro follows immediately. */
@keyframes portfolio-last-travel{
 from{transform:translateY(calc(200% + 64px))}
 to{transform:translateY(0)}
}
@keyframes portfolio-last-depth{
 0%{transform:perspective(900px) translateZ(-1000px) rotateX(-30deg)}
 80%{transform:perspective(900px) translateZ(0) rotateX(-6deg)}
 100%{transform:perspective(900px) translateZ(0) rotateX(0)}
}
.portfolio.is-flight .portfolio-card:last-child{animation-name:portfolio-last-travel;animation-range:contain var(--start) contain 100%}
.portfolio.is-flight .portfolio-card:last-child .portfolio-card-surface{animation-name:portfolio-last-depth;animation-range:contain var(--start) contain 100%}
@media(min-width:761px){
 .portfolio.is-flight .portfolio-card:nth-last-child(-n+2){animation-name:portfolio-last-travel;animation-range:contain var(--start) contain 100%}
 .portfolio.is-flight .portfolio-card:nth-last-child(-n+2) .portfolio-card-surface{animation-name:portfolio-last-depth;animation-range:contain var(--start) contain 100%}
}
