/* ============================================================
   DAVI VINCO — refined dark portfolio (minimal + one accent)
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --panel: #101012;
  --ink: #f2f2f2;
  --muted: #969696;
  --faint: #5e5e5e;
  --line: #212124;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --font-display: "Inter Tight", sans-serif;
  --font-body: "Inter", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

a { color: var(--ink); }

.accent { color: var(--accent); }

/* ---------- preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--muted);
  animation: preFade 0.9s ease forwards;
}
@keyframes preFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- ambient ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 90;
  height: 2px; width: 0;
  background: var(--accent);
}
#edgeCanvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.55;
}
.hero-glow {
  position: absolute; z-index: 0;
  top: -20vh; left: 50%;
  width: 90vw; height: 90vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(59, 130, 246, 0.09),
    rgba(59, 130, 246, 0.03) 40%,
    transparent 70%);
  pointer-events: none;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px;
  transition: background 0.35s, border-color 0.35s, padding 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
  padding: 14px 32px;
}
.nav-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-name .dot { color: var(--accent); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  transition: border-color 0.25s, background 0.25s;
}
.nav-cta:hover { border-color: var(--accent); background: var(--accent-soft); }
.lang-switch {
  display: flex; align-items: center; gap: 4px;
  margin-left: 6px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.lang-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  transition: color 0.25s;
}
.lang-btn:hover { color: var(--muted); }
.lang-btn.is-active { color: var(--accent); }
.lang-sep { color: var(--line); font-size: 0.8rem; }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line);
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 34px 34px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 64px;
  align-items: center;
  width: 100%;
}
.hero-photo {
  position: relative;
  justify-self: end;
}
.hero-photo img {
  display: block;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 6px rgba(59, 130, 246, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.5),
    0 0 90px rgba(59, 130, 246, 0.12);
}
.hero-photo-badge {
  position: absolute;
  left: 50%; bottom: -18px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  background: rgba(16, 16, 18, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}
.hero-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 10px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(59,130,246,0.5);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(59,130,246,0.45); }
  70% { box-shadow: 0 0 0 10px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 13vw, 10.5rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.hero-title span { display: block; }
.hero-title-alt {
  background: linear-gradient(120deg, var(--ink) 30%, #8a8a8a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 36px;
  max-width: 540px;
  font-size: 1.05rem;
  color: var(--muted);
}
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-foot {
  margin-top: 48px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 999px;
  transition: transform 0.3s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.btn-solid {
  background: var(--ink);
  color: var(--bg);
}
.btn-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255,255,255,0.12);
}
.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.hero-scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--faint);
  animation: bob 2.4s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- sections ---------- */
main { position: relative; z-index: 1; }
.section {
  padding: 130px 0;
  border-bottom: 1px solid var(--line);
}
.section-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}
.section-label {
  position: sticky; top: 96px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.section-label span {
  color: var(--accent);
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.section-body { min-width: 0; }
.section-note { color: var(--muted); font-size: 0.95rem; margin-bottom: 40px; }
.section-note a { color: var(--ink); text-underline-offset: 3px; }

.lead {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.4;
  letter-spacing: -0.015em;
  margin-bottom: 32px;
}
.lead em { font-style: normal; color: var(--accent); }
.body-text { color: var(--muted); max-width: 640px; }
.body-text strong { color: var(--ink); font-weight: 600; }

/* ---------- stats ---------- */
.stats {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 20px 18px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.stat:hover { border-color: rgba(59,130,246,0.35); transform: translateY(-3px); }
.stat-num, .stat-suffix {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-suffix { color: var(--accent); }
.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- experience ---------- */
.xp {
  padding: 36px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  margin-bottom: 20px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.xp:hover { border-color: rgba(255,255,255,0.16); transform: translateY(-3px); }
.xp.current { border-color: rgba(59,130,246,0.3); }
.xp.current:hover { border-color: rgba(59,130,246,0.55); }
.xp-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.xp h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.xp-co {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.95rem;
  margin-left: 10px;
}
.xp-period {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.xp p { color: var(--muted); font-size: 0.95rem; max-width: 640px; }
.xp-roles {
  list-style: none;
  margin-top: 22px;
}
.xp-roles li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.xp-roles li span:first-child { color: var(--ink); }
.xp-roles li span:last-child { color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.skill-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.skill-card:hover {
  border-color: rgba(59,130,246,0.35);
  transform: translateY(-3px);
}
.skill-card h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.skill-card ul { list-style: none; }
.skill-card li {
  position: relative;
  padding: 5px 0 5px 18px;
  font-size: 0.88rem;
  color: var(--muted);
}
.skill-card li::before {
  content: "";
  position: absolute;
  left: 0; top: 13px;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
}

/* ---------- projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.project {
  position: relative;
  display: flex; flex-direction: column;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  text-decoration: none;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease),
              border-color 0.3s, box-shadow 0.3s;
}
.project.in { opacity: 1; transform: translateY(0); }
.project:hover {
  border-color: rgba(59,130,246,0.45);
  box-shadow: 0 18px 44px rgba(0,0,0,0.45);
}
.project::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(59,130,246,0.08), transparent 55%);
  opacity: 0; transition: opacity 0.35s;
  pointer-events: none;
}
.project:hover::before { opacity: 1; }
.project.featured { grid-column: 1 / -1; }
.project-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
}
.project h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 10px;
  word-break: break-word;
}
.project h3 .arrow {
  font-size: 0.9em;
  color: var(--faint);
  transition: transform 0.3s var(--ease), color 0.3s;
}
.project:hover h3 .arrow { transform: translate(3px, -3px); color: var(--accent); }
.project-meta {
  font-size: 0.78rem; color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.project p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}
.project .tag {
  align-self: flex-start;
  margin-top: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 999px;
  padding: 4px 12px;
}
.project-highlights {
  list-style: none;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 28px;
}
.project-highlights li {
  position: relative;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--muted);
}
.project-highlights li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85em;
}
.project-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px;
}
.project-chips span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  transition: border-color 0.25s, color 0.25s;
}
.project:hover .project-chips span {
  border-color: rgba(59,130,246,0.3);
  color: var(--ink);
}

/* ---------- education & certs ---------- */
.edu { list-style: none; }
.edu li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.edu li:first-child { border-top: none; padding-top: 0; }
.edu strong { display: block; font-weight: 600; }
.edu li > div > span { color: var(--muted); font-size: 0.9rem; }
.edu-period {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sub-head {
  margin: 64px 0 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.certs { list-style: none; }
.certs li {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.certs li:first-child { border-top: none; }
.certs strong { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 2px; }
.certs li div > span { color: var(--muted); font-size: 0.88rem; }

/* ---------- contact ---------- */
.contact-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 18px;
}
.contact-list { list-style: none; margin-top: 8px; }
.contact-list li { border-top: 1px solid var(--line); }
.contact-list li:first-child { border-top: none; }
.contact-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0;
  text-decoration: none;
  font-size: 1.05rem;
  color: var(--muted);
  transition: color 0.25s, padding-left 0.3s var(--ease);
}
.contact-list a:hover { color: var(--ink); padding-left: 10px; }
.contact-list a span { color: var(--faint); transition: color 0.25s, transform 0.3s var(--ease); }
.contact-list a:hover span { color: var(--accent); transform: translate(3px, -3px); }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 1; padding: 28px 0; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--faint);
}
.footer a { color: var(--faint); text-decoration: none; transition: color 0.25s; }
.footer a:hover { color: var(--ink); }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.05s; }
.reveal.d2 { transition-delay: 0.15s; }
.reveal.d3 { transition-delay: 0.3s; }
.reveal.d4 { transition-delay: 0.45s; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) and (min-width: 821px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr 300px; gap: 40px; }
}

@media (max-width: 820px) {
  .container { padding: 0 20px; }
  .nav { padding: 16px 20px; }
  .nav.scrolled { padding: 12px 20px; }
  .nav-links { gap: 12px; }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-cta { padding: 6px 12px; font-size: 0.8rem; }
  .nav-name { font-size: 0.88rem; }
  .lang-switch { padding-left: 12px; margin-left: 2px; }

  .section { padding: 90px 0; }
  .section-grid { grid-template-columns: 1fr; gap: 28px; }
  .section-label { position: static; }

  .hero { padding: 110px 0 70px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-photo { justify-self: start; order: -1; }
  .hero-photo img { max-width: 220px; border-radius: 20px; }
  .hero-photo-badge { left: 0; transform: none; bottom: -14px; padding: 7px 14px; font-size: 0.72rem; }
  .hero-scroll { display: none; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 24px; }
  .projects { grid-template-columns: 1fr; }
  .project-highlights { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .xp { padding: 26px 20px; }
  .xp-head { flex-direction: column; gap: 4px; }
  .edu li { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
