:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 72px;
}

/* dark */
[data-theme="dark"] {
  --bg: #0b0d17;
  --bg-soft: #10131f;
  --surface: #151928;
  --surface-2: #1b2032;
  --border: rgba(148, 163, 216, 0.14);
  --text: #eef1fa;
  --text-muted: #9aa3bd;
  --accent: #4c6fff;
  --accent-2: #7a5cff;
  --accent-soft: rgba(76, 111, 255, 0.14);
  --green: #2ee6a8;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --code-bg: #0e1120;
  --header-bg: rgba(11, 13, 23, 0.78);
  --grid-line: rgba(122, 92, 255, 0.05);
}

/* light */
[data-theme="light"] {
  --bg: #f6f8fd;
  --bg-soft: #eef2fb;
  --surface: #ffffff;
  --surface-2: #f1f4fc;
  --border: rgba(30, 44, 100, 0.12);
  --text: #131a2e;
  --text-muted: #5b6482;
  --accent: #3557e6;
  --accent-2: #6b46ec;
  --accent-soft: rgba(53, 87, 230, 0.1);
  --green: #0bb27e;
  --shadow: 0 16px 44px rgba(30, 44, 100, 0.12);
  --code-bg: #10131f;
  --header-bg: rgba(246, 248, 253, 0.82);
  --grid-line: rgba(53, 87, 230, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

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

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent); }
a { color: inherit; text-decoration: none; }

.bg-blobs { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.35; animation: blobFloat 18s ease-in-out infinite alternate; }
.blob-1 { width: 560px; height: 560px; background: var(--accent); top: -180px; right: -120px; }
.blob-2 { width: 460px; height: 460px; background: var(--accent-2); bottom: -160px; left: -140px; animation-delay: -6s; }
.blob-3 { width: 340px; height: 340px; background: var(--green); top: 45%; left: 55%; opacity: 0.14; animation-delay: -12s; }
[data-theme="light"] .blob { opacity: 0.18; }
[data-theme="light"] .blob-3 { opacity: 0.1; }

@keyframes blobFloat {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-60px, 40px) scale(1.12); }
  100% { transform: translate(40px, -50px) scale(0.94); }
}

.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}


.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.logo-badge {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 0.85rem; font-weight: 800; font-family: var(--font-mono);
  box-shadow: 0 4px 16px rgba(76, 111, 255, 0.4);
}
.logo-text { font-family: var(--font-mono); }

.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; font-size: 0.92rem; font-weight: 500;
  color: var(--text-muted); transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: grid; place-items: center; transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(20deg); }
.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

.navbtn { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.navbtn span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }
.navbtn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbtn.open span:nth-child(2) { opacity: 0; }
.navbtn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

.welcome-description {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 0.9fr;
  align-items: center; gap: 48px; padding-top: calc(var(--header-h) + 40px); padding-bottom: 60px;
}

.welcome-description-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(76, 111, 255, 0.25); margin-bottom: 22px;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 230, 168, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(46, 230, 168, 0); }
}

.welcome-description-title { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; }
.gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--green));
  background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradientShift 6s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.welcome-description-typed {
  font-family: var(--font-mono); font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 500; margin: 18px 0 20px; min-height: 1.6em; color: var(--text);
}
.typed-prefix { color: var(--green); margin-right: 10px; }
.cursor { color: var(--accent); animation: blink 1s step-end infinite; font-weight: 400; }
@keyframes blink { 50% { opacity: 0; } }

.welcome-desc { color: var(--text-muted); font-size: 1.05rem; max-width: 540px; margin-bottom: 30px; }
.tw-link { color: var(--accent); font-weight: 600; border-bottom: 1px dashed var(--accent); transition: opacity var(--transition); }
.tw-link:hover { opacity: 0.75; }

.welcome-description-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 13px; font-weight: 600; font-size: 0.97rem;
  transition: all var(--transition); cursor: pointer; border: none;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 8px 26px rgba(76, 111, 255, 0.38);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(76, 111, 255, 0.5); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.welcome-description-stats { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 800; font-family: var(--font-mono); color: var(--accent); display: inline-block; }
.stat-plus { font-size: 1rem; font-weight: 700; color: var(--accent-2); margin-left: 3px; display: inline-block; }
.stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.stat-divider { width: 1px; height: 44px; background: var(--border); }

.welcome-description-visual { position: relative; }
.float-anim { animation: floatY 6s ease-in-out infinite; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
.code-window {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.code-header {
  display: flex; align-items: center; gap: 8px; padding: 13px 18px;
  background: rgba(255, 255, 255, 0.04); 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-title { margin-left: 10px; font-family: var(--font-mono); font-size: 0.78rem; color: #7c86a5; }
.code-body { padding: 22px 24px; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.75; color: #c9d2ef; overflow-x: auto; }
.c-key { color: #ff7ab3; } .c-var { color: #82aaff; } .c-prop { color: #7fdbca; }
.c-str { color: #c3e88d; } .c-fn { color: #ffcb6b; }

.floating-tag {
  position: absolute; padding: 9px 16px; border-radius: 12px; font-size: 0.85rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: floatY 5s ease-in-out infinite;
}
.tag-1 { top: -22px; right: 8%; animation-delay: -1.2s; }
.tag-2 { bottom: -18px; left: 4%; animation-delay: -2.6s; }
.tag-3 { top: 42%; right: -26px; animation-delay: -3.8s; }

.section { padding: 96px 24px; }
.section-head { margin-bottom: 48px; }
.section-tag { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent); font-weight: 500; }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; margin-top: 8px; }

.about-grid { display: grid; grid-template-columns: 280px 1fr 0.75fr; gap: 40px; align-items: start; }
.about-photo { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.about-photo-frame {
  width: 280px; height: 280px;
  transition: transform var(--transition);
}
.about-photo-frame:hover { transform: translateY(-6px) scale(1.03); }
.about-photo-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='e' x='-40%25' y='-40%25' width='180%25' height='180%25'><feTurbulence type='fractalNoise' baseFrequency='0.052' numOctaves='5' seed='17' stitchTiles='stitch' result='n'/><feDisplacementMap in='SourceGraphic' in2='n' scale='72'/><feGaussianBlur stdDeviation='1.2'/></filter><ellipse cx='140' cy='142' rx='104' ry='108' fill='%23fff' filter='url(%23e)'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='e' x='-40%25' y='-40%25' width='180%25' height='180%25'><feTurbulence type='fractalNoise' baseFrequency='0.052' numOctaves='5' seed='17' stitchTiles='stitch' result='n'/><feDisplacementMap in='SourceGraphic' in2='n' scale='72'/><feGaussianBlur stdDeviation='1.2'/></filter><ellipse cx='140' cy='142' rx='104' ry='108' fill='%23fff' filter='url(%23e)'/></svg>");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.about-text p { color: var(--text-muted); margin-bottom: 18px; font-size: 1.02rem; }
.about-text strong { color: var(--text); }
.about-facts { list-style: none; display: grid; gap: 12px; width: 100%; }
.about-facts li {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  font-size: 0.95rem; transition: all var(--transition);
}
.about-facts li:hover { border-color: var(--accent); transform: translateX(6px); }
.fact-icon { font-size: 1.15rem; }

.about-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quality-card {
  display: flex; align-items: center; gap: 10px; padding: 15px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  font-size: 0.88rem; font-weight: 500; transition: all var(--transition);
}
.quality-card span { font-size: 1.25rem; }
.quality-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 10px 26px rgba(76, 111, 255, 0.16); }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 20px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: all var(--transition); position: relative; overflow: hidden;
}
.skill-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease;
}
.skill-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 16px 38px rgba(76, 111, 255, 0.18); }
.skill-card:hover::before { transform: scaleX(1); }
.skill-icon { font-size: 1.9rem; margin-bottom: 14px; }
.skill-card h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 500;
  font-family: var(--font-mono);
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent; transition: all var(--transition);
}
.chip:hover { border-color: var(--accent); transform: translateY(-2px); }

.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute; left: -34px; top: 10px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 4px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 2.2s ease-in-out infinite;
}
.timeline-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 32px; transition: all var(--transition);
}
.timeline-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.timeline-meta { margin-bottom: 14px; }
.badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; font-family: var(--font-mono);
  background: var(--accent-soft); color: var(--accent);
}
.badge-active { background: rgba(46, 230, 168, 0.13); color: var(--green); }
.timeline-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 6px; }
.timeline-company { display: inline-block; color: var(--accent); font-weight: 600; margin-bottom: 14px; }
.timeline-company:hover { text-decoration: underline; }
.timeline-card p { color: var(--text-muted); margin-bottom: 14px; }
.timeline-list { list-style: none; display: grid; gap: 8px; }
.timeline-list li { position: relative; padding-left: 24px; color: var(--text-muted); font-size: 0.95rem; }
.timeline-list li::before { content: '▹'; position: absolute; left: 0; color: var(--green); }

.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 30px; display: flex; flex-direction: column; gap: 14px;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.project-card::after {
  content: ''; position: absolute; top: -60%; right: -40%; width: 320px; height: 320px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.5s ease; pointer-events: none;
}
.project-card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: var(--shadow); }
.project-card:hover::after { opacity: 1; }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project-icon {
  width: 54px; height: 54px; display: grid; place-items: center; font-size: 1.7rem;
  border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--border);
}
.project-card h3 { font-size: 1.25rem; font-weight: 700; font-family: var(--font-mono); }
.project-sub { color: var(--accent); font-weight: 600; font-size: 0.92rem; }
.project-card > p { color: var(--text-muted); font-size: 0.95rem; }
.project-card strong { color: var(--text); }
.project-features { display: grid; gap: 8px; font-size: 0.88rem; color: var(--text-muted); }
.project-stack { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); }

.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.edu-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 28px; transition: all var(--transition);
}
.edu-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.edu-icon { font-size: 2.1rem; margin-bottom: 14px; }
.edu-card .badge { margin-bottom: 14px; }
.edu-card h3 { font-size: 1.03rem; font-weight: 700; margin-bottom: 10px; }
.edu-card p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 8px; }
.edu-card strong { color: var(--text); }
.edu-degree { color: var(--accent) !important; font-weight: 600; }
.red-diploma {
  color: #ff5f6d; font-weight: 700;
  background: rgba(255, 95, 109, 0.12); padding: 2px 10px; border-radius: 6px;
}

.lang-row { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 0.88rem; }
.lang-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.lang-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.edu-card.visible .lang-fill { width: var(--w); }
.lang-lvl { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }

.contact-card {
  position: relative; text-align: center; padding: 72px 40px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  overflow: hidden;
}
.contact-glow {
  position: absolute; top: -140px; left: 50%; transform: translateX(-50%);
  width: 480px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}
.contact-card p { color: var(--text-muted); margin: 14px auto 30px; max-width: 460px; position: relative; }
.contact-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; position: relative; }
.contact-note { font-size: 0.88rem !important; margin-top: 26px !important; margin-bottom: 0 !important; }

.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-copy { color: var(--text-muted); font-size: 0.88rem; }
.to-top {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); transition: all var(--transition);
}
.to-top svg { width: 18px; height: 18px; }
.to-top:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-4px); }


@media (max-width: 980px) {
  .welcome-description { grid-template-columns: 1fr; padding-top: calc(var(--header-h) + 32px); min-height: auto; }
  .welcome-description-visual { max-width: 560px; margin: 12px auto 0; width: 100%; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { order: -1; }
  .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 4px; padding: 16px 24px 24px;
    background: var(--header-bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%); opacity: 0; pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { display: block; padding: 12px 16px; }
  .navbtn { display: flex; }
  .section { padding: 64px 24px; }
  .stat-divider { display: none; }
  .welcome-description-stats { gap: 20px; }
  .floating-tag { display: none; }
  .about-cards { grid-template-columns: 1fr; }
  .timeline-card { padding: 24px 20px; }
  .contact-card { padding: 52px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

