/* =====================================================================
   Mantiqi Engineering — style.css
   Override e componenti custom su base Tailwind (CDN).
   ===================================================================== */

:root {
  --brand: #264B9B;
  --brandlt: #3B6FD4;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

/* Offset per ancore sotto la navbar fissa */
section[id] { scroll-margin-top: 80px; }

/* ---------------------------------------------------------------------
   LOGO MARK (SVG via mask → eredita il colore di testo / accenti fissi)
   Usiamo l'immagine SVG direttamente come background.
   --------------------------------------------------------------------- */
.logo-mark {
  display: inline-block;
  background: url('assets/mark.svg?v=3') center / contain no-repeat;
}

/* ---------------------------------------------------------------------
   NAVBAR
   --------------------------------------------------------------------- */
#navbar.scrolled {
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-link { position: relative; transition: color .25s; }
.nav-link:hover { color: #fff; }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--brandlt); transition: width .3s;
}
.nav-link:hover::after { width: 100%; }

.mobile-link {
  display: block; padding: .75rem .25rem;
  color: rgba(255,255,255,.8); border-bottom: 1px solid rgba(255,255,255,.06);
  transition: color .2s, padding-left .2s;
}
.mobile-link:hover { color: #fff; padding-left: .75rem; }

/* Hamburger */
.hb-line {
  display: block; width: 22px; height: 2px; background: #fff;
  transition: transform .3s, opacity .3s;
}
#menu-toggle.open .hb-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle.open .hb-line:nth-child(2) { opacity: 0; }
#menu-toggle.open .hb-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------------
   BOTTONI
   --------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--brand); color: #fff; font-weight: 600;
  padding: .8rem 1.6rem; font-size: .9rem; border-radius: 2px;
  transition: background .25s, transform .25s, box-shadow .25s;
  box-shadow: 0 8px 24px -10px rgba(38,75,155,.8);
}
.btn-primary:hover { background: var(--brandlt); transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(59,111,212,.9); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid rgba(255,255,255,.25); color: #fff; font-weight: 500;
  padding: .8rem 1.6rem; font-size: .9rem; border-radius: 2px;
  transition: border-color .25s, background .25s;
}
.btn-ghost:hover { border-color: var(--brandlt); background: rgba(59,111,212,.1); }

/* ---------------------------------------------------------------------
   HERO — griglia tecnica + glow
   --------------------------------------------------------------------- */
.tech-grid {
  background-image:
    linear-gradient(rgba(59,111,212,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,111,212,.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
}
.hero-glow {
  background: radial-gradient(circle, rgba(38,75,155,.45) 0%, transparent 65%);
  filter: blur(20px); pointer-events: none;
}

/* ---------------------------------------------------------------------
   TIPOGRAFIA DI SEZIONE
   --------------------------------------------------------------------- */
.section-label {
  font-family: "Space Grotesk", sans-serif; font-weight: 600;
  font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; margin-bottom: 1rem;
}
.section-title {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1;
}

/* Counters */
.counter { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   SERVIZI
   --------------------------------------------------------------------- */
.service-card {
  border: 1px solid var(--tw-line, #D6DBE2); border-radius: 3px; padding: 1.75rem 1.5rem;
  background: #fff; transition: transform .3s, box-shadow .3s, border-color .3s;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px -24px rgba(14,17,22,.25);
  border-color: var(--brand);
}
.service-icon {
  width: 52px; height: 52px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(38,75,155,.08); color: var(--brand); margin-bottom: 1.25rem;
  transition: background .3s, color .3s;
}
.service-icon svg { width: 26px; height: 26px; }
.service-card:hover .service-icon { background: var(--brand); color: #fff; }
.service-name { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.05rem; margin-bottom: .5rem; }
.service-desc { color: #5B6470; font-size: .9rem; line-height: 1.5; }
.service-list { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #EEF1F5; display: grid; gap: .4rem; }
.service-list li { position: relative; padding-left: 1rem; font-size: .82rem; color: #5B6470; }
.service-list li::before { content: ""; position: absolute; left: 0; top: .5rem; width: 5px; height: 5px; background: var(--brandlt); border-radius: 50%; }

/* ---------------------------------------------------------------------
   CHIP (norme) e TECH CHIP
   --------------------------------------------------------------------- */
.chip {
  border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.8);
  padding: .5rem 1rem; font-size: .82rem; border-radius: 2px;
  font-family: "Space Grotesk", sans-serif; letter-spacing: .03em;
  transition: border-color .25s, color .25s, background .25s;
}
.chip:hover { border-color: var(--brandlt); color: #fff; background: rgba(59,111,212,.12); }

.tech-chip {
  border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.75);
  padding: .45rem .9rem; font-size: .8rem; border-radius: 2px; transition: all .25s;
}
.tech-chip:hover { border-color: var(--brandlt); color: var(--brandlt); }

/* ---------------------------------------------------------------------
   PORTFOLIO
   --------------------------------------------------------------------- */
.filter-btn {
  font-size: .82rem; font-weight: 500; padding: .5rem 1.1rem; border-radius: 2px;
  border: 1px solid #D6DBE2; color: #5B6470; background: #fff; transition: all .25s;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.project-card {
  position: relative; overflow: hidden; border-radius: 3px; aspect-ratio: 4 / 3;
  background: #1E242E; display: block; cursor: pointer;
  transition: transform .35s; border: 1px solid #E4E8EE;
}
.project-card:hover { transform: translateY(-4px); }
/* Placeholder visivo (in attesa delle foto reali): icona categoria + indice */
.project-thumb {
  position: absolute; inset: 0;
  background:
    linear-gradient(150deg, #20305A 0%, #161A21 55%, #0E1116 100%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 16px);
  display: flex; align-items: center; justify-content: center;
  transition: transform .5s;
}
.project-card:hover .project-thumb { transform: scale(1.05); }
.project-thumb .ph-ico { width: 60px; height: 60px; color: rgba(255,255,255,.85); opacity: .9; transition: color .35s; }
.project-card:hover .ph-ico { color: #fff; }
.project-thumb .ph-index {
  position: absolute; top: 1rem; right: 1.1rem;
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.05rem;
  color: rgba(255,255,255,.28); letter-spacing: .05em;
}
.project-overlay {
  position: absolute; inset: 0; padding: 1.25rem;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(14,17,22,.94) 0%, rgba(14,17,22,.25) 55%, transparent 100%);
  color: #fff; transition: background .35s;
}
.project-card:hover .project-overlay { background: linear-gradient(to top, rgba(20,38,80,.96) 0%, rgba(38,75,155,.45) 60%, rgba(38,75,155,.12) 100%); }
.project-cat {
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  font-family: "Space Grotesk", sans-serif; font-weight: 600; color: var(--brandlt);
  transition: color .3s;
}
.project-card:hover .project-cat { color: #fff; }
.project-name { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.1rem; margin-top: .25rem; }
.project-reveal { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s ease, opacity .4s ease; }
.project-card:hover .project-reveal { max-height: 120px; opacity: 1; }
.project-note { font-size: .8rem; color: rgba(255,255,255,.8); margin-top: .5rem; line-height: 1.45; }
.project-note b { color: #fff; font-weight: 600; }
.proj-tools { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.proj-tool {
  font-size: .66rem; letter-spacing: .04em; padding: .2rem .5rem; border-radius: 2px;
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2);
}

/* Animazione filtro */
.project-card.hide { display: none; }

/* ---------------------------------------------------------------------
   PROCESSO
   --------------------------------------------------------------------- */
.step { border-top: 2px solid #E4E8EE; padding-top: 1.25rem; transition: border-color .3s; }
.step:hover { border-color: var(--brand); }
.step-num { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 2rem; color: var(--brand); opacity: .9; }
.step-title { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.05rem; margin: .5rem 0; }
.step-text { font-size: .88rem; color: #5B6470; line-height: 1.55; }

/* ---------------------------------------------------------------------
   GRUPPO
   --------------------------------------------------------------------- */
.group-card {
  display: block; padding: 1.75rem; border: 1px solid rgba(255,255,255,.12);
  border-radius: 3px; background: rgba(255,255,255,.02); transition: all .3s;
}
.group-card:hover { border-color: var(--brandlt); background: rgba(59,111,212,.07); transform: translateY(-4px); }
.group-tag { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--brandlt); font-family: "Space Grotesk", sans-serif; font-weight: 600; }
.group-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.35rem; margin: .6rem 0; color: #fff; }
.group-desc { font-size: .88rem; color: rgba(255,255,255,.6); line-height: 1.55; }
.group-link { display: inline-block; margin-top: 1rem; font-size: .82rem; color: rgba(255,255,255,.5); transition: color .25s; }
.group-card:hover .group-link { color: var(--brandlt); }

/* ---------------------------------------------------------------------
   FORM
   --------------------------------------------------------------------- */
.form-input {
  width: 100%; padding: .8rem 1rem; border: 1px solid #D6DBE2; border-radius: 2px;
  font-size: .9rem; color: #15181D; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.form-input::placeholder { color: #9AA3AE; }
.form-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(38,75,155,.12); }
select.form-input:valid { color: #15181D; }

/* ---------------------------------------------------------------------
   CONTATTI (card scura)
   --------------------------------------------------------------------- */
.contact-row { display: flex; gap: 1rem; align-items: flex-start; }
.contact-ico {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,111,212,.15); color: var(--brandlt); font-size: 1rem;
}
.contact-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.contact-val { font-size: .92rem; color: #fff; transition: color .2s; word-break: break-word; }

/* ---------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------- */
.footer-head { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 1rem; }
.footer-list { display: grid; gap: .6rem; font-size: .88rem; }
.footer-a { color: rgba(255,255,255,.7); transition: color .2s; }
.footer-a:hover { color: var(--brandlt); }

/* ---------------------------------------------------------------------
   RESPONSIVE FINE-TUNING
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .section-title { font-size: 1.8rem; }
}
