/* ═══════════════════════════════════════════════════════════════
   ROCCO INVESTIGAZIONI — DESIGN SYSTEM
   Sorgente unica di verità per colori, font e componenti condivisi.
   Incluso in tutte le 35 pagine del sito.
   CSS specifico di pagina rimane inline nel <style> di ogni file.
════════════════════════════════════════════════════════════════ */

/* ─── 1. RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── 2. DESIGN TOKENS ─── */
:root {
  /* Backgrounds */
  --bg:  #0c0c0e;
  --bg2: #111113;
  --bg3: #17171a;
  --bg4: #1e1e22;

  /* Borders */
  --border: rgba(255,255,255,0.07);

  /* Text */
  --text:     #eceae6;
  --text-mid: #8a8a90;
  --text-dim: #4a4a52;
  --white:    #eceae6;

  /* Accent */
  --accent:       oklch(38% 0.09 195);
  --accent-light: oklch(55% 0.09 195);

  /* Typography */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;

  /* Buttons */
  --btn-radius:  4px;
  --btn-size:    12px;
  --btn-weight:  600;
  --btn-spacing: 0.06em;
}

/* ─── 3. BASE ─── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

/* ─── 4. CANVAS BACKGROUND (solo pagine principali) ─── */
#city-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
}

/* ─── 5. NAV ─── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 40px;
  height: 64px;
  background: rgba(12,12,14,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}
.nav-brand span { color: var(--accent-light); }

.nav-links { display: flex; list-style: none; gap: 2px; align-items: center; }
.nav-links li a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-links li a:hover,
.nav-links li a.active { color: var(--white); }

.nav-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: opacity 0.2s;
  margin-left: 8px;
}
.nav-contact:hover { opacity: 0.85; }

.lang-switcher { display: flex; align-items: center; gap: 2px; }
.lang-btn {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, border-color 0.2s;
  padding: 3px 5px;
  line-height: 1;
  border-radius: 2px;
}
.lang-btn.active { opacity: 1; border-color: var(--border); }
.lang-btn:hover { opacity: 0.75; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  z-index: 110;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) {
  .nav-cta-text { display: none; }
  .nav-contact { padding: 7px 10px; gap: 0; }
}
@media (max-width: 900px) {
  nav { padding: 0 20px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(12,12,14,0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 8px 0 16px;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    padding: 14px 20px;
    font-size: 13px;
    letter-spacing: 0.04em;
    display: block;
    text-transform: none;
    font-weight: 500;
  }
  .nav-contact { display: none; }
  .nav-toggle { display: flex; }
}

/* ─── 6. FOOTER ─── */
footer {
  padding: 48px 60px 28px;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 32px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.2em;
  color: var(--text-mid);
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 200px;
}

.footer-col-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  font-size: 12px;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-legal {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

@media (max-width: 900px) {
  footer { padding: 40px 20px 24px; }
  .footer-top { flex-direction: column; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ─── 7. ANIMAZIONI REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ─── 8. SEZIONE UTILITIES ─── */
section { position: relative; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.section-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 52px);
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

@media (max-width: 900px) {
  .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .section-header .btn-secondary { width: 100%; justify-content: center; }
}

/* ─── 9. PAGE HERO (pagine interne: servizi, contatti) ─── */
.page-hero {
  padding-top: 64px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 60px;
  padding-left: 60px;
  padding-right: 60px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  background: var(--bg2);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -48deg,
    transparent,
    transparent 5px,
    rgba(255,255,255,0.012) 5px,
    rgba(255,255,255,0.012) 6px
  );
}

.page-hero-content { position: relative; z-index: 1; }

.breadcrumb {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-light);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent-light); }
.breadcrumb span { color: var(--text-dim); }

.page-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 88px);
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 0.95;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 20px;
  max-width: 520px;
}

@media (max-width: 900px) {
  .page-hero { padding: 60px 20px 48px; min-height: auto; }
}

/* ─── 10. BOTTONI ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--btn-size);
  font-weight: var(--btn-weight);
  letter-spacing: var(--btn-spacing);
  text-transform: none;
  text-decoration: none;
  padding: 14px 26px;
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--text-mid);
  font-family: var(--font-body);
  font-size: var(--btn-size);
  font-weight: var(--btn-weight);
  letter-spacing: var(--btn-spacing);
  text-transform: none;
  text-decoration: none;
  border: 1px solid var(--text-mid);
  padding: 13px 25px;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.btn-secondary:hover { color: var(--white); border-color: var(--white); }

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--btn-size);
  font-weight: var(--btn-weight);
  letter-spacing: var(--btn-spacing);
  text-transform: none;
  padding: 16px 36px;
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}
.btn-submit:hover { background: var(--accent-light); }

.service-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.2s;
}
.service-card:hover .service-cta { color: var(--accent-light); }

/* ─── 11. SERVICE CARDS ─── */
.service-card {
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.3s;
  position: relative;
  overflow: hidden;
  height: 340px;
}
.service-card:hover { border-color: rgba(255,255,255,0.18); }

.service-card-img {
  position: absolute;
  inset: 0;
  background-color: var(--bg3);
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
  background-image: repeating-linear-gradient(
    -48deg,
    transparent,
    transparent 5px,
    rgba(255,255,255,0.018) 5px,
    rgba(255,255,255,0.018) 6px
  );
}
.service-card:hover .service-card-img { transform: scale(1.04); }

.service-card-img-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  font-family: var(--font-body);
  border: 1px solid var(--text-dim);
  padding: 5px 10px;
  pointer-events: none;
}

.service-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,10,12,0.96) 0%,
    rgba(10,10,12,0.7) 45%,
    rgba(10,10,12,0.15) 100%
  );
  transition: background 0.3s;
}
.service-card:hover .service-card-overlay {
  background: linear-gradient(
    to top,
    rgba(10,10,12,0.98) 0%,
    rgba(10,10,12,0.72) 50%,
    rgba(10,10,12,0.2) 100%
  );
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.35s ease;
  transform-origin: left;
  z-index: 3;
}
.service-card:hover::after { transform: scaleX(1); }

.service-card-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 28px 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.06em;
  color: var(--white);
  line-height: 1.05;
}

.service-desc {
  font-size: 11.5px;
  color: rgba(200,198,194,0.75);
  line-height: 1.65;
}

@media (max-width: 540px) {
  .service-card { height: 300px; }
}

/* ─── 12. ARTICLE CARDS (dossier index) ─── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 80px;
}

.article-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.article-card:hover { border-color: rgba(255,255,255,0.14); background: var(--bg3); }

.card-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.15;
}

.card-excerpt {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 24px;
  flex: 1;
}

.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-read-time { font-size: 11px; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; }
.card-arrow { font-size: 13px; color: var(--accent-light); font-weight: 500; }

@media (max-width: 900px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .articles-grid { grid-template-columns: 1fr; }
}

/* ─── 13. FORM FIELDS ─── */
.field { display: flex; flex-direction: column; gap: 8px; }

.field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field label .req { color: var(--accent-light); margin-left: 3px; }

.field input, .field select, .field textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 14px 16px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a4a52' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}
.field select option { background: var(--bg3); }

.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent-light); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field textarea { resize: vertical; min-height: 120px; }

.privacy-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.6;
  cursor: pointer;
}
.privacy-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ─── 14. ARTICLE CTA (dossier articles) ─── */
.article-cta {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 32px 36px;
  margin: 52px 0;
}

.article-cta h3 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--white);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.article-cta p {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 20px;
  line-height: 1.65;
}

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* Bottoni dentro .article-body erediterebbero .article-body a { color: accent; text-decoration: underline }
   — queste regole ripristinano i valori corretti con specificità superiore */
.article-body .btn-primary { color: var(--white); text-decoration: none; }
.article-body .btn-secondary { color: var(--text-mid); text-decoration: none; }

@media (max-width: 900px) {
  .article-cta { padding: 24px 20px; }
}
