/* Keep Kita's palette and typography; arrange the portfolio like Blythe. */
.primary-link[aria-current="page"] {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45rem;
}

.portfolio-home .site-title { visibility: hidden; opacity: 0; pointer-events: none; }
.portfolio-home.show-header-title .site-title { visibility: visible; opacity: 1; pointer-events: auto; }

.mobile-theme-item { margin-top: .5rem; border-top: 1px solid rgba(128, 128, 128, .25); }
.mobile-theme-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  padding: .85rem 0 .35rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}
.mobile-theme-icon {
  width: 1.5rem;
  height: 1.5rem;
  background: url(./icons/theme.svg) left center / cover no-repeat;
}
.dark .mobile-theme-icon { background-position: right center; filter: invert(1); }

.portfolio-intro {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  margin: 0 0 4rem;
}
.portfolio-avatar {
  width: 9rem;
  height: 13.5rem;
  border-radius: 1rem;
  object-fit: cover;
  object-position: right center;
}
.portfolio-intro h1 { margin: 0 0 .4rem; }
.portfolio-intro p { margin: .4rem 0; }
.portfolio-social {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.portfolio-social a {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
}
.portfolio-social img { width: 1.65rem; height: 1.65rem; }
.dark .portfolio-social img { filter: invert(1); }
.portfolio-kicker {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .65;
}
.portfolio-sections { border-top: 1px solid currentColor; }
.portfolio-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid currentColor;
}
.portfolio-row h2 {
  margin: .1rem 0 0;
  font-size: 1rem;
  font-weight: 700;
}
.portfolio-row p { margin-top: 0; }
.portfolio-section-content > :last-child { margin-bottom: 0; }
.portfolio-section-content h3 { margin: 0 0 .25rem; }
.portfolio-section-content h3:not(:first-child) { margin-top: 2.5rem; }
.portfolio-section-content h3 + p { margin: .15rem 0 .85rem; font-size: .9rem; line-height: 1.6; }
.portfolio-section-content h3 + p strong { font-size: 1rem; }
.portfolio-section-content ul { margin: .6rem 0 0; padding-left: 1.25rem; }
.portfolio-section-content li + li { margin-top: .35rem; }

.experience-list { display: grid; gap: 2.5rem; }
.experience-entry {
  position: relative;
  isolation: isolate;
  min-width: 0;
}
.experience-heading,
.experience-description { position: relative; z-index: 1; }
.experience-heading h3 { margin: 0 0 .25rem; }
.experience-heading .experience-role { margin: .15rem 0 .85rem; font-size: .9rem; line-height: 1.6; }
.experience-heading .experience-role strong { font-size: 1rem; }
.experience-logo {
  position: absolute;
  inset: 0 0 auto auto;
  z-index: 0;
  width: 33%;
  height: 5.5rem;
  object-fit: contain;
  object-position: right top;
  opacity: .28;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, rgba(0, 0, 0, .8) 30%, #000 65%);
  mask-image: linear-gradient(to right, transparent, rgba(0, 0, 0, .8) 30%, #000 65%);
}
.dark .experience-logo { opacity: .34; }
.experience-logo--hp-dark { display: none; }
.dark .experience-logo--hp-light { display: none; }
.dark .experience-logo--hp-dark { display: block; }
.experience-logo--alabama { object-fit: cover; object-position: right center; }
.experience-description p:last-child { margin-bottom: 0; }

.contact-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 42rem;
  padding: clamp(1.5rem, 4vw, 2rem);
  border: 1px solid rgba(24, 24, 27, .16);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(245, 246, 248, .88));
  box-shadow: 0 12px 32px rgba(24, 24, 27, .08);
}
.contact-card::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at 100% 0%, rgba(30, 96, 147, .16), transparent 55%);
  content: "";
  pointer-events: none;
}
.contact-card > * { position: relative; z-index: 1; }
.dark .contact-card {
  border-color: rgba(255, 255, 255, .16);
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
.contact-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.contact-card-label {
  display: block;
  margin: 0 0 .55rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
  opacity: .6;
}
.contact-card .contact-card-name { margin: 0; font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.15; }
.contact-card .contact-card-role { margin: .35rem 0 0; font-size: .95rem; opacity: .7; }
.contact-card-monogram {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid rgba(24, 24, 27, .22);
  border-radius: .7rem;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -.06em;
}
.dark .contact-card-monogram { border-color: rgba(255, 255, 255, .28); }
.contact-card-monogram span { color: #2585b9; }
.contact-card-details {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1.5rem;
}
.contact-card-label { margin-bottom: .25rem; }
.contact-card-email,
.contact-card-value { display: block; font-size: 1.12rem; font-weight: 600; }
.contact-card-email { overflow-wrap: anywhere; }
.contact-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(24, 24, 27, .14);
  font-size: .82rem;
  font-weight: 600;
}
.dark .contact-card-links { border-color: rgba(255, 255, 255, .18); }
.contact-card-links a { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.contact-card-links img { width: 1.1rem; height: 1.1rem; margin: 0; object-fit: contain; }
.dark .contact-card-links img { filter: invert(1); }
.contact-card-links a:hover { text-decoration: underline; }
.contact-note {
  max-width: 42rem;
  margin: 0 0 1.25rem;
  padding: .75rem 1rem;
  border-left: 3px solid currentColor;
  border-radius: 0 .5rem .5rem 0;
  background: rgba(128, 128, 128, .08);
  font-size: .9rem;
  line-height: 1.55;
}

.skill-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
}
.skill-icons figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  width: 5rem;
  margin: 0;
}
.skill-icons img { width: 3rem; height: 3rem; object-fit: contain; }
.skill-icons figcaption { font-size: .8rem; line-height: 1.4; text-align: center; }
.skill-icons .skill-icon-wordmark { width: 5rem; }
.skill-icon-yocto,
.skill-icon-freertos,
.skill-icon-aws {
  border: 1px solid rgba(128, 128, 128, .5);
  border-radius: .4rem;
  padding: .2rem;
  box-sizing: border-box;
}
.skill-icon-yocto { background: #252b36; }
.skill-icon-freertos,
.skill-icon-aws { background: #fff; }
.dark .skill-icon-monochrome { filter: invert(1); }

.projects-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.projects-page > :not(.project-card) { grid-column: 1 / -1; }
.projects-page > h1 { margin-bottom: 2rem; }
.projects-page > h2 { margin: 2rem 0 .25rem; }
.projects-page > h3 { margin: 1.25rem 0 .25rem; }
.project-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 1.35rem;
  border: 1px solid rgba(24, 24, 27, .12);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 3px 12px rgba(24, 24, 27, .04);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.project-card--image { min-height: 13rem; }
.project-card-accent {
  position: absolute;
  inset: 0 0 0 auto;
  width: 64%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: .62;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 105% 120% at 100% 50%, #000 8%, rgba(0, 0, 0, .9) 34%, transparent 86%);
  mask-image: radial-gradient(ellipse 105% 120% at 100% 50%, #000 8%, rgba(0, 0, 0, .9) 34%, transparent 86%);
}
.dark .project-card-accent { opacity: .52; }
.project-card--image .project-card-heading,
.project-card--image .project-card-description,
.project-card--image .project-card-tags { position: relative; z-index: 1; }
.project-card:hover,
.project-card:focus-within {
  transform: translateY(-2px);
  border-color: rgba(24, 24, 27, .28);
  box-shadow: 0 10px 24px rgba(24, 24, 27, .10);
}
.dark .project-card {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
}
.dark .project-card:hover,
.dark .project-card:focus-within {
  border-color: rgba(255, 255, 255, .3);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}
.project-card h4 { margin: 0; font-size: 1.12rem; line-height: 1.35; }
.project-card h4 a { display: inline-flex; align-items: baseline; gap: .35rem; text-decoration: none; }
.project-card h4 a::after { content: ""; position: absolute; inset: 0; }
.project-card h4 a:hover { text-decoration: underline; }
.project-card-arrow { font-size: .9rem; opacity: .55; }
.project-card-description { flex: 1; margin: .75rem 0 1.25rem; font-size: .92rem; line-height: 1.55; opacity: .8; }
.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.project-card-tags li {
  margin: 0;
  padding: .22rem .6rem;
  border-radius: 999px;
  background: rgba(24, 24, 27, .08);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.4;
}
.dark .project-card-tags li { background: rgba(255, 255, 255, .12); }

.project-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  border-radius: .75rem;
  background: #000;
}
.project-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.action-button {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .45rem .7rem;
  border: 1px solid rgba(24, 24, 27, .2);
  border-radius: .65rem;
  background: rgba(128, 128, 128, .08);
  color: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 24, 27, .38);
  background: rgba(128, 128, 128, .15);
  text-decoration: none;
}
.action-button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.action-button img { width: 1rem; height: 1rem; margin: 0; object-fit: contain; }
.dark .action-button { border-color: rgba(255, 255, 255, .2); }
.dark .action-button:hover {
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .14);
}
.dark .action-button img { filter: invert(1); }

@media (max-width: 640px) {
  .portfolio-intro { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 3rem; }
  .portfolio-avatar { width: 7rem; height: 10.5rem; }
  .portfolio-row { grid-template-columns: 1fr; gap: 1rem; }
  .experience-logo { height: 4rem; }
  .projects-page { grid-template-columns: 1fr; }
}
