*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-outer: #ffffff;
  --bg-inner: #f2f2f2;
  --dot-color: #d1d1d1;
  --text: #111111;
  --shell-radius: 40px;
  --photo-radius: 14px;
  --frame-padding: clamp(12px, 1.25vw, 24px);
  --hero-size: clamp(2.4rem, 5vw, 6rem);
  --photo-width: clamp(72px, 8.25vw, 158px);
  --dot-size: 7px;
  --dot-gap: 13.5px;
  --dot-step: calc(var(--dot-size) + var(--dot-gap));
  --dot-field-size: min(554px, calc(100vw - (var(--frame-padding) * 2) - 48px));
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-outer);
  color: var(--text);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
}

.page-frame {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  padding: var(--frame-padding);
  box-sizing: border-box;
}

.page-shell {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: calc(100vh - (var(--frame-padding) * 2));
  min-height: calc(100dvh - (var(--frame-padding) * 2));
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--shell-radius);
  background-color: var(--bg-inner);
  overflow: hidden;
  isolation: isolate;
}

.page-shell::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dot-field-size);
  height: var(--dot-field-size);
  transform: translate(-50%, -50%);
  opacity: 0.3;
  background-image: radial-gradient(
    circle,
    var(--dot-color) calc(var(--dot-size) / 2),
    transparent calc(var(--dot-size) / 2)
  );
  background-size: var(--dot-step) var(--dot-step);
  background-position: center center;
  -webkit-mask-image: radial-gradient(50% 50%, #000 0%, transparent 100%);
  mask-image: radial-gradient(50% 50%, #000 0%, transparent 100%);
  pointer-events: none;
}

.page-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 44%,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0) 58%
  );
  pointer-events: none;
}

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.35rem, 2vw, 0.75rem);
  text-align: center;
}

.hero__intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.55rem, 2vw, 1rem);
  flex-wrap: nowrap;
}

.hero__line {
  margin: 0;
  font-size: var(--hero-size);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero__line--hi {
  display: inline-flex;
  align-items: baseline;
  min-height: 1.1em;
}

.hero__line--rest {
  min-height: 1.1em;
}

.photo-wrap {
  margin: 0;
  flex: 0 0 auto;
  opacity: 0;
  transform: rotate(-7deg) translateY(8px) scale(0.96);
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-wrap.is-visible {
  opacity: 1;
  transform: rotate(-7deg) translateY(0) scale(1);
}

.photo-wrap.is-visible.is-swaying {
  animation: photo-sway 2.6s ease-in-out infinite;
}

@keyframes photo-sway {
  0%,
  100% {
    transform: rotate(-9deg) translateX(-3px) translateY(0) scale(1);
  }

  50% {
    transform: rotate(-5deg) translateX(3px) translateY(-3px) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-wrap.is-visible.is-swaying {
    animation: none;
    transform: rotate(-7deg) translateY(-2px) scale(1.02);
  }
}

.photo {
  display: block;
  width: var(--photo-width);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 4px solid #ffffff;
  border-radius: var(--photo-radius);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08);
  background: #ddd;
}

.typing-cursor {
  display: inline-block;
  width: 0.06em;
  min-width: 2px;
  height: 0.86em;
  margin-left: 0.04em;
  vertical-align: -0.08em;
  background: currentColor;
  opacity: 0;
}

.typing-cursor.is-active {
  opacity: 1;
  animation: blink 0.95s step-end infinite;
}

.typing-cursor.is-hidden {
  display: none;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 768px) {
  .hero {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: clamp(0.55rem, 2vw, 1rem);
    row-gap: 0;
  }

  .hero__intro {
    display: contents;
  }

  .hero__line--rest {
    flex: 0 1 auto;
  }
}

@media (max-width: 767px) {
  .hero__intro {
    gap: clamp(0.45rem, 3vw, 0.75rem);
  }
}
