/* ============================================================
   Mickey Szabo — Portfolio
   Custom layer on top of Tailwind CSS
   ============================================================ */

/* ---------- Base ---------- */
html { scroll-padding-top: 5.5rem; }
body { overflow-x: hidden; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
.dark ::-webkit-scrollbar-thumb { background: #2a3448; }
::-webkit-scrollbar-thumb:hover { background: #6366f1; }

/* ---------- Navbar ---------- */
#navbar.scrolled {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 8px 30px -18px rgba(2, 6, 23, .5);
}
.dark #navbar.scrolled {
  background: rgba(11, 15, 25, .78);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.nav-link {
  position: relative;
  display: block;
  padding: .5rem .9rem;
  font-size: .875rem;
  font-weight: 500;
  border-radius: .75rem;
  color: #475569;
  transition: color .2s ease, background-color .2s ease;
}
.dark .nav-link { color: #94a3b8; }
.nav-link:hover { color: #4f46e5; }
.dark .nav-link:hover { color: #a5b4fc; }
.nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: .15rem;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transform: translateX(-50%);
  transition: width .25s ease;
}
.nav-link.active { color: #4f46e5; }
.dark .nav-link.active { color: #fff; }
.nav-link.active::after { width: 1.4rem; }

.mobile-link {
  display: block;
  padding: .75rem 1rem;
  border-radius: .75rem;
  font-size: .95rem;
  font-weight: 500;
  color: #334155;
  transition: background-color .2s, color .2s;
}
.dark .mobile-link { color: #cbd5e1; }
.mobile-link:hover, .mobile-link.active {
  background: rgba(99, 102, 241, .1);
  color: #4f46e5;
}
.dark .mobile-link:hover, .dark .mobile-link.active { color: #a5b4fc; }

/* ---------- Hero decor ---------- */
.grid-pattern {
  background-image:
    linear-gradient(to right, rgba(99, 102, 241, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, .07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 40%, transparent 100%);
}

.caret {
  color: #22d3ee;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1 } 50% { opacity: 0 } }

/* ---------- Section headings ---------- */
.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #6366f1;
}
.section-title {
  margin-top: .65rem;
  font-size: clamp(1.85rem, 4vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  color: #0f172a;
}
.dark .section-title { color: #fff; }
.section-sub {
  margin-top: .9rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #64748b;
}
.dark .section-sub { color: #94a3b8; }

/* ---------- Buttons / chips ---------- */
.social-btn {
  display: grid;
  place-items: center;
  height: 2.75rem;
  width: 2.75rem;
  border-radius: .85rem;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, .7);
  color: #475569;
  transition: all .25s ease;
}
.dark .social-btn {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .05);
  color: #cbd5e1;
}
.social-btn:hover {
  transform: translateY(-3px);
  border-color: #818cf8;
  color: #4f46e5;
  box-shadow: 0 10px 24px -12px rgba(99, 102, 241, .8);
}
.dark .social-btn:hover { color: #a5b4fc; }

.tag {
  display: inline-block;
  padding: .3rem .7rem;
  border-radius: .55rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  font-weight: 500;
  background: rgba(99, 102, 241, .09);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, .18);
}
.dark .tag { background: rgba(99, 102, 241, .14); color: #a5b4fc; }

.chip-date {
  display: inline-block;
  padding: .35rem .8rem;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  font-weight: 500;
  background: linear-gradient(90deg, rgba(99, 102, 241, .12), rgba(34, 211, 238, .12));
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, .2);
  white-space: nowrap;
}
.dark .chip-date { color: #c7d2fe; }

/* ---------- Marquee ---------- */
.marquee-mask {
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  border-radius: .75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem;
  white-space: nowrap;
  color: #475569;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.dark .marquee-item {
  color: #94a3b8;
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}

/* ---------- About ---------- */
.about-check {
  position: relative;
  padding-left: 1.9rem;
  font-size: .95rem;
  font-weight: 500;
  color: #334155;
}
.dark .about-check { color: #cbd5e1; }
.about-check::before {
  content: '';
  position: absolute;
  left: 0;
  top: .15rem;
  height: 1.25rem;
  width: 1.25rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / .8rem no-repeat;
}

.stat-card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.35rem;
  transition: transform .25s ease, border-color .25s ease;
}
.dark .stat-card { border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .03); }
.stat-card:hover { transform: translateY(-4px); border-color: #818cf8; }
.stat-num {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  margin-top: .25rem;
  font-size: .78rem;
  font-weight: 500;
  color: #64748b;
}
.dark .stat-label { color: #94a3b8; }

/* ---------- Experience timeline ---------- */
.timeline-item { position: relative; padding-bottom: 2.5rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -2.4rem;
  top: 1.9rem;
  height: .95rem;
  width: .95rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .18);
}
@media (min-width: 640px) { .timeline-dot { left: -3.4rem; } }

.job-card {
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.75rem;
  box-shadow: 0 10px 40px -12px rgba(2, 6, 23, .08);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.dark .job-card {
  border-color: rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .03);
  box-shadow: none;
}
.job-card:hover {
  transform: translateY(-4px);
  border-color: #818cf8;
  box-shadow: 0 22px 50px -22px rgba(99, 102, 241, .55);
}
@media (min-width: 640px) { .job-card { padding: 2rem; } }

.bullet {
  position: relative;
  padding-left: 1.4rem;
  font-size: .93rem;
  line-height: 1.7;
  color: #475569;
}
.dark .bullet { color: #94a3b8; }
.bullet::before {
  content: '';
  position: absolute;
  left: 0;
  top: .62rem;
  height: .4rem;
  width: .4rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
}

/* ---------- Filters ---------- */
.filter-btn {
  padding: .5rem 1.1rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: .82rem;
  font-weight: 600;
  color: #475569;
  transition: all .22s ease;
}
.dark .filter-btn {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: #94a3b8;
}
.filter-btn:hover { border-color: #818cf8; color: #4f46e5; }
.dark .filter-btn:hover { color: #a5b4fc; }
.filter-btn.active {
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(99, 102, 241, .9);
}

/* ---------- Skill / project cards ---------- */
.skill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.6rem;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease, opacity .3s ease;
}
.skill-count { margin-top: auto; padding-top: 1.25rem; }
.dark .skill-card { border-color: rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .03); }
.skill-card:hover {
  transform: translateY(-6px);
  border-color: #818cf8;
  box-shadow: 0 24px 50px -24px rgba(99, 102, 241, .6);
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.9rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.dark .project-card { border-color: rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .03); }
.project-card:hover {
  transform: translateY(-6px);
  border-color: #818cf8;
  box-shadow: 0 26px 56px -26px rgba(99, 102, 241, .6);
}
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(99, 102, 241, .1), transparent 45%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.project-card:hover::before { opacity: 1; }

.card-hidden {
  display: none !important;
}

/* ---------- Progress bars ---------- */
.bar {
  height: .5rem;
  width: 100%;
  border-radius: 9999px;
  background: #e2e8f0;
  overflow: hidden;
}
.dark .bar { background: rgba(255, 255, 255, .08); }
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transition: width 1.4s cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Contact ---------- */
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: 1.15rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1.1rem 1.25rem;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.dark .contact-card { border-color: rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .03); }
.contact-card:hover {
  transform: translateX(5px);
  border-color: #818cf8;
  box-shadow: 0 18px 40px -22px rgba(99, 102, 241, .7);
}
.contact-icon {
  display: grid;
  place-items: center;
  height: 2.9rem;
  width: 2.9rem;
  flex-shrink: 0;
  border-radius: .9rem;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
}
.contact-label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94a3b8;
}
.contact-value {
  display: block;
  margin-top: .15rem;
  font-size: .95rem;
  font-weight: 600;
  color: #0f172a;
}
.dark .contact-value { color: #fff; }

/* ---------- Form ---------- */
.form-label {
  display: block;
  margin-bottom: .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #334155;
}
.dark .form-label { color: #cbd5e1; }
.form-input {
  width: 100%;
  border-radius: .85rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: .8rem 1rem;
  font-size: .93rem;
  color: #0f172a;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.dark .form-input {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: #fff;
}
.form-input::placeholder { color: #94a3b8; }
.form-input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .14);
}
.dark .form-input:focus { background: rgba(255, 255, 255, .06); }
.form-input.invalid { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }
.form-error {
  margin-top: .4rem;
  min-height: 1rem;
  font-size: .75rem;
  font-weight: 500;
  color: #ef4444;
}

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1);
  will-change: opacity, transform;
}
.js .reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Back to top ---------- */
#toTop.show { opacity: 1; transform: translateY(0); }
#toTop:hover { transform: translateY(-4px); }

/* ---------- Modal ---------- */
#modal.open { display: flex; }
#modalPanel.open { opacity: 1; transform: scale(1); }

/* ---------- Toast ---------- */
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  #navbar, #toTop, #progress, #contactForm, .marquee-mask { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}
