/* A small finishing layer for a calmer, more polished portfolio. */
:root {
  --blue: #3948d8;
  --paper: #f7f7f2;
  --line: #dedfd7;
}

::selection {
  color: var(--ink);
  background: #d7eaa9;
}

:focus-visible {
  outline: 3px solid #8793ff;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

section[id] {
  scroll-margin-top: 112px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  margin-inline: -12px;
  padding-inline: 12px;
  background: rgb(247 247 242 / 92%);
  border-bottom-color: rgb(32 34 31 / 10%);
  backdrop-filter: blur(16px);
}

.topbar nav a:not(.nav-contact) {
  position: relative;
  padding-block: 8px;
}

.topbar nav a:not(.nav-contact)::after {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.topbar nav a:not(.nav-contact):hover::after,
.topbar nav a:not(.nav-contact):focus-visible::after {
  transform: scaleX(1);
}

.nav-contact {
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav-contact:hover {
  color: #fff !important;
  background: var(--ink);
  border-color: var(--ink) !important;
}

.hero {
  padding-top: 86px;
  gap: 68px;
}

.eyebrow {
  width: fit-content;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff9;
}

.hero h1 {
  max-width: 720px;
  text-wrap: balance;
}

.hero-art::before {
  position: absolute;
  width: 390px;
  height: 390px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(circle, #e4e8d8 0%, #e4e8d800 70%);
}

.portrait-card {
  z-index: 1;
  border: 7px solid rgb(255 255 255 / 82%);
  border-radius: 170px 170px 18px 18px;
  box-shadow: 16px 18px 0 #dce4cb, 0 28px 70px #25272318;
}

.portrait-image {
  object-position: 50% 21%;
  filter: saturate(.94) contrast(1.02);
}

.portrait-caption {
  padding: 8px 12px;
  border: 1px solid #fff9;
  border-radius: 999px;
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 5px 18px #20221f14;
  backdrop-filter: blur(8px);
}

.float-note {
  z-index: 2;
  border: 1px solid #fff;
  border-radius: 5px;
  box-shadow: 0 14px 34px #20221f14;
}

.intro-strip {
  border: 1px solid #dce1cf;
  border-left: 4px solid var(--blue);
  border-radius: 5px;
  box-shadow: 0 16px 44px #20221f08;
}

.section-heading h2,
.projects-head h2,
.contact-section h2 {
  text-wrap: balance;
}

.section-kicker::before {
  margin-right: 8px;
  color: var(--blue);
  content: "—";
}

.skill-chip {
  border-radius: 999px;
  background: #fbfbf8;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.skill-chip:hover {
  border-color: #aab0f3;
  box-shadow: 0 7px 18px #3948d814;
  transform: translateY(-2px);
}

.work-item,
.education-item {
  border-radius: 6px;
  transition: background 180ms ease, padding 180ms ease;
}

.work-item:hover,
.education-item:hover {
  padding-inline: 9px;
  background: #fff9;
}

.work-index {
  width: fit-content;
  padding: 5px 7px;
  border-radius: 999px;
  background: #e9eae2;
}

.project-card {
  border: 1px solid #ffffff20;
  border-radius: 9px;
  box-shadow: 0 8px 24px #00000012;
}

.project-card:first-child {
  grid-column: span 2;
  min-height: 365px;
}

.project-card:first-child .project-image {
  object-position: center 54%;
}

.project-card:not(.has-image) .project-symbol {
  color: #20221f;
}

.project-top span:first-child {
  padding: 6px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

.project-card.has-image .project-top span:first-child {
  border-color: #ffffff85;
  background: #16161635;
  text-shadow: none;
}

.project-bottom strong {
  text-wrap: balance;
}

.achievement-card {
  border-radius: 8px;
  transition: background 180ms ease;
}

.achievement-card:hover {
  background: #ffffff80;
}

.achievement-photo {
  border: 1px solid #fff;
  border-radius: 8px;
  box-shadow: 0 14px 32px #20221f12;
}

.contact-section {
  background:
    radial-gradient(circle at 18% 22%, #ffffff20 0 1px, transparent 2px),
    radial-gradient(circle at 82% 75%, #ffffff18 0 1px, transparent 2px),
    linear-gradient(135deg, #3443cf, #4c58e7 58%, #3543ca);
  background-size: 38px 38px, 54px 54px, auto;
}

.contact-section .button-light {
  border-radius: 999px;
  box-shadow: 0 10px 28px #101a8b3d;
}

.social-links a {
  transition: opacity 180ms ease, border-color 180ms ease;
}

.social-links a:hover {
  border-color: #fff;
  opacity: .75;
}

footer {
  border-top: 1px solid var(--line);
}

@media (max-width: 1000px) {
  .hero {
    gap: 36px;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card:first-child {
    min-height: 340px;
  }
}

@media (max-width: 760px) {
  .topbar {
    margin-inline: 0;
    padding-inline: 0;
  }

  .hero {
    padding-top: 58px;
    gap: 16px;
  }

  .hero-art::before {
    width: min(88vw, 350px);
    height: min(88vw, 350px);
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-card:first-child {
    grid-column: auto;
    min-height: 300px;
  }

  .work-item:hover,
  .education-item:hover {
    padding-inline: 0;
  }
}

@media (max-width: 420px) {
  .hero-art {
    height: 340px;
  }

  .portrait-card {
    width: 238px;
    height: 300px;
  }

  .note-top {
    left: 0;
  }

  .note-bottom {
    right: 0;
  }

  .hero-meta {
    gap: 12px;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar nav a:not(.nav-contact)::after {
    transition: none;
  }
}
