/* /portfolio — uses the homepage tokens in home.css. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-links a[aria-current="page"],
.navlinks a[aria-current="page"] {
  background: var(--primary-c);
  color: var(--on-primary-c);
}

.fgrid a[aria-current="page"] {
  color: var(--primary);
}

.port-index {
  padding-top: 112px;
  padding-bottom: clamp(8px, 2vw, 24px);
}

.port-page-title,
.port-title {
  letter-spacing: -0.035em;
  font-weight: 500;
  line-height: 1.02;
}

.port-page-title {
  max-width: 12ch;
  font-size: clamp(48px, 5.2vw, 84px);
}

.port-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: clamp(28px, 4vw, 48px) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .port-grid {
    grid-template-columns: 1fr 1fr;
  }

  .port-card.is-featured {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1100px) {
  .port-grid {
    grid-template-columns: 1.35fr 1fr 1fr;
  }

  .port-card.is-featured {
    grid-column: span 2;
  }

  .port-grid > .port-card:last-child:not(.is-featured) {
    grid-column: 1 / -1;
  }

  .port-grid > .port-card:last-child:not(.is-featured) .port-card-link {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) 1.3fr;
    align-items: stretch;
  }

  .port-grid > .port-card:last-child:not(.is-featured) .cover {
    aspect-ratio: auto;
    height: 100%;
    min-height: 220px;
  }

  .port-grid > .port-card:last-child:not(.is-featured) .port-card-body {
    justify-content: center;
    padding: 28px 36px;
  }
}

.port-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100%;
}

.port-card-link {
  color: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.port-card-link img,
.cover {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  object-position: top center;
  background: linear-gradient(180deg, #fff 0%, #e7eef8 100%);
}

.port-card.is-featured img {
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
  object-position: top center;
}

.cover {
  display: grid;
  place-items: center;
}

.cover svg {
  width: min(78%, 280px);
  height: auto;
  display: block;
}

.cover .soft {
  fill: var(--primary-c);
}

.cover .ink {
  fill: var(--primary);
}

.cover .paper {
  fill: #fff;
}

.cover .mark {
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cover .ink-mark {
  stroke: var(--primary);
  stroke-width: 3;
}

.cover .hair {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.port-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 20px 22px 22px;
}

.port-card-kicker {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
}

.port-card-name {
  letter-spacing: -0.02em;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  line-height: 1.15;
}

.port-card-role {
  color: var(--fg-2);
  font-size: 15px;
}

.port-card-note {
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.45;
}

.port-card-foot {
  padding: 0 22px 22px;
}

.port-card-score {
  aspect-ratio: 16 / 10;
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: space-between;
  gap: 6px 14px;
  padding: 18px 20px 16px;
  background: linear-gradient(165deg, var(--primary-c), var(--surface) 58%);
}

.port-score-kicker {
  grid-column: 1 / -1;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
}

.port-score-num {
  letter-spacing: -0.04em;
  font-size: clamp(42px, 4vw, 64px);
  font-weight: 500;
  line-height: 0.9;
}

.port-score-label {
  align-self: end;
  color: var(--fg-2);
  font-size: 14px;
}

.port-score-rows {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
}

.port-score-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  font-size: 13px;
}

.port-score-row b:last-child {
  color: var(--primary);
}

.port-hero {
  padding-top: clamp(48px, 6vw, 88px);
}

.port-title {
  max-width: 14ch;
  font-size: clamp(44px, 5vw, 76px);
}

.port-title.is-long {
  max-width: 18ch;
  font-size: clamp(36px, 4vw, 60px);
}

.port-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.port-summary {
  color: var(--fg-2);
  max-width: 40em;
  margin-top: 18px;
  font-size: clamp(16px, 1.2vw, 18px);
}

.port-note {
  color: var(--fg-2);
  max-width: 42em;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.port-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.port-ba,
.port-changes,
.port-results {
  padding-block: var(--sec);
}

.findings {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .findings {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    align-items: stretch;
  }
}

.finding-total,
.metric {
  background: var(--surface);
  border-radius: var(--r-xl);
}

.finding-total {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(22px, 2.4vw, 32px);
}

.finding-num {
  letter-spacing: -0.045em;
  font-size: clamp(64px, 7vw, 96px);
  font-weight: 500;
  line-height: 0.9;
}

.finding-label {
  font-size: 18px;
  font-weight: 500;
}

.finding-sevs {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.finding-sevs b {
  display: inline-block;
  min-width: 1.6em;
  font-weight: 500;
}

.finding-detail {
  color: var(--fg-2);
  margin-top: auto;
  font-size: 15px;
}

.metric-grid {
  display: grid;
  align-content: start;
  gap: 8px;
}

.metric {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: baseline;
  border-radius: var(--r-lg);
  padding: 14px 16px;
}

.metric-head {
  background: transparent;
  padding: 0 16px 2px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 500;
}

.metric-before,
.metric-after {
  white-space: nowrap;
}

.metric-before {
  color: var(--fg-2);
}

.metric-after {
  font-weight: 500;
}

.ba-stack {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}

.ba-block h3 {
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  font-size: clamp(22px, 2vw, 28px);
}

.ba-stage {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--e2);
  overflow: hidden;
  touch-action: none;
}

.ba-stage > img,
.ba-before img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.ba-stage > img {
  position: absolute;
  inset: 0;
}

.ba-before {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pos, 50%);
  overflow: hidden;
  border-right: 2px solid #fff;
}

.ba-before img {
  width: 100cqi;
  max-width: none;
  height: 100%;
}

.ba-chip {
  position: absolute;
  z-index: 2;
  top: 16px;
  border-radius: 999px;
  background: #fffffff0;
  box-shadow: var(--e1);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
}

.ba-chip-before {
  left: 16px;
}

.ba-chip-after {
  right: 16px;
}

.ba-handle {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 44px;
  transform: translateX(-50%);
  pointer-events: none;
}

.ba-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--e2);
  transform: translate(-50%, -50%);
}

.ba-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  background: #fff;
  box-shadow:
    0 -4px 0 #fff,
    0 4px 0 #fff;
  transform: translate(-50%, -50%);
}

.ba-range {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  appearance: none;
}

.ba-stage:has(.ba-range:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.ba-note {
  color: var(--fg-2);
  margin-top: 10px;
  font-size: 13px;
}

.ba-slider {
  display: none;
}

.ba-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .ba-split {
    grid-template-columns: 1fr 1fr;
  }
}

.ba-split figure {
  margin: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ba-split img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}

.ba-split figcaption,
.ba-phone figcaption {
  padding: 10px 12px 12px;
  font-size: 14px;
  font-weight: 500;
}

.ba-phone {
  max-width: 280px;
  margin: 28px auto 0;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--e2);
  overflow: hidden;
}

.ba-phone img {
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 844;
  object-fit: cover;
  object-position: top center;
}

.ba-phone figcaption {
  text-align: center;
}

.ba-full {
  margin-top: 20px;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.ba-full summary {
  cursor: pointer;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 500;
}

.ba-full-frame {
  max-height: min(70vh, 720px);
  overflow: auto;
  box-shadow: inset 0 1px 0 #00000014;
}

.ba-full-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.js .ba-slider {
  display: block;
}

@media (min-width: 768px) {
  .js .ba-split {
    display: none;
  }
}

@media (max-width: 767px) {
  .js .ba-slider {
    display: none;
  }

  .port-page-title,
  .port-title {
    max-width: none;
    font-size: clamp(40px, 11vw, 64px);
  }

  .port-index {
    padding-top: 96px;
  }
}

.change-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.change {
  background: var(--surface);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 2.4vw, 32px);
}

.step-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.step-kicker {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
}

.step-ic {
  width: 28px;
  height: 28px;
  color: var(--fg);
  display: block;
  flex: none;
}

.step-n {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
}

.step-tag {
  color: var(--fg-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
}

.change h3 {
  border-top: 1px solid #1f1f1f1a;
  letter-spacing: -0.015em;
  margin: 2px 0 0;
  padding-top: 14px;
  font-size: clamp(21px, 1.7vw, 26px);
  line-height: 1.25;
}

.change p {
  color: var(--fg-2);
  font-size: 16px;
}

.change .step-kicker {
  color: inherit;
  font-size: 13px;
}

@media (min-width: 768px) {
  .change-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1100px) {
  .change-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.port-cta {
  padding-bottom: clamp(48px, 6vw, 96px);
}

.port-cta-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 3vw, 40px);
}

.port-cta-card h2 {
  letter-spacing: -0.03em;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.06;
}

.port-cta-card p:last-child {
  color: var(--fg-2);
  max-width: 36em;
  margin-top: 12px;
  font-size: 17px;
}

.port-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 640px) {
  .port-cta-actions a,
  .port-cta-actions button {
    width: 100%;
  }
}
