/* ===== TOKENS ===== */
:root {
  --bg: #080c14;
  --bg2: #0d1220;
  --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(100,220,255,0.35);
  --text: #f0f4ff;
  --muted: #8892aa;
  --accent: #64dcff;
  --accent2: #7fffb2;
  --accent3: #ff6b9d;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --shadow: 0 24px 60px rgba(0,0,0,0.5);
  --glow: 0 0 40px rgba(100,220,255,0.12);
}

/* ===== RESET ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== NOISE OVERLAY ===== */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== CUSTOM CURSOR ===== */
.cursor {
  position: fixed;
  width: 40px; height: 40px;
  border: 1.5px solid rgba(100,220,255,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.2s, height 0.2s, border-color 0.2s;
  mix-blend-mode: screen;
}
.cursor-dot {
  position: fixed;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
}
body:has(a:hover) .cursor,
body:has(button:hover) .cursor {
  width: 60px; height: 60px;
  border-color: var(--accent);
}

/* ===== LAYOUT ===== */
.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.4s ease;
}
header.scrolled {
  padding: 14px 0;
  background: rgba(8,12,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
}
.logo-bracket { color: var(--accent); }
.menu {
  display: flex;
  gap: 32px;
  list-style: none;
}
.menu a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}
.menu a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s;
}
.menu a:hover { color: var(--accent); }
.menu a:hover::after { width: 100%; }
.btn-github {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 9px 18px;
  transition: all 0.3s;
  white-space: nowrap;
}
.btn-github:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(100,220,255,0.06);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(100,220,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,220,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 60% 40%, black 20%, transparent 70%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent2);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 40px;
  animation: fadeUp 0.7s ease forwards;
}
.dot-pulse {
  width: 8px; height: 8px;
  background: var(--accent2);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform: scale(1); }
  50% { opacity:0.4; transform: scale(0.8); }
}
.hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -3px;
  margin-bottom: 24px;
}
.line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: slideUp 0.8s ease forwards;
}
.line-1 { animation-delay: 0.1s; color: var(--text); }
.line-2 {
  animation-delay: 0.25s;
  -webkit-text-stroke: 2px var(--accent);
  color: transparent;
}
@keyframes slideUp {
  to { opacity:1; transform:translateY(0); }
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to { opacity:1; transform:translateY(0); }
}
.hero-sub {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 20px;
  min-height: 1.6em;
  animation: fadeUp 0.8s 0.4s ease both;
}
.caret {
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.hero-desc {
  max-width: 520px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 36px;
  animation: fadeUp 0.8s 0.5s ease both;
}
.hero-desc em { color: var(--accent); font-style: normal; }
.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeUp 0.8s 0.65s ease both;
}
.btn-primary {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 14px 28px;
  background: var(--accent);
  color: #030810;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s;
  letter-spacing: 0.5px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(100,220,255,0.35);
}
.btn-outline {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 14px 28px;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.3s;
  letter-spacing: 0.5px;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(100,220,255,0.05);
}
.hero-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeUp 0.9s 0.3s ease both;
}
.photo-frame {
  position: relative;
  width: 260px; height: 320px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.photo-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.photo-frame:hover .photo-img { transform: scale(1.04); }
.photo-deco {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(8,12,20,0.6));
  pointer-events: none;
}
.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 22px;
  width: 100%;
  justify-content: center;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stat-divider {
  width: 1px; height: 32px;
  background: var(--border);
}
.scroll-hint {
  position: absolute;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: fadeUp 1s 1s ease both;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollDown 2s ease infinite;
}
@keyframes scrollDown {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ===== SKILLS ===== */
.skills-section {
  padding: 120px 0;
  position: relative;
}
.skills-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0.3;
}
.section-head { margin-bottom: 52px; }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}
.skills-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.skill-col { flex: 1 1 200px; }
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  height: 100%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute;
  top: -60%; left: -60%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(100,220,255,0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.skill-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--glow); }
.skill-card:hover::before { opacity: 1; }
.skill-icon {
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 14px;
  display: block;
}
.skill-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 12px;
  background: rgba(100,220,255,0.06);
  border: 1px solid rgba(100,220,255,0.12);
  color: var(--muted);
  border-radius: 100px;
  transition: all 0.2s;
}
.tag:hover {
  background: rgba(100,220,255,0.12);
  color: var(--accent);
  border-color: rgba(100,220,255,0.3);
}

/* ===== PROJECTS ===== */
.projects-section {
  padding: 0 0 120px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 52px;
}
.project-card {
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s ease;
  position: relative;
}
.project-card::before {
  content: attr(data-num);
  position: absolute;
  top: 14px; left: 16px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  z-index: 2;
  background: rgba(8,12,20,0.7);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-6px); box-shadow: var(--shadow), var(--glow); }
.project-img-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.project-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.project-card:hover .project-img-wrap img { transform: scale(1.06); }
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8,12,20,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover .project-overlay { opacity: 1; }
.project-link-icon {
  font-size: 2rem;
  color: var(--accent);
}
.project-info { padding: 18px 20px; }
.project-type {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.project-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* ===== ABOUT ===== */
.about-section { padding: 0 0 120px; }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
.about-left { }
.about-desc {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
  margin: 24px 0 32px;
}
.about-details { display: grid; gap: 16px; }
.detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.detail-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.detail-val { font-size: 0.95rem; color: var(--text); }
.about-right { display: grid; gap: 20px; }
.lang-card, .contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
}
.lang-card h3, .contact-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--text);
}
.lang-list { display: grid; gap: 16px; }
.lang-item { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 14px; }
.lang-name { font-size: 0.9rem; color: var(--muted); }
.lang-bar {
  height: 3px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.lang-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent), var(--accent2));
  border-radius: 100px;
  transition: width 1.2s ease;
}
.lang-level {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  white-space: nowrap;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.contact-link:hover { color: var(--accent); }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
footer p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s;
}
.footer-links a:hover { color: var(--accent); }

/* ===== REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-photo { flex-direction: row; flex-wrap: wrap; }
  .photo-frame { width: 200px; height: 240px; }
  .about-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(3.5rem, 12vw, 6rem); }
}
@media (max-width: 640px) {
  .menu { gap: 16px; }
  .btn-github { display: none; }
  .hero-stats { padding: 12px 16px; }
  .stat-num { font-size: 1.1rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .lang-item { grid-template-columns: 80px 1fr auto; }
}
@media (max-width: 460px) {
  .nav { flex-wrap: wrap; }
  .cursor, .cursor-dot { display: none; }
}