/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; line-height: 1.6; overflow-x: hidden; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

#scroll-progress { position: fixed; top: 0; left: 0; height: 2px; z-index: 200; background: var(--gradient); width: 0%; transition: width 0.1s linear; }
#particles-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 0 5%; height: 64px; background: var(--nav-bg); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); transition: var(--transition); }
.nav.scrolled { box-shadow: 0 4px 30px rgba(0,0,0,0.3); }
.nav-logo { font-size: 1.2rem; font-weight: 700; }
.logo-bracket, .logo-accent { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color var(--transition); position: relative; }
.nav-links a::after { content: ""; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px; background: var(--accent); transition: width var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-resume {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--accent);
  color: var(--accent) !important;
  font-weight: 600;
}
.nav-resume::after { display: none !important; }
.nav-resume:hover { background: rgba(0, 212, 255, 0.12); }
.btn-resume { box-shadow: 0 0 20px rgba(0, 212, 255, 0.25); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; transition: var(--transition); }
.theme-toggle:hover { border-color: var(--accent); transform: rotate(20deg); }
.lang-toggle { padding: 4px 12px; border-radius: 100px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; cursor: pointer; transition: var(--transition); }
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }

/* Layout */
section { position: relative; z-index: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-tag { font-size: 0.8rem; font-family: "Courier New", monospace; color: var(--accent); letter-spacing: 0.15em; margin-bottom: 0.75rem; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Hero */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: space-between; padding: 80px 5% 0; gap: 4rem; }
.hero-content { flex: 1; max-width: 600px; }
.hero-badge { display: inline-block; padding: 6px 16px; border: 1px solid var(--accent); border-radius: 100px; font-size: 0.8rem; color: var(--accent); letter-spacing: 0.05em; margin-bottom: 1.5rem; animation: fadeInUp 0.6s ease both; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; line-height: 1.1; margin-bottom: 1rem; animation: fadeInUp 0.6s 0.1s ease both; }
.hero-title .line { display: block; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-desc { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; animation: fadeInUp 0.6s 0.2s ease both; }
.hero-stats { display: flex; align-items: center; gap: 2rem; margin-bottom: 2.5rem; animation: fadeInUp 0.6s 0.3s ease both; }
.stat { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }
.hero-actions { display: flex; gap: 1rem; animation: fadeInUp 0.6s 0.4s ease both; }
.btn { padding: 12px 28px; border-radius: 8px; font-size: 0.95rem; font-weight: 600; text-decoration: none; transition: var(--transition); cursor: pointer; border: none; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 0 20px rgba(0,212,255,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0,212,255,0.5); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Orbit */
.hero-visual { flex: 0 0 420px; height: 420px; position: relative; display: flex; align-items: center; justify-content: center; animation: fadeIn 1s 0.5s ease both; }
.orbit-ring { position: absolute; border-radius: 50%; border: 1px solid var(--border); }
.ring-1 { width: 160px; height: 160px; border-color: rgba(0,212,255,0.3); animation: spin 8s linear infinite; }
.ring-2 { width: 280px; height: 280px; border-color: rgba(124,58,237,0.2); animation: spin 14s linear infinite reverse; }
.ring-3 { width: 400px; height: 400px; border-color: rgba(6,255,165,0.1); animation: spin 20s linear infinite; }
.orbit-center { width: 80px; height: 80px; background: var(--gradient); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; box-shadow: 0 0 40px rgba(0,212,255,0.4); z-index: 2; animation: pulse 3s ease-in-out infinite; }
.orbit-dot { position: absolute; width: 44px; height: 44px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; backdrop-filter: blur(10px); }
.dot-1 { top: 50%; left: 50%; transform: translate(-50%,-50%) translateX(140px); }
.dot-2 { top: 50%; left: 50%; transform: translate(-50%,-50%) translateY(-140px); }
.dot-3 { top: 50%; left: 50%; transform: translate(-50%,-50%) translateX(-140px); }
.dot-4 { top: 50%; left: 50%; transform: translate(-50%,-50%) translateY(140px); }

/* About */
.about { padding: 120px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about-text p { color: var(--text-muted); margin-bottom: 1.2rem; font-size: 1.05rem; line-height: 1.8; }
.skills { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.skill-tag { padding: 6px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 100px; font-size: 0.82rem; color: var(--accent); transition: var(--transition); }
.skill-tag:hover { background: rgba(0,212,255,0.1); border-color: var(--accent); transform: translateY(-2px); }
.code-block { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--glow); transition: transform var(--transition); }
.code-block:hover { transform: rotateY(-5deg) rotateX(3deg); }
.code-header { display: flex; align-items: center; gap: 6px; padding: 12px 16px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.code-filename { margin-left: 8px; font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }
.code-content { padding: 1.5rem; font-family: "Courier New", monospace; font-size: 0.9rem; line-height: 1.8; }
.code-content .key { color: #79c0ff; } .code-content .str { color: #a5d6ff; } .code-content .bool { color: #ff7b72; }

/* Timeline */
.timeline { padding: 120px 0; }
.timeline-list { position: relative; max-width: 700px; margin: 0 auto; }
.timeline-list::before { content: ""; position: absolute; left: 20px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.timeline-item { display: flex; gap: 2rem; margin-bottom: 3rem; position: relative; }
.timeline-dot { flex: 0 0 40px; height: 40px; background: var(--gradient); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; z-index: 1; box-shadow: 0 0 20px rgba(0,212,255,0.3); }
.timeline-content { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: var(--transition); }
.timeline-content:hover { border-color: var(--border-hover); transform: translateX(6px); }
.timeline-year { font-size: 0.75rem; color: var(--accent); font-family: monospace; margin-bottom: 0.4rem; }
.timeline-content h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.timeline-content p { color: var(--text-muted); font-size: 0.9rem; }

/* Filter */
.filter-bar { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.filter-btn { padding: 8px 20px; border-radius: 100px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; cursor: pointer; transition: var(--transition); }
.filter-btn:hover, .filter-btn.active { background: rgba(0,212,255,0.1); border-color: var(--accent); color: var(--accent); }

/* Projects */
.projects { padding: 120px 0; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.project-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; transition: var(--transition); overflow: hidden; cursor: pointer; }
.project-card:hover { border-color: var(--border-hover); transform: translateY(-6px); box-shadow: var(--shadow), 0 0 30px rgba(0,212,255,0.1); }
.project-card.hidden { display: none; }
.card-glow { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, rgba(0,212,255,0.05), transparent 60%); opacity: 0; transition: opacity var(--transition); pointer-events: none; }
.project-card:hover .card-glow { opacity: 1; }
.card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.card-platform { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.platform-badge { padding: 2px 10px; border-radius: 100px; font-size: 0.72rem; font-weight: 600; }
.platform-badge.ios { background: rgba(0,122,255,0.15); color: #4da6ff; border: 1px solid rgba(0,122,255,0.3); }
.platform-badge.macos { background: rgba(150,150,150,0.15); color: #aaa; border: 1px solid rgba(150,150,150,0.3); }
.platform-badge.android { background: rgba(61,220,132,0.15); color: #3ddc84; border: 1px solid rgba(61,220,132,0.3); }
.platform-badge.web { background: rgba(0,212,255,0.15); color: var(--accent); border: 1px solid rgba(0,212,255,0.3); }
.project-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.6rem; }
.project-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 1rem; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.2rem; }
.card-tags span { padding: 3px 10px; background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3); border-radius: 100px; font-size: 0.75rem; color: #a78bfa; }
.card-footer { border-top: 1px solid var(--border); padding-top: 1rem; display: flex; justify-content: space-between; align-items: center; }
.card-link { color: var(--accent); text-decoration: none; font-size: 0.88rem; font-weight: 600; transition: var(--transition); }
.card-link:hover { color: var(--accent3); }
.project-card--more { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-style: dashed; min-height: 200px; cursor: default; }
.more-icon { font-size: 3rem; color: var(--accent); opacity: 0.6; margin-bottom: 0.5rem; }
.project-card--more p { color: var(--text-muted); margin: 0; }
.more-hint { font-size: 0.8rem; color: var(--text-muted); opacity: 0.5; margin-top: 0.3rem; }

/* Web Grid */
.web-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.web-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); cursor: pointer; }
.web-card:hover { border-color: var(--border-hover); transform: translateY(-6px); box-shadow: var(--shadow); }
.web-card--featured { border-color: rgba(124,58,237,0.3); }
.web-card-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); }
.browser-url { font-size: 0.78rem; color: var(--text-muted); font-family: monospace; flex: 1; text-align: center; }
.web-card-body { padding: 1.8rem; }
.web-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.web-card-body h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.6rem; }
.web-card-body p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 1rem; }
.web-card-footer { padding: 1rem 1.8rem; border-top: 1px solid var(--border); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 2rem; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; transform: translateY(30px) scale(0.97); transition: transform var(--transition); }
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 2rem 2rem 1rem; border-bottom: 1px solid var(--border); }
.modal-title-area { display: flex; align-items: center; gap: 1rem; }
.modal-icon { font-size: 2.5rem; }
.modal-header h2 { font-size: 1.4rem; font-weight: 800; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-body { padding: 1.5rem 2rem 2rem; }
.modal-desc { color: var(--text-muted); line-height: 1.8; margin-bottom: 1.5rem; }
.modal-screenshots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin-bottom: 1.5rem; }
.modal-screenshot { aspect-ratio: 9/16; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.modal-links { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.modal-links a { padding: 10px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; text-decoration: none; transition: var(--transition); }
.modal-links .btn-primary { background: var(--gradient); color: #fff; }
.modal-links .btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.modal-links .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* GitHub */
.github-section { padding: 80px 0; }
.github-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.github-repo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.2rem; transition: var(--transition); text-decoration: none; display: block; }
.github-repo:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.github-repo-name { font-size: 0.95rem; font-weight: 700; color: var(--accent); margin-bottom: 0.4rem; }
.github-repo-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.8rem; line-height: 1.5; }
.github-repo-meta { display: flex; gap: 1rem; font-size: 0.78rem; color: var(--text-muted); }
.github-loading { text-align: center; color: var(--text-muted); padding: 2rem; }

/* Contact */
.contact { padding: 120px 0; text-align: center; }
.contact-desc { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2.5rem; }
.contact-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 3rem; }
.contact-item { display: flex; align-items: center; gap: 0.6rem; padding: 14px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; font-size: 0.95rem; transition: var(--transition); }
.contact-item:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,212,255,0.1); }
.contact-icon { font-size: 1.2rem; display: flex; align-items: center; }
.contact-form { max-width: 520px; margin: 0 auto; text-align: left; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.form-group input, .form-group textarea { width: 100%; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 0.95rem; font-family: inherit; transition: var(--transition); resize: vertical; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.form-group textarea { min-height: 120px; }
.form-submit { width: 100%; padding: 14px; background: var(--gradient); color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.form-submit:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(0,212,255,0.4); }
.form-msg { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--accent3); display: none; }

/* Footer */
.footer { padding: 2rem 5%; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.footer-sub { margin-top: 0.4rem; opacity: 0.5; }
.footer-resume { color: var(--accent); text-decoration: none; opacity: 1; }
.footer-resume:hover { text-decoration: underline; }

/* Keyboard hint */
.kbd-hint { position: fixed; bottom: 2rem; right: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem 1rem; font-size: 0.78rem; color: var(--text-muted); z-index: 50; backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.5s; pointer-events: none; line-height: 1.8; }
.kbd-hint.show { opacity: 1; }
kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 0.75rem; }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 40px rgba(0,212,255,0.4); } 50% { box-shadow: 0 0 60px rgba(0,212,255,0.7), 0 0 80px rgba(124,58,237,0.3); } }
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 900px) {
  .hero { flex-direction: column; text-align: center; padding-top: 100px; }
  .hero-visual { flex: 0 0 300px; height: 300px; }
  .ring-3 { width: 280px; height: 280px; } .ring-2 { width: 200px; height: 200px; } .ring-1 { width: 120px; height: 120px; }
  .dot-1 { transform: translate(-50%,-50%) translateX(100px); } .dot-2 { transform: translate(-50%,-50%) translateY(-100px); }
  .dot-3 { transform: translate(-50%,-50%) translateX(-100px); } .dot-4 { transform: translate(-50%,-50%) translateY(100px); }
  .hero-actions, .hero-stats { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0; background: var(--nav-bg); padding: 2rem; gap: 1.5rem; border-bottom: 1px solid var(--border); backdrop-filter: blur(20px); }
  .nav-toggle { display: flex; }
  .projects-grid, .web-grid { grid-template-columns: 1fr; }
  .contact-links { flex-direction: column; align-items: center; }
  .modal-screenshots { grid-template-columns: repeat(2, 1fr); }
}
