/* ══════════════════════════════════════
   AMS Solutions — style.css
   ══════════════════════════════════════ */

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

:root {
  --blue:      #1a2e4a;
  --blue-mid:  #1e3f6f;
  --accent:    #c8a84b;
  --light:     #f5f5f5;
  --dark:      #111;
  --text:      #333;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  overflow-x: hidden;
}


/* ══════════════════════════════════════
   NAV
   ══════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(26, 46, 74, 0.96);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  transition: box-shadow .3s;
}

.nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.nav-logo-circle img {
  max-width: 64px;
}
.nav-logo-text {
  color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 2px;
}

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-links a:hover { color: #fff; border-bottom-color: var(--accent); }

.nav-contact {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 8px 20px !important;
  border-radius: 3px;
  border-bottom: none !important;
}
.nav-contact:hover { background: #b8962e !important; }


/*    HERO    */
#hero {
  height: 70vh; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}

.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0d1f35 0%, #1e3f6f 50%, #0d1f35 100%);
  will-change: transform;
}

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(200,168,75,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200,168,75,.08) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
  from { background-position: 0 0; }
  to   { background-position: 60px 60px; }
}

.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 0 20px;
}
.hero-badge {
  display: inline-block;
  background: rgba(200,168,75,.15);
  border: 1px solid rgba(200,168,75,.4);
  color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  padding: 6px 18px; border-radius: 20px; margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(42px, 7vw, 90px);
  font-weight: 900; color: #fff; letter-spacing: 6px; line-height: 1;
  text-shadow: 0 4px 30px rgba(0,0,0,.5);
}
.hero-title span { color: var(--accent); }
.hero-sub {
  font-size: clamp(14px, 2vw, 20px);
  color: rgba(255,255,255,.7); letter-spacing: 4px; margin-top: 16px; font-weight: 300;
}
.hero-tagline {
  font-size: clamp(15px, 1.8vw, 18px);
  color: rgba(255,255,255,.55);
  max-width: 600px; margin: 24px auto 0;
  line-height: 1.7; font-style: italic;
}

.hero-scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,.4); font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  animation: bounce 2s ease-in-out infinite;
}
.hero-scroll svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

.tech-float {
  position: absolute; opacity: .12;
  font-size: 120px; font-weight: 900; color: #fff; letter-spacing: -10px;
  animation: floatEl 6s ease-in-out infinite;
  pointer-events: none;
}
.tf1 { top: 15%; left: 5%; animation-delay: 0s; }
.tf2 { bottom: 20%; right: 5%; animation-delay: 3s; font-size: 80px; }
@keyframes floatEl {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-20px); }
}


/*    SEZIONI – COMUNI   */
section { padding: 100px 0; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 40px; }

.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.section-title {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800; color: var(--blue); line-height: 1.15; margin-bottom: 20px;
}
.section-title.light { color: #fff; }

.divider { width: 60px; height: 3px; background: var(--accent); margin-bottom: 36px; }

a { color:#b8962e;}

/*    AUTOMAZIONE E ROBOTICA  */
#automazione { background: #fff; }

.auto-intro {
  max-width: 700px; margin: 0 auto 72px; text-align: center;
}
.auto-intro .section-title { text-align: center; }
.auto-intro .divider       { margin: 0 auto 24px; }
.auto-intro p { font-size: 17px; color: #555; line-height: 1.75; }

.auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.auto-img {
display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 24px;
  padding-bottom: 2rem;
}
.auto-img.sfondo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.auto-img.sfondo.automazione {
  background-image: url('img/automazione-e-robotica.jpg');
}
.auto-img.sfondo.robotica {
  background-image: url('img/robotica.webp');
}
.auto-img.sfondo.lxautomation {
  background-image: url('img/LX_attuatori.jpg');
}
.auto-img.sfondo.produzione {
  background-image: url('img/produzione.webp');
}

.auto-card {
  background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
  padding: 36px 24px 32px; text-align: center;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  position: relative; overflow: hidden;
}

.auto-card img {
  width: 5%;
}
.auto-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.auto-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,.1); border-color: transparent; }
.auto-card:hover::before { transform: scaleX(1); }

.auto-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  background: linear-gradient(135deg, #eef2f8, #dde6f2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.auto-icon svg { width: 32px; height: 32px; stroke: var(--blue-mid); fill: none; stroke-width: 1.5; }
.auto-card h3  { font-size: 16px; font-weight: 700; color: var(--blue); margin-bottom: 10px; }
.auto-card p   { font-size: 14px; color: #666; line-height: 1.65; }


/* ══════════════════════════════════════
   SERVICE + CARD ORIZZONTALI
   ══════════════════════════════════════ */
#services {
  position: relative;
  overflow: hidden;
  padding: 100px 0;
}

.service-parallax-bg {
  position: absolute;
  inset: -60px 0;
  background: linear-gradient(180deg, #0d1f35 0%, #1a3a5c 100%);
  will-change: transform;
}

.service-inner { position: relative; z-index: 2; }

.service-head {
  text-align: center;
  margin-bottom: 56px;
}

.service-lead {
  max-width: 580px;
  margin: 0 auto;
  font-size: 15px;
  color: rgba(255, 255, 255, .52);
  line-height: 1.75;
}

/* Stack di card */
.service-cards {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 960px;
  margin: 0 auto;
}

.service-card {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 210px;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  position: relative;
  transition: background .3s;
  cursor: default;
}

/* Arrotondamenti solo sugli angoli esterni */
.service-card:first-child { border-radius: 10px 10px 0 0; }
.service-card:last-child  { border-radius: 0 0 10px 10px; }

/* Striscia accent sinistra */
.service-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background .3s;
}
.service-card:hover { background: rgba(200, 168, 75, .08); }
.service-card:hover::before { background: var(--accent); }

/* Colonna foto */
.sc-img {
  position: relative;
  overflow: hidden;
  background: #0a1928;
}
.sc-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(.72) saturate(.85);
  transition: transform .5s ease, filter .4s ease;
}
.service-card:hover .sc-img img {
  transform: scale(1.05);
  filter: brightness(.92) saturate(1.05);
}

/* Numero grande overlay */
.sc-num {
  position: absolute;
  top: 12px; left: 16px;
  font-size: 64px;
  font-weight: 900;
  color: rgba(255, 255, 255, .1);
  line-height: 1;
  letter-spacing: -2px;
  pointer-events: none;
  transition: color .3s;
}
.service-card:hover .sc-num { color: rgba(200, 168, 75, .2); }

/* Badge categoria */
.sc-tag {
  position: absolute;
  bottom: 14px; left: 14px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  background: rgba(200, 168, 75, 75%);
  border: 1px solid rgba(200, 168, 75, .4);
  color: #f0f2f5;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Colonna testo */
.sc-body {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.sc-claim {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}

.sc-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.sc-text {
  font-size: 13px;
  color: rgba(255, 255, 255, .56);
  line-height: 1.72;
  max-width: 480px;
}

.sc-arrow {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(200, 168, 75, .45);
  transition: color .3s;
}
.sc-arrow svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s;
}
.service-card:hover .sc-arrow        { color: var(--accent); }
.service-card:hover .sc-arrow svg    { transform: translateX(4px); }


/* ── Responsive ── */

/* Sotto 1500px: verticalizza le card (foto sopra, testo sotto) */
@media (max-width: 1800px) {
  .service-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    max-width: 960px;
  }

  .service-card {
    grid-template-columns: 1fr;
    grid-template-rows: 220px auto;
    min-height: unset;
  }

  /* Ripristina tutti gli angoli a 0, poi ridisegna i 4 angoli esterni della griglia */
  .service-card                { border-radius: 0; }
  .service-card:first-child    { border-radius: 10px 0 0 0; }
  .service-card:nth-child(2)   { border-radius: 0 10px 0 0; }
  .service-card:nth-child(3)   { border-radius: 0 0 0 10px; }
  .service-card:last-child     { border-radius: 0 0 10px 0; }

  .sc-num { font-size: 48px; }
}

/* Sotto 700px: singola colonna */
@media (max-width: 700px) {
  .service-cards { grid-template-columns: 1fr; }

  .service-card                { border-radius: 0; }
  .service-card:first-child    { border-radius: 10px 10px 0 0; }
  .service-card:nth-child(2)   { border-radius: 0; }
  .service-card:nth-child(3)   { border-radius: 0; }
  .service-card:last-child     { border-radius: 0 0 10px 10px; }
}

@media (max-width: 500px) {
  .sc-body { padding: 24px 20px; }
}

/*    STORIA – PARALLAX  */
#storia { position: relative; overflow: hidden; padding: 120px 0; }

.storia-parallax-bg {
  position: absolute; inset: -60px 0;
  background: linear-gradient(#f0f2f5 0%, #e8edf3 100%);
  will-change: transform;
}
.storia-overlay {
  position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><circle cx="1" cy="1" r="1" fill="rgba(200,168,75,0.15)"/></svg>') repeat;
  opacity: .4;
}
.storia-inner { position: relative; z-index: 2; }

.storia-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: start; margin-top: 48px;
}

.storia-text p {
  font-size: 16px; color: rgba(30, 50, 80, 0.72);
  line-height: 1.85; margin-bottom: 20px;
}
.storia-text p:first-child {
  font-size: 18px; color: rgba(20, 40, 70, 0.9); font-weight: 500;
}

.storia-timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: flex; gap: 24px;
  padding-bottom: 36px;
  border-left: 2px solid rgba(200,168,75,.25);
  margin-left: 18px; padding-left: 28px;
  position: relative;
}
.timeline-item:last-child { border-left: none; padding-bottom: 0; }

.timeline-dot {
  position: absolute; left: -9px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 3px solid #f0f2f5;
}
.timeline-year {
  font-size: 13px; font-weight: 700; color: var(--accent);
  min-width: 44px; margin-top: 2px;
}
.timeline-body strong { color: var(--blue); display: block; margin-bottom: 4px; }
.timeline-body p { font-size: 14px; color: rgba(30, 50, 80, 0.65); line-height: 1.6; }

#storia .section-title { color: var(--blue) !important; }

/*     CONTATTI  */
#contatti { background: linear-gradient(#0d1f35 0%, #1a3a5c 100%); padding: 20px 0 10px 0; }
#contatti .section-title { color: rgba(255,255,255,0.95) !important; }

.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 64px; margin-top: 40px; margin-bottom: 40px;
}

.contact-grid h3 {
  font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.95); margin-bottom: 24px;
}
.contact-row {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 18px; font-size: 15px; color: rgba(255,255,255,0.72);
}
.contact-row svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; min-width: 20px; margin-top: 2px; }
.contact-row a   { color: color: var(--accent); text-decoration: none; }
.contact-row a:hover { text-decoration: underline; }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.contact-form input,
.contact-form textarea {
  width: 100%; padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 6px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff; outline: none;
  transition: border-color .2s;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--blue-mid); }
.contact-form textarea { min-height: 100px; resize: vertical; }


/*  FOOTER  */
footer {
  background: var(--dark); color: rgba(255,255,255,.5);
  text-align: center; padding: 15px 40px; font-size: 13px;
}
footer span { color: var(--accent); }


/*  SCROLL REVEAL  */
.reveal       { opacity: 0; transform: translateY(30px);   transition: opacity .7s, transform .7s; }
.reveal-left  { opacity: 0; transform: translateX(-40px);  transition: opacity .7s, transform .7s; }
.reveal-right { opacity: 0; transform: translateX(40px);   transition: opacity .7s, transform .7s; }

.reveal.visible,
.reveal-left.visible,
.reveal-right.visible { opacity: 1; transform: translate(0); }


/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 1200px) {
  .auto-grid       { grid-template-columns: 1fr 1fr; }
  .infografica-grid { grid-template-columns: 1fr; max-width: 480px; }
  .storia-cols     { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid    { grid-template-columns: 1fr; }
  .form-row        { grid-template-columns: 1fr; }
  .nav-links       { display: none; }
  .infografica-grid .info-piece:nth-child(n) { border-radius: 0; }
  .infografica-grid .info-piece:first-child  { border-radius: 12px 12px 0 0; }
  .infografica-grid .info-piece:last-child   { border-radius: 0 0 12px 12px; }
}

@media (max-width: 900px) {
  .auto-grid { grid-template-columns: 1fr; }
  nav { padding: 0 20px; }
  .container { padding: 0 20px; }
  .auto-img.sfondo {
    min-height: 16vh;
  }
}
