/* One 1920 x 1080 composition, scaled uniformly by script.js. */
:root { color-scheme: light; font-family: "Zen Maru Gothic", sans-serif; color: #483932; background: #9bd6f6; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
#portfolio-home { position: relative; width: 100%; height: 100%; overflow: hidden; }
.home-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-stage {
  position: absolute; left: 50%; top: 0; width: 1920px; height: 1080px;
  transform: translateX(-50%) scale(var(--stage-scale, 1));
  transform-origin: top center; isolation: isolate;
}
.decoration, .work { position: absolute; }
.decoration { z-index: 1; }
.art-slot { position: relative; }
/* Reserve full rotated bounds above the label. Original PNG files remain intact. */
.art-image { position: absolute; transform: rotate(var(--angle, 0deg)); transform-origin: center; }
.art-image img { position: absolute; max-width: none; user-select: none; }
.work .art-image { scale: 1.16; transform-origin: center bottom; }
#work-sunglasses .art-image, #work-horror .art-image, #work-garden .art-image { scale: 1.26; }
#work-energy .art-image { scale: 1.28 1.16; }
#work-horror .art-image { scale: 1.34; }
#work-cats .art-image { scale: 1.14; transform-origin: center top; }
#instruction-cloud, #puzzle-instruction, #navigation-cloud, #main-navigation { translate: 0 var(--header-downshift, 0px); }
.work, #puzzle-board, #puzzle-layer { translate: 0 var(--puzzle-downshift, 0px); }
.work { translate: 0 calc(var(--puzzle-downshift, 0px) + 20px); }
.puzzle-instruction {
  position: absolute; z-index: 2; left: 518px; top: 103px; margin: 0;
  font-size: 32px; line-height: 1.5; font-weight: 700; color: #68534a; white-space: nowrap;
  text-shadow: 1px 2px 3px rgb(72 57 50 / 18%);
}
.main-navigation {
  position: absolute; z-index: 2; left: calc(1619px + var(--right-gutter-shift, 0px)); top: 106px; display: flex; gap: 24px;
  font-size: 32px; line-height: 1.5; font-weight: 700; color: #68534a;
}
/* The work owns its position. Labels have no top, left or transform overrides. */
.work { z-index: 3; display: grid; grid-template-columns: max-content; gap: 4px; align-items: start; }
.work-label {
  translate: 0 -18px;
  position: static; margin: 0; margin-inline-start: var(--label-offset, 0px);
  display: grid; place-items: center; padding: 6px 12px;
  border-radius: 40px; background: #eadbc7;
  box-shadow: inset -5px 5px 4px rgb(255 255 255 / 50%), inset 5px -5px 5px rgb(0 0 0 / 15%);
  font-size: 24px; font-weight: 700; line-height: 1.42; color: #483932; text-align: center; white-space: nowrap;
}
/* The reference puts the parfait caption alongside the image. */
.work--side { grid-template-columns: max-content max-content; }
.work--side .work-label { margin-inline-start: 0; margin-block-start: var(--label-offset); }
/* Fine placement stays relative to each work, including the transparent piece corner. */
#work-parfait > .art-slot { transform: translateX(12px); }
#work-horror { grid-template-columns: 210px max-content; grid-template-rows: 198px auto; }
#work-horror > .art-slot { grid-area: 1 / 1 / 3 / 3; }
#work-horror > .work-label { grid-area: 2 / 2; margin-inline-start: 0; }
/* Align the requested right-hand elements into available widescreen space. */
#navigation-cloud { margin-inline-start: var(--right-gutter-shift, 0px); }
#work-energy > .work-label { margin-inline-start: calc(64px + var(--right-gutter-shift, 0px)); }
#work-parfait { margin-inline-start: var(--parfait-shift, 0px); }
.puzzle-layer { position: absolute; z-index: 2; left: 530px; top: 605px; width: 902px; height: 387.86px; border-radius: 40px; overflow: hidden; pointer-events: none; }
.puzzle-piece { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
body.modal-open { overflow: hidden; }
.puzzle-reset { position: fixed; right: 10px; bottom: 10px; z-index: 10; padding: 5px 9px; border: 1px solid #b8a99b; border-radius: 6px; background: #fffaf0; color: #68534a; font: 12px/1.4 sans-serif; cursor: pointer; }
.work-modal[hidden] { display: none; }
.work-modal { position: fixed; inset: 0; z-index: 50; font-family: "Noto Sans", sans-serif; color: #000; font-size: 18px; }
.work-modal__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 52%); }
.work-modal__dialog { position: absolute; inset: 5vh 6vw; display: grid; grid-template-columns: minmax(280px, 42%) 1fr; gap: 4vw; max-height: 90vh; overflow: hidden; margin: auto; padding: 5vh 5vw; background: #fff; border-radius: 8px; box-shadow: 0 12px 40px rgb(0 0 0 / 30%); }
.work-modal__image-wrap { min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; }
.work-modal__image { display: block; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.work-modal__content { min-width: 0; overflow-y: auto; padding: 1.5rem 2rem 2rem 0; line-height: 1.65; }
.work-modal__content h2 { display: none; }
.work-modal__content p { margin: 0 0 1.4rem; }
.work-modal__content strong { font-weight: 700; font-size: 20px; }
.work-modal__content a { color: #000; overflow-wrap: anywhere; }
.work-modal__close { position: absolute; top: 1rem; right: 1.5rem; z-index: 1; width: 2.5rem; height: 2.5rem; border: 0; outline: none; background: transparent; color: #333; font: 400 3rem/1 sans-serif; cursor: pointer; }
@media (max-width: 800px) { .work-modal__dialog { inset: 3vh 3vw; grid-template-columns: 1fr; grid-template-rows: 38% 1fr; gap: 1rem; padding: calc(3.5rem + 18px) 1.25rem 1.25rem; } .work-modal__content { padding: 0 0 1rem; font-size: 18px; } .work-modal__image-wrap { overflow: hidden; } }
/* Requested home composition refinements. */
#work-sunglasses > .art-slot { transform: translateX(-40px); }
#puzzle-board, #puzzle-layer { translate: -30px var(--puzzle-downshift, 0px); }
#instruction-cloud, #puzzle-instruction { translate: -30px var(--header-downshift, 0px); }
#navigation-cloud { scale: .95; transform-origin: 195px 67.766px; }
#main-navigation { left: calc(1526px + var(--right-gutter-shift, 0px)); top: 57px; width: 390px; height: 135.5319px; display: grid; place-items: center; }
#label-sunglasses, #label-horror, #label-garden, #label-parfait, #label-energy { translate: -30px -43px; }
#work-aroma > .art-slot { z-index: 1; }
#work-energy .art-image { scale: 1.40 1.27; }
#work-cats { margin-left: 30px; }
#puzzle-reset { position: absolute; left: 1280px; top: 921px; right: auto; bottom: auto; width: 250px; padding: 0; border: 0; background: transparent; translate: 0 var(--puzzle-downshift, 0px); }
#puzzle-reset img { display: block; width: 100%; height: auto; }
/* Keep every work piece in front of its label where they overlap. */
.work > .art-slot { position: relative; z-index: 1; }
.work > .work-label { position: relative; z-index: 0; }
.home-intro #puzzle-instruction, .home-intro #puzzle-board, .home-intro #puzzle-layer,
.home-intro .work, .home-intro #puzzle-reset, .home-intro #nav-profile { visibility: hidden; }
.home-intro .home-revealed, .home-intro #puzzle-instruction.home-revealed,
.home-intro #puzzle-board.home-revealed, .home-intro #puzzle-layer.home-revealed,
.home-intro #puzzle-reset.home-revealed, .home-intro #nav-profile.home-revealed { visibility: visible; }
.home-letter { visibility: hidden; }
.home-letter.home-revealed { visibility: visible; }
.home-intro #puzzle-reset.home-revealed { animation: reset-appear 600ms ease-out both; }
@keyframes reset-appear { from { opacity: 0; } to { opacity: 1; } }
#main-navigation { font-size: 40px; }
/* Animate only the artwork; the article, label and hit area stay in place. */
#home-stage[data-phase="complete"] .work .art-image img {
  animation: var(--float-path, work-float) var(--float-duration, 4.5s) ease-in-out var(--float-delay, 0s) infinite;
}
#work-sunglasses { --float-duration: 4.4s; --float-delay: 0s; }
#work-energy { --float-duration: 4.8s; --float-delay: .6s; }
#work-garden { --float-duration: 4.6s; --float-delay: 1.2s; }
#work-panda { --float-duration: 4.2s; --float-delay: .3s; }
#work-cats { --float-duration: 4.9s; --float-delay: 1.5s; }
#work-horror { --float-duration: 4.5s; --float-delay: .9s; }
#work-parfait { --float-duration: 4.7s; --float-delay: 1.8s; }
#work-aroma { --float-duration: 4.3s; --float-delay: 2.1s; }
@keyframes work-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -2.8px; } }
@media (prefers-reduced-motion: reduce) {
  #home-stage[data-phase="complete"] .work .art-image img { animation: none; }
}
#work-energy, #work-aroma { --float-path: work-drift-horizontal; }
#work-garden, #work-parfait { --float-path: work-drift-diagonal; }
#work-cats { --float-path: work-drift-diagonal-reverse; }
#work-horror { --float-path: work-drift-down; }
@keyframes work-drift-horizontal { 0%,100% { translate: 0 0; } 50% { translate: 2.8px 0; } }
@keyframes work-drift-diagonal { 0%,100% { translate: 0 0; } 35% { translate: 1.8px -2px; } 70% { translate: -.6px -1.4px; } }
@keyframes work-drift-diagonal-reverse { 0%,100% { translate: 0 0; } 40% { translate: -2px 1.8px; } 75% { translate: -.4px 1px; } }
@keyframes work-drift-down { 0%,100% { translate: 0 0; } 50% { translate: 0 2.8px; } }
.home-intro #nav-profile.home-revealed { animation: reset-appear 600ms ease-out both; }
.mobile-home { display: none; }
@media (max-width: 700px) {
 html:has(#portfolio-home), body:has(#portfolio-home) { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
 #portfolio-home { height: auto; min-height: 100svh; overflow: hidden; }
 #portfolio-home .home-background { position: fixed; height: 100svh; }
 #home-stage { position: relative; left: auto; top: auto; width: 100%; height: auto; transform: none; padding: 20px 0 30px; display: grid; grid-template-columns: 4% 92% 4%; grid-template-areas: '. heading .' '. nav .' '. works .' '. board .' '. reset .'; row-gap: 18px; }
 #instruction-cloud, #navigation-cloud { display: none; }
 #puzzle-instruction { grid-area: heading; position: relative; left: auto; top: auto; translate: none; width: 100%; min-height: 116px; padding: 25px 24px; display: block; font-size: 18px; line-height: 1.65; white-space: normal; text-align: center; background: url('assets/profile/cloud.png') center / 100% 100% no-repeat; }
 #main-navigation { grid-area: nav; position: relative; left: auto; top: auto; translate: none; width: auto; height: auto; display: flex; justify-content: center; gap: 30px; font-size: 23px; }
 #main-navigation a { min-height: 44px; padding: 6px 12px; color: inherit; text-decoration: none; }
 #main-navigation .mobile-home { display: block; }
 #works { grid-area: works; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 12px; padding: 4px 0 14px; }
 #works .work { position: relative; left: auto !important; top: auto !important; translate: none; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; cursor: pointer; }
 #works .work > .art-slot { width: 100% !important; height: auto !important; aspect-ratio: 1; transform: none; display: grid; place-items: center; }
 #works .work .art-image { position: relative; width: 100% !important; height: 100% !important; left: auto !important; top: auto !important; scale: none; transform: none; }
 #works .work .art-image img { inset: 0 !important; width: 100% !important; height: 100% !important; object-fit: contain; }
 #works .work > .work-label { width: 100% !important; min-height: 48px !important; margin: 0; translate: none; font-size: 14px; line-height: 1.5; padding: 8px 7px; white-space: normal; border-radius: 22px; }
 #puzzle-board { grid-area: board; position: relative; left: auto !important; top: auto !important; translate: none; width: 100%; aspect-ratio: 964 / 445.0187; }
 #puzzle-board .art-slot, #puzzle-board .art-image { width: 100% !important; height: 100% !important; left: 0 !important; top: 0 !important; }
 #puzzle-board img { width: 105.22244% !important; height: auto !important; left: -2.64345% !important; top: -18.5754% !important; }
 #puzzle-layer { grid-area: board; position: relative; left: auto; top: auto; translate: none; align-self: start; width: 93.568465%; height: auto; aspect-ratio: 902 / 387.86; margin: 3.008299% 0 0 3.319502%; border-radius: 4.43459% / 10.312%; }
 #puzzle-reset { grid-area: reset; position: relative; left: auto; top: auto; right: auto; bottom: auto; translate: none; width: 155px; min-height: 60px; justify-self: end; margin-top: -12px; }
 html:has(#portfolio-home):has(body.modal-open), body.modal-open:has(#portfolio-home) { overflow: hidden; }
}
#mobile-top { display: none; }
@media (max-width: 700px) {
 #home-stage { grid-template-areas: '. heading .' '. nav .' '. board .' '. reset .' '. works .'; padding-bottom: 100px; row-gap: 10px; }
 #puzzle-instruction { width: 108%; margin-left: -4%; min-height: 0; aspect-ratio: 1965 / 800; padding: 11% 13% 5%; font-size: clamp(14px, 4vw, 17px); line-height: 1.55; background-size: contain; }
 #main-navigation { justify-content: flex-end; }
 #main-navigation .mobile-home { display: none; }
 #main-navigation #nav-profile { display: grid; place-items: center; width: 140px; height: 62px; padding: 0; background: url('assets/profile/cloud.png') center / contain no-repeat; font-size: 22px; }
 #home-stage #nav-profile, #home-stage #puzzle-reset { animation: none; }
 #home-stage.home-intro #puzzle-instruction, #home-stage.home-intro .home-letter,
 #home-stage.home-intro #puzzle-board, #home-stage.home-intro #puzzle-layer,
 #home-stage.home-intro .work, #home-stage.home-intro #puzzle-reset, #home-stage.home-intro #nav-profile { visibility: visible; }
 #mobile-top { display: block; position: fixed; z-index: 20; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: 78px; padding: 0; border: 0; background: transparent; cursor: pointer; }
 #mobile-top img { display: block; width: 100%; height: auto; }
 body:has(#loading-screen:not([hidden])) #mobile-top, body:has(#loading-curtain:not([hidden])) #mobile-top { visibility: hidden; }
}
@media (max-width: 700px) {
 html:has(#loading-screen:not([hidden])), body:has(#loading-screen:not([hidden])) { overflow: hidden; }
}
@media (max-width: 700px) {
 #home-stage { grid-template-areas: '. heading .' '. board .' '. reset .' '. works .' '. nav .'; row-gap: 4px; padding-top: 12px; }
 #puzzle-instruction { padding-top: 15%; padding-bottom: 1%; }
 #puzzle-reset { width: 132px; min-height: 48px; margin-top: -14px; }
 #works { padding-top: 0; gap: 16px 12px; }
 #main-navigation { margin-top: 12px; }
}

/* Completion overlay is confined to the existing inner puzzle canvas. */
.puzzle-layer { container-type: inline-size; }
.puzzle-thanks { position: absolute; inset: 0; isolation: isolate; }
.puzzle-thanks__picture { position: absolute; inset: 0; opacity: .65; }
.puzzle-thanks__glow { position: absolute; left: 50%; top: 50%; width: 55%; height: 62%; transform: translate(-50%, -50%); background: #fff; filter: blur(50px); filter: blur(clamp(18px, 5.543cqw, 50px)); }
.puzzle-thanks__message { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #994926; text-align: center; }
.puzzle-thanks__title { font-family: 'Miller Text', Georgia, 'Times New Roman', serif; font-style: italic; font-size: 40px; font-size: clamp(18px, 4.435cqw, 40px); line-height: 1.2; margin-bottom: 5px; }
.puzzle-thanks__copy { font-family: 'Zen Maru Gothic', sans-serif; font-size: 32px; font-size: clamp(14px, 3.548cqw, 32px); font-weight: 700; line-height: 1.4; }

.puzzle-flight-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 40; }
.puzzle-flight-layer .puzzle-piece { inset: auto; }
.puzzle-thanks__message { text-shadow: 0 2px 3px rgba(93, 66, 54, .24); }

html.skip-loading #loading-screen { display: none; }
