/* Portfolio landing and the shared specialization layout. */
@media screen {
  .portfolio-hero { grid-template-columns: minmax(0, 1fr) clamp(120px, 22vw, 220px); }
  .portfolio-hero h1 {
    font-size: clamp(36px, 5.2vw, 66px);
    line-height: 1.07;
    max-width: 20ch;
  }
  .portfolio-hero .lead { max-width: 57ch; }
  .portfolio-hero .profile-portrait { display: block; max-width: 220px; }
  .portfolio-home .portfolio-hero .id-card { justify-self: end; }
  .portfolio-home .portfolio-hero .id-card img { width: 100%; }
}

/* The directions stay in the reading flow. Section shortcuts use the left gutter. */
.home-directions { padding-block: 0; scroll-margin-top: 80px; }
.home-directions h2 { margin-bottom: 10px; font-size: 17px; }
.direction-list { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 24px; }
.direction-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-block-end: 1px solid var(--line);
}
.direction-link { padding-block: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.direction-link:hover, .direction-resume:hover { color: var(--accent); text-decoration: underline; }
.direction-resume { padding: 10px 4px; color: var(--accent); font-size: 13px; white-space: nowrap; text-decoration: none; }
.portfolio-home .nav-in { padding-block: 8px; }
.portfolio-home .value { gap: 8px 20px; }
.portfolio-home .value li { padding: 13px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }

@media screen and (min-width: 600px) {
  .direction-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (min-width: 1000px) {
  .direction-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.portfolio-home .profile-project { margin-top: 14px; }

.profile-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.specialization .nav-in { grid-template-columns: minmax(0, 1fr) auto; }
.specialization main { overflow-wrap: anywhere; }
.analytics-pixel { position: absolute; left: -9999px; }
.profile-section { padding-top: clamp(40px, 6vw, 72px); }
.resume-download {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 12px 19px;
}
.resume-download:hover { background: var(--accent-soft); }
.profile-job .job-head { position: static; }
.profile-job-overview { grid-template-columns: minmax(0, 1fr); }
.implementation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.implementation {
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  background: var(--surface);
}
.implementation h3 { font-size: 17px; margin-bottom: 10px; }
.implementation p { color: var(--ink-2); margin-block: 6px; }
.implementation .implementation-outcome { color: var(--accent); font-weight: 600; }
.implementation .link-arrow { padding-inline: 0; }
.profile-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-numbers:has(div:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-numbers:has(div:nth-child(6)) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.profile-numbers div { border: 0; padding-inline: clamp(10px, 1.6vw, 18px); }
.profile-numbers div + div { border-left: 1px solid var(--line); }
.profile-numbers dd { font-size: clamp(26px, 3.1vw, 40px); white-space: normal; }
.profile-projects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.profile-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: clamp(18px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-box);
}
.profile-project h3 { font-size: clamp(19px, 2.6vw, 26px); }
.profile-project p { margin-top: 8px; color: var(--ink-2); }
.cutbeat-details { margin-top: 16px; padding-block: 11px; border-block: 1px solid var(--line); }
.cutbeat-details .study-name { color: var(--accent); }
.cutbeat-details[open] .study-toggle .ph { display: inline-block; transform: rotate(90deg); }
.profile-links { margin-top: 18px; }
.specialization .reach .cta { margin-top: 12px; }

@media screen and (max-width: 960px) {
  .portfolio-home .portfolio-hero .id-card { display: block; max-width: 180px; }
  .portfolio-home .portfolio-hero .id-card .contacts { display: none; }
  .profile-numbers div:nth-child(n+3) { border-top: 0; }
  .profile-numbers:has(div:nth-child(6)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-numbers div:nth-child(4) { border-left: 0; }
  .profile-numbers div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media screen and (max-width: 730px) {
  .implementation-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-numbers, .profile-numbers:has(div:nth-child(6)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-numbers div:nth-child(even) { border-left: 1px solid var(--line); }
  .profile-numbers div:nth-child(odd) { border-left: 0; }
  .profile-numbers div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .profile-numbers div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media screen and (max-width: 560px) {
  .portfolio-hero { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .portfolio-hero h1 { font-size: clamp(29px, 8vw, 42px); }
  .portfolio-hero .profile-portrait, .portfolio-home .portfolio-hero .id-card { display: none; }
  .profile-numbers dd { font-size: clamp(24px, 7vw, 35px); }
}

@media print {
  .home-directions, .related-profiles, .portfolio-home .profile-project { display: none; }
  .portfolio-home .portfolio-hero h1 { font-size: 35px; }
  .specialization .hero { grid-template-columns: 1fr auto; }
  .specialization .hero h1 { font-size: 34px; }
  .specialization .id-card { display: block; width: 105px; padding: 4px; }
  .specialization .profile-section { padding-top: 17px; }
  .specialization .profile-project { display: block; padding: 10px 14px; break-inside: avoid; }
  .specialization .profile-project p { margin-top: 4px; }
  .specialization .profile-numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .specialization .profile-numbers dd { font-size: 25px; }
}

.portfolio-home .portfolio-hero h1 { max-width: none; }
@media screen and (min-width: 561px) {
  .portfolio-home .portfolio-hero h1 { font-size: clamp(38px, 5vw, 58px); }
}
.portfolio-home .hero .role { margin-block: 12px 0; }
.profile-breadcrumb { padding-top: 22px; font-size: 14px; color: var(--ink-2); }
.specialization .hero { padding-top: clamp(20px, 4vw, 46px); }
.related-profiles {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 14px;
}
.related-profiles > span { color: var(--ink-2); }
.related-profiles ul, .project .related-profiles ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
}
.related-profiles li, .project .related-profiles li { font: inherit; padding: 0; }
.project .related-profiles { margin-top: 6px; }
.case .related-profiles { order: 1; grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }

.case-action { margin-top: 12px; }
.skills-ledger { border-top: 1px solid var(--line); }
.skills-ledger > div { padding-block: clamp(16px, 3vw, 26px); border-bottom: 1px solid var(--line); }
.skills-ledger h3 { margin-bottom: 5px; font-size: 17px; }
.skills-ledger ul { display: flex; flex-wrap: wrap; gap: 4px 13px; color: var(--ink-2); font-size: 14px; }
.skills-ledger li { padding: 0 12px 0 0; border-inline-end: 1px solid var(--line); }
.skills-ledger li:last-child { border-inline-end: 0; }
@media screen and (max-width: 560px) {
  .portfolio-home .portfolio-hero h1 { font-size: clamp(30px, 8.5vw, 46px); }
  .direction-link, .direction-resume { padding-block: 11px; }
}
@media print {
  .analytics-pixel, .profile-breadcrumb, .related-profiles { display: none; }
}
