*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #080c14;
  --bg2:     #0d1526;
  --surface: rgba(255,255,255,0.04);
  --border:  rgba(255,255,255,0.08);
  --accent:  #3b82f6;
  --accent2: #818cf8;
  --text:    #f1f5f9;
  --muted:   #94a3b8;
  --nav-h:   64px;
  --btn-inner: #0d1a30;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── CONTAINER ─── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 3.5rem);
}

/* ══════════ NAV ══════════ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(8,12,20,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

/* hamburger — mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}

/* ══════════ HERO ══════════ */
#home {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--nav-h);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('bg.jpg');
  background-size: cover;
  background-position: center;
  filter: brightness(0.18) saturate(1.2);
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(8,12,20,0.55) 0%,
    rgba(59,130,246,0.07) 50%,
    rgba(8,12,20,0.82) 100%
  );
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 1;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  z-index: 1;
  animation: drift 12s ease-in-out infinite alternate;
}
.blob-1 { width: 560px; height: 560px; background: #3b82f6; top: -140px; left: -120px; animation-duration: 15s; }
.blob-2 { width: 440px; height: 440px; background: #818cf8; bottom: -100px; right: -80px; animation-duration: 11s; animation-direction: alternate-reverse; }

@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(35px, 25px) scale(1.07); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 4rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #93c5fd;
  text-transform: uppercase;
  margin-bottom: 1.3rem;
}
.badge-dot {
  width: 6px; height: 6px;
  background: #3b82f6;
  border-radius: 50%;
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.45); }
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.2rem;
}
.hero-title .accent2 {
  background: linear-gradient(90deg, #3b82f6 0%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.78;
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* ── HERO stats column ── */
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.4rem 1.2rem;
  transition: border-color 0.25s, background 0.25s;
}
.stat-box:hover {
  border-color: rgba(59,130,246,0.25);
  background: rgba(59,130,246,0.06);
}
.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* ══════════ BUTTONS ══════════ */
.btn-wrap {
  position: relative;
  display: inline-flex;
  border-radius: 11px;
  padding: 2px;
  overflow: hidden;
}
.btn-wrap::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%; left: -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    #3b82f6 25%,
    #818cf8 50%,
    #c084fc 65%,
    transparent 75%
  );
  animation: border-spin 3s linear infinite;
  z-index: 0;
}
@keyframes border-spin {
  to { transform: rotate(360deg); }
}

.btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.5rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--btn-inner);
  color: var(--text);
}
.btn-ghost:hover {
  background: #122040;
  transform: translateY(-1px);
}

.btn-plain-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-plain-ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

/* ══════════ SECTION SHARED ══════════ */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.section-sub {
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

/* ══════════ SKILLS ══════════ */
#skills {
  background: var(--bg2);
  padding: 4rem 0;
}

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

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  cursor: default;
  opacity: 0;
  transform: translateY(18px);
}
.skill-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease,
              background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.skill-card:hover {
  background: rgba(59,130,246,0.07);
  border-color: rgba(59,130,246,0.25);
  box-shadow: 0 0 22px rgba(59,130,246,0.1);
}

.skill-icon { font-size: 1.65rem; margin-bottom: 0.7rem; }

.skill-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.skill-desc { color: var(--muted); font-size: 0.85rem; line-height: 1.55; }

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}
.tag {
  background: rgba(59,130,246,0.1);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 5px;
  padding: 0.18rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ══════════ DEMO ══════════ */
#demo { padding: 4rem 0; }

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.demo-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(18px);
}
.demo-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease,
              box-shadow 0.3s, transform 0.3s;
}
.demo-card:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow: 0 22px 60px rgba(0,0,0,0.5),
              0 0 32px rgba(59,130,246,0.15);
}

.demo-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  z-index: 0;
}
.demo-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}

.demo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    transparent 40%,
    rgba(59,130,246,0.07) 60%,
    transparent 80%
  );
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
}
.demo-card:hover::before { opacity: 1; }

.demo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,12,20,0.93) 0%, transparent 60%);
  z-index: 1;
}

.demo-info {
  position: relative;
  z-index: 2;
  padding: 1.6rem;
}
.demo-tag {
  display: inline-block;
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 5px;
  padding: 0.18rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}
.demo-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.demo-desc { color: var(--muted); font-size: 0.85rem; line-height: 1.55; }
.demo-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin-top: 0.9rem;
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 600;
  transition: gap 0.2s;
}
.demo-card:hover .demo-arrow { gap: 0.6rem; }

/* ══════════ CONTACT ══════════ */
#kapcsolatok {
  background: var(--bg2);
  padding: 4rem 0;
  text-align: center;
}
.contact-inner { max-width: 560px; margin: 0 auto; }
.contact-links {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}

/* ══════════ FOOTER ══════════ */
footer {
  text-align: center;
  padding: 1.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

/* ══════════ FADE-UP ══════════ */
.fade-up { opacity: 0; transform: translateY(22px); }
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ══════════ CODE MODAL ══════════ */
#code-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8,12,20,0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
}
#code-modal-overlay.open { display: flex; }

#code-modal {
  background: #0d1526;
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 18px;
  padding: 2.2rem 2rem;
  width: min(360px, 90vw);
  box-shadow: 0 0 60px rgba(59,130,246,0.15);
  text-align: center;
  animation: modal-in 0.22s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.93) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

#code-modal .modal-icon { font-size: 2rem; margin-bottom: 0.7rem; }
#code-modal h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
#code-modal p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.4rem;
}

#code-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Space Grotesk', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 0.65rem 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 0.6rem;
}
#code-input:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
#code-input.shake {
  animation: shake 0.35s ease;
  border-color: #f87171;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

#code-error {
  color: #f87171;
  font-size: 0.8rem;
  min-height: 1.1rem;
  margin-bottom: 1rem;
  transition: opacity 0.2s;
}

.modal-btns { display: flex; gap: 0.7rem; }
.modal-btns .btn { flex: 1; justify-content: center; }

/* ══════════ SCROLL PROGRESS BAR ══════════ */
#scroll-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, #3b82f6, #818cf8, #c084fc);
  box-shadow: 0 0 10px rgba(59,130,246,0.7), 0 0 20px rgba(129,140,248,0.4);
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
}


/* ══════════ RESPONSIVE ══════════ */

/* Tablet */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 0; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .skills-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile */
@media (max-width: 600px) {
  .nav-links { display: none; flex-direction: column; gap: 1rem; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(8,12,20,0.97);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
  }
  .nav-toggle { display: flex; }

  .hero-title { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .hero-stats  { grid-template-columns: 1fr 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .demo-grid   { grid-template-columns: 1fr; }
  .hero-ctas   { flex-direction: column; align-items: flex-start; }
  .contact-links { flex-direction: column; align-items: center; }
}
