.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 36, 47, 0.58);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.overlay.is-open { opacity: 1; pointer-events: auto; }

.overlay-panel {
  position: relative;
  width: min(820px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  box-sizing: border-box;
  padding: clamp(30px, 5vw, 54px);
  border: 5px solid #263a43;
  background-color: #fffdf5;
  background-image: none;
  color: #19313b;
  box-shadow: 9px 9px 0 #315969, 15px 15px 0 rgba(10, 24, 31, 0.36);
  transform: translateY(12px);
  transition: transform 180ms ease;
}

.overlay.is-open .overlay-panel { transform: translateY(0); }

.overlay-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 10px;
  background: #315969;
  content: "";
  box-shadow: 0 4px 0 rgba(43, 36, 29, 0.25);
}

.overlay-panel[data-kind="projects"] {
  background-color: #e3f1ed;
  border-color: #315969;
  box-shadow: 9px 9px 0 #315969, 15px 15px 0 rgba(10, 24, 31, 0.36);
}
.overlay-panel[data-kind="writing"] {
  background-color: #fff5d6;
  border-color: #7a6234;
  box-shadow: 9px 9px 0 #9a7a3c, 15px 15px 0 rgba(55, 42, 16, 0.28);
}
.overlay-panel[data-kind="gallery"] {
  background-color: #e4f1d8;
  border-color: #456446;
  box-shadow: 9px 9px 0 #587f53, 15px 15px 0 rgba(24, 43, 23, 0.28);
}
.overlay-panel[data-kind="personal"] { background-color: #c6a37e; }
.overlay-panel[data-kind="tools"] { background-color: #c2a06f; }

.overlay-kicker {
  margin: 0 0 12px;
  color: #315969;
  font: 700 12px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.overlay h2 {
  margin: 0 46px 18px 0;
  color: #17333e;
  font: 800 clamp(29px, 5vw, 48px)/1.04 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: -0.045em;
  text-transform: none;
  text-shadow: none;
}
.overlay p {
  max-width: 60ch;
  margin: 0;
  font: 18px/1.68 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.overlay-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.overlay-list li {
  padding: 19px 20px;
  border: 2px solid rgba(23, 51, 62, 0.35);
  border-left: 8px solid #d58a42;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 4px 4px 0 rgba(23, 51, 62, 0.12);
}
.overlay-list__linked { padding: 0 !important; }
.overlay-list strong,
.overlay-list span { display: block; }
.overlay-list strong {
  font: 700 18px/1.35 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.overlay-list span {
  margin-top: 7px;
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0.9;
}
.overlay-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 3px solid #17333e;
  background: #f3bd65;
  color: inherit;
  cursor: pointer;
  font: 700 21px/20px ui-monospace, "SFMono-Regular", Consolas, monospace;
  box-shadow: 3px 3px 0 rgba(23, 51, 62, 0.25);
}
.overlay-close:focus-visible,
.overlay-card-link:focus-visible {
  outline: 3px solid #d26831;
  outline-offset: 3px;
}
.overlay-card-link {
  display: block;
  padding: 19px 20px;
  color: inherit;
  text-decoration: none;
}
.overlay-card-link:hover {
  background: rgba(49, 89, 105, 0.08);
}
.overlay-card-cta {
  display: inline-block;
  margin-top: 13px;
  padding: 7px 10px;
  background: #315969;
  color: #fffdf4;
  font: 700 13px/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .02em;
  font-style: normal;
}

@media (max-width: 600px) {
  .overlay { padding: 12px; }
  .overlay-panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 26px 22px;
  }
}
