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

:root {
  --bg: #0c1a1a;
  --card: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(255, 255, 255, 0.15);
  --text: #ffffff;
  --text-sec: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

@media (pointer: fine) {
  body, a, button, [onclick], .contact-item, .site-item, .tech-tag, .back-to-top, .avatar {
    cursor: none !important;
  }
}

/* ===== Background ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45) saturate(1.1);
}

.bg-overlay {
  display: none;
}

/* ===== Container ===== */
.container {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px 80px;
}

/* ===== Hero ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0 50px;
}

.avatar-wrapper {
  margin-bottom: 24px;
  position: relative;
}

.avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.avatar.spin {
  animation: avatarSpin 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes avatarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.avatar:hover {
  transform: scale(1.05);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.name {
  font-family: 'Caveat', 'Dancing Script', cursive;
  font-size: 3.2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 14px;
}

.tagline {
  font-size: 1rem;
  color: var(--text-sec);
  max-width: 480px;
  line-height: 1.7;
  font-weight: 400;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Section ===== */
.section {
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.3), transparent);
}

/* ===== Contact Grid ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.contact-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.35s;
  border-radius: 16px;
}

.contact-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.contact-item:hover::before {
  opacity: 1;
}

.contact-item .icon {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.contact-item .icon svg,
.site-icon svg {
  fill: #ffffff;
  width: 20px;
  height: 20px;
}

.contact-item .icon img {
  width: 20px;
  height: 20px;
}

.contact-item .info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.contact-item .label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  font-weight: 600;
}

.contact-item .value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Site List ===== */
.site-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.site-item::after {
  content: '→';
  position: absolute;
  right: 20px;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: all 0.3s;
  opacity: 0;
  transform: translateX(-8px);
}

.site-item:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px) translateX(4px);
  box-shadow: var(--shadow-hover);
}

.site-item:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.site-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.site-icon img {
  width: 22px;
  height: 22px;
}

.site-item .site-info {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.site-item .site-name {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.site-item .site-desc {
  font-size: 0.75rem;
  color: var(--text-sec);
  font-weight: 400;
}

.site-item .site-tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.site-tag.teal,
.site-tag.purple,
.site-tag.blue,
.site-tag.green {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ===== Tech Stack ===== */
.tech-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px 0;
}

.tech-tag {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: default;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tech-tag:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 36px 0 20px;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.footer .heart {
  color: #ffffff;
  animation: heartbeat 1.5s ease-in-out infinite;
  display: inline-block;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
}

.footer .time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  margin-top: 8px;
  display: block;
  color: var(--text-muted);
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  box-shadow: var(--shadow);
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2.5;
}

/* ===== Custom Cursor ===== */
.cursor-dot {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: difference;
}

.cursor-dot.hover {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

@media (pointer: coarse) {
  .cursor-dot { display: none; }
  * { cursor: auto !important; }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .container {
    padding: 36px 16px 60px;
  }

  .name {
    font-size: 2.4rem;
  }

  .avatar {
    width: 110px;
    height: 110px;
  }

  .hero {
    padding: 10px 0 36px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .site-item {
    padding: 14px 16px;
  }

  .contact-item {
    padding: 12px 14px;
  }

  .back-to-top {
    bottom: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
  }
}
