/* CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 32px 32px 0 32px;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

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

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

/* Custom Properties */
:root {
  --background-color: #f2e9e4;
  --text-color: #03045e;
}

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: "Manrope", sans-serif;
  font-optical-sizing: auto;
  position: relative;
  overflow-x: hidden;
}

.spotlight-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../assets/background.jpg");
  background-size: 105vw;
  background-position: center;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: radial-gradient(
    circle 200px at var(--mouse-x, 50%) var(--mouse-y, 50%),
    black 0%,
    transparent 100%
  );
  mask-image: radial-gradient(
    circle 200px at var(--mouse-x, 50%) var(--mouse-y, 50%),
    black 0%,
    transparent 100%
  );
}

.lang-switch {
  z-index: 10;
  display: flex;
  gap: 0;
}

.lang-option {
  width: 32px;
  height: 32px;
  border: 2px solid var(--text-color);
  background-color: transparent;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-option:first-child {
  border-right: none;
}

.lang-option.active {
  background-color: var(--text-color);
  color: var(--background-color);
}

.lang-option:not(.active):hover {
  opacity: 0.7;
}

#hero {
  display: flex;
  justify-content: space-between;
  max-height: 100vh;
  position: relative;
  z-index: 2;
}

.hero-greeting {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 32px;
  padding-top: 16px;
}

.hero-name {
  font-weight: 500;
  font-size: 56px;
  line-height: 1;
}

.hero-description {
  margin-top: 4px;
  font-weight: 500;
  font-size: 24px;
  white-space: pre-line;
  text-align: right;
}

.tech-list {
  display: flex;
  flex-direction: column;
  padding-left: 32px;
}

.tech-item {
  font-weight: 500;
  font-size: 56px;
  line-height: 1.4;
}

.avatar {
  width: 200px;
  height: 250px;
  object-fit: cover;
  padding-top: 16px;
  padding-left: 16px;
  background-color: var(--text-color);
}

.social-icon-list {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.social-link {
  width: 48px;
  height: 48px;
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.social-icon {
  width: 32px;
  height: 32px;
  filter: brightness(0) saturate(100%) invert(8%) sepia(92%) saturate(5574%)
    hue-rotate(242deg) brightness(80%) contrast(150%);
  &:hover {
    filter: brightness(0) saturate(100%) invert(35%) sepia(100%) saturate(7491%)
      hue-rotate(203deg) brightness(60%) contrast(105%);
  }
}

.explosion-line {
  position: absolute;
  width: 4px;
  height: 0;
  background-color: var(--text-color);
  top: 50%;
  left: 50%;
  transform-origin: center;
  pointer-events: none;
}

.explosion-line::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 20px;
  background-color: var(--text-color);
  animation: explode 0.6s ease-out forwards;
}

@keyframes explode {
  0% {
    height: 0px;
    opacity: 1;
  }
  100% {
    height: 30px;
    opacity: 0;
  }
}

.avatar-section {
  position: absolute;
  bottom: 16px;
  right: 32px;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #e8ddd8;
  padding: 4px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.footer-text {
  font-size: 12px;
  margin-left: 4px;
}

@media (max-width: 768px) {
  body {
    padding: 20px 20px 0 20px;
    overflow-x: hidden;
    position: relative;
  }

  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.08;
    pointer-events: none;
    z-index: 100;
    animation: grain 8s steps(10) infinite;
  }

  @keyframes grain {
    0%,
    100% {
      transform: translate(0, 0);
    }
    10% {
      transform: translate(-5%, -5%);
    }
    20% {
      transform: translate(-10%, 5%);
    }
    30% {
      transform: translate(5%, -10%);
    }
    40% {
      transform: translate(-5%, 15%);
    }
    50% {
      transform: translate(-10%, 5%);
    }
    60% {
      transform: translate(15%, 0);
    }
    70% {
      transform: translate(0, 10%);
    }
    80% {
      transform: translate(-15%, 0);
    }
    90% {
      transform: translate(10%, 5%);
    }
  }

  .spotlight-overlay {
    background-size: 120vw;
  }

  #hero {
    display: flex;
    flex-direction: column;
    max-height: none;
    min-height: 100vh;
    padding-bottom: 70px;
    justify-content: flex-start;
  }

  .hero-greeting {
    display: contents;
  }

  .hero-name {
    order: 1;
    font-size: clamp(42px, 13vw, 68px);
    line-height: 0.9;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    margin-left: 8px;
    max-width: 80%;
    align-self: flex-start;
  }

  .tech-list {
    order: 3;
    padding: 0;
    margin: 28px 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 10px;
    width: 100%;
  }

  .tech-item {
    font-size: clamp(24px, 7vw, 42px);
    line-height: 1.2;
    font-weight: 600;
    padding: 6px 8px;
    transition: transform 0.2s ease;
  }

  .tech-item:nth-child(1) {
    transform: rotate(-1deg);
  }

  .tech-item:nth-child(2) {
    transform: rotate(0.8deg);
  }

  .tech-item:nth-child(3) {
    transform: rotate(-1.2deg);
  }

  .tech-item:nth-child(4) {
    transform: rotate(1deg);
  }

  .tech-item:nth-child(5) {
    transform: rotate(-0.5deg);
  }

  .tech-item:nth-child(6) {
    transform: rotate(1.2deg);
  }

  .tech-item:nth-child(7) {
    transform: rotate(-0.8deg);
  }

  .tech-item:nth-child(8) {
    transform: rotate(0.6deg);
  }

  .hero-description {
    order: 2;
    text-align: left;
    font-size: 16px;
    font-weight: 400;
    padding-left: 12px;
    max-width: 88%;
    line-height: 1.5;
    align-self: flex-start;
  }

  .social-icon-list {
    order: 4;
    margin: 28px 0 32px 0;
    gap: 18px;
    padding-left: 2px;
    align-self: center;
  }

  .social-link {
    width: 50px;
    height: 50px;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .social-link:active {
    transform: scale(0.82);
    transition: transform 0.05s ease;
  }

  .social-link:active .social-icon {
    transform: scale(1.12);
  }

  .social-icon {
    width: 34px;
    height: 34px;
    transition: transform 0.15s ease;
  }

  .avatar-section {
    position: relative;
    bottom: auto;
    right: auto;
    order: 5;
    margin-top: 36px;
    margin-bottom: 36px;
    width: 100%;
    display: flex;
    justify-content: center;
    touch-action: pan-y;
    align-self: center;
  }

  .avatar {
    width: clamp(220px, 55vw, 300px);
    height: clamp(270px, 68vw, 370px);
    padding: 0;
    object-fit: cover;
    background-color: transparent;
    transition: filter 0.3s ease;
    cursor: grab;
  }

  .avatar:active {
    cursor: grabbing;
  }

  .avatar-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%)
      translate(var(--smear-x, 0px), var(--smear-y, 0px));
    width: clamp(220px, 55vw, 300px);
    height: clamp(270px, 68vw, 370px);
    background-image: url("../assets/avatar.png");
    background-size: cover;
    background-position: center;
    opacity: 0;
    filter: blur(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.1s ease;
  }

  .avatar-section.dragging::after {
    opacity: 0.35;
  }

  .footer {
    padding: 10px 16px;
  }

  .footer-text {
    font-size: 10px;
  }

  .lang-option {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .ripple {
    position: absolute;
    border-radius: 50%;
    background-color: var(--text-color);
    opacity: 0.4;
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
  }

  @keyframes ripple-animation {
    to {
      transform: scale(4);
      opacity: 0;
    }
  }

  .lang-option:active {
    transform: scale(0.88);
  }

  #copyEmailBtn:active {
    transform: scale(0.82);
  }

  .tech-item:active {
    transform: scale(1.08) rotate(var(--rotation, 0deg));
    transition: transform 0.1s ease;
  }
}
