/* ============================================================
   LAMI S.R.L. — sober blue/white corporate site
   ============================================================ */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-sans-400i-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-sans-500-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/ibm-plex-sans-600-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ibm-plex-sans-700-latin.woff2') format('woff2'); }

:root {
  --blue:       #1854A3;
  --blue-dark:  #0A2E52;
  --blue-hover: #123F79;
  --blue-pale:  #EAF1FA;
  --white:      #FFFFFF;
  --tint:       #F5F8FB;
  --ink:        #17222E;
  --steel:      #55677E;
  --border:     #E2E8F0;

  --font-body: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;

  --container: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-pad: clamp(56px, 8vw, 96px);
  --radius: 4px;
  --ease: cubic-bezier(.2,.7,.3,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

body {
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; line-height: 1.12; color: var(--blue-dark); letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { color: var(--steel); max-width: 62ch; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.skip-link {
  position: fixed; top: -100px; left: 12px; z-index: 1000;
  background: var(--blue-dark); color: #fff;
  padding: .8em 1.2em; border-radius: var(--radius); font-size: .9rem;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

.hero-inner .reveal:nth-child(2) { transition-delay: .08s; }
.hero-inner .reveal:nth-child(3) { transition-delay: .16s; }
.hero-inner .reveal:nth-child(4) { transition-delay: .24s; }
.service-grid .reveal:nth-child(2) { transition-delay: .1s; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-weight: 600; font-size: .95rem;
  padding: .85em 1.5em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  cursor: pointer;
}
.btn--primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn--primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn--ghost { background: transparent; color: var(--blue-dark); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--blue); background: var(--blue-pale); }
.btn--nav { display: none; }
@media (min-width: 860px) { .btn--nav { display: inline-flex; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -16px rgba(10,46,82,.35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }

.logo { display: inline-flex; align-items: baseline; color: var(--blue-dark); }
.logo-word { font-weight: 700; font-size: 1.2rem; line-height: 1; letter-spacing: .01em; }
.logo-tag { font-weight: 400; font-size: .68rem; color: var(--blue); margin-left: .35em; letter-spacing: .02em; }

.main-nav { display: none; }
@media (min-width: 860px) {
  .main-nav { display: block; flex: 1; }
  .main-nav ul { display: flex; justify-content: center; gap: 2.2rem; }
  .main-nav a { font-size: .92rem; color: var(--steel); }
  .main-nav a:hover { color: var(--blue-dark); }
}

.nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; }
@media (min-width: 860px) { .nav-toggle { display: none; } }
.nav-toggle-bar { width: 22px; height: 1.5px; background: var(--blue-dark); transition: transform .18s var(--ease), opacity .18s var(--ease); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(4) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav { max-height: 0; overflow: hidden; background: var(--white); border-bottom: 0 solid var(--border); transition: max-height .3s var(--ease); }
.mobile-nav.is-open { max-height: 320px; border-bottom-width: 1px; }
.mobile-nav ul { padding: 8px var(--gutter) 0; }
.mobile-nav li { border-top: 1px solid var(--border); }
.mobile-nav a { display: block; padding: 1em 0; font-size: 1rem; }
.mobile-nav .btn { margin: 16px var(--gutter) 24px; width: calc(100% - 2 * var(--gutter)); justify-content: center; }
@media (min-width: 860px) { .mobile-nav { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(88px, 14vw, 156px) clamp(64px, 10vw, 108px); overflow: hidden; }
.hero-backdrop {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 420px at 82% -10%, var(--blue-pale) 0%, transparent 70%),
    radial-gradient(520px 360px at -6% 90%, var(--blue-pale) 0%, transparent 65%);
}
.eyebrow { font-size: .85rem; font-weight: 600; letter-spacing: .02em; color: var(--blue); margin-bottom: .9em; }
.hero h1 { max-width: 15ch; }
.hero-sub { font-size: 1.1rem; max-width: 46ch; margin-top: 1.2em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2.2em; }

.hero-inner { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 6vw, 56px); align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.05fr .95fr; } }

.hero-visual {
  position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 220px;
  display: flex; align-items: center; justify-content: center;
  perspective: 1400px;
}

.hero-backdrop { will-change: transform; }
@media (prefers-reduced-motion: reduce) { .hero-backdrop { transform: none !important; } }

/* ---------- hero: 3D logo plaque (CSS-only, no WebGL) ---------- */
.plaque-glow {
  position: absolute; inset: 6%;
  background: radial-gradient(closest-side, var(--blue-pale) 0%, transparent 70%);
  opacity: .9;
  pointer-events: none;
}

.plaque-sway { animation: plaque-sway 9s ease-in-out infinite; }
@keyframes plaque-sway {
  0%, 100% { transform: rotateY(-10deg) rotateX(4deg); }
  50% { transform: rotateY(10deg) rotateX(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .plaque-sway { animation: none; transform: rotateY(-7deg) rotateX(2deg); }
}

.logo-plaque {
  --tilt-x: 0deg; --tilt-y: 0deg;
  display: flex; align-items: baseline; gap: .5em;
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform .3s var(--ease);
}
.logo-plaque-main {
  font-weight: 700; font-size: clamp(3.4rem, 8vw, 6rem); color: var(--blue-dark);
  letter-spacing: .01em; line-height: 1;
  text-shadow: 0 18px 40px rgba(10, 46, 82, .28);
}
.logo-plaque-sub { font-weight: 500; font-size: clamp(1.15rem, 2.4vw, 1.7rem); color: var(--blue); }
@media (prefers-reduced-motion: reduce) { .logo-plaque { transition: none; } }

/* ---------- sections ---------- */
.section { padding-block: var(--section-pad); border-top: 1px solid var(--border); }
.section--tint { background: var(--tint); }
.section-head { max-width: 56ch; margin-bottom: clamp(32px, 5vw, 48px); }
.section-head h2 { margin-top: .3em; }

/* ---------- chi siamo ---------- */
.azienda-grid { display: grid; gap: clamp(24px, 5vw, 56px); grid-template-columns: 1fr; }
@media (min-width: 760px) { .azienda-grid { grid-template-columns: .9fr 1.1fr; } }
.azienda-grid h2 { margin-top: .3em; }
.azienda-grid p { margin-bottom: 1em; }

/* ---------- servizi ---------- */
.service-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .service-grid { grid-template-columns: 1fr 1fr; } }

.service-card {
  --tilt-x: 0deg; --tilt-y: 0deg; --tilt-lift: 0px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateY(var(--tilt-lift));
  transition: box-shadow .3s var(--ease), transform .35s var(--ease);
}
.service-card:hover { box-shadow: 0 24px 44px -24px rgba(10,46,82,.3); }
.service-card-body { padding: clamp(24px, 3.4vw, 32px); }
.service-card h3 { margin-bottom: .5em; }
.service-card p { font-size: .95rem; }
@media (prefers-reduced-motion: reduce) {
  .service-card { transform: none !important; transition: box-shadow .3s var(--ease); }
}

/* ---------- photo placeholders ---------- */
.photo-placeholder {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8em;
  background: linear-gradient(155deg, var(--blue-pale) 0%, #DCE8F5 100%);
  color: var(--blue);
  text-align: center;
  aspect-ratio: 16 / 10;
}
.photo-placeholder-icon { width: 34px; height: 34px; opacity: .55; transition: transform .4s var(--ease); }
.photo-placeholder-label { font-size: .78rem; font-weight: 600; color: var(--blue-hover); padding-inline: 1em; }
.service-card:hover .photo-placeholder-icon { transform: scale(1.08) translateY(-2px); }

.photo-placeholder::after {
  content: ''; position: absolute; inset: -20% -60%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.6) 50%, transparent 60%);
  transform: translateX(-60%);
  transition: transform .8s var(--ease);
  pointer-events: none;
}
.service-card:hover .photo-placeholder::after { transform: translateX(60%); }
@media (prefers-reduced-motion: reduce) {
  .photo-placeholder::after { display: none; }
  .service-card:hover .photo-placeholder-icon { transform: none; }
}

/* ---------- service photo (real image) ---------- */
.service-photo { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--blue-pale); }
.service-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s var(--ease);
}
.service-card:hover .service-photo img { transform: scale(1.045); }
@media (prefers-reduced-motion: reduce) { .service-card:hover .service-photo img { transform: none; } }

/* ---------- map embed ---------- */
.map-embed {
  aspect-ratio: 21 / 6; min-height: 220px;
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-top: clamp(28px, 4vw, 40px);
  overflow: hidden;
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- contatti ---------- */
.contatti-grid { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: 1fr; }
@media (min-width: 820px) { .contatti-grid { grid-template-columns: .9fr 1.1fr; } }
.contatti-grid h2 { margin: .3em 0 .5em; }

.info-list { margin-top: 2em; display: grid; gap: 1.2em; }
.info-list dt { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); margin-bottom: .35em; }
.info-list dd { font-size: 1rem; color: var(--ink); }
.info-list a:hover { color: var(--blue); }

.contact-form { background: var(--tint); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(24px, 4vw, 36px); }
.field { margin-bottom: 1.2em; }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: .5em; }
.field input, .field textarea {
  width: 100%; background: var(--white); border: 1px solid var(--border);
  color: var(--ink); padding: .8em 1em; border-radius: var(--radius);
  transition: border-color .18s var(--ease);
}
.field input:focus, .field textarea:focus { border-color: var(--blue); outline: none; }
.field textarea { resize: vertical; min-height: 110px; }
.contact-form .btn { margin-top: .3em; width: 100%; justify-content: center; }
.contact-form .btn:disabled { opacity: .65; cursor: not-allowed; }

.field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: .85rem; margin-top: 1em; max-width: none; min-height: 1.2em; }
.form-status[data-state="error"] { color: #B3261E; }
.form-status[data-state="success"] { color: var(--blue-hover); }

/* ---------- footer ---------- */
.site-footer { background: var(--tint); border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: 36px; padding-block: clamp(40px, 6vw, 64px); grid-template-columns: 1fr; color: var(--steel); }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer-brand .logo { margin-bottom: 1em; }
.footer-brand p { font-size: .92rem; max-width: 30ch; }
.footer-nav h4, .footer-contact h4 { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); margin-bottom: 1.1em; }
.footer-nav ul { display: grid; gap: .75em; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--blue); }
.footer-contact p { font-size: .92rem; margin-bottom: .55em; }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px;
  padding-block: 20px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--steel);
}
.footer-credit { display: inline-flex; align-items: center; gap: .4em; }
.footer-credit-icon { width: 13px; height: 13px; color: var(--blue); }
.footer-credit a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border); }
.footer-credit a:hover { color: var(--blue); text-decoration-color: var(--blue); }
