/* ==========================================================
   Lorenzo Carrabs & Giulia Cavaliere — Portfolio
   ========================================================== */

:root {
  --bg: #0a0a0a;
  --bg-alt: #141414;
  --bg-card: #1b1b1b;
  --red: #cf0404;
  --red-soft: rgba(207, 4, 4, 0.15);
  --text: #ffffff;
  --text-muted: #b9b9b9;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 14px;
  --max-width: 1180px;
  --font: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 1300px 850px at 12% -10%, rgba(255,255,255,0.08), transparent 62%),
    radial-gradient(ellipse 1100px 800px at 105% 10%, rgba(207,4,4,0.11), transparent 58%),
    radial-gradient(ellipse 1000px 750px at -5% 55%, rgba(255,255,255,0.05), transparent 55%),
    radial-gradient(ellipse 1000px 800px at 100% 95%, rgba(207,4,4,0.07), transparent 55%),
    linear-gradient(165deg, #131313 0%, #050505 30%, #101010 55%, #040404 80%, #0e0e0e 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (hover: hover) and (pointer: fine) {
  body, a, button, input, textarea, .client-logo { cursor: none; }
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }

.section-tag {
  display: inline-block;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  margin-bottom: 14px;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 16px; }

h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }

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

p { color: var(--text-muted); margin: 0 0 16px; }

.lead { font-size: 1.1rem; color: var(--text-muted); max-width: 680px; }

.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-outline {
  background: transparent;
  border-color: var(--red);
  color: var(--text);
}
.btn-outline:hover { background: var(--red-soft); transform: translateY(-2px); }

.btn-solid {
  background: var(--red);
  color: #fff;
}
.btn-solid:hover { background: #a80303; transform: translateY(-2px); }

.btn-whatsapp {
  background: #25d366;
  color: #06210f;
  margin-top: 18px;
  width: 100%;
  justify-content: center;
}
.btn-whatsapp:hover { background: #1ebe5b; transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }

.nav-links {
  display: flex;
  gap: 34px;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: var(--red);
}

.nav-cta { display: flex; align-items: center; gap: 18px; }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.burger span { width: 24px; height: 2px; background: var(--text); display: block; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 120px;
  overflow: hidden;
  background: #000;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(rgba(0,0,0,0.32), rgba(0,0,0,0.5)),
    radial-gradient(circle at 50% 40%, rgba(0,0,0,0.08), rgba(0,0,0,0.55) 75%);
}

.hero-grid {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero-copy {
  max-width: 980px;
  text-align: center;
}

.hero-copy h1 {
  font-size: clamp(1.7rem, 4.4vw, 3.1rem);
  margin-bottom: 18px;
  text-wrap: balance;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .hero-copy h1 { white-space: normal; }
}

.hero-copy .sub {
  font-size: 1.15rem;
  color: #e6e6e6;
  margin-bottom: 2px;
}

.hero-copy .services-line {
  color: var(--text-muted);
  margin-bottom: 36px;
}

/* ---------- Chi siamo ---------- */
.about-intro { max-width: 760px; margin-bottom: 56px; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.team-card .photo-wrap {
  padding: 28px 28px 0;
  display: flex;
  justify-content: center;
}
.team-card .photo-wrap .photo-frame {
  width: 62%;
  aspect-ratio: 4/5;
  border-radius: 10px;
  overflow: hidden;
}
.team-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.team-card .photo-frame:hover img {
  animation: photo-pulse 1.4s ease-in-out infinite;
}

@keyframes photo-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.team-card .info { padding: 28px; }
.team-card .role { color: var(--red); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; display: block; }
.team-card h3 { font-size: 1.4rem; margin-bottom: 14px; }
.team-card p { font-size: 0.95rem; }

/* ---------- Servizi ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  margin-top: 48px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.service-card:hover { transform: translateY(-6px); border-color: var(--red); }

.service-card .tag {
  color: var(--red);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  display: inline-block;
}

.service-card h3 { font-size: 1.3rem; margin-bottom: 12px; }
.service-card p { margin-bottom: 0; }

.services-cta { text-align: center; margin-top: 56px; }

/* ---------- Portfolio ---------- */
.portfolio-sub { margin: 56px 0 36px; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.portfolio-sub h3 { font-size: 1.5rem; margin: 0; }

.shorts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.shorts-grid .video-frame { aspect-ratio: 9/16; }

.horizontal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.horizontal-grid .video-frame { aspect-ratio: 16/9; }

.video-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }

.preview-note {
  background: rgba(207, 4, 4, 0.12);
  border: 1px solid rgba(207, 4, 4, 0.35);
  color: #f0c9c9;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.85rem;
  margin: 0 0 32px;
}

.video-thumb {
  position: relative;
  display: block;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.video-thumb .play-badge::before {
  content: "";
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--red);
  z-index: -1;
}
.video-thumb:hover .play-badge { opacity: 1; }

/* ---------- Clienti ---------- */
.clients-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #050505;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
  margin: 44px 0 48px;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.carousel-track {
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  will-change: transform;
}

.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.client-logo img { height: 100%; width: auto; max-width: 160px; object-fit: contain; pointer-events: none; }

/* ---------- Global custom cursor ---------- */
.custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.2s ease, transform 0.18s ease, width 0.18s ease, height 0.18s ease, background 0.18s ease;
}
.custom-cursor.visible { opacity: 1; }
.custom-cursor.hover-link {
  width: 40px;
  height: 40px;
  background: rgba(207, 4, 4, 0.18);
  border: 2px solid var(--red);
}
.custom-cursor.drag-mode {
  width: 48px;
  height: 48px;
  background: var(--red);
}
.custom-cursor.click { transform: translate(-50%, -50%) scale(0.8); }

.clients-actions { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

/* ---------- Contatti ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  margin-top: 44px;
}

.contact-info .contact-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 18px;
}
.contact-item .name { font-weight: 700; margin-bottom: 4px; }
.contact-item a { color: var(--text-muted); font-size: 0.95rem; display: block; }
.contact-item a:hover { color: var(--red); }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form input, .contact-form textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #7c7c7c; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--red); }
.form-note { font-size: 0.82rem; color: #7c7c7c; margin-top: -6px; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-status { font-size: 0.9rem; margin: 0; min-height: 1.2em; }
.form-status.success { color: #6fd18f; }
.form-status.error { color: #ff8080; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  text-align: center;
}
.footer-links { display: flex; gap: 22px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--text); }
.footer-note { color: #6e6e6e; font-size: 0.8rem; }

/* ---------- Scroll reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

.reveal-group .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-group .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-group .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-group .reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal-group .reveal:nth-child(5) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (hover: none) and (pointer: coarse) {
  .custom-cursor { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .team-grid, .services-grid, .horizontal-grid { grid-template-columns: 1fr; }
  .shorts-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .clients-carousel { padding: 28px 0; }
  .carousel-track { gap: 44px; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: rgba(10,10,10,0.97);
    flex-direction: column;
    padding: 24px;
    gap: 22px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-150%);
    transition: transform 0.25s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .burger { display: flex; }
  .nav-cta .btn-outline { display: none; }
  section { padding: 64px 0; }
  .shorts-grid { grid-template-columns: repeat(2, 1fr); }
  .client-logo { height: 48px; }
}
