* {
  box-sizing: border-box;
}

:root {
  font-family: system-ui, sans-serif;
  color: #1e201e;
  background: #edeeea;
}

body {
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

.profile-link {
  position: fixed;
  inset: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) auto auto;
  z-index: 2;
  width: clamp(60px, 5.6vw, 78px);
  aspect-ratio: 1;
  padding: 3px;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgb(20 23 18 / .07), 0 5px 13px rgb(20 23 18 / .08);
}

.profile-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}

.profile-link:hover {
  box-shadow: 0 1px 2px rgb(20 23 18 / .08), 0 6px 16px rgb(20 23 18 / .16);
}

@media (max-width: 650px) and (max-height: 380px) and (orientation: landscape) {
  .profile-link { width: 48px; }
}

@media (max-width: 540px) and (max-height: 380px) and (orientation: landscape) {
  .profile-link { width: 44px; top: max(6px, env(safe-area-inset-top)); padding: 2px; }
}

@media (prefers-reduced-motion: no-preference) {
  .profile-link img {
    view-transition-name: profile-portrait;
  }

  .profile-link {
    view-transition-name: profile-chrome;
    animation: profile-nudge 5s infinite;
  }

  .project-card {
    view-transition-class: profile-card;
  }

  ::view-transition-new(profile-chrome) {
    animation: profile-restore 135ms ease 630ms both;
  }

  @keyframes profile-restore {
    from { opacity: 0; }
  }

  ::view-transition-new(profile-portrait) {
    animation: none;
    opacity: 0;
  }

  ::view-transition-group(profile-portrait) {
    animation-duration: var(--portrait-return);
    animation-delay: var(--portrait-return-delay);
    animation-fill-mode: both;
  }

  ::view-transition-old(profile-portrait) {
    mix-blend-mode: normal;
    animation: portrait-to-avatar var(--portrait-return) var(--print-ease) var(--portrait-return-delay) both;
  }

  ::view-transition-old(cv-work),
  ::view-transition-old(cv-record),
  ::view-transition-old(cv-showcase),
  ::view-transition-old(cv-role) {
    mix-blend-mode: normal;
    animation: cv-pull-up 158ms cubic-bezier(.65, 0, .85, .4) both;
  }

  ::view-transition-old(cv-roman),
  ::view-transition-old(cv-italic) {
    mix-blend-mode: normal;
    animation: cv-pull-up 190ms cubic-bezier(.65, 0, .85, .4) 35ms both;
  }

  ::view-transition-old(cv-roman) { animation-delay: 60ms; }

  ::view-transition-old(cv-navigation) {
    animation: profile-dissolve 180ms ease both;
  }

  @keyframes cv-pull-up {
    from { clip-path: inset(-12% -8% -12% -8%); }
    to { clip-path: inset(-12% -8% 102% -8%); transform: translateY(-8px); }
  }

  @keyframes portrait-to-avatar {
    0% { clip-path: inset(0 round var(--profile-portrait-corner)); transform: rotate(0); }
    38% { transform: rotate(3deg); }
    100% { clip-path: inset(0 round 50%); transform: rotate(0); }
  }

  @keyframes profile-nudge {
    0%, 91%, 100% { transform: none; }
    94% { transform: translateX(-1px) rotate(-.8deg); }
    96% { transform: translateX(1.5px) rotate(.65deg); }
    98% { transform: translateX(-.4px); }
  }
}

.deck {
  position: relative;
  height: 100vh;
  height: 100dvh;
  outline: none;
  overflow: hidden;
  contain: layout paint;
  isolation: isolate;
  touch-action: pinch-zoom;
}

.project-card {
  position: absolute;
  inset: 0 auto auto 0;
  margin: 0;
  width: min(100% - 42px, 1010px);
  transform-origin: top left;
  visibility: hidden;
  overflow: hidden;
  border-radius: clamp(8px, 1.15vw, 18px);
  background: var(--cover-ink, transparent);
  box-shadow:
    0 2px 4px rgb(21 27 26 / var(--cast-shadow, .12)),
    0 13px 28px rgb(21 27 26 / calc(var(--cast-shadow, .12) * .8));
}

.deck:not([data-ready]) .project-card:first-child {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100% - 42px, 1010px, 73dvh);
  visibility: visible;
}

.project-card h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

@media (max-width: 740px) {
  .project-card[data-board-mode="wide"] .stage {--board-height:var(--d0-height)}
  .project-card[data-board-mode="wide"] .stage[data-layout="1"] {--board-height:var(--d1-height)}
  .project-card[data-board-mode="wide"] .piece {--x:var(--d0-x);--y:var(--d0-y);--w:var(--d0-w);--h:var(--d0-h)}
  .project-card[data-board-mode="wide"] .stage[data-layout="1"] .piece {--x:var(--d1-x);--y:var(--d1-y);--w:var(--d1-w);--h:var(--d1-h)}
}

.project-card .board {
  position: absolute;
  width: var(--board-width);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: none;
  visibility: hidden;
}

.deck:not([data-ready]) .project-card:first-child .board {
  position: static;
  width: auto;
  transform: none;
  visibility: visible;
}

.project-card[data-open] .board,
.project-card.morphing .board {
  visibility: visible;
}

.recent-project, .version-index {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: clamp(.84rem, 1.45vw, 1.22rem);
  font-weight: 660;
  letter-spacing: -.026em;
  line-height: 1;
}

.recent-project {
  display: none;
  position: absolute;
  inset: 0 0 auto;
  height: var(--recent-space);
  margin: 0;
  place-items: center;
  color: var(--recent-ink);
}

.project-card[data-recent-project]:is([data-open], .morphing) {
  background: transparent;
  box-shadow: none;
}

.project-card[data-recent-project]:is([data-open], .morphing) .board {
  top: calc(50% + var(--recent-space) / 2);
}

.project-card[data-open][data-recent-project]:not(.morphing) .recent-project {display: grid}
.project-card[data-open][data-recent-project]:not(.morphing) .board {
  box-shadow: 0 4px 11px rgb(21 27 26 / .14), 0 15px 29px rgb(21 27 26 / .08);
}

@media (prefers-reduced-motion: no-preference) {
  .project-card[data-open][data-recent-project]:not(.morphing) .recent-project {
    animation: recent-project-in 250ms var(--print-ease) both;
  }
  @keyframes recent-project-in {
    from {opacity: 0; transform: translateY(4px)}
    to {opacity: 1; transform: none}
  }
}

.brand-face {
  position: absolute;
  inset: 0;
  z-index: 1;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  color: var(--cover-tone, #faf8ee);
  background: var(--cover-ink);
  font: inherit;
  cursor: pointer;
}

.brand-face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: #171525;
  opacity: var(--depth-shade, 0);
  pointer-events: none;
}

.project-card:not(.morphing) .brand-face:focus-visible {
  outline: 2px solid var(--cover-tone, #faf8ee);
  outline-offset: -2px;
}

.project-card[data-open]:not(.morphing) .brand-face {
  visibility: hidden;
}

.brand-face > :is(img, span, svg) {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.brand-face > :is(img, svg) {
  display: block;
  width: var(--mark-width, 42%);
  height: var(--mark-height, 54%);
  object-fit: contain;
}

#thirst-trap {
  --cover-ink: #dc2666;
  --cover-tone: #fff1e5;
  --mark-width: 44%;
}

#rachi-studio {
  --cover-ink: #5835d4;
  --cover-tone: #f5eaff;
  --mark-width: 46%;
}

#rachi-studio .brand-face .rachi-spiral-stroke {
  stroke: #d7baff;
}

#rachi-studio .brand-face .rachi-letter {
  fill: #fcf2ff;
}

#scruples {
  --cover-ink: #f4ebdd;
  --cover-tone: #25202b;
}

#scruples .brand-face span {
  font-family: Georgia, serif;
  font-size: clamp(2.15rem, 7.4vw, 5.45rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.068em;
}

#the-garden-doctors {
  --cover-ink: #087c5d;
  --cover-tone: #f6fbe9;
  --mark-width: 30%;
  --mark-height: 46%;
}

[data-unisave-version="1"] {
  --cover-ink: #ff7242;
  --cover-tone: #331925;
  --mark-width: 49%;
  --mark-height: 72%;
  --unisave-cap-top: #331925;
  --unisave-cap-body: #51243a;
  --unisave-wordmark: #331925;
}

[data-unisave-version="2"] {
  --cover-ink: #def272;
  --cover-tone: #273017;
  --mark-width: 51%;
  --mark-height: 57%;
}

[data-unisave-version="3"] {
  --cover-ink: #66aa45;
  --cover-tone: #f7fff3;
  --mark-width: 44%;
  --mark-height: 65%;
}

.version-index {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #363836;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.version-index[data-side] {
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  transform: translate(-100%, -50%);
}

.version-index[data-visible] {opacity: 1}

.version-steps {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  place-items: center;
  gap: 4px;
}

.version-steps > span {
  width: 4px;
  height: 4px;
  border-radius: 9px;
  background: currentColor;
  opacity: .34;
}

.version-index[data-step="1"] .version-steps > :nth-child(1),
.version-index[data-step="2"] .version-steps > :nth-child(2),
.version-index[data-step="3"] .version-steps > :nth-child(3) {
  opacity: 1;
  transform: scaleX(2);
}

@media (prefers-reduced-motion: no-preference) {
  .version-index {transition: opacity 180ms ease}
  .version-steps > span {transition: opacity 150ms ease, transform 260ms var(--print-ease)}
}

#juno-bakery {
  --cover-ink: #194ed1;
  --cover-tone: #eff5ff;
  --mark-width: 45%;
  --mark-height: 54%;
}

#first-word {
  --cover-ink: #79eadc;
  --cover-tone: #12142f;
  --mark-width: 53%;
  --mark-height: 55%;
}
