:root {
  --bg: #0a0e1a;
  --bg-2: #111729;
  --card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #a855f7;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.mono { font-family: 'JetBrains Mono', monospace; }
.accent { color: var(--accent); }

/* Butoane */
.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: 50px;
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .3s, box-shadow .3s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(34, 211, 238, .35); }
.btn-outline { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-small { padding: .5rem 1.3rem; }

/* Navigare */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.3rem 8%;
  transition: padding .3s;
}
/* Fundalul blurat stă pe ::before: backdrop-filter pe .nav ar face meniul mobil (fixed) relativ la header */
.nav::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(10, 14, 26, .85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  opacity: 0; transition: opacity .3s;
}
.nav.scrolled { padding: .8rem 8%; }
.nav.scrolled::before { opacity: 1; }
.logo { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 1.4rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a:not(.btn) { color: var(--muted); transition: color .3s; }
.nav-links a:not(.btn):hover { color: var(--accent); }
.burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.burger span { width: 26px; height: 2px; background: var(--text); transition: .3s; }

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100svh; /* pe telefon nu include bara de adrese */
  display: flex; align-items: center;
  padding: 0 8%;
  position: relative;
  overflow: hidden;
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; animation: float 12s ease-in-out infinite; }
.blob-1 { width: 450px; height: 450px; background: var(--accent); top: -100px; right: -100px; }
.blob-2 { width: 380px; height: 380px; background: var(--accent-2); bottom: -120px; left: -80px; animation-delay: -6s; }
@keyframes float { 50% { transform: translate(40px, 40px) scale(1.1); } }

.hero-content { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem; align-items: center; width: 100%; max-width: 1300px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.8rem, 6vw, 4.8rem); font-weight: 800; line-height: 1.1; margin: .4rem 0; }
.hero h2 { font-size: clamp(1.3rem, 3vw, 2rem); color: var(--muted); font-weight: 400; margin-bottom: 1.2rem; }
.typed { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.cursor { color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { color: var(--muted); max-width: 540px; font-size: 1.1rem; }
.hero-buttons { display: flex; gap: 1rem; margin: 2rem 0; flex-wrap: wrap; }
.socials { display: flex; gap: 1rem; }
.socials a {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--card);
  transition: .3s;
}
.socials svg { width: 20px; fill: var(--muted); transition: .3s; }
.socials a:hover { border-color: var(--accent); transform: translateY(-3px); }
.socials a:hover svg { fill: var(--accent); }

.hero-image { position: relative; display: flex; justify-content: center; }
.avatar-ring {
  width: 340px; height: 340px; border-radius: 50%;
  padding: 6px; background: var(--grad);
  animation: pulse 4s ease-in-out infinite;
}
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--bg-2); }
@keyframes pulse { 50% { box-shadow: 0 0 60px rgba(168, 85, 247, .5); } }

.terminal {
  position: absolute; bottom: -30px; left: 0;
  background: rgba(17, 23, 41, .92); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: .8rem; min-width: 250px;
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}
.terminal-bar { display: flex; gap: 6px; padding: .6rem .8rem; border-bottom: 1px solid var(--border); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.terminal-bar i:nth-child(2) { background: #eab308; }
.terminal-bar i:nth-child(3) { background: #22c55e; }
.terminal pre { padding: .8rem 1rem; color: var(--text); }

.scroll-down { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--muted); border-radius: 20px; }
.scroll-down span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; background: var(--accent); border-radius: 2px; animation: scroll 2s infinite; }
@keyframes scroll { 0% { opacity: 1; top: 8px; } 100% { opacity: 0; top: 24px; } }

/* Secțiuni */
.section { padding: 7rem 8%; max-width: 1300px; margin: 0 auto; }
.section-title { font-size: 2.2rem; margin-bottom: 3rem; display: flex; align-items: center; gap: 1rem; }
.section-title::after { content: ''; flex: 1; max-width: 300px; height: 1px; background: var(--border); }

/* Despre */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 4rem; align-items: center; }
.about-text p { color: var(--muted); margin-bottom: 1rem; font-size: 1.05rem; }
.about-text strong { color: var(--accent); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.8rem 1rem; text-align: center; font-size: 2.4rem; font-weight: 800; transition: .3s; }
.stat:hover { border-color: var(--accent); transform: translateY(-5px); }
.stat .counter { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat p { font-size: .9rem; color: var(--muted); font-weight: 400; }

/* Competențe */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 4rem; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 2rem;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 15px 40px rgba(34, 211, 238, .12); }
.card-icon { font-size: 2.4rem; margin-bottom: 1rem; }
.card h3 { margin-bottom: .6rem; }
.card p { color: var(--muted); font-size: .95rem; }

.bars { display: grid; gap: 1.4rem; max-width: 800px; }
.bar-label { display: flex; justify-content: space-between; margin-bottom: .4rem; font-size: .95rem; }
.bar-label span:last-child { color: var(--accent); font-family: 'JetBrains Mono', monospace; }
.bar-track { height: 8px; background: var(--card); border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--grad); border-radius: 10px; transition: width 1.5s cubic-bezier(.2,.8,.2,1); }

/* Proiecte */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 2rem; }
.project { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: .4s; }
.project img { width: 100%; height: 200px; object-fit: cover; transition: transform .5s; }
.project:hover { transform: translateY(-8px); border-color: var(--accent-2); box-shadow: 0 20px 45px rgba(168, 85, 247, .18); }
.project:hover img { transform: scale(1.06); }
.project-body { padding: 1.6rem; }
.project-body h3 { margin-bottom: .6rem; }
.project-body p { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags span { font-family: 'JetBrains Mono', monospace; font-size: .75rem; padding: .3rem .8rem; border-radius: 20px; background: rgba(34, 211, 238, .1); color: var(--accent); }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; border-left: 2px solid var(--border); max-width: 800px; }
.tl-item { position: relative; margin-bottom: 2.8rem; }
.tl-item::before { content: ''; position: absolute; left: calc(-2rem - 8px); top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--bg), 0 0 15px var(--accent); }
.tl-date { color: var(--accent); font-size: .85rem; }
.tl-item h3 { margin: .3rem 0; }
.tl-item p { color: var(--muted); }
.tl-item .tl-company { color: var(--text); opacity: .85; font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
.sub-title { font-size: 1.5rem; margin: 4rem 0 2rem; }

/* Video */
.video { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: center; }
.video-text h3 { font-size: 1.6rem; margin-bottom: 1rem; }
.video-text p { color: var(--muted); margin-bottom: 1.8rem; }
.video-frame {
  aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border); background: var(--card);
  box-shadow: 0 20px 50px rgba(168, 85, 247, .18);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Card canal YouTube */
.channel-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  text-align: center; padding: 2rem;
  background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, .15), transparent 60%),
              radial-gradient(circle at 80% 90%, rgba(168, 85, 247, .2), transparent 60%), var(--card);
  transition: transform .3s, border-color .3s;
}
.channel-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.channel-logo { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #ff0033; box-shadow: 0 0 30px rgba(255, 0, 51, .4); }
.channel-logo svg { width: 44px; height: 44px; fill: #fff; }
.channel-name { font-size: 1.6rem; font-weight: 800; margin-top: .6rem; }
.channel-handle { color: var(--accent); font-size: .9rem; }
.channel-meta { color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }

/* Blog / tutoriale */
.blog-intro { color: var(--muted); margin-bottom: 1.5rem; }
.blog-tools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1.2rem; }
.blog-tools input {
  flex: 1 1 280px; padding: .9rem 1.2rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font: inherit; transition: border-color .3s;
}
.blog-tools input:focus { outline: none; border-color: var(--accent); }
.blog-count { color: var(--accent); font-size: .85rem; }
.blog-tabs { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.8rem; }
.blog-tab {
  padding: .5rem 1rem; border-radius: 30px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  font: inherit; font-size: .9rem; transition: all .25s;
}
.blog-tab:hover { color: var(--text); border-color: var(--accent); }
.blog-tab.active { background: var(--grad); color: #0a0e1a; border-color: transparent; font-weight: 600; }
.blog-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem;
  max-height: 720px; overflow-y: auto; padding-right: .4rem;
}
.tut {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; gap: .3rem 1rem;
  padding: 1rem 1.2rem; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); transition: transform .25s, border-color .25s;
}
.tut:hover { transform: translateY(-3px); border-color: var(--accent); }
.tut-cat { font-size: .72rem; color: var(--accent); }
.tut-title { grid-column: 1; font-size: .95rem; line-height: 1.45; }
.tut-play {
  grid-column: 2; grid-row: 1 / 3; align-self: center;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 0, 51, .15); color: #ff4d6d; font-size: .8rem; transition: background .25s, color .25s;
}
.tut:hover .tut-play { background: #ff0033; color: #fff; }

/* Others / link-uri utile */
.others-banner {
  position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 2rem;
  border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(168, 85, 247, .18);
}
.others-banner img { width: 100%; height: 260px; object-fit: cover; }
.others-banner-text {
  position: absolute; inset: auto 0 0 0; padding: 1.5rem 2rem;
  background: linear-gradient(transparent, rgba(10, 14, 26, .95));
}
.others-banner-text h3 { font-size: 1.5rem; margin-bottom: .3rem; }
.others-banner-text p { color: var(--muted); margin: 0; }
.links-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.link-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.3rem; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.link-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(34, 211, 238, .12); }
.link-icon { font-size: 1.6rem; flex: 0 0 auto; }
.link-text { flex: 1; display: grid; min-width: 0; }
.link-title { font-weight: 600; }
.link-desc { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.link-arrow {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(34, 211, 238, .1); color: var(--accent); transition: background .25s, color .25s;
}
.link-card:hover .link-arrow { background: var(--grad); color: #fff; }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4rem; }
.contact-info h3 { font-size: 1.8rem; margin-bottom: 1rem; }
.contact-info p { color: var(--muted); margin-bottom: 1.5rem; }
.contact-info ul { list-style: none; display: grid; gap: .8rem; }
.contact-info a:hover { color: var(--accent); }
.contact-form { display: grid; gap: 1rem; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 1rem 1.2rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font: inherit; resize: vertical; transition: border-color .3s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }

.footer { text-align: center; padding: 2rem; color: var(--muted); border-top: 1px solid var(--border); font-size: .9rem; }

/* Animații la scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Responsive */

/* Monitoare mari */
@media (min-width: 1600px) {
  html { font-size: 17px; }
}

/* Laptop mic / tabletă landscape */
@media (max-width: 1100px) {
  .nav, .nav.scrolled { padding-left: 5%; padding-right: 5%; }
  .nav-links { gap: 1.2rem; }
  .hero { padding: 0 5%; }
  .section { padding: 6rem 5%; }
  .hero-content, .about, .contact { gap: 2.5rem; }
  .avatar-ring { width: 280px; height: 280px; }
}

/* Tabletă portrait + telefon */
@media (max-width: 900px) {
  .burger { display: flex; z-index: 101; padding: 8px; margin-right: -8px; }
  .nav-links {
    position: fixed; inset: 0 0 0 30%;
    height: 100vh; height: 100dvh;
    flex-direction: column; justify-content: center; gap: 1.6rem;
    background: var(--bg-2); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform .4s, visibility .4s;
    visibility: hidden;
  }
  .nav-links.open { transform: none; visibility: visible; }
  .nav-links a:not(.btn) { font-size: 1.15rem; padding: .4rem 1rem; }
  .burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.open span:nth-child(2) { opacity: 0; }
  .burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  body.menu-open { overflow: hidden; }

  .hero { padding-top: 7rem; padding-bottom: 4rem; }
  .hero-content, .about, .contact, .video { grid-template-columns: 1fr; }
  .hero-content { gap: 2.5rem; text-align: center; }
  .lead { margin: 0 auto; }
  .hero-buttons, .socials { justify-content: center; }
  .hero-image { order: -1; }
  .avatar-ring { width: 220px; height: 220px; }
  .terminal { display: none; }
  .scroll-down { display: none; }
  .blob-1 { width: 300px; height: 300px; }
  .blob-2 { width: 260px; height: 260px; }

  .section { padding: 5rem 5%; }
  .section-title { font-size: 1.9rem; margin-bottom: 2.2rem; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .blog-list { max-height: 70vh; }

  .channel-card { padding: 2rem 1.25rem; aspect-ratio: auto; }
  .channel-logo { width: 64px; height: 64px; }
  .channel-logo svg { width: 34px; height: 34px; }
}

/* Telefon */
@media (max-width: 600px) {
  .nav-links { inset: 0 0 0 20%; }
  .hero h1 { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  .hero h2 { font-size: 1.15rem; min-height: 2.6em; } /* nu sare layout-ul când se schimbă textul animat */
  .lead { font-size: 1rem; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { text-align: center; }
  .avatar-ring { width: 180px; height: 180px; }

  .section { padding: 4rem 1.25rem; }
  .section-title { font-size: 1.55rem; gap: .6rem; margin-bottom: 1.8rem; }
  .section-title::after { display: none; }
  .about-text p { font-size: 1rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: .8rem; }
  .stat { font-size: 2rem; padding: 1.3rem .6rem; }
  .stat p { font-size: .8rem; line-height: 1.4; }

  .skills-grid { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 3rem; }
  .card { padding: 1.5rem; }
  .bar-label { font-size: .85rem; gap: .5rem; }
  .projects { gap: 1.25rem; }
  .project img { height: 160px; }
  .project-body { padding: 1.25rem; }

  .timeline { padding-left: 1.4rem; }
  .tl-item { margin-bottom: 2.2rem; }
  .tl-item::before { left: calc(-1.4rem - 8px); }
  .sub-title { font-size: 1.3rem; margin: 3rem 0 1.5rem; }

  .video-text h3, .contact-info h3 { font-size: 1.35rem; }
  .video-text .btn { display: block; text-align: center; }
  .channel-name { font-size: 1.3rem; }

  .blog-tools input { flex-basis: 100%; }
  .blog-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1.25rem 1.5rem; padding: 0 1.25rem .4rem; scrollbar-width: none; }
  .blog-tabs::-webkit-scrollbar { display: none; }
  .blog-tab { flex: 0 0 auto; }
  .blog-list { padding-right: 0; }

  .others-banner img { height: 170px; }
  .others-banner-text { padding: 1rem 1.25rem; }
  .others-banner-text h3 { font-size: 1.2rem; }
  .links-grid { grid-template-columns: 1fr; }

  .contact-info a { word-break: break-word; }
  .contact-form .btn { width: 100%; }
}

/* Ecrane foarte înguste (ex. 320px) */
@media (max-width: 360px) {
  .logo { font-size: 1.2rem; }
  .stats { grid-template-columns: 1fr; }
}

/* Pe touchscreen efectele hover rămân „lipite” după atingere */
@media (hover: none) {
  .btn:hover, .socials a:hover, .stat:hover, .card:hover, .project:hover,
  .channel-card:hover, .tut:hover, .link-card:hover { transform: none; }
  .project:hover img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
/* Text justificat doar pentru blocurile de conținut */
p,
li,
blockquote,
.text,
.content p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;          /* despărțire în silabe, reduce golurile */
  -webkit-hyphens: auto;
}

/* Titlurile, meniul și butoanele rămân nejustificate */
h1, h2, h3, h4, h5, h6,
nav, button, .btn, footer {
  text-align: initial;
}

/* Pe telefon textul rămâne aliniat la stânga */
@media (max-width: 600px) {
  p, li, blockquote, .text, .content p {
    text-align: left;
  }
}
/* Cardurile de competențe: text aliniat la stânga, fără goluri */
h3 + p {
  text-align: left;
  hyphens: manual;
}

/* Titlurile din carduri: mai puțin spațiu între rânduri */
h3 {
  line-height: 1.3;
}