:root {
  --ink: #111;
  --paper: #fbfaf7;
  --orange: #df7e3e;
  --orange-dark: #b86635;
  --aqua: #6ac8d9;
  --mauve: #aa9094;
  --line: rgba(40, 40, 40, 0.12);
  --dash: rgba(40, 40, 40, 0.15);
  --shadow: rgba(59, 39, 25, 0.24);
  --content-width: min(88vw, 1080px);
  --card-width: min(82vw, 1004px);
  --work-width: min(78vw, 900px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("./assets/grid.svg");
  background-size: 104px 104px;
  font-family: "Times New Roman", "Yu Mincho", "Hiragino Mincho ProN", serif;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(18px, 5vw, 48px);
  width: 100%;
  min-height: 48px;
  margin: 0 auto;
  padding: 0 clamp(10px, 2vw, 18px);
  background: #fff;
  border-bottom: 1px solid #ece8e1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1;
}

.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand span {
  font-size: clamp(18px, 3vw, 24px);
}

.nav {
  display: flex;
  gap: clamp(16px, 4vw, 36px);
  align-items: center;
  font-family: Arial, "Hiragino Sans", sans-serif;
  font-size: 14px;
}

.nav a {
  padding: 16px 0 14px;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: var(--ink);
}

.paper {
  width: 100%;
  margin: 0 auto;
  background-color: var(--paper);
  background-image: url("./assets/grid.svg");
  background-size: 104px 104px;
}

.hero {
  min-height: clamp(360px, 58vw, 506px);
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 28px) clamp(36px, 5vw, 56px);
}

.business-card {
  position: relative;
  width: var(--card-width);
  max-width: 100%;
  color: transparent;
}

.business-card > img {
  display: block;
  width: 100%;
  height: auto;
}

.card-menu {
  position: absolute;
  left: 4.8%;
  bottom: 13.5%;
  display: grid;
  gap: 0;
  width: 18%;
  min-width: 98px;
  color: #fff;
  font-family: Arial, "Hiragino Sans", sans-serif;
  text-shadow: 1px 2px 2px rgba(0, 0, 0, 0.18);
}

.card-menu p {
  margin: 0 0 4px;
  font-size: 32px;
  line-height: 1;
}

.card-menu a {
  display: block;
  height: auto;
  border-radius: 3px;
  font-size: 22px;
  line-height: 1.18;
  width: max-content;
  padding: 0 4px;
  transform-origin: center;
  animation: menuWiggle 1s steps(1, end) infinite;
}

.card-menu a:nth-of-type(2) {
  animation-name: menuWiggleReverse;
}

.card-menu a:hover,
.card-menu a:focus-visible {
  background: rgba(255, 255, 255, 0.25);
  outline: none;
}

.business-card h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@keyframes menuWiggle {
  0%,
  49.999% {
    transform: rotate(5deg);
  }

  50%,
  100% {
    transform: rotate(-5deg);
  }
}

@keyframes menuWiggleReverse {
  0%,
  49.999% {
    transform: rotate(-5deg);
  }

  50%,
  100% {
    transform: rotate(5deg);
  }
}

.section {
  min-height: 536px;
  margin-top: -34px;
  padding: 0 clamp(18px, 6vw, 64px) 44px;
  scroll-margin-top: 88px;
}

#profile {
  scroll-margin-top: 78px;
}

#work {
  scroll-margin-top: 48px;
}

#work,
#contact {
  padding-top: 20px;
}

.label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(34vw, 430px);
  min-width: 310px;
  height: 82px;
  margin: 0 auto 38px;
  padding: 0 20px 20px;
  color: #fff;
  background-color: transparent;
  background-image: url("./assets/title-label.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  font-family: Arial, "Hiragino Sans", sans-serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 36%) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 36px);
  align-items: start;
  width: var(--content-width);
  margin: 0 auto;
}

.collage-switcher {
  position: relative;
  width: 100%;
  aspect-ratio: 280 / 358;
  box-shadow: 8px 12px 0 rgba(255, 255, 255, 0.7), 3px 4px 5px rgba(0,0,0,.16);
  overflow: hidden;
}

.collage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-one {
  animation: profileSwapOne 1s steps(1, end) infinite;
}

.collage-two {
  animation: profileSwapTwo 1s steps(1, end) infinite;
}

@keyframes profileSwapOne {
  0%,
  49.999% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes profileSwapTwo {
  0%,
  49.999% {
    opacity: 0;
  }

  50%,
  100% {
    opacity: 1;
  }
}

.profile-copy {
  padding-top: 4px;
}

.profile-copy h3 {
  margin: 0 0 8px;
  font-size: 40px;
  font-weight: 400;
}

.profile-copy p {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.45;
  text-align: justify;
  text-justify: inter-ideograph;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px clamp(12px, 3vw, 26px);
  padding: 18px 0 0;
  margin: 0;
  list-style: none;
}

.tags li {
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #777;
  border-radius: 3px;
  font-size: 19px;
}

.work-stack {
  display: grid;
  gap: 28px;
  width: var(--work-width);
  margin: 0 auto;
}

.work-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(138px, 18vw, 200px);
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  font-family: Arial, "Hiragino Sans", sans-serif;
  font-size: 78px;
  font-weight: 700;
  text-align: center;
  text-shadow: 3px 4px 5px rgba(0, 0, 0, 0.32);
}

.website {
  background-image: linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,.18)), url("./assets/work-button.png");
  background-position: center;
  background-size: cover;
}

.design,
.more {
  background: var(--mauve);
}

.contact-section {
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
  padding-bottom: 344px;
}

.contact-section .label {
  margin-bottom: 42px;
}

.contact-section p {
  width: 100%;
  max-width: 820px;
  margin: 0 0 42px;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.45;
}

.email {
  display: block;
  width: 100%;
  max-width: 880px;
  margin-bottom: 48px;
  font-family: Arial, "Hiragino Sans", sans-serif;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
  font-size: 46px;
}

.mail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 430px;
  min-height: 96px;
  padding: 0 clamp(22px, 5vw, 38px);
  color: #fff;
  background: var(--aqua);
  border-radius: 999px;
  font-family: Arial, "Hiragino Sans", sans-serif;
  font-size: 32px;
}

.mail-button span {
  font-size: 46px;
  line-height: 1;
}

@media (max-width: 720px) {
  :root {
    --content-width: min(100%, 560px);
    --card-width: min(100%, 560px);
    --work-width: min(100%, 620px);
  }

  .site-header {
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 10px 14px 0;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .nav a {
    padding-top: 8px;
  }

  .hero {
    min-height: auto;
    padding: clamp(34px, 11vw, 64px) 16px 46px;
  }

  .business-card {
    width: min(100%, 560px);
  }

  .card-menu {
    bottom: 5%;
  }

  .card-menu p {
    font-size: 16px;
  }

  .card-menu a {
    font-size: 12px;
    line-height: 1.1;
  }

  .section {
    margin-top: -28px;
    padding: 0 18px 44px;
    scroll-margin-top: 94px;
  }

  .label {
    min-width: 0;
    width: min(310px, 82vw);
    margin-bottom: 28px;
    font-size: 29px;
    height: 64px;
    padding-bottom: 19px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .collage-switcher {
    width: min(100%, 340px);
    margin: 0 auto;
  }

  .profile-copy h3 {
    font-size: 32px;
  }

  .profile-copy p {
    font-size: 16px;
  }

  .tags li {
    font-size: 19px;
  }

  .work-panel {
    min-height: 126px;
    font-size: 58px;
  }

  .contact-section p {
    font-size: 19px;
  }

  .email {
    font-size: 28px;
  }

  .mail-button {
    max-width: 360px;
    min-height: 74px;
    font-size: 24px;
    padding-inline: 22px;
  }
}

@media (max-width: 520px) {
  .site-header {
    gap: 8px 14px;
  }

  .brand img {
    width: 24px;
    height: 24px;
  }

  .brand span {
    font-size: 18px;
  }

  .nav {
    font-size: 14px;
  }

  .hero {
    padding-top: 42px;
  }

  .business-card {
    width: min(100%, 420px);
  }

  .card-menu {
    left: 4.5%;
    bottom: 4.5%;
    min-width: 72px;
  }

  .card-menu p {
    margin-bottom: 2px;
    font-size: 16px;
  }

  .card-menu a {
    font-size: 12px;
    line-height: 1.05;
  }

  .paper {
    background-size: 78px 78px;
  }

  .section {
    padding-inline: 16px;
  }

  .profile-copy h3 {
    font-size: 30px;
  }

  .work-panel {
    min-height: 112px;
    font-size: 44px;
  }

  .email {
    font-size: 24px;
  }
}

@media (max-width: 360px) {
  .site-header {
    padding-inline: 12px;
  }

  .nav {
    font-size: 13px;
  }

  .label {
    width: min(270px, 84vw);
    font-size: 26px;
  }

  .email {
    font-size: 19px;
  }

  .mail-button {
    gap: 8px;
    min-height: 58px;
    padding-inline: 14px;
  }

  .mail-button span {
    font-size: 34px;
  }
}
