/* --- BRAND IDENTITY COLORS & VARIABLES --- */
:root {
  --bg: #0c0e12;
  --surface: #151820;
  --surface-hover: #1b1f29;
  --line: #262c38;
  --text: #e9e7e1;
  --dim: #8b909c;
  --cyan: #5fc9e8; /* WEB */
  --amber: #e8a23d; /* VIDEO */
  --purple: #c9a6f7; /* CONTENT */
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- BRAND TYPOGRAPHY --- */
h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.mono {
  font-family: "JetBrains Mono", monospace;
}

a {
  color: inherit;
  text-decoration: none;
  transition: 0.2s ease;
}
img {
  max-width: 100%;
  display: block;
  border-radius: 8px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
section {
  padding: 8rem 0;
  border-bottom: 1px solid var(--line);
}
section:last-of-type {
  border-bottom: none;
}

::selection {
  background: var(--amber);
  color: #0c0e12;
}
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Elementi Comuni: Timecode Eyebrow */
.tc-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}
.tc-eyebrow span {
  color: var(--amber);
}

/* ---------- NAV ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(12, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wordmark {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
}
.wordmark .cursor {
  color: var(--amber);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dim);
}
.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
}
.nav-cta:hover {
  border-color: var(--amber);
  color: var(--amber);
}

/* ---------- HERO ---------- */
.hero {
  padding: 12rem 0 7rem;
  position: relative;
  text-align: center;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(232, 162, 61, 0.05) 0%,
    transparent 50%
  );
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 2rem;
}
.hero .badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(232, 162, 61, 0.5);
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 1.05;
  max-width: 20ch;
  margin: 0 auto;
}
.hero p.lead {
  margin: 1.8rem auto 0;
  max-width: 50ch;
  color: var(--dim);
  font-size: 1.1rem;
}
.hero .actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.9rem 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--amber);
  color: #0c0e12;
}
.btn-primary:hover {
  background: #f0b158;
  transform: translateY(-2px);
}
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ---------- SCROLLYTELLING AGENCY WORKFLOW (Struttura Nuova + Tema Brand) ---------- */
.scrolly-wrap {
  position: relative;
  height: 340vh;
  margin-top: 2rem;
}
.scrolly-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.workflow-panel {
  width: min(900px, 90vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.workflow-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.01);
  opacity: 0.35;
  transition: all 0.4s ease;
}
.workflow-step.is-active {
  opacity: 1;
  background: var(--surface-hover);
  border-color: var(--line);
  transform: scale(1.01);
}

.step-tc {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
}
.step-1.is-active .step-tc {
  color: var(--cyan);
  border-color: var(--cyan);
}
.step-2.is-active .step-tc {
  color: var(--amber);
  border-color: var(--amber);
}
.step-3.is-active .step-tc {
  color: var(--purple);
  border-color: var(--purple);
}

.step-info h4 {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  color: var(--text);
}
.step-info p {
  font-size: 0.95rem;
  color: var(--dim);
  margin: 0;
}

.scrolly-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--dim);
  opacity: 0.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.scrolly-hint::after {
  content: "↓";
  display: block;
  animation: bounce 2s infinite;
  color: var(--amber);
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* ---------- SERVIZI ---------- */
.section-head {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.section-head h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  transition: all 0.3s ease;
}
.service-card:hover {
  background: var(--surface-hover);
}
.service-card.web:hover {
  border-color: var(--cyan);
}
.service-card.video:hover {
  border-color: var(--amber);
}
.service-card.content:hover {
  border-color: var(--purple);
}

.track-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--dim);
}
.track-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.service-card.web .track-dot {
  background: var(--cyan);
}
.service-card.video .track-dot {
  background: var(--amber);
}
.service-card.content .track-dot {
  background: var(--purple);
}

.service-card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.service-card p {
  color: var(--dim);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag {
  background: var(--bg);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--dim);
  border: 1px solid var(--line);
}

/* ---------- PROCESSO ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  position: relative;
  margin-top: 3rem;
}
.process-grid::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  z-index: 0;
}
.process-step {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding-right: 1rem;
}
.process-step .tc {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--amber);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}
.process-step h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.process-step p {
  color: var(--dim);
  font-size: 0.95rem;
}

/* ---------- LAVORI (Portfolio) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.work-card {
  cursor: pointer;
  display: block;
}

.work-thumb {
  aspect-ratio: 16/10;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 1.2rem;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.work-card:hover .work-thumb {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

/* Sfondi portfolio in stile Brand */
.p1 {
  background: linear-gradient(135deg, rgba(95, 201, 232, 0.15), transparent);
}
.p2 {
  background: linear-gradient(135deg, rgba(232, 162, 61, 0.15), transparent);
}
.p3 {
  background: linear-gradient(135deg, rgba(201, 166, 247, 0.15), transparent);
}

.thumb-cap {
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}
.p1 .thumb-cap {
  color: var(--cyan);
}
.p2 .thumb-cap {
  color: var(--amber);
}
.p3 .thumb-cap {
  color: var(--purple);
}

.work-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.work-meta h3 {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
}
.work-meta p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--dim);
}
.work-meta span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* ---------- L'AGENZIA (About) ---------- */
.about-section {
  background: var(--surface);
  border-radius: 16px;
  padding: 4.5rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
  border: 1px solid var(--line);
}
.about-content h2 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
}
.about-content p {
  color: var(--dim);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  max-width: 48ch;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.stat {
  background: var(--bg);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stat h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.8rem;
  color: var(--amber);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.stat p {
  font-size: 0.85rem;
  color: var(--dim);
}

/* ---------- CONTACT ---------- */
.contact {
  text-align: center;
  padding: 8rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.contact h2 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
}
.contact p {
  color: var(--dim);
  max-width: 450px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

footer {
  padding: 3rem 1.5rem;
  text-align: center;
}
footer p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: var(--dim);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .work-grid {
    grid-template-columns: 1fr;
  }
  .process-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
  }
  .process-grid::before {
    display: none;
  }
  .about-section {
    grid-template-columns: 1fr;
    padding: 2.5rem 1.5rem;
  }
}
