@font-face {
  font-family: Anybody;
  src: url('../fonts/anybody.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: block;
}

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

:root {
  --bg: hsl(120 92% 50%);
  --ink: hsl(300 92% 20%);
}

html { scroll-snap-type: y mandatory; }
html[data-boot] body { visibility: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Anybody, system-ui, sans-serif;
  overflow-x: hidden;
}

.name {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  height: 100dvh;
  padding: 2dvh 3vw;
  scroll-snap-align: start;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .6s, opacity .6s;
}

.word {
  display: flex;
  justify-content: space-between;
  line-height: .78;
}
.word:first-child { font-size: min(46dvh, 30vw); }
.word:last-child { font-size: min(46dvh, 24vw); }

.letter {
  all: unset;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
  font-variation-settings: "wght" 650, "wdth" 110;
}

body.open .name { transform: scale(.5); filter: blur(8px); opacity: .18; }

.hint {
  position: absolute;
  left: 50%;
  top: calc(100dvh - 7dvh);
  translate: -50% 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 4dvh;
  font-variation-settings: "wght" 700, "wdth" 100;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { translate: -50% .9dvh; } }

.plain {
  height: 100dvh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6dvh;
  padding: 4vw;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 3vw, 40px);
}
.badge {
  all: unset;
  box-sizing: border-box;
  color: var(--ink);
  border: .45vmin solid var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-family: Anybody, system-ui, sans-serif;
  font-variation-settings: "wght" 700, "wdth" 110;
  transition: transform .15s ease;
}
.badge:hover, .badge:focus-visible { transform: scale(1.12) rotate(-4deg); outline: none; background: var(--ink); color: var(--bg); }
.badge.round {
  width: clamp(52px, 9vmin, 84px);
  aspect-ratio: 1;
  border: none;
}
.badge.round svg { width: 100%; height: 100%; }
.badge.round:hover, .badge.round:focus-visible {
  background: none;
  color: var(--ink);
  transform: scale(1.12) rotate(-4deg);
}
.badge.pill {
  border-radius: 999px;
  padding: clamp(14px, 2.4vmin, 22px) clamp(28px, 5vmin, 52px);
  font-size: clamp(1.3rem, 4vmin, 2.4rem);
  font-variation-settings: "wght" 420, "wdth" 100;
}

#panel {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8vw;
  font-size: clamp(1.4rem, 4vw, 3rem);
  font-variation-settings: "wght" 640, "wdth" 100;
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
  opacity: 0;
  transition: opacity .5s ease;
}
#panel.show { opacity: 1; }
#panel[data-mode="smile"],
#panel[data-mode="about"],
#panel[data-mode="contact"] { background: transparent; }
#panel #close {
  all: unset;
  position: fixed;
  top: 3vmin;
  right: 4.5vmin;
  font-size: clamp(2.2rem, 7vmin, 4rem);
  line-height: 1;
  cursor: pointer;
  font-variation-settings: "wght" 700, "wdth" 100;
}
#panel #close::before { content: "×"; }
#panel[data-mode="works"] #close { left: 4.5vmin; right: auto; }
#panel[data-mode="works"] #close::before { content: "←"; }
#panel[data-mode="about"] #close,
#panel[data-mode="contact"] #close { display: none; }
#panel [data-section="about"],
#panel [data-section="contact"] {
  width: min(88vw, 780px);
  height: min(64vh, 480px);
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vmin, 48px);
}
#panel [data-section="about"] { background: #d9f24b; color: #142400; }
#panel [data-section="contact"] {
  background: #111;
  color: #fff;
  font-size: clamp(1.1rem, 2.6vw, 1.8rem);
  font-variation-settings: "wght" 420, "wdth" 100;
}
#panel[data-mode="works"] { background: #fff; color: #111; place-items: start center; padding: 6vmin; }
#panel .works {
  column-count: 2;
  column-gap: 9vmin;
  width: 100%;
  max-width: 980px;
  padding: 7vmin 0 13vmin;
}
#panel .works img {
  width: 78%;
  height: auto;
  display: block;
  margin: 0 0 12vmin;
  break-inside: avoid;
  cursor: pointer;
  transition: transform .25s ease;
}
#panel .works img:hover, #panel .works img:focus-visible { transform: scale(1.045); }
#panel .works img:nth-child(2n) { width: 92%; }
#panel .works img:nth-child(3n) { width: 64%; margin-left: 22%; }
@media (max-width: 700px) {
  .name { justify-content: center; gap: 7dvh; }
  .word:first-child { font-size: min(22dvh, 28vw); }
  .word:last-child { font-size: min(22dvh, 21.5vw); }
  .plain { gap: 7dvh; }
  .badges { gap: 14px; }
  .badge.pill { font-size: 1.15rem; padding: 12px 26px; }
  .badge.round { width: 58px; }
  #panel { padding: 6vw; }
  #panel [data-section="about"],
  #panel [data-section="contact"] {
    width: 92vw;
    height: auto;
    min-height: 38vh;
  }
  #panel[data-mode="works"] { padding: 14vmin 7vw 10vmin; }
  #panel .works { column-count: 1; padding-bottom: 8vmin; }
  #panel .works img, #panel .works img:nth-child(2n) { width: 100%; margin-left: 0; margin-bottom: 9vmin; }
  #panel .works img:nth-child(3n) { width: 84%; margin-left: 16%; }
  #lightbox { padding: 4vw; }
  #lightbox img { max-width: 92vw; max-height: 64vh; }
}
#panel .works { transition: filter .35s ease; will-change: filter; }
#panel.lightboxed .works { filter: blur(14px); pointer-events: none; }
@keyframes lbfade { from { opacity: 0; } }
#lightbox { animation: lbfade .3s ease; }
#lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 3vmin;
  padding: 5vmin;
  background: rgba(255, 255, 255, .4);
  cursor: pointer;
  margin: 0;
}
#lightbox[hidden] { display: none; }
#lightbox img { max-width: min(86vw, 1000px); max-height: 72vh; width: auto; height: auto; justify-self: center; }
#lightbox figcaption {
  text-align: center;
  font-size: clamp(1rem, 2.6vmin, 1.5rem);
  font-variation-settings: "wght" 400, "wdth" 100;
}
#lightbox figcaption em { font-style: italic; }
#panel[hidden] { display: none; }
#panel [data-section]:focus { outline: none; }
#panel [data-section][hidden] { display: none; }
body.open .hint { visibility: hidden; }
#panel a { color: var(--ink); }
#panel [data-section="about"] p {
  font-size: clamp(1.1rem, 2.6vw, 1.8rem);
  line-height: 1.4;
  max-width: 34ch;
  font-variation-settings: "wght" 420, "wdth" 100;
}

#panel [data-section="smile"] { font-size: clamp(2.2rem, 9vmin, 6rem); font-variation-settings: "wght" 420, "wdth" 110; }

@media (prefers-reduced-motion: reduce) {
  .name { transition: none; }
  .hint { animation: none; }
  .badge { transition: none; }
  #panel { transition: none; }
  #panel .works, #panel .works img { transition: none; }
  #lightbox { animation: none; }
}

body.static .letter { font-variation-settings: "wght" 640, "wdth" 105; }
