/*
  Theme Name: Valents Portfolio
  Version: 3.0 — Scroll reveal · Custom cursor · Nav indicator
            Project overlay · Hero glow · Footer · Mobile
*/

/* ═══════════════════════════════════════════════
   VARIABLES
═══════════════════════════════════════════════ */
:root {
  --black:       #0d0d0d;
  --dark:        #1a1a1a;
  --titanium:    #2a2a2a;
  --text-main:   #eaeaea;
  --text-soft:   #b5b5b5;
  --border:      rgba(255,255,255,0.06);
  --highlight:   rgba(255,255,255,0.08);
  --radius:      18px;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--text-main);
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  cursor: none;
}
@media (hover: none) { body { cursor: auto; } }
section { scroll-margin-top: 110px; }
h1, h2, h3 { letter-spacing: -0.5px; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 10px; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-top: 70px; margin-bottom: 20px; }
p  { color: var(--text-soft); line-height: 1.7; font-size: clamp(1rem, 2.5vw, 1.1rem); }

/* ═══════════════════════════════════════════════
   CUSTOM CURSOR — dot professionale
═══════════════════════════════════════════════ */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-spring),
              height 0.3s var(--ease-spring),
              background 0.2s ease,
              opacity 0.3s ease;
  mix-blend-mode: difference;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.45s var(--ease-spring),
              height 0.45s var(--ease-spring),
              border-color 0.3s ease,
              opacity 0.3s ease;
}

body.cursor-hover .cursor-dot  { width: 14px; height: 14px; }
body.cursor-hover .cursor-ring { width: 52px; height: 52px; border-color: rgba(255,255,255,0.6); }

@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ═══════════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes headerSlideIn {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes dropdownOpen {
  from { opacity: 0; transform: scale(0.9) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 0.65; transform: translate(-50%, -50%) scale(1.08); }
}

/* ═══════════════════════════════════════════════
   FLOATING 37s
═══════════════════════════════════════════════ */
.floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floater {
  position: absolute;
  color: rgba(255,255,255,0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-weight: 700;
  user-select: none;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(0)   rotate(var(--rot)); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(var(--rot)); opacity: 0; }
}

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.main-header {
  position: fixed; top: 0; left: 0; width: 100%;
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 15px 0; z-index: 9999;
  animation: headerSlideIn 0.6s var(--ease-out) both;
}
.header-container {
  width: 88%; max-width: 1150px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; position: relative;
}
.logo a {
  color: #fff; font-size: 1.4rem; text-decoration: none;
  font-weight: 600; letter-spacing: -0.5px; transition: opacity 0.2s ease;
}
.logo a:hover { opacity: 0.7; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 6px 12px; text-decoration: none;
  color: var(--text-soft); font-size: 1rem; border-radius: 8px;
  transition: color 0.25s ease, background 0.25s ease;
}
.main-nav a.nav-active { color: #fff; background: rgba(255,255,255,0.08); }
.main-nav a:hover      { color: #fff; background: rgba(255,255,255,0.06); }

/* ═══════════════════════════════════════════════
   HAMBURGER + MOBILE OVERLAY
═══════════════════════════════════════════════ */
.hamburger {
  display: none; flex-direction: column; justify-content: space-between;
  width: 24px; height: 18px; background: none; border: none; cursor: pointer; padding: 0; z-index: 10001;
}
.hamburger span {
  display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(13,13,13,0.97); backdrop-filter: blur(16px);
  z-index: 10000; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.mobile-nav-overlay.open { display: flex; animation: fadeIn 0.25s ease; }
.mobile-nav-overlay a {
  color: var(--text-main); text-decoration: none;
  font-size: 1.7rem; font-weight: 500; letter-spacing: -0.5px;
  padding: 14px 32px; border-radius: 16px;
  transition: background 0.2s ease, transform 0.25s var(--ease-spring);
}
.mobile-nav-overlay a:hover { background: rgba(255,255,255,0.07); transform: scale(1.04); }

/* ═══════════════════════════════════════════════
   LANG DROPDOWN
═══════════════════════════════════════════════ */
.lang-dropdown { position: relative; flex-shrink: 0; }
.lang-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 14px; border-radius: 10px; color: white; cursor: none; font-size: 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.lang-btn:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: rgba(20,20,20,0.97); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 12px;
  padding: 6px 0; min-width: 130px; display: none; transform-origin: top right;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.lang-menu.open { display: block; animation: dropdownOpen 0.2s var(--ease-spring) both; }
.lang-menu a {
  display: block; padding: 10px 18px; color: #eee;
  text-decoration: none; font-size: 14px; cursor: none; transition: background 0.15s ease;
}
.lang-menu a:hover  { background: rgba(255,255,255,0.10); }
.lang-menu a.active { color: #fff; font-weight: 600; }

/* ═══════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════ */
.container      { width: 88%; max-width: 1150px; margin: 0 auto; padding: 60px 0; }
.home-container { padding-top: 100px; }

/* ═══════════════════════════════════════════════
   HERO FULLWIDTH
═══════════════════════════════════════════════ */
.hero-fullwidth {
  position: relative;
  width: 100%;
  margin-top: 60px; /* altezza header */
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 85vh;
}

.hero-photo {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  max-height: 90vh;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  animation: fadeIn 0.8s var(--ease-out) both;
  /* Se l'immagine ha sfondo, usa mix-blend-mode per integrare meglio */
}

/* Gradiente dal basso per far leggere il testo */
.hero-fullwidth::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(13,13,13,0.85) 0%, rgba(13,13,13,0.2) 40%, transparent 70%),
    linear-gradient(to bottom, rgba(13,13,13,0.4) 0%, transparent 20%);
  pointer-events: none;
  z-index: 1;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  width: 88%;
  max-width: 1150px;
  margin: 0 auto;
  padding: 60px 0 70px;
  text-align: left;
}

.hero-overlay h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 14px;
  animation: fadeUp 0.8s var(--ease-out) 0.2s both;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-overlay p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 520px;
  color: #cfcfcf;
  animation: fadeUp 0.8s var(--ease-out) 0.4s both;
  text-shadow: 0 1px 10px rgba(0,0,0,0.6);
}

/* Se l'immagine ha lo sfondo (JPEG), centra diversamente */
.hero-fullwidth.has-bg .hero-photo {
  left: 0;
  transform: none;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: brightness(0.7);
}

@media (max-width: 900px) {
  .hero-fullwidth { min-height: 70vh; }
  .hero-overlay { padding: 40px 0 50px; }
  .hero-overlay h1 { font-size: clamp(2rem, 8vw, 3rem); }
}

@media (max-width: 480px) {
  .hero-fullwidth { min-height: 60vh; }
  .hero-overlay p { font-size: 0.95rem; }
}

/* ═══════════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════════ */
.reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.grid .reveal:nth-child(1) { transition-delay: 0s; }
.grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.grid .reveal:nth-child(3) { transition-delay: 0.2s; }

/* ═══════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════ */
.card {
  background: var(--dark); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 25px;
  transition: background 0.3s ease, transform 0.35s var(--ease-spring), border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  background: var(--titanium); transform: translateY(-6px);
  border-color: rgba(255,255,255,0.12); box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; margin-top: 25px; }
.card h3 { margin-bottom: 8px; font-size: 1.25rem; }

/* ═══════════════════════════════════════════════
   PROJECT CARDS — overlay
═══════════════════════════════════════════════ */
.project-card { overflow: hidden; position: relative; }

.project-card .project-img-wrap {
  position: relative; overflow: hidden;
  border-radius: var(--radius); margin-bottom: 15px;
}
.project-card .project-img-wrap img {
  width: 100%; display: block; filter: brightness(0.82);
  transition: filter 0.4s ease, transform 0.5s var(--ease-out);
}
.project-card:hover .project-img-wrap img { filter: brightness(0.35); transform: scale(1.04); }

.project-card .project-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  opacity: 0; transition: opacity 0.35s ease;
}
.project-card:hover .project-overlay { opacity: 1; }

.project-overlay a {
  color: #fff; text-decoration: none; font-size: 0.88rem; font-weight: 500; letter-spacing: 0.4px;
  padding: 9px 22px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.08);
  backdrop-filter: blur(6px); cursor: none;
  transition: background 0.2s ease, transform 0.2s var(--ease-spring);
}
.project-overlay a:hover { background: rgba(255,255,255,0.18); transform: scale(1.05); }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.project-tags span {
  font-size: 0.75rem; color: var(--text-soft);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  padding: 3px 10px; border-radius: 20px; letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════ */
.contact { margin-top: 80px; text-align: center; }
.contact a {
  font-size: clamp(1.1rem, 3vw, 1.4rem); color: var(--text-main);
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 3px; transition: opacity 0.25s ease, border-color 0.25s ease;
}
.contact a:hover { opacity: 0.55; border-color: transparent; }

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.cv-button-container { text-align: center; margin-top: 35px; }
.cv-button {
  display: inline-block; padding: 14px 28px; font-size: 1.05rem; font-weight: 500;
  color: #fff; text-decoration: none; cursor: none;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 14px; backdrop-filter: blur(6px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.3s var(--ease-spring), box-shadow 0.25s ease;
}
.cv-button:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.cv-button:active { transform: translateY(-1px); }

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.site-footer {
  margin-top: 100px; padding: 40px 0 36px;
  border-top: 1px solid rgba(255,255,255,0.06); text-align: center;
}
.footer-inner {
  width: 88%; max-width: 1150px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--text-soft); text-decoration: none; font-size: 0.95rem; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--text-main); }
.footer-copy { color: rgba(255,255,255,0.2); font-size: 0.82rem; letter-spacing: 0.3px; }

/* ═══════════════════════════════════════════════
   TIMELINE (CV)
═══════════════════════════════════════════════ */
.timeline-section { width: 88%; max-width: 900px; margin: 130px auto 80px; }
.timeline-section h2 { text-align: center; font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 50px; }
.timeline { position: relative; margin-left: 25px; padding-left: 25px; border-left: 2px solid rgba(255,255,255,0.1); }
.timeline-item { position: relative; margin: 40px 0; transition: transform 0.3s var(--ease-spring); }
.timeline-dot {
  position: absolute; left: -34px; top: 8px;
  width: 16px; height: 16px; background: var(--text-main); border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease, background 0.3s ease;
}
.timeline-content {
  padding: 18px 22px; background: var(--dark);
  border: 1px solid var(--border); border-radius: 14px;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.timeline-content h3   { margin: 0 0 6px; font-size: 1.2rem; }
.timeline-content .date { color: var(--text-soft); font-size: 0.9rem; }
.timeline-item:hover { transform: translateX(10px); }
.timeline-item:hover .timeline-dot { background: #fff; transform: scale(1.3); box-shadow: 0 0 14px rgba(255,255,255,0.45); }
.timeline-item:hover .timeline-content { background: var(--titanium); border-color: rgba(255,255,255,0.18); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET (≤900px)
═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .main-nav  { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 50px 0 60px; }
  .hero img { width: 130px; height: 130px; }
  .hero::before { width: 300px; height: 300px; top: 110px; }
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .container { width: 92%; padding: 40px 0; }
  .home-container { padding-top: 90px; }
  .timeline-section { width: 92%; margin-top: 100px; }
  .timeline { margin-left: 12px; padding-left: 18px; }
  .timeline-dot { left: -25px; width: 12px; height: 12px; }
  .timeline-item:hover { transform: translateX(5px); }
  h2 { margin-top: 50px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤480px)
═══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .hero img { width: 110px; height: 110px; }
  .cv-button { font-size: 0.95rem; padding: 12px 20px; width: 100%; text-align: center; }
  .card { padding: 22px 18px; }
  .timeline-content h3 { font-size: 1.05rem; }
  .lang-btn { padding: 6px 10px; font-size: 13px; }
  .footer-links { gap: 16px; }
  .project-overlay a { font-size: 0.82rem; padding: 8px 16px; }
}