/* Interior identity: portrait and editable introduction above one menu row. */
html:has(body:not([data-view="landing"])) { scroll-padding-top: 28px; }

body:not([data-view="landing"]) .page-header {
  --portrait-size: 176px;
  --masthead-accent: #8ea5b3;
  position: relative;
  top: auto;
  display: grid;
  grid-template-columns: var(--portrait-size) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  justify-items: stretch;
  column-gap: 28px;
  row-gap: 18px;
  width: 100%;
  max-width: 1050px;
  height: auto;
  min-height: 0;
  margin: 0 auto;
  padding: 72px 38px 36px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
body:not([data-view="landing"]) .page-header::after { content: none; }

.page-header > .profile-illustration {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 100%;
  aspect-ratio: 1;
}
.page-header .profile-avatar {
  width: 100%;
  height: 100%;
  padding: 6px;
  box-sizing: border-box;
}
.page-header .profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.page-header > .masthead-copy {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: var(--portrait-size);
}
.masthead-heading { margin: 0; line-height: 1; }
.masthead-heading:focus { outline: none; }

body:not([data-view="landing"]) #portfolio .masthead-brand {
  display: inline-flex;
  align-items: center;
  column-gap: 4px;
  min-height: 44px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d6eaf3;
  text-align: left;
  cursor: pointer;
}
body:not([data-view="landing"]) #portfolio .masthead-name {
  min-width: 0;
  font-size: 2rem;
  line-height: 1.2;
  text-shadow: none;
  overflow-wrap: anywhere;
}
body:not([data-view="landing"]) #portfolio .masthead-brand .masthead-heart {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 12px;
  color: var(--heading-minor, #edb6d4);
  fill: currentColor;
  shape-rendering: crispEdges;
}
body:not([data-view="landing"]) #portfolio .page-header .masthead-copy .masthead-bio {
  margin: 12px 0 16px;
  color: #bdcbd6;
  font-size: 1.125rem;
  line-height: 1.85;
  white-space: pre-line;
  word-break: normal;
  overflow-wrap: anywhere;
}
.masthead-bio:empty,
.masthead-bio[hidden] { display: none; }

body:not([data-view="landing"]) #portfolio .masthead-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  margin-top: auto;
  padding-top: 8px;
}
body:not([data-view="landing"]) #portfolio .masthead-socials .profile-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #9dadb9;
  font-size: .875rem;
  line-height: 1.5;
  text-decoration: none;
}
body:not([data-view="landing"]) #portfolio .masthead-socials a:hover { color: #eaf8ff; }
body:not([data-view="landing"]) #portfolio .masthead-socials .profile-link:disabled {
  color: #6f7986;
  cursor: default;
}

body:not([data-view="landing"]) #portfolio .page-header > .masthead-menu {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 0 1px;
  border-bottom: 1px solid #c7d0da24;
}
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  max-width: 100%;
  padding: 8px 14px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #a2adb8;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
  box-shadow: none;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: color .15s ease;
}
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a:hover {
  background: transparent;
  color: #e5ebef;
}
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a.active,
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a[aria-current="page"] {
  background: transparent;
  color: var(--heading-major, #b9b5f3);
}
/* One quiet, stepped tab frame; inactive links remain unboxed. */
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-style: solid;
  border-color: transparent;
  border-width: 6px 6px 0;
  border-image-source: url("assets/nav-pixel-tab.svg");
  border-image-slice: 6 6 0 6;
  border-image-width: 6px 6px 0 6px;
  border-image-repeat: stretch;
  background: #e7edf408;
  clip-path: polygon(0 4px,2px 4px,2px 2px,4px 2px,4px 0,calc(100% - 4px) 0,calc(100% - 4px) 2px,calc(100% - 2px) 2px,calc(100% - 2px) 4px,100% 4px,100% 100%,0 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
/* A six-pixel starlike cursor echoes the entrance's selected-menu detail. */
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a::after {
  content: "";
  display: block;
  position: absolute;
  left: calc(50% - 1px);
  right: auto;
  bottom: 6px;
  width: 2px;
  height: 2px;
  border: 0;
  border-radius: 0;
  color: var(--heading-major, #b9b5f3);
  background: currentColor;
  box-shadow: -2px 0 currentColor,2px 0 currentColor,0 -2px currentColor,0 2px currentColor;
  transform: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a:hover::before { opacity: .35; }
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu :is(a.active,a[aria-current="page"])::before,
body:not([data-view="landing"]) #portfolio .page-header .masthead-menu :is(a.active,a[aria-current="page"])::after {
  opacity: 1;
}
body:not([data-view="landing"]) #portfolio .page-header :is(a, button):focus-visible {
  outline: 2px solid #cae8f3;
  outline-offset: 3px;
}

/* The route anchor no longer contains a second copy of the biography. */
body:not([data-view="landing"]) #portfolio #profile.profile-section {
  display: block;
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Seven links stay on one desktop row; tablet rows use a centered four-plus-three split. */
@media (max-width: 920px) {
  body:not([data-view="landing"]) #portfolio .page-header > .masthead-menu {
    justify-content: center;
    row-gap: 4px;
    border-bottom: 0;
  }
  body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a {
    flex: 0 0 calc((100% - 18px) / 4);
  }
}

@media (max-width: 800px) {
  body:not([data-view="landing"]) .page-header {
    --portrait-size: 144px;
    column-gap: 24px;
    padding: 56px 30px 36px;
  }
}
@media (max-width: 700px) {
  body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a {
    flex-basis: calc((100% - 12px) / 3);
  }
}
@media (max-width: 600px) {
  body:not([data-view="landing"]) .page-header {
    --portrait-size: 128px;
    column-gap: 20px;
    padding: 44px 24px 30px;
  }
  body:not([data-view="landing"]) #portfolio .masthead-socials { gap: 0 12px; }
  body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a {
    padding: 8px 10px 16px;
    font-size: .875rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a,
  body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a::before,
  body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a::after { transition: none; }
}
@media (max-width: 480px) {
  body:not([data-view="landing"]) .page-header {
    --portrait-size: 100px;
    column-gap: 16px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .page-header .profile-avatar { padding: 4px; }
  body:not([data-view="landing"]) #portfolio .masthead-name { font-size: 1.875rem; }
  body:not([data-view="landing"]) #portfolio .page-header .masthead-menu a {
    flex-basis: calc((100% - 6px) / 2);
  }
}
