/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #06060e;
  --surface: rgba(18, 18, 30, 0.75);
  --surface-hover: rgba(28, 28, 48, 0.85);
  --border: rgba(255, 255, 255, 0.06);
  --text: #eeeef6;
  --text-muted: #8888a8;
  --text-dim: #55556a;
  --blue: #3b82f6;
  --blue-glow: rgba(59, 130, 246, 0.3);
  --red: #f43f5e;
  --red-glow: rgba(244, 63, 94, 0.3);
  --purple: #8b5cf6;
  --radius: 20px;
  --radius-sm: 12px;
}

html, body {
  height: 100%;
  font-family: -apple-system, "PingFang SC", "SF Pro Display", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* ===== Animated Gradient BG ===== */
.bg-gradient {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 70% 40% at 50% 80%, rgba(244, 63, 94, 0.04) 0%, transparent 50%);
  animation: gradientShift 20s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(2deg); }
  100% { transform: scale(1) rotate(-2deg); }
}

/* ===== Particle Canvas ===== */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ===== Grid Overlay ===== */
.grid-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ===== Floating Orbs ===== */
.floating-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.3;
  animation: orbFloat 30s ease-in-out infinite;
}

.floating-orb:nth-child(1) {
  width: 400px; height: 400px;
  background: var(--blue);
  top: -10%; left: -5%;
  animation-delay: 0s;
}

.floating-orb:nth-child(2) {
  width: 350px; height: 350px;
  background: var(--purple);
  bottom: -15%; right: -8%;
  animation-delay: -10s;
}

.floating-orb:nth-child(3) {
  width: 250px; height: 250px;
  background: var(--red);
  bottom: 30%; left: 50%;
  animation-delay: -20s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.9); }
}

/* ===== Main Container ===== */
.container {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
  max-width: 920px;
  width: 100%;
}

/* ===== Logo Animation ===== */
.logo-wrapper {
  display: inline-block;
  position: relative;
  margin-bottom: 16px;
  animation: logoEntrance 1s ease-out forwards;
  opacity: 0;
}

@keyframes logoEntrance {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  50% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.logo {
  font-size: 4.5rem;
  display: block;
  filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.3));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.2)); }
  50% { filter: drop-shadow(0 0 60px rgba(139, 92, 246, 0.4)); }
}

/* ===== Title ===== */
.title-wrapper {
  animation: fadeUp 1s ease-out 0.2s forwards;
  opacity: 0;
}

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

.title {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.1;
  background: linear-gradient(135deg, #f43f5e, #8b5cf6, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.title-underline {
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);
  margin: 4px auto 0;
  border-radius: 2px;
  animation: underlineExpand 1.2s ease-out 0.6s forwards;
}

@keyframes underlineExpand {
  to { width: 120px; }
}

/* ===== Subtitle with Typewriter ===== */
.subtitle-wrapper {
  animation: fadeUp 1s ease-out 0.4s forwards;
  opacity: 0;
  min-height: 1.8em;
}

.subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.3px;
}

.subtitle .cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background: var(--purple);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== Identity Cards ===== */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 60px;
  perspective: 1200px;
}

.card-wrapper {
  animation: cardEntrance 0.8s ease-out forwards;
  opacity: 0;
}

.card-wrapper:nth-child(1) { animation-delay: 0.6s; }
.card-wrapper:nth-child(2) { animation-delay: 0.8s; }

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 44px 32px 36px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
  overflow: hidden;
  transform-style: preserve-3d;
}

/* Animated border glow */
.card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius) + 2px);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.card-programmer::before {
  background: conic-gradient(from 0deg, transparent, var(--blue), var(--purple), transparent, var(--blue), transparent);
  animation: borderSpin 3s linear infinite;
}

.card-novelist::before {
  background: conic-gradient(from 0deg, transparent, var(--red), var(--purple), transparent, var(--red), transparent);
  animation: borderSpin 3s linear infinite;
}

@keyframes borderSpin {
  to { transform: rotate(360deg); }
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
}

/* Card inner glow */
.card-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  transform: translate(-50%, -50%);
  filter: blur(80px);
}

.card-programmer .card-glow { background: var(--blue-glow); }
.card-novelist .card-glow { background: var(--red-glow); }
.card:hover .card-glow { opacity: 1; }

/* Floating icons inside card */
.card-float-icon {
  position: absolute;
  font-size: 1.2rem;
  opacity: 0.06;
  pointer-events: none;
  animation: floatIcon 8s ease-in-out infinite;
}

.card-float-icon:nth-child(2) { top: 10%; right: 12%; animation-delay: 0s; }
.card-float-icon:nth-child(3) { bottom: 15%; left: 8%; animation-delay: -3s; }
.card-float-icon:nth-child(4) { top: 20%; left: 15%; animation-delay: -6s; }

@keyframes floatIcon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

.card-icon {
  font-size: 3.2rem;
  display: block;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.card:hover .card-icon {
  transform: scale(1.15);
}

.card-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.card-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.card-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.card-programmer .card-tag {
  background: rgba(59, 130, 246, 0.1);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.card-novelist .card-tag {
  background: rgba(244, 63, 94, 0.1);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.15);
}

/* Card hover underline effect */
.card-hover-line {
  position: absolute;
  bottom: 0; left: 50%;
  width: 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(-50%);
}

.card-programmer .card-hover-line { background: linear-gradient(90deg, var(--blue), var(--purple)); }
.card-novelist .card-hover-line { background: linear-gradient(90deg, var(--red), var(--purple)); }
.card:hover .card-hover-line { width: 80%; }

/* ===== Footer ===== */
.footer-wrapper {
  animation: fadeUp 1s ease-out 1s forwards;
  opacity: 0;
  margin-top: 50px;
}

.footer {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

.footer .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* ===== Floating Particles (CSS) ===== */
.particle {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
  animation: particleRise linear infinite;
  opacity: 0;
}

@keyframes particleRise {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .cards { grid-template-columns: 1fr; gap: 18px; margin-top: 40px; }
  .title { font-size: 2.6rem; }
  .logo { font-size: 3.5rem; }
  .card { padding: 34px 24px 30px; }
}

@media (max-width: 480px) {
  .title { font-size: 2rem; }
  .subtitle { font-size: 1rem; }
  .card-title { font-size: 1.3rem; }
}
