:root {
  --color-surface-1: #141414;
  --color-surface-2: #1c1c1c;
  --color-surface-3: #232323;
  --color-surface-3-t: rgba(35, 35, 35, 0.8);
  --color-primary: #ffffff;
  --color-secondary: #8a8a8a;
  --color-border: #282828;
  --color-overlay: rgba(0, 0, 0, 0.8);
  --color-buttoncircle: #3b3b3b;
  --color-icon: #6f6f6f;
  --color-error: #e46062;
  --color-success: #4ade80;
}
* {
  box-sizing: border-box;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
body {
  margin: 0;
  display: flex;
  justify-content: center;
  background-color: #000000;
}


/* Layout */
#wrapper, #container, #title, #footer, #url {
  width: 100%;
}
#wrapper, #container, #contents, #title, footer {
  display: flex;
}
#container, #contents, #title, #url {
  flex-direction: column;
}
#wrapper {
  max-width: 640px;
  height: 100%;
  align-items: center;
  padding: 48px 0 0 0;
}
#container {
  margin-top: 96px;
  background-color: var(--color-surface-1);
  opacity: 0;
  position: relative;
  transform: translateY(80px);
  transition: opacity 0.3s, transform 1s cubic-bezier(0, 1.3, 0.2, 1);
  will-change: opacity, transform;
  padding-bottom: 48px;
  border-radius: 0;
}
#container.show {
  opacity: 1;
  transform: translateY(0);
}
#contents, #container {
  gap: 40px;
}
#title {
  align-items: center;
  text-align: center;
  gap: 24px;
}
.button-group {
  display: flex;
  gap: 12px;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.section-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
footer {
  justify-content: center;
  margin-top: 8px;
}
#url {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(1, 1fr);
}


/* Background */
#background, #bgfilter {
  width: 105%;
  height: 105%;
  position: fixed;
}
#background {
  top: -2.5%;
  left: -2.5%;
  object-fit: cover;
  transform-origin: center;
  filter: blur(12px);
  will-change: transform;
  transition: opacity 1s;
  opacity: 0;
}
#background.loaded {
  opacity: 1;
}
#bgfilter {
  background-color: var(--color-overlay);
}


/* Text */
p, h1, h2 {
  color: var(--color-primary);
  margin: 0;
}
h2 {
  font-weight: 500;
}
p {
  line-height: 150%;
}
a {
  text-decoration: none;
}
.desc {
  color: var(--color-secondary);
  font-weight: 400;
  font-size: 14px;
}
b {
  font-weight: 600;
}
.section > p, .section > h2 {
  margin: 0px 4px;
}

/* Profile */
#profilePhoto {
  width: 160px;
  border-radius: 999px;
  margin-top: -96px;
}


.button, button {
  color: var(--color-primary);
  background-color: var(--color-surface-3);
  border-radius: 4px;
  transition: transform 0.3s;
  cursor: pointer;
}
button {
  font-size: 15px;
  padding: 12px 16px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button i {
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
}
.button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 20px 10px 10px;
}
.button > div {
  display: flex;
  align-items: center;
  gap: 16px;
}
.button i {
  color: var(--color-icon);
}
.urlTitle {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 0;
}
.urlLogo {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-buttoncircle);
}
.button:hover, button:hover {
  transform: scale(0.96);
}


/* Line */
hr {
  height: 1px;
  background-color: var(--color-border);
  border: 0;
  margin: 0 16px;
}


/* Carousel */
.carousel-container {
  position: relative;
  width: 100%;
}
.carousel {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar {
  display: none;
}
.carousel-track {
  display: flex;
  gap: 16px;
  width: max-content;
}
.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface-3-t);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  color: var(--color-primary);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1;
  cursor: pointer;
  left: 16px;
}
.carousel-button.next {
  left: auto;
  right: 16px;
}
.carousel-button.hidden {
  opacity: 0;
  pointer-events: none;
}
.carousel-button:hover {
  opacity: 1;
  transform: translateY(-50%) scale(0.94);
}
.carousel-button i {
  font-size: 16px;
  margin: 0;
}


/* YouTube Thumbnail */
.youtube-thumbnail {
  min-width: 320px;
  max-width: 320px;
  height: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
  background-color: var(--color-surface-2);
  overflow: hidden;
  border-radius: 8px;
  transition: transform 0.3s;
}
.youtube-thumbnail:hover {
  transform: scale(0.98);
}
.project-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  width: 100%;
}
.project-title {
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-tags {
  display: flex;
  gap: 4px;
  color: var(--color-secondary);
}
.project-tag {
  background: var(--color-surface-3);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  white-space: nowrap;
}


/* Modal */
#videoModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  transition: background-color 0.3s ease;
}
#videoModal.visible .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.6);
}
.modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
  z-index: 101;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
#videoModal.visible .modal-content {
  transform: scale(1);
  opacity: 1;
}
.modal-content iframe {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: 100%;
  border: 0;
}


/* Message Form */
#messageForm {
  display: flex;
  flex-direction: row;
  gap: 12px;
}
#msgContent {
  padding: 16px 12px;
  border-radius: 4px;
  font-size: 15px;
  width: 100%;
  border: 1px solid var(--color-surface-2);
  background: var(--color-surface-2);
  color: var(--color-primary);
  resize: none;
  min-height: 32px;
  overflow-y: hidden;
}
#msgContent:focus {
  border: 1px solid var(--color-border);
  outline: none;
}

.desc.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
  100% { transform: none; }
}

.desc.fadeout {
  transition: opacity 0.4s;
  opacity: 0;
}
.desc.fadein {
  transition: opacity 0.4s;
  opacity: 1;
}
.desc.error {
  color: var(--color-error);
}
.desc.success {
  color: var(--color-success);
}


/* Utility Classes */
.side-padding {
  padding-left: 16px;
  padding-right: 16px;
}


/* Visually Hidden (Accessibility Utility) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Responsive */
@media (min-width: 640px) {
  #container {
    border-radius: 12px;
  }
  #wrapper {
    padding: 64px 0px 64px 0px;
  }
  #url {
    grid-template-columns: repeat(2, 1fr);
  }
  .side-padding {
    padding-left: 40px;
    padding-right: 40px;
  }
  .carousel-button {
    left: 40px;
  }
  .carousel-button.next {
    right: 40px;
  }
  hr {
    margin: 0 40px;
  }
}

@media (max-width: 639px) {
  .carousel-button {
    display: none;
  }
}

@media (max-width: 959px) {
  #cursorFollower {
    display: none !important;
  }
}


/* Custom Cursor */
html, body {
  cursor: url('images/cursor_x.png') 16 16, auto;
}

a[href], button, textarea, .button, .carousel-button, .youtube-thumbnail {
  cursor: url('images/cursor_o.png') 16 16, auto;
}

/* Cursor Follower */
#cursorFollower {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-9999px, -9999px); /* hide off-screen initially */
  transition: transform 0.1s linear, opacity 0.3s ease;
  opacity: 0;
  display: block;
}

#cursorFollower img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
}