/* =============================================================
   RESET & BASE
============================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0d0d0d;
  --bg-deep: #000000;
  --white: #ffffff;
  --silver: #a3a3a3;
  --silver-dim: #6e6e6e;
  --line: rgba(255, 255, 255, 0.12);
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

section {
  padding: 140px 6vw;
}

.section-label {
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--silver-dim);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 48px);
  margin-bottom: 64px;
}

/* =============================================================
   HEADER
============================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 6vw;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(12px, 3.2vw, 16px);
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
}

.main-nav {
  display: flex;
  gap: 40px;
}

.nav-link {
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--silver);
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 1px;
  background: var(--white);
  transition: width 0.35s ease;
}

.nav-link:hover {
  color: var(--white);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 1px;
  background: var(--white);
}

/* =============================================================
   HERO
============================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 160px 6vw 80px;
  gap: 56px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.01em;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title-first {
  font-size: clamp(34px, 9vw, 130px);
  white-space: nowrap;
}

.hero-title-last {
  font-size: clamp(22px, 6.5vw, 96px);
  white-space: nowrap;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--silver);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-outline {
  margin-top: 12px;
  padding: 16px 38px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.btn-outline:hover {
  background: var(--white);
  color: var(--bg-deep);
  border-color: var(--white);
}

/* --- Before/After Color Grading Slider --- */
.grading-slider {
  position: relative;
  width: min(1100px, 92vw);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
  user-select: none;
  cursor: ew-resize;
}

.grading-layer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.grading-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grading-after {
  z-index: 1;
}

.grading-before {
  z-index: 2;
  width: 100%;
  /* maschera, non ridimensiona: il video resta fermo, si rivela solo una porzione */
  clip-path: inset(0 50% 0 0); /* valore iniziale, controllato via JS */
}

.grading-label {
  position: absolute;
  bottom: 18px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

.label-after {
  right: 18px;
}

.label-before {
  left: 18px;
}

.grading-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.6);
}

.handle-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  color: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: ew-resize;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.handle-arrows {
  display: block;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver-dim);
}

.scroll-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, var(--silver-dim), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* =============================================================
   SHOWREEL
============================================================= */
.showreel {
  background: var(--bg-deep);
}

.video-frame {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.video-frame video,
.video-frame iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
}

/* =============================================================
   SELECTED WORK GRID
============================================================= */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 32px;
}

.work-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-video {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #111;
}

/* Progetti girati in verticale: il riquadro segue il formato 9:16 reale del video */
.work-item.vertical .work-video {
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin: 0 auto;
}

.work-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.work-item:hover .work-video video {
  transform: scale(1.045);
  opacity: 0.92;
}

.work-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
}

.work-title a {
  transition: color 0.3s ease;
}

.work-title a:hover {
  color: var(--silver);
}

.work-role {
  font-style: italic;
  font-size: 13px;
  color: var(--silver);
}

/* =============================================================
   ABOUT
============================================================= */
.about {
  background: var(--bg-deep);
  display: flex;
  justify-content: center;
}

.about-text {
  max-width: 760px;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.5;
  color: var(--silver);
  font-weight: 300;
  text-align: center;
}

/* =============================================================
   FOOTER / CONTACT
============================================================= */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
  padding-bottom: 80px;
}

.footer-availability {
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--silver-dim);
  text-transform: uppercase;
}

.footer-email {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 6vw, 56px);
  max-width: 90vw;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.footer-email:hover {
  border-color: var(--white);
}

.btn-whatsapp {
  padding: 16px 38px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.btn-whatsapp:hover {
  background: var(--white);
  color: var(--bg-deep);
  border-color: var(--white);
}

.footer-bottom {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  color: var(--silver-dim);
}

.footer-socials {
  display: flex;
  gap: 18px;
}

.footer-socials a {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

.footer-socials a:hover {
  color: var(--white);
}

.social-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

/* =============================================================
   RESPONSIVE — Tablet & Mobile
============================================================= */
@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  section {
    padding: 100px 6vw;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70%;
    max-width: 320px;
    background: var(--bg-deep);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    padding: 0 40px;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    border-left: 1px solid var(--line);
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .nav-toggle {
    display: flex;
    z-index: 110;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
  }

  .hero {
    padding-top: 140px;
    gap: 40px;
  }
}
