/* ============================================
   RUOBIN RESUME — Modern Animated Theme
   ============================================ */

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

:root {
  /* Dark theme (default) */
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a28;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --text: #e4e4e7;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #818cf8;
  --accent-2: #6366f1;
  --accent-glow: rgba(129,140,248,0.25);
  --gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  --gradient-2: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --card-bg: rgba(255,255,255,0.03);
  --card-border: rgba(255,255,255,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: 'Inter', -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --nav-height: 72px;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-2: #f4f4f5;
  --bg-3: #e4e4e7;
  --surface: rgba(0,0,0,0.03);
  --surface-hover: rgba(0,0,0,0.06);
  --border: rgba(0,0,0,0.08);
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #a1a1aa;
  --accent: #6366f1;
  --accent-2: #4f46e5;
  --accent-glow: rgba(99,102,241,0.2);
  --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --gradient-2: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
  --card-bg: rgba(255,255,255,0.7);
  --card-border: rgba(0,0,0,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}

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

/* --- Cursor Glow --- */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
}

body:hover .cursor-glow { opacity: 1; }

/* --- Particles Canvas --- */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10,10,15,0.7);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s, transform 0.3s;
}

[data-theme="light"] .nav {
  background: rgba(250,250,250,0.8);
}

.nav.hidden { transform: translateY(-100%); }

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.nav-logo .accent { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  position: relative;
}

.nav-link:hover { color: var(--text); background: var(--surface); }

.nav-link.active { color: var(--accent); }

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }

.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* --- Sections --- */
.section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 2rem;
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  font-family: 'Space Grotesk', monospace;
}

/* --- Gradient Text --- */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-2);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; }

/* --- Hero --- */
.hero {
  padding-top: calc(var(--nav-height) + 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1;
  min-width: 320px;
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--text-2);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-name .line {
  display: block;
  overflow: hidden;
}

.hero-name .word {
  display: inline-block;
}

.hero-title {
  font-size: 1.25rem;
  color: var(--text-2);
  margin-bottom: 1.25rem;
  min-height: 2rem;
}

.typewriter { color: var(--accent); font-weight: 500; }

.cursor {
  color: var(--accent);
  animation: blink 1s infinite;
  font-weight: 300;
}

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

.hero-desc {
  color: var(--text-3);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.stat { text-align: center; }

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}

.stat-plus { font-size: 1.5rem; color: var(--accent); font-weight: 700; }

.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 0.25rem;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* --- Hero Visual --- */
.hero-visual {
  flex: 0 0 auto;
}

.avatar-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  opacity: 0.3;
  animation: spin 8s linear infinite;
}

.ring-2 {
  inset: 20px;
  animation-duration: 12s;
  animation-direction: reverse;
  border-top-color: #c084fc;
  border-right-color: #c084fc;
}

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

.avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 60px var(--accent-glow);
}

.avatar-placeholder {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  color: white;
}

.floating-badge {
  position: absolute;
  width: 48px;
  height: 48px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
  z-index: 3;
}

.badge-1 { top: 10px; right: 20px; animation-delay: 0s; }
.badge-2 { bottom: 30px; left: 10px; animation-delay: 2s; }
.badge-3 { bottom: 10px; right: 10px; animation-delay: 4s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 12px;
  display: flex;
  justify-content: center;
}

.scroll-line {
  width: 2px;
  height: 8px;
  background: var(--accent);
  border-radius: 1px;
  margin-top: 6px;
  animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(12px); opacity: 0; }
}

/* --- About --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}

.highlight {
  display: flex;
  gap: 1rem;
  align-items: start;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.highlight:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateX(4px);
}

.highlight-icon { font-size: 1.5rem; flex-shrink: 0; }

.highlight h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.highlight p {
  font-size: 0.8125rem !important;
  color: var(--text-3) !important;
  margin-bottom: 0 !important;
  line-height: 1.4 !important;
}

/* --- Code Window --- */
.code-window {
  background: #1e1e2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

[data-theme="light"] .code-window {
  background: #1e1e2e;
}

.code-header {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

.code-filename {
  margin-left: auto;
  font-size: 0.75rem;
  color: #71717a;
  font-family: 'Space Grotesk', monospace;
}

.code-body {
  padding: 1.5rem;
  font-family: 'Space Grotesk', 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.8;
  color: #cdd6f4;
  overflow-x: auto;
}

.kw { color: #cba6f7; }
.var { color: #89b4fa; }
.prop { color: #89dceb; }
.str { color: #a6e3a1; }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  z-index: 2;
  transition: all 0.3s;
}

.timeline-item:hover .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s;
}

.timeline-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateX(8px);
}

.timeline-date {
  font-size: 0.8125rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-family: 'Space Grotesk', monospace;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-size: 0.9375rem;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-3);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.timeline-tags, .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag, .project-tags span {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 500;
  transition: all 0.2s;
}

.tag:hover, .project-tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Skills --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-category {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all 0.3s;
}

.skill-category:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.skill-category-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-family: var(--font-display);
}

.skill-items { display: flex; flex-direction: column; gap: 1.25rem; }

.skill-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.skill-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.skill-icon svg { width: 20px; height: 20px; }

.skill-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.skill-bar {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.skill-fill.animate {
  width: var(--level);
}

/* --- Projects --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.project-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.project-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
    hsl(var(--hue), 60%, 15%) 0%,
    hsl(calc(var(--hue) + 40), 60%, 25%) 100%
  );
  display: grid;
  place-items: center;
  font-size: 3rem;
  transition: transform 0.5s;
}

[data-theme="light"] .project-placeholder {
  background: linear-gradient(135deg,
    hsl(var(--hue), 70%, 90%) 0%,
    hsl(calc(var(--hue) + 40), 70%, 80%) 100%
  );
}

.project-card:hover .project-placeholder {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover .project-overlay { opacity: 1; }

.project-link-icon {
  width: 44px;
  height: 44px;
  background: white;
  color: #18181b;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.3s;
}

.project-link-icon:hover { transform: scale(1.1); }

.project-info { padding: 1.5rem; }

.project-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.8125rem;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* --- Contact --- */
.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-desc {
  font-size: 1.0625rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--surface-hover);
}

.contact-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.contact-card-label { font-size: 0.75rem; color: var(--text-3); margin-bottom: 0.25rem; }
.contact-card-value { font-size: 0.9375rem; font-weight: 600; color: var(--accent); }

/* --- Footer --- */
.footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }
.reveal:nth-child(5) { transition-delay: 0.4s; }

/* --- Magnetic Hover (applied via JS) --- */
.magnetic { transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* --- Selection --- */
::selection {
  background: var(--accent);
  color: white;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* --- Responsive --- */
@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; gap: 2rem; }
  .hero-content { max-width: 100%; }
  .hero-desc { margin: 0 auto 2rem; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .avatar-wrapper { width: 240px; height: 240px; }
  .avatar { width: 150px; height: 150px; }
  .avatar-placeholder { font-size: 3rem; }
}

@media (max-width: 600px) {
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
}
