* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: #faf7ef;
  color: #111;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.home-page.return-page-tint,
html.return-page-tint-pending body.home-page {
  animation: return-page-tint 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes return-page-tint {
  0%,
  8% {
    background-color: color-mix(
      in srgb,
      rgb(var(--return-page-tint, 250, 247, 239)) 50%,
      #faf7ef
    );
  }
  100% {
    background-color: #faf7ef;
  }
}

.fade-in-content {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.fade-in-content.visible {
  opacity: 1;
}

html.return-page-ready .home-page .fade-in-content {
  opacity: 1;
  transition: none;
}

header {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.logo:link,
.logo:visited,
.logo:hover,
.logo:active {
  text-decoration: none;
  color: inherit;
}

.logo:hover {
  transform: translateY(-2px);
}

.logo .dot {
  width: 12px;
  height: 12px;
  background-color: #32CD32;
  border-radius: 50%;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.top-nav a {
  text-decoration: none;
  color: #111;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.top-nav a:hover {
  transform: scale(1.05);
}

.top-nav .divider {
  width: 1px;
  height: 1rem;
  background-color: #111;
  opacity: 0.3;
}

main {
  text-align: center;
  flex: 1;
  padding: 4rem 2rem 1rem;
}

.typing-text {
  position: relative;
  font-family: 'Source Code Pro', monospace;
  font-size: 3rem;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  margin-bottom: 2rem;
  height: 3.6rem;
  line-height: 1.2;
}

.typing-text.typing-active {
  border-right: 0;
}

.typing-text.typing-active::after {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 0.08em;
  background: #111;
  vertical-align: -0.12em;
}

.typing-text.typing-quote {
  font-size: clamp(1rem, 4vw, 2.65rem);
}

.name-signature {
  width: min(90%, 380px);
  height: auto;
  display: block;
}

.signature-path {
  fill: #1a1a1a;
  stroke: none;
}

.about {
  max-width: 500px;
  margin: 0 auto 3rem;
}

.about h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.about p {
  line-height: 1.6;
  color: #444;
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: #111;
  font-weight: bold;
  font-size: 1rem;
  transition: transform 0.2s;
}

.resume-page {
  background-color: #b8d3e9;
}

.resume-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  flex: 1;
  margin: 0 auto;
  padding: 6rem 2rem 3rem;
}

.resume-page .resume-main .circle.resume {
  flex: 0 0 auto;
  margin-top: -8.5rem;
  margin-bottom: 5rem;
}

.resume-hint {
  position: absolute;
  top: 3.5rem;
  right: max(2rem, calc((100% - 1120px) / 2));
  font-family: 'Source Code Pro', monospace;
  font-size: 0.7rem;
  opacity: 0.55;
}

.resume-explorer {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 7rem;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: 27rem;
  width: min(1120px, 100%);
  text-align: left;
}

.resume-project-rail {
  position: relative;
  align-self: center;
  width: 7rem;
  text-align: center;
}

.resume-project-rail.hidden {
  visibility: hidden;
}

.resume-project-label,
.resume-project-hint {
  margin: 0;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.48;
}

.resume-project-label {
  margin-bottom: 0.6rem;
}

.resume-project-hint {
  margin-top: 0.6rem;
}

.resume-project-window {
  position: relative;
}

.resume-project-rail.scrollable .resume-project-window {
  width: 17rem;
  height: 18rem;
  margin-left: -10rem;
  overflow: hidden;
  padding: 7rem 0;
  mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 82%, transparent 100%);
}

.resume-project-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.circle[aria-current="page"] {
  pointer-events: none;
}

.circle[aria-current="page"]:hover {
  transform: none;
}

.resume-project-rail.scrollable .resume-project-list {
  align-items: flex-end;
  padding-right: 1.575rem;
  transform: translateY(calc(var(--project-index) * -4.5rem));
}

.resume-project-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 3.85rem;
  height: 3.85rem;
  border: 1px solid rgba(17, 17, 17, 0.25);
  border-radius: 1.15rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #111;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
  user-select: none;
  backface-visibility: hidden;
  will-change: transform, opacity;
  opacity: 0.34;
  transform: scale(0.78);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease, color 0.2s ease;
}

.resume-project-item.near {
  opacity: 0.62;
  transform: scale(0.9);
}

.resume-project-item.selected,
.resume-project-rail:not(.scrollable) .resume-project-item {
  opacity: 1;
  transform: scale(1);
}

.resume-project-item:hover {
  background: #111;
  color: white;
  opacity: 1;
}

.resume-project-icon {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.resume-project-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}

.resume-project-image.cover {
  object-fit: cover;
}

.resume-project-image.monochrome {
  width: 76%;
  height: auto;
  max-height: 58%;
  filter: brightness(0);
  transition: filter 0.2s ease;
}

.resume-project-image.contained {
  width: 60%;
  height: 60%;
}

.resume-project-image.company-logo {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 82%;
  height: 82%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  -webkit-user-drag: none;
  backface-visibility: hidden;
}

.resume-project-rail.is-touch-dragging .resume-project-item {
  transition: none;
}

.resume-project-rail.is-touch-dragging .resume-project-item:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #111;
  opacity: 0.34;
  transform: scale(0.78);
}

.resume-project-rail.is-touch-dragging .resume-project-item.near:hover {
  opacity: 0.62;
  transform: scale(0.9);
}

.resume-project-rail.is-touch-dragging .resume-project-item.selected:hover {
  opacity: 1;
  transform: scale(1);
}

html {
  background: #f2f2f2;
}

.resume-project-item:hover .resume-project-image.monochrome,
.resume-project-item:focus-visible .resume-project-image.monochrome {
  filter: brightness(0) invert(1);
}

.resume-project-store {
  position: absolute;
  right: -0.22rem;
  bottom: -0.22rem;
  display: grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  border: 1px solid rgba(17, 17, 17, 0.28);
  border-radius: 999px;
  padding: 0.15rem;
  background: #edf4f8;
  color: #111;
  overflow: hidden;
}

.resume-project-store svg {
  display: block;
  width: 100%;
  height: 100%;
}

.resume-series-panel {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: calc(100% + 1rem);
  width: min(19rem, 34vw);
  max-height: 21rem;
  transform: translateY(-50%);
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 1.15rem;
  background: rgba(247, 243, 233, 0.97);
  box-shadow: 0 1.2rem 3rem rgba(17, 17, 17, 0.16);
  text-align: left;
  backdrop-filter: blur(12px);
}

.resume-series-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.8rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
}

.resume-series-header p {
  margin: 0 0 0.22rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.48;
}

.resume-series-header h3 {
  margin: 0;
  font-size: 0.9rem;
}

.resume-series-header button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.resume-series-games {
  max-height: 16.5rem;
  overflow-y: auto;
  padding: 0.35rem 0.45rem 0.55rem;
  scrollbar-width: thin;
}

.resume-series-game {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.55rem;
  padding: 0.38rem 0.5rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.09);
}

.resume-series-game:last-child {
  border-bottom: 0;
}

.resume-series-number {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.55rem;
  opacity: 0.38;
}

.resume-series-title {
  font-size: 0.68rem;
  line-height: 1.25;
}

.resume-series-stores {
  display: flex;
  gap: 0.3rem;
}

.resume-series-stores a {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0.28rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.resume-series-stores a:hover {
  transform: translateY(-0.1rem);
  opacity: 0.72;
}

.resume-series-stores svg {
  display: block;
  width: 100%;
  height: 100%;
}

.resume-project-name {
  position: absolute;
  right: calc(100% + 0.55rem);
  top: 50%;
  width: max-content;
  max-width: 10rem;
  transform: translateY(-50%) translateX(0.3rem);
  border-radius: 0.45rem;
  padding: 0.35rem 0.5rem;
  background: #111;
  color: white;
  font-size: 0.62rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.resume-project-item:hover .resume-project-name,
.resume-project-item:focus-visible .resume-project-name {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.resume-year-wheel {
  height: 21rem;
  overflow: hidden;
  padding: 8.75rem 0;
  outline: none;
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}

.resume-year-wheel:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.45);
  outline-offset: 0.4rem;
  border-radius: 1rem;
}

.resume-year-list {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.resume-year {
  width: 100%;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0.22;
  transform: scale(0.82);
  transition: opacity 0.3s ease, transform 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.resume-year.near {
  opacity: 0.5;
  transform: scale(0.93);
}

.resume-year.selected {
  opacity: 1;
  transform: scale(1.18);
  font-weight: 700;
}

.resume-year.selected::before {
  content: '›';
  margin-right: 0.9rem;
}

.resume-year.selected::after {
  content: '‹';
  margin-left: 0.9rem;
}

.resume-year-wheel.placeholder-mode {
  visibility: hidden;
}

.resume-card {
  width: 100%;
  max-width: 52rem;
  animation: resume-card-in 0.35s ease both;
}

.resume-eyebrow {
  margin-bottom: 0.75rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.58;
}

.resume-card h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.resume-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}

.resume-description {
  max-width: 40rem;
  font-size: 0.8rem;
  line-height: 1.55;
}

.resume-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

.resume-details-grid h3 {
  margin: 0 0 0.45rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.resume-details-grid ul {
  margin: 0;
  padding-left: 1rem;
}

.resume-details-grid li {
  margin-bottom: 0.2rem;
  font-size: 0.61rem;
  line-height: 1.3;
}

.resume-details-grid section:last-child ul {
  columns: 2;
  column-gap: 1.35rem;
}

.resume-details-grid section:last-child li {
  break-inside: avoid;
}

.resume-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.resume-see-more {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.35rem;
  border: 0;
  border-bottom: 1px solid #111;
  padding: 0.25rem 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  transition: gap 0.2s ease, opacity 0.2s ease;
}

.resume-see-more:hover {
  gap: 0.7rem;
  opacity: 0.65;
}

.resume-modal {
  width: min(62rem, calc(100% - 3rem));
  max-height: min(46rem, calc(100vh - 3rem));
  margin: auto;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 1.5rem;
  padding: 0;
  background: #f7f3e9;
  color: #111;
  box-shadow: 0 2rem 6rem rgba(17, 17, 17, 0.28);
}

.resume-modal[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

body.resume-modal-open {
  position: fixed;
  top: var(--resume-modal-scroll-y, 0);
  left: 0;
  width: 100%;
  overflow: hidden;
}

.resume-modal::backdrop {
  background: rgba(17, 17, 17, 0.48);
  backdrop-filter: blur(5px);
}

.resume-modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem 2.25rem 1.4rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
  background: #f7f3e9;
}

.resume-modal-header h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.resume-modal-role {
  margin: 0;
  font-size: 0.9rem;
}

.resume-modal-close {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(17, 17, 17, 0.3);
  border-radius: 50%;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.resume-modal-close:hover {
  transform: rotate(8deg);
  background: rgba(17, 17, 17, 0.08);
}

.resume-modal-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  max-height: calc(100vh - 13rem);
  min-height: 0;
  overflow-y: auto;
  padding: 1.75rem 2.25rem 2.25rem;
  scrollbar-width: thin;
}

.resume-modal-content h3 {
  margin: 0 0 1rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.resume-modal-content ul {
  margin: 0;
  padding-left: 1.15rem;
}

.resume-modal-content li {
  margin-bottom: 0.7rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

.resume-modal-content .resume-detail-subitem {
  margin-left: 1.35rem;
  font-size: 0.76rem;
}

.resume-modal-content .resume-detail-subitem::marker {
  font-size: 0.7em;
}

.resume-modal-content .resume-detail-footnote {
  margin-top: 1rem;
  margin-left: -1.15rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(17, 17, 17, 0.14);
  color: rgba(17, 17, 17, 0.7);
  font-size: 0.72rem;
  line-height: 1.45;
  list-style: none;
}

.resume-chip,
.resume-tab {
  border: 1px solid rgba(17, 17, 17, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #111;
  font-size: 0.7rem;
}

.resume-chip {
  padding: 0.45rem 0.65rem;
}

.resume-more-skills {
  cursor: pointer;
  border-style: dashed;
  font-family: inherit;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.resume-more-skills:hover {
  background: #111;
  color: white;
}

.resume-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.resume-tab {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.resume-tab:hover {
  transform: translateY(-2px);
}

.resume-tab.active {
  background: #111;
  color: white;
}

@keyframes resume-card-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

.projects-page {
  background-color: #fcb7ac;
}

.projects-page main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6rem 2rem 3rem;
}

.contact-page {
  background-color: #c6f6c8;
}

.resume-page .circle {
  width: 75px;
  height: 75px;
  font-size: 0.75rem;
  background-color: transparent;
  border: 4px solid #f2f2f2;
}

.projects-page .circle {
  width: 75px;
  height: 75px;
  font-size: 0.75rem;
  background-color: transparent;
  border: 4px solid #f2f2f2;
  color: black;
}

.contact-page .circle {
  width: 75px;
  height: 75px;
  font-size: 0.75rem;
  background-color: transparent;
  border: 4px solid #f2f2f2;
}

.projects-page .circle.projects,
.contact-page .circle.contact {
  margin-top: -8.5rem;
  margin-bottom: 5rem;
}

.contact-page main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  padding: 6rem 2rem 3rem;
}

.contact-info {
  background: white;
  border-radius: 20px;
  padding: 2rem 3rem;
  max-width: 500px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  text-align: left;
  margin-bottom: 4rem;
}

.contact-info h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
  color: #444;
}

.contact-info a {
  color: #111;
  text-decoration: none;
  font-weight: 500;
}

.contact-info a:hover {
  text-decoration: underline;
}

.circle:hover {
  transform: scale(1.025);
}

.circle.droplet-impact {
  animation: droplet-impact 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.circle.droplet-release {
  animation: droplet-release 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes droplet-impact {
  0% {
    transform: scale(1);
    border-radius: 50%;
  }
  24% {
    transform: scaleX(1.065) scaleY(0.955) rotate(-1.5deg);
    border-radius: 45% 55% 52% 48% / 54% 46% 54% 46%;
  }
  48% {
    transform: scaleX(0.975) scaleY(1.035) rotate(1deg);
    border-radius: 54% 46% 47% 53% / 47% 53% 46% 54%;
  }
  72% {
    transform: scaleX(1.018) scaleY(0.99);
    border-radius: 48% 52% 51% 49% / 52% 48% 51% 49%;
  }
  100% {
    transform: scale(1.025);
    border-radius: 50%;
  }
}

@keyframes droplet-release {
  0% {
    transform: scale(1.025);
    border-radius: 50%;
  }
  20% {
    transform:
      rotate(var(--droplet-release-angle, 0deg))
      translateX(4px)
      scaleX(1.13)
      scaleY(0.91)
      rotate(var(--droplet-release-angle-reverse, 0deg));
    border-radius: 43% 57% 57% 43% / 47% 47% 53% 53%;
  }
  39% {
    transform:
      rotate(var(--droplet-release-angle, 0deg))
      translateX(-2px)
      scaleX(0.965)
      scaleY(1.045)
      rotate(var(--droplet-release-angle-reverse, 0deg));
    border-radius: 54% 46% 47% 53% / 52% 48% 52% 48%;
  }
  66% {
    transform:
      rotate(var(--droplet-release-angle, 0deg))
      translateX(1px)
      scaleX(1.018)
      scaleY(0.99)
      rotate(var(--droplet-release-angle-reverse, 0deg));
    border-radius: 48% 52% 51% 49% / 49% 51% 48% 52%;
  }
  100% {
    transform: scale(1);
    border-radius: 50%;
  }
}

.resume {
  background-color: #b8d3e9;
}

.projects {
  background-color: #fcb7ac;
  color: white;
}

.contact {
  background-color: #c6f6c8;
}

.signature-block {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 0rem;
  flex-wrap: wrap;
}

.signature-ink-clone {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(90%, 380px);
  height: auto;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  filter: blur(4px) contrast(1.22);
  -webkit-mask-image: radial-gradient(
    circle 42px at var(--signature-ink-x, 50%) var(--signature-ink-y, 50%),
    #000 0 42%,
    transparent 100%
  );
  mask-image: radial-gradient(
    circle 42px at var(--signature-ink-x, 50%) var(--signature-ink-y, 50%),
    #000 0 42%,
    transparent 100%
  );
  transition: filter 0.75s ease, opacity 0.32s ease;
}

.signature-ink-clone .signature-path {
  fill: var(--signature-ink-color, #1a1a1a);
}

.signature-ink-active .signature-ink-clone {
  opacity: 0.72;
}

.signature-ink-recovering .signature-ink-clone {
  opacity: 0;
  filter: blur(0) contrast(1);
  transition-duration: 2s;
  transition-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
}

@media (min-width: 601px) and (max-height: 850px) {
  .signature-ink-clone {
    width: min(90%, 310px);
  }
}

.signature {
  max-height: 60px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.signature:hover {
  transform: scale(1.03);
}

.signature-symbol:hover {
  transform: translateY(-18px) scale(1.03);
}

.signature-name {
  max-width: 250px;
}

.signature-symbol {
  transform: translateY(-18px);
  transition: transform 0.2s ease;
}

footer {
  background: #f2f2f2;
  padding: 3rem 2rem 2rem;
  border-top: 1px solid #ccc;
  margin-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.footer-grid > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Keep an older cached page shell from restoring the removed phone column. */
.footer-grid > div:has(a[href^="tel:"]) {
  display: none;
}

.footer-grid p {
  margin-bottom: 0.5rem;
}

.footer-grid .icons a {
  margin: 0 0.3rem;
  text-decoration: none;
  font-size: 1.2rem;
  color: #000;
}

.footer-grid a {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.footer-grid a:link,
.footer-grid a:visited,
.footer-grid a:active {
  text-decoration: none;
  color: inherit;
}

.footer-grid a:hover {
  transform: scale(1.03);
}

.copy {
  font-size: 0.9rem;
  color: #666;
}

.social-icon {
  height: 30px;
  width: auto;
  object-fit: contain;
  margin: 0 0.3rem;
  transition: transform 0.2s ease;
}

.github-icon {
  height: 25px;
  transform: translateY(-4px);
  transition: transform 0.2s ease;
}

.contact-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: center;
  align-items: flex-start;
  margin-top: -9rem;
  margin-bottom: 1rem;
}

.contact-text {
  max-width: 400px;
  text-align: center;
  margin-top: -3rem;
}

.contact-text h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.contact-text p {
  color: #444;
  font-size: 1rem;
}

.contact-form {
  background: #f2f2f2;
  border-radius: 20px;
  padding: 1.5rem;
  max-width: 450px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}

.contact-form .form-row {
  display: flex;
  gap: 1rem;
}

.contact-form button {
  background: #f7bf50;
  color: #f2f2f2;
  font-weight: bold;
  font-size: 1rem;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.contact-form button:hover {
  background: #d0992d;
}

.best_regards {
  display: block;
  margin: 0 auto;
  max-width: 300px;
  height: auto;
  margin-top: 1rem;
}

.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 10000;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot {
  width: 12px;
  height: 12px;
  background-color: #7800ff;
}

.cursor-outline {
  width: 36px;
  height: 36px;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 10000;
  transform: translate(-50%, -50%);
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
}


.cursor-outline-inner {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: rgba(120, 0, 255, 0.08);
  border: 1px solid rgba(120, 0, 255, 0.38);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}



.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  image-rendering: pixelated;
  mix-blend-mode: multiply;
  filter: none;
}

.cursor-outline {
  border-radius: 7px;
}

.progress-section {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-label {
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #222;
}

.progress-bar-container {
  width: 320px;
  height: 24px;
  background-color: #f2f2f2;
  border: 2px solid #333;
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
  overflow: hidden;
}

.progress-bar-fill {
  display: flex;
  height: 100%;
  gap: 2px;
  transition: all 1s ease-in-out;
}

.progress-percentage {
  margin-top: 0.5rem;
  font-size: 0.55rem;
  color: #555;
}

.progress-segment {
  width: 6px;
  height: 100%;
  background-color: #67c067;
  flex-shrink: 0;
  animation: segmentFadeIn 0.3s ease-in-out forwards;
  opacity: 0;
}

@keyframes segmentFadeIn {
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-center-wrapper {
  position: relative;
  height: 55vh;
}

.retro-font {
  font-family: 'Press Start 2P', monospace !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-section {
  position: relative;
}

.progress-days-left {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  margin-top: 2em;
  font-size: 0.7em;
  font-weight: normal;
  line-height: 1.7;
  text-align: center;
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}

@media (hover: none) and (pointer: coarse) {
  .cursor-dot,
  .cursor-outline,
  .cursor-trail,
  .portrait-smudge-cursor {
    display: none;
  }
}

/* Compact "business card" layout for short desktop viewports such as a
   13-inch MacBook. Keep every page inside the visible browser height. */
@media (min-width: 601px) and (max-height: 850px) {
  html,
  body {
    height: 100%;
    min-height: 100dvh;
    overflow: hidden;
  }

  header {
    flex: 0 0 auto;
    padding: 0.85rem 2rem;
  }

  main {
    min-height: 0;
    padding: 1rem 2rem 0.5rem;
  }

  .typing-text {
    height: 3rem;
    margin-bottom: 0.8rem;
    font-size: 2.5rem;
  }

  .about {
    margin-bottom: 1rem;
  }

  .about p {
    line-height: 1.4;
  }

  .buttons {
    gap: 1.4rem;
    margin-top: 0.65rem;
  }

  .circle {
    width: 82px;
    height: 82px;
    font-size: 0.85rem;
  }

  .signature-block {
    margin-top: 0.65rem;
  }

  .name-signature {
    width: min(90%, 310px);
  }

  footer {
    flex: 0 0 auto;
    margin-top: 0.35rem;
    padding: 1.15rem 2rem 0.9rem;
  }

  .footer-grid {
    gap: 1rem;
  }

  .footer-grid p {
    margin-bottom: 0.25rem;
  }

  .resume-main {
    padding: 2.5rem 2rem 0.65rem;
  }

  .resume-page .resume-main .circle.resume {
    width: 64px;
    height: 64px;
    margin-top: -3.75rem;
    margin-bottom: 0.65rem;
  }

  .resume-hint {
    top: 1rem;
  }

  .resume-explorer {
    min-height: 22rem;
  }

  .resume-year-wheel {
    height: 18rem;
    padding: 7.25rem 0;
  }

  .resume-project-rail.scrollable .resume-project-window {
    height: 15rem;
    padding: 5.5rem 0;
  }

  .resume-tabs {
    margin-top: 0.35rem;
  }

  .projects-page main,
  .contact-page > main:first-of-type {
    flex: 0 0 auto;
    padding: 2.5rem 2rem 0 !important;
  }

  .projects-page .circle.projects,
  .contact-page .circle.contact {
    width: 64px;
    height: 64px;
    margin-top: -3.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  .progress-center-wrapper {
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
  }

  .progress-section {
    top: 38%;
  }

  .contact-layout {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 0 0.35rem;
    padding: 0 2rem !important;
  }

  .contact-text {
    margin-top: 0;
  }

  .contact-form {
    max-width: 420px;
    padding: 1rem;
    gap: 0.55rem;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 0.5rem 0.8rem;
  }

  .best_regards {
    max-width: 220px;
    margin-top: 0.35rem;
  }
}

/* Keep the home composition visually consistent across desktop browsers.
   Browser chrome changes the reported viewport height, so this page scales
   continuously instead of jumping at the compact-layout breakpoint. */
@media (min-width: 601px) {
  .home-page > main {
    padding: clamp(3.15rem, 7vh, 4rem) 2rem clamp(0.5rem, 1.2vh, 1rem);
  }

  .home-page .typing-text {
    height: clamp(3rem, 6.4vh, 3.6rem);
    margin-bottom: clamp(0.8rem, 2.2vh, 2rem);
    font-size: clamp(2.5rem, 5.4vh, 3rem);
  }

  .home-page .about {
    margin-bottom: clamp(1rem, 3.5vh, 3rem);
  }

  .home-page .about p {
    line-height: 1.5;
  }

  .home-page .buttons {
    gap: clamp(1.4rem, 2.5vw, 2rem);
    margin-top: clamp(0.65rem, 2vh, 2rem);
  }

  .home-page .circle {
    width: clamp(82px, 11vh, 100px);
    height: clamp(82px, 11vh, 100px);
    font-size: clamp(0.85rem, 1.8vh, 1rem);
  }

  .home-page .signature-block {
    margin-top: clamp(0.65rem, 2.2vh, 2rem);
  }

  .home-page .name-signature,
  .home-page .signature-ink-clone {
    width: min(90%, clamp(310px, 42vh, 380px));
  }
}

@media (max-width: 600px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .projects-page main,
  .contact-page main {
    padding: 3rem 1.25rem 2rem;
  }

  .projects-page .circle.projects {
    margin-top: -1rem;
    margin-bottom: 2.5rem;
  }

  .contact-page .circle.contact {
    margin-top: -1rem;
    margin-bottom: 2rem;
  }

  header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem;
    text-align: center;
  }

  .top-nav {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  main {
    padding: 2.5rem 1.25rem 1rem;
  }

  .typing-text {
    font-size: clamp(1.5rem, 9vw, 3rem);
    height: clamp(1.8rem, 10.8vw, 3.6rem);
  }

  .typing-text.typing-quote {
    max-width: 100%;
    font-size: clamp(0.75rem, 3.4vw, 0.95rem);
    letter-spacing: -0.015em;
  }

  .buttons {
    gap: 1rem;
  }

  .circle {
    width: 80px;
    height: 80px;
    font-size: 0.85rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .progress-bar-container {
    width: min(320px, 100%);
  }

  .contact-layout {
    margin-top: 0;
  }

  .contact-text {
    margin-top: 0;
  }

  .progress-center-wrapper {
    height: auto;
    margin: 2rem 0 3rem;
  }

  .progress-section {
    position: static;
    transform: none;
  }

  .progress-days-left {
    position: static;
    transform: none;
    margin-top: 1.5rem;
    padding: 0 0.5rem;
  }

  .resume-main {
    padding: 3rem 1.25rem 2rem;
    overflow-x: hidden;
  }

  .resume-hint {
    display: none;
  }

  .resume-page .resume-main .circle.resume {
    margin-top: -1rem;
    margin-bottom: 2.5rem;
  }

  .resume-explorer {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 0;
    min-width: 0;
    width: calc(100vw - 2.5rem);
    max-width: calc(100vw - 2.5rem);
  }

  .resume-project-rail {
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 2.5rem);
  }

  .resume-project-rail.scrollable .resume-project-window {
    width: 100%;
    height: auto;
    margin-left: 0;
    overflow-x: hidden;
    padding: 0.5rem 0;
    mask-image: none;
    overscroll-behavior-x: contain;
    touch-action: pan-y;
    scrollbar-width: none;
  }

  .resume-project-rail.scrollable .resume-project-window::-webkit-scrollbar {
    display: none;
  }

  .resume-project-list,
  .resume-project-rail.scrollable .resume-project-list {
    flex-direction: row;
    justify-content: center;
    transform: none;
  }

  .resume-project-item {
    scroll-snap-align: center;
  }

  .resume-project-rail.scrollable .resume-project-list {
    align-items: center;
    justify-content: flex-start;
    padding-inline: calc(50% - 1.925rem);
  }

  .resume-project-hint {
    display: none;
  }

  .resume-series-panel {
    position: absolute;
    z-index: 6;
    top: auto;
    right: auto;
    bottom: calc(100% - 0.25rem);
    left: 50%;
    width: min(100%, 22rem);
    max-height: min(24rem, 66dvh);
    margin: 0;
    transform: translateX(-50%);
  }

  .resume-series-header {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .resume-series-header button {
    margin-left: auto;
  }

  .resume-series-games {
    max-height: min(18.5rem, calc(66dvh - 4.5rem));
  }

  .resume-year-wheel {
    width: min(100%, 18rem);
    max-width: calc(100vw - 2.5rem);
    height: 10.5rem;
    margin: 0 auto;
    padding: 3.5rem 0;
    touch-action: none;
    overscroll-behavior: contain;
  }

  .resume-year {
    padding: 0 0.25rem;
    font-size: 0.78rem;
  }

  .resume-year:focus,
  .resume-year:focus-visible {
    outline: none;
    box-shadow: none;
  }

  .resume-year.selected {
    transform: scale(1);
  }

  .resume-year.selected::before {
    margin-right: 0.5rem;
  }

  .resume-year.selected::after {
    margin-left: 0.5rem;
  }

  .resume-card {
    width: 100%;
    min-width: 0;
    max-width: calc(100vw - 2.5rem);
    min-height: 0;
    text-align: center;
  }

  .resume-card h1 {
    font-size: clamp(2.15rem, 12vw, 3.2rem);
    overflow-wrap: anywhere;
  }

  .resume-card h2,
  .resume-description {
    width: 100%;
    max-width: calc(100vw - 2.5rem);
    margin-right: auto;
    margin-left: auto;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .resume-chips {
    width: 100%;
    max-width: calc(100vw - 2.5rem);
    margin-right: auto;
    margin-left: auto;
    justify-content: center;
  }

  .resume-details-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    text-align: left;
  }

  .resume-details-grid section:last-child ul {
    columns: 1;
  }

  .resume-modal {
    width: calc(100% - 1.5rem);
    height: calc(100dvh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    border-radius: 1rem;
  }

  .resume-modal-header {
    padding: 1.4rem 1.25rem 1rem;
  }

  .resume-modal-content {
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    align-content: start;
    gap: clamp(1.25rem, 4vh, 2rem);
    max-height: none;
    min-height: 0;
    padding: 1.25rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .resume-page footer {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }

}

/* Projects — portrait archive */
.projects-page .projects-main {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 4.8rem 2rem 1.4rem;
}

.projects-page .projects-main > .circle.projects {
  position: absolute;
  top: -2.5rem;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
}

.projects-page .projects-main > .circle.projects:hover {
  transform: translateX(-50%);
}

.portfolio-build {
  position: absolute;
  top: 0.8rem;
  left: max(2rem, calc((100% - 1240px) / 2));
  width: 210px;
  font-family: 'Source Code Pro', monospace;
  text-transform: uppercase;
}

.portfolio-build-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.portfolio-build .progress-bar-container {
  width: 100%;
  height: 4px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
}

.portfolio-build .progress-bar-fill {
  height: 100%;
  gap: 0;
  background: #111;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.portfolio-build-days {
  margin: 0.45rem 0 0;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

.projects-gallery {
  display: grid;
  grid-template-columns: minmax(15rem, 17.5rem) minmax(19rem, 27rem) minmax(9rem, 12rem);
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  width: min(1180px, 100%);
  min-height: 0;
  text-align: left;
}

.projects-kicker,
.portrait-archive > p:first-child {
  margin: 0 0 0.85rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.5;
}

.projects-intro h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.7rem, 4vw, 3.55rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
}

.projects-intro h1 span {
  display: block;
  white-space: nowrap;
}

.projects-filters {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.projects-filter {
  position: relative;
  border: 1px solid rgba(17, 17, 17, 0.28);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: transparent;
  color: #111;
  font-size: 0.72rem;
}

.projects-filter.active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.projects-filter:disabled {
  cursor: default;
  opacity: 0.38;
}

.projects-filter span {
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 50%;
  width: max-content;
  transform: translateY(-50%);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.projects-filter:disabled:hover span {
  opacity: 1;
}

.projects-note {
  max-width: 14rem;
  margin: 1.3rem 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
  opacity: 0.68;
}

.portrait-stage {
  min-width: 0;
}

.portrait-paper {
  position: relative;
  height: min(52vh, 550px);
  aspect-ratio: 0.75;
  margin: 0 auto;
  padding: 0.55rem;
  background: rgba(250, 247, 239, 0.72);
  box-shadow: 0 0.7rem 2rem rgba(49, 28, 24, 0.12), 0 2rem 4rem rgba(49, 28, 24, 0.08);
  transform: rotate(-0.12deg);
  cursor: none;
}

body.portrait-inspecting .cursor-dot,
body.portrait-inspecting .cursor-outline,
body.portrait-inspecting .cursor-trail,
body.portrait-drawing .cursor-dot,
body.portrait-drawing .cursor-outline,
body.portrait-drawing .cursor-trail {
  visibility: hidden;
}

.portrait-smudge-cursor {
  --smudge-cursor-value: 86;
  --draw-tool-angle: -12deg;
  position: fixed;
  z-index: 10002;
  top: 0;
  left: 0;
  width: 1.8rem;
  height: 2.25rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -54%) rotate(var(--draw-tool-angle)) scale(0.82);
  transition: opacity 0.14s ease, transform 0.14s ease;
  filter: drop-shadow(0 2px 3px rgba(17, 17, 17, 0.15));
  will-change: left, top, transform;
}

body.portrait-drawing .portrait-smudge-cursor {
  opacity: 0.88;
  transform: translate(-50%, -54%) rotate(var(--draw-tool-angle)) scale(1);
}

body.portrait-drawing.is-smudging .portrait-smudge-cursor {
  transform: translate(-50%, -48%) rotate(var(--draw-tool-angle)) scale(0.9, 0.94);
}

body.portrait-drawing .portrait-modal,
body.portrait-drawing .portrait-modal * {
  cursor: none !important;
}

.portrait-smudge-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.portrait-smudge-cursor .fingerprint-cursor-path {
  fill: none;
  stroke: rgb(
    var(--smudge-cursor-value)
    var(--smudge-cursor-value)
    var(--smudge-cursor-value)
  );
  stroke-width: 1.05;
  stroke-linecap: round;
  opacity: 0.86;
}

.pencil-cursor-art {
  display: none;
}

body.draw-tool-pencil .portrait-smudge-cursor {
  width: 2.4rem;
  height: 2.4rem;
  transform-origin: 15% 81%;
  transform: translate(-15%, -81%) rotate(-12deg) scale(1);
}

body.draw-tool-pencil.is-smudging .portrait-smudge-cursor {
  transform: translate(-15%, -81%) rotate(-12deg) scale(0.92);
}

body.draw-tool-pencil .fingerprint-cursor-path {
  display: none;
}

body.draw-tool-pencil .pencil-cursor-art {
  display: block;
}

.eraser-cursor-art {
  display: none;
}

body.draw-tool-eraser .fingerprint-cursor-path,
body.draw-tool-eraser .pencil-cursor-art {
  display: none;
}

body.draw-tool-eraser .eraser-cursor-art {
  display: block;
}

body.draw-tool-eraser .portrait-smudge-cursor {
  width: 2.3rem;
  height: 2.3rem;
  transform-origin: 18% 82%;
  transform: translate(-18%, -82%) rotate(-18deg) scale(1);
}

body.draw-tool-eraser.is-smudging .portrait-smudge-cursor {
  transform: translate(-18%, -82%) rotate(-18deg) scale(0.92);
}

.eraser-cursor-body,
.eraser-cursor-edge {
  fill: rgba(247, 243, 233, 0.96);
  stroke: #111;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.eraser-cursor-edge {
  fill: none;
  opacity: 0.68;
}

.pencil-cursor-body,
.pencil-cursor-mark {
  fill: none;
  stroke: rgb(var(--smudge-cursor-value) var(--smudge-cursor-value) var(--smudge-cursor-value));
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pencil-cursor-tip {
  fill: rgb(var(--smudge-cursor-value) var(--smudge-cursor-value) var(--smudge-cursor-value));
}

.pencil-cursor-mark {
  stroke-width: 1;
  opacity: 0.48;
}

.portrait-paper > img {
  display: block;
  width: 100%;
  height: 100%;
  background: #f4f0e6;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.portrait-lens {
  position: absolute;
  z-index: 2;
  width: 9.5rem;
  height: 9.5rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  background-repeat: no-repeat;
  box-shadow: 0 0.8rem 2.4rem rgba(17, 17, 17, 0.25), inset 0 0 0 1px rgba(17, 17, 17, 0.12);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.portrait-paper.inspecting .portrait-lens {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.portrait-open {
  position: absolute;
  z-index: 3;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.45rem;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 999px;
  padding: 0.55rem 0.85rem 0.55rem 1rem;
  background: rgba(250, 247, 239, 0.94);
  color: #111;
  box-shadow: 0 0.5rem 1.5rem rgba(17, 17, 17, 0.14);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.portrait-open:hover,
.portrait-open:focus-visible {
  background: #111;
  color: #fff;
  transform: translateY(-2px);
}

.portrait-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 0.65rem;
}

.portrait-caption h2 {
  margin: 0;
  font-size: 0.9rem;
}

.portrait-caption span {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  opacity: 0.5;
}

.portrait-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.portrait-thumb {
  position: relative;
  aspect-ratio: 0.75;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.18);
  padding: 0;
  background: transparent;
  opacity: 0.38;
  transform: scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.portrait-thumb:hover,
.portrait-thumb:focus-visible {
  opacity: 0.72;
  transform: scale(1);
}

.portrait-thumb.active {
  border-color: #111;
  opacity: 1;
  transform: scale(1);
}

.portrait-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}

.portrait-thumb span {
  position: absolute;
  left: 0.3rem;
  bottom: 0.3rem;
  border-radius: 0.25rem;
  padding: 0.18rem 0.28rem;
  background: rgba(250, 247, 239, 0.9);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.48rem;
}

.portrait-archive-note {
  margin: 0.8rem 0 0;
  font-size: 0.62rem;
  line-height: 1.5;
  opacity: 0.58;
}

.portrait-magnifier-settings {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(17, 17, 17, 0.18);
}

.portrait-magnifier-settings > p {
  margin: 0 0 0.65rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
}

.portrait-magnifier-settings label {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) 2.2rem;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
  font-size: 0.56rem;
}

.portrait-magnifier-settings input[type="range"] {
  width: 100%;
  height: 0.2rem;
  accent-color: #111;
}

.portrait-magnifier-settings output {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.5rem;
  text-align: right;
  opacity: 0.55;
}

.portrait-magnifier-settings .portrait-magnifier-hint {
  margin: 0.7rem 0 0;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.43rem;
  line-height: 1.55;
  letter-spacing: 0.04em;
  opacity: 0.42;
}

.portrait-modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: 0;
  padding: 0;
  background: transparent;
}

.portrait-modal::backdrop {
  background: rgba(38, 31, 29, 0.62);
  backdrop-filter: blur(7px);
}

.portrait-modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(90vw, 1040px);
  height: min(82dvh, 780px);
  margin: 9dvh auto;
  overflow: visible;
  border-radius: 1.25rem;
  background: #f7f3e9;
  box-shadow: 0 2rem 6rem rgba(17, 17, 17, 0.3);
}

.portrait-modal-card > header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(17, 17, 17, 0.13);
}

.portrait-modal-card header p {
  margin: 0 0 0.2rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
}

.portrait-modal-card header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.portrait-modal-card header button {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(17, 17, 17, 0.25);
  border-radius: 50%;
  background: transparent;
  font-size: 1.4rem;
}

.portrait-modal-workspace {
  display: grid;
  grid-template-columns: 18.5rem minmax(0, 1fr);
  min-height: 0;
  padding: 0 1.75rem;
}

.portrait-modal-tools {
  position: relative;
  z-index: 4;
  align-self: start;
  padding: 1.35rem 1.5rem 0 0;
}

.portrait-modal-summary > p,
.portrait-tool-panel[data-portrait-panel="draw"] > p {
  margin: 0 0 0.55rem;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.48;
}

.portrait-modal-summary > div {
  font-size: 0.84rem;
  line-height: 1.6;
  opacity: 0.78;
}

.portrait-modal-summary {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(17, 17, 17, 0.16);
}

.portrait-mode-tabs {
  display: flex;
  gap: 0.4rem;
  margin-top: 0;
}

.portrait-mode-tabs button,
.portrait-draw-actions button {
  border: 1px solid rgba(17, 17, 17, 0.24);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  background: transparent;
  color: #111;
  font-size: 0.68rem;
}

.portrait-mode-tabs button.active {
  border-color: #111;
  background: #111;
  color: #fff;
}

.portrait-tool-panel {
  display: none;
  margin-top: 1.15rem;
  height: 15.5rem;
}

.portrait-tool-panel.active {
  display: block;
}

.portrait-tool-panel[data-portrait-panel="magnify"] p {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  line-height: 1.5;
  opacity: 0.65;
}

.portrait-tool-panel[data-portrait-panel="magnify"] span {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  opacity: 0.42;
}

.portrait-modal-magnifier-settings {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.9rem;
  min-height: 7.5rem;
}

.portrait-modal-magnifier-settings label {
  font-size: 0.68rem;
}

.portrait-modal-magnifier-settings output {
  font-size: 0.62rem;
}

.portrait-tool-panel[data-portrait-panel="magnify"] .portrait-modal-magnifier-settings .portrait-magnifier-hint {
  margin: 0.7rem 0 0;
  font-size: 0.56rem;
  line-height: 1.55;
  opacity: 0.42;
}

.graphite-palette {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 2.55rem);
  gap: 0.25rem 0.35rem;
  min-height: 6.4rem;
  padding: 0.45rem 0.1rem;
}

.portrait-draw-picker {
  display: flex;
  align-items: center;
  gap: 1.45rem;
}

.portrait-draw-tools {
  display: grid;
  min-width: 4.2rem;
  justify-items: center;
  gap: 0.45rem;
  padding-left: 0.85rem;
  border-left: 1px solid rgba(17, 17, 17, 0.14);
}

.portrait-draw-tools > button {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.26);
  border-radius: 50%;
  background: rgba(247, 243, 233, 0.66);
  color: #111;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.portrait-draw-tools > button:hover {
  border-color: rgba(17, 17, 17, 0.58);
}

.portrait-modal-card button.droplet-impact {
  animation: droplet-impact 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.portrait-modal-card button.droplet-release {
  animation: droplet-release 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.portrait-draw-tools > button.active {
  border-color: #111;
  background: #111;
  color: #f7f3e9;
}

.portrait-draw-tools > button svg {
  width: 1.55rem;
  height: 1.55rem;
  overflow: visible;
}

.portrait-draw-tools > button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portrait-draw-tools .pencil-tip {
  fill: currentColor;
}

.portrait-draw-tools .pencil-mark {
  opacity: 0.5;
}

.graphite-palette button {
  position: relative;
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  transform: rotate(-5deg) translateY(0.15rem);
}

.graphite-palette button:nth-child(2n) { transform: rotate(7deg) translateY(-0.2rem); }
.graphite-palette button:nth-child(3n) { transform: rotate(-10deg) translateX(0.2rem); }
.graphite-palette button:nth-child(5n) { transform: rotate(4deg) translate(-0.15rem, 0.25rem); }

.graphite-palette i {
  position: absolute;
  inset: 0.18rem;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.62);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.72), transparent 38%),
    #eee9de;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.46),
    0 1px 2px rgba(17, 17, 17, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.graphite-palette i::before,
.graphite-palette i::after {
  position: absolute;
  content: '';
  inset: 0.1rem -0.22rem;
  border-radius: 50%;
  background: repeating-linear-gradient(
    169deg,
    rgb(var(--graphite-value, 18) var(--graphite-value, 18) var(--graphite-value, 18)) 0 1.25px,
    transparent 1px var(--graphite-spacing, 2.7px)
  );
  opacity: var(--graphite-opacity, 0.65);
}

.graphite-palette i::after {
  inset: 0.22rem -0.18rem;
  background: repeating-linear-gradient(
    13deg,
    rgb(var(--graphite-value, 18) var(--graphite-value, 18) var(--graphite-value, 18) / 0.9) 0 1px,
    transparent 1px var(--graphite-secondary-spacing, 4.3px)
  );
  opacity: var(--graphite-secondary-opacity, 0.53);
}

.graphite-palette span {
  position: relative;
  z-index: 1;
  padding: 0.12rem 0.2rem;
  border-radius: 0.2rem;
  color: #050505;
  background: rgba(247, 243, 233, 0.92);
  box-shadow: 0 0 0 1px rgba(247, 243, 233, 0.72);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  font-weight: 700;
}

.graphite-palette button.graphite-none i {
  background: rgba(247, 243, 233, 0.96);
}

.graphite-palette button.graphite-none i::before,
.graphite-palette button.graphite-none i::after {
  opacity: 0;
}

.graphite-palette button.graphite-none i {
  background:
    linear-gradient(135deg, transparent 45%, #111 46% 53%, transparent 54%),
    rgba(247, 243, 233, 0.96);
}

.graphite-palette button.selected i {
  transform: scale(1.16) rotate(-2deg);
  box-shadow:
    inset 0 0 0 1px rgba(17, 17, 17, 0.86),
    0 0 0 2px #f7f3e9,
    0 0 0 3px #111,
    0 5px 10px rgba(17, 17, 17, 0.22);
}

body.draw-tool-eraser .graphite-palette button:not(.graphite-none) {
  opacity: 0.26;
  filter: grayscale(1);
  cursor: not-allowed;
}

.portrait-draw-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.3rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(17, 17, 17, 0.14);
  width: 100%;
  align-items: stretch;
}

.portrait-draw-actions button {
  min-width: 3.75rem;
  padding-inline: 0.6rem;
}

.portrait-detail-focus {
  display: flex;
  gap: 0.9rem;
  margin-top: 1rem;
}

.portrait-detail-focus[hidden] {
  display: none;
}

.portrait-detail-focus figure {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  margin: 0;
}

.portrait-detail-focus.is-trio {
  gap: 0.55rem;
}

.portrait-detail-focus.is-trio .portrait-detail-crop {
  width: 5.1rem;
  height: 5.1rem;
}

.portrait-detail-crop {
  display: block;
  width: 6.8rem;
  height: 6.8rem;
  border: 0.32rem solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background-repeat: no-repeat;
  background-color: #eee9de;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.2), 0 0.65rem 1.6rem rgba(17, 17, 17, 0.13);
}

.portrait-detail-moustache {
  background-size: 180% auto;
  background-position: 50% 67%;
}

.portrait-detail-sweater {
  background-size: 195% auto;
  background-position: 68% 100%;
}

.portrait-detail-image {
  background-size: contain;
  background-position: center;
}

.portrait-detail-focus figcaption {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  opacity: 0.56;
}

.portrait-modal-image {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 1rem 0 0 1rem;
  overflow: visible;
}

.portrait-modal-paper {
  position: relative;
  width: auto;
  height: calc(100% + 2rem);
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: calc(100% + 2rem);
  aspect-ratio: 0.75;
  border: 0.7rem solid rgba(255, 255, 255, 0.72);
  background: #f4f0e6;
  box-shadow: 0 1rem 3rem rgba(17, 17, 17, 0.16);
  touch-action: none;
}

.portrait-modal-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

#portraitDrawCanvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: normal;
}

.portrait-modal-image.draw-mode #portraitDrawCanvas {
  pointer-events: auto;
  cursor: none;
}

.portrait-modal-image.magnify-mode .portrait-modal-paper {
  cursor: none;
}

.portrait-modal-lens {
  position: absolute;
  z-index: 5;
  width: 14rem;
  height: 14rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  background-repeat: no-repeat;
  box-shadow: 0 1.2rem 3.5rem rgba(17, 17, 17, 0.3), inset 0 0 0 1px rgba(17, 17, 17, 0.16);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.portrait-modal-lens.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.portrait-modal-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.2rem;
  margin: 0 1.75rem;
  border-top: 1px solid rgba(17, 17, 17, 0.15);
  color: rgba(17, 17, 17, 0.62);
  font-size: 0.72rem;
}

.portrait-modal-meta span:last-child {
  font-family: 'Source Code Pro', monospace;
}

body.portrait-modal-open {
  overflow: hidden;
}

@media (max-width: 820px) {
  .projects-page .projects-main {
    display: block;
    padding: 7rem 1.25rem 2rem;
  }

  .projects-page .projects-main > .circle.projects {
    top: 0;
  }

  .portfolio-build {
    position: relative;
    top: auto;
    left: auto;
    width: min(100%, 230px);
    margin: 0 0 2.25rem;
  }

  .projects-gallery {
    grid-template-columns: 1fr;
    gap: 2rem;
    width: min(100%, 520px);
    margin: 0 auto;
  }

  .projects-intro h1 {
    font-size: clamp(2.6rem, 12vw, 3.2rem);
  }

  .projects-filters {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .projects-filter span {
    display: none;
  }

  .projects-note {
    width: 100%;
    max-width: 100%;
  }

  .portrait-paper {
    width: min(100%, 430px);
    height: auto;
  }

  .portrait-lens {
    display: none;
  }

  .portrait-open {
    right: 0.9rem;
    bottom: 0.9rem;
    min-height: 2.75rem;
  }

  .portrait-archive {
    width: 100%;
  }

  .portrait-thumbs {
    grid-template-columns: repeat(4, minmax(4rem, 1fr));
  }

  .portrait-archive-note {
    display: none;
  }

  .portrait-magnifier-settings {
    display: none;
  }

  .portrait-modal-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 0 0.75rem;
  }

  .portrait-modal-tools {
    padding: 0.65rem 0 0.35rem;
  }

  .portrait-modal-summary {
    display: none;
  }

  .portrait-mode-tabs {
    justify-content: center;
    margin-top: 0;
  }

  .portrait-tool-panel[data-portrait-panel="magnify"].active {
    display: none;
  }

  .portrait-tool-panel {
    height: auto;
  }

  .portrait-tool-panel[data-portrait-panel="draw"] {
    margin-top: 0.5rem;
  }

  .portrait-tool-panel[data-portrait-panel="draw"] > p {
    display: none;
  }

  .graphite-palette {
    display: flex;
    min-height: auto;
    justify-content: center;
    padding: 0.2rem 0;
  }

  .graphite-palette button {
    width: 2.15rem;
    height: 2.15rem;
  }

  .portrait-draw-actions {
    justify-content: center;
    margin-top: 0.3rem;
  }
}

@media (max-width: 600px) {
  .projects-page .projects-main {
    padding-top: 6.5rem;
  }

  .portfolio-build {
    margin-top: 0.5rem;
  }

  .portrait-open {
    right: 0.9rem;
    bottom: 0.9rem;
  }

  .portrait-caption {
    padding: 0 0.5rem;
  }

  .portrait-modal-card {
    width: calc(100vw - 1rem);
    height: calc(100dvh - 1rem);
    margin: 0.5rem;
    border-radius: 1rem;
  }

  .portrait-modal-image {
    padding: 0.25rem 0 0;
    overflow: hidden;
  }

  .portrait-modal-paper {
    width: auto;
    max-width: 100%;
    height: 100%;
    border-width: 0.45rem;
  }

  .portrait-modal-lens {
    width: 10rem;
    height: 10rem;
  }

  .portrait-modal-meta {
    min-height: 2.75rem;
    margin: 0 1rem;
    font-size: 0.52rem;
  }
}
