/* ╔══════════════════════════════════════════════════════════════╗
   ║  Daniel Frezzato — Design System & Styles                   ║
   ╚══════════════════════════════════════════════════════════════╝ */

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1425;
  --bg-card: rgba(15, 20, 40, 0.6);
  --bg-card-hover: rgba(20, 28, 58, 0.8);
  --bg-nav: rgba(10, 14, 26, 0.85);

  --text-primary: #e8ecf4;
  --text-secondary: #8892a8;
  --text-muted: #5a6480;

  --accent-1: #00d4ff;
  --accent-2: #6c5ce7;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #6c5ce7 100%);
  --accent-gradient-hover: linear-gradient(135deg, #00e5ff 0%, #7c6cf7 100%);

  --border-color: rgba(100, 120, 180, 0.12);
  --border-glow: rgba(0, 212, 255, 0.25);

  /* Spacing */
  --section-padding: 120px 0;
  --container-width: 1200px;
  --gap: 2rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.4s var(--ease-out);
}

/* ── Reset & Base ────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul,
ol {
  list-style: none;
}

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

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

/* ── Typography ──────────────────────────────────────────────── */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-tag {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section {
  padding: var(--section-padding);
  position: relative;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-glow);
}

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--accent-1);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-bracket {
  color: var(--accent-1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-cta {
  background: var(--accent-gradient);
  color: #fff !important;
  margin-left: 8px;
}

.nav-cta:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
  transform: translateY(-1px);
  background: var(--accent-gradient-hover);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

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

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(108, 92, 231, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  z-index: 0;
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-1);
  border-radius: 50%;
  opacity: 0;
  animation: floatParticle 8s infinite;
}

@keyframes floatParticle {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    opacity: 0;
    transform: translateY(-100px) scale(1);
  }
}

.hero-content {
  text-align: center;
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.hero-tag {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 24px;
  animation: fadeInDown 0.8s var(--ease-out) both;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
  animation: fadeInUp 0.8s var(--ease-out) 0.1s both;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-plus {
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  color: var(--text-muted);
  z-index: 1;
}

.hero-scroll-indicator svg {
  width: 28px;
  height: 28px;
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  40% {
    transform: translateX(-50%) translateY(-12px);
  }

  60% {
    transform: translateX(-50%) translateY(-6px);
  }
}

/* ── Service Cards ────────────────────────────────────────────── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.service-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  transition: var(--transition);
  overflow: hidden;
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-6px);
}

.card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: var(--transition);
}

.service-card:hover .card-glow {
  opacity: 1;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(0, 212, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--accent-1);
  transition: var(--transition);
}

.service-card:hover .card-icon {
  background: rgba(0, 212, 255, 0.15);
  transform: scale(1.05);
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.card-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.card-features li svg {
  width: 16px;
  height: 16px;
  color: var(--accent-1);
  flex-shrink: 0;
}

/* ── Chi Sono ─────────────────────────────────────────────────── */
.chi-sono {
  background: var(--bg-secondary);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 20px;
  line-height: 1.8;
}

.about-text strong {
  color: var(--text-primary);
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.tech-tag {
  padding: 6px 16px;
  border-radius: 50px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.15);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-1);
  transition: var(--transition);
}

.tech-tag:hover {
  background: rgba(0, 212, 255, 0.12);
  transform: translateY(-2px);
}

.about-visual {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.experience-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: var(--transition);
}

.experience-card:hover {
  border-color: var(--border-glow);
  transform: translateX(8px);
}

.exp-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-1);
  flex-shrink: 0;
}

.exp-icon svg {
  width: 22px;
  height: 22px;
}

.experience-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.experience-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Processo ─────────────────────────────────────────────────── */
.process-timeline {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.process-timeline::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-1), var(--accent-2));
  opacity: 0.2;
}

.process-step {
  display: flex;
  gap: 28px;
  margin-bottom: 48px;
  position: relative;
}

.process-step:last-child {
  margin-bottom: 0;
}

.step-number {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background-color: var(--bg-primary);
}

.step-content {
  padding-top: 14px;
}

.step-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Contatti ──────────────────────────────────────────────────── */
.contatti {
  background: var(--bg-secondary);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 64px;
  align-items: center;
  justify-items: center;
}

.contact-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
  line-height: 1.8;
}

.contact-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 700px;
  width: 100%;
}

.contact-details {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-1);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.contact-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.contact-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

a.contact-value:hover {
  color: var(--accent-1);
}

.social-links {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.social-link:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  transform: translateY(-3px);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-secondary);
  margin-top: 12px;
  font-size: 0.95rem;
}

.footer-links h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-links a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-1);
  transform: translateX(4px);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Reveal Animations ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.services-grid .reveal:nth-child(2) {
  transition-delay: 0.1s;
}

.services-grid .reveal:nth-child(3) {
  transition-delay: 0.2s;
}

.services-grid .reveal:nth-child(4) {
  transition-delay: 0.3s;
}

.services-grid .reveal:nth-child(5) {
  transition-delay: 0.4s;
}

.services-grid .reveal:nth-child(6) {
  transition-delay: 0.5s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .experience-card:hover {
    transform: translateX(0);
  }

  .reveal.visible {
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 80px 0;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    padding: 100px 32px 32px;
    gap: 4px;
    transition: right 0.4s var(--ease-out);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
  }

  .nav-cta {
    margin-left: 0;
    margin-top: 12px;
    text-align: center;
    justify-content: center;
    display: flex;
  }

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

  .hero-stats {
    gap: 32px;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-tag {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .contact-details {
    flex-direction: column;
    gap: 24px;
  }

  .contact-info {
    max-width: 100%;
  }

  .section-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  .process-timeline::before {
    left: 28px;
  }

  .step-number {
    width: 56px;
    height: 56px;
    font-size: 1rem;
  }

  .process-step {
    gap: 16px;
  }

  .experience-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 16px 60px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }

  .container {
    padding: 0 16px;
  }

  .service-card {
    padding: 28px 20px;
  }

  .step-number {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
  }

  .process-timeline::before {
    left: 23px;
  }

  .contact-item {
    gap: 12px;
  }

  .contact-icon {
    width: 40px;
    height: 40px;
  }
}

/* ── Backdrop for mobile menu ─────────────────────────────────── */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.nav-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* ── Selection color ──────────────────────────────────────────── */
::selection {
  background: rgba(0, 212, 255, 0.25);
  color: var(--text-primary);
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.35);
}