/* ════════════════════════════════════════
   FONT FACES (self-hosted, no Google)
════════════════════════════════════════ */

/* Syne 700 & 800 */
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('fonts/syne-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('fonts/syne-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Serif 4 normal 300/400 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url('fonts/source-serif-4-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 300 400;
  font-display: swap;
  src: url('fonts/source-serif-4-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Serif 4 italic 300/400 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('fonts/source-serif-4-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('fonts/source-serif-4-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans normal 300/400/500 */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('fonts/ibm-plex-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ════════════════════════════════════════
   RESET & VARIABLES
════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azure:     #0284C7;
  --azure-lt:  #38BDF8;
  --azure-dk:  #0369A1;
  --azure-bg:  #E0F2FE;
  --g900: #0F172A;
  --g700: #334155;
  --g500: #64748B;
  --g300: #CBD5E1;
  --g100: #F1F5F9;
  --g50:  #F8FAFC;
  --white: #FFFFFF;
  --ff-h: 'Syne', sans-serif;
  --ff-serif: 'Source Serif 4', Georgia, serif;
  --ff-b: 'IBM Plex Sans', sans-serif;
  --nav-h: 64px;       /* altezza navbar quando scrollata */
  --nav-h-exp: 92px;   /* altezza navbar all'apertura (logo grande) */
  --logo-exp: 68px;    /* logo grande */
  --logo-sm: 38px;     /* logo piccolo */
  --max-w: 1160px;
  --radius: 12px;
}

html { scroll-behavior: smooth; height: 100%; }

body {
  font-family: var(--ff-b);
  background: var(--white);
  color: var(--g700);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Spinge il footer al fondo su pagine con poco contenuto */
main, .page-content, .hero, .home-pitch, .home-services {
  flex-shrink: 0;
}
footer { margin-top: auto; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ════════════════════════════════════════
   NAV
════════════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h-exp);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--g100);
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s ease;
}
nav.nav--scrolled {
  height: var(--nav-h);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 2rem;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; }
.logo-img {
  height: var(--logo-exp);
  width: var(--logo-exp);
  object-fit: contain;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width  0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
nav.nav--scrolled .logo-img {
  height: var(--logo-sm);
  width: var(--logo-sm);
}
.logo-img--footer { height: 36px; filter: brightness(0) invert(1); }

.nav-links {
  display: flex; gap: 2rem; list-style: none; align-items: center;
}
.nav-links a {
  font-family: var(--ff-b); font-size: .875rem; font-weight: 500;
  color: var(--g500); transition: color .2s; letter-spacing: .01em;
}
.nav-links a:hover,
.nav-links a.active { color: var(--azure); }

.nav-links .nav-cta {
  background: var(--azure); color: var(--white) !important;
  padding: .45rem 1.2rem; border-radius: 7px;
  transition: background .2s, transform .15s;
}
.nav-links .nav-cta:hover { background: var(--azure-dk); transform: translateY(-1px); }
.nav-links .nav-cta.active { background: var(--azure-dk); color: var(--white) !important; }

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--g700); border-radius: 2px; transition: all .3s;
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--ff-b); font-size: .9rem; font-weight: 500;
  border-radius: 8px; padding: .75rem 1.8rem;
  transition: all .2s; cursor: pointer; border: none; text-decoration: none;
}
.btn-primary {
  background: var(--azure); color: var(--white);
}
.btn-primary:hover {
  background: var(--azure-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2,132,199,.28);
}

/* ════════════════════════════════════════
   HERO (home)
════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  padding: calc(var(--nav-h-exp) + 4rem) 2rem 5rem;
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start;
}

.hero-bg-shape {
  position: absolute; top: 0; right: 0;
  width: 50%; height: 100%;
  background: linear-gradient(150deg, var(--g50) 0%, #DBEAFE 100%);
  clip-path: polygon(8% 0%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 0;
}
.hero-bg-dots {
  position: absolute; top: 0; right: 0;
  width: 50%; height: 100%;
  background-image: radial-gradient(circle, var(--g300) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  opacity: .4;
  clip-path: polygon(8% 0%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 1;
}

.hero-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  align-items: start;
  position: relative; z-index: 2;
  padding-top: 1rem;
}

/* colonna foto */
.hero-photo-col { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.hero-photo-frame {
  width: 220px; height: 270px;
  border-radius: 16px; overflow: hidden;
  background: linear-gradient(145deg, #BFDBFE, #E0F2FE);
  box-shadow: 0 20px 60px rgba(2,132,199,.18), 0 6px 18px rgba(0,0,0,.08);
  flex-shrink: 0;
}
.hero-photo-frame img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}

.hero-nameplate {
  text-align: center; padding: .8rem 1.2rem;
  background: var(--white);
  border: 1px solid var(--g100);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  width: 100%;
}
.hero-nameplate strong {
  display: block;
  font-family: var(--ff-h); font-size: 1rem; font-weight: 700;
  color: var(--g900); letter-spacing: -.01em;
}
.hero-nameplate span {
  font-size: .8rem; color: var(--g500);
}

/* colonna testo */
.hero-text-col h1 {
  font-family: var(--ff-h);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 800; letter-spacing: -.03em;
  color: var(--g900); line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-body p {
  font-family: var(--ff-serif);
  font-size: 1.05rem; font-weight: 400;
  color: var(--g700); line-height: 1.75;
  margin-bottom: 1.1rem;
}

/* ════════════════════════════════════════
   HOME: PITCH SECTION
════════════════════════════════════════ */
.home-pitch {
  background: var(--g900);
  padding: 5rem 2rem;
  text-align: center;
}
.home-pitch h2 {
  font-family: var(--ff-h);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800; letter-spacing: -.03em;
  color: var(--white); margin-bottom: 1.2rem;
}
.home-pitch p {
  font-family: var(--ff-serif);
  font-size: 1.1rem; font-weight: 400;
  color: var(--g300); max-width: 720px;
  margin: 0 auto; line-height: 1.75;
}

/* ════════════════════════════════════════
   HOME: SERVICES LIST
════════════════════════════════════════ */
.home-services {
  background: var(--g50);
  padding: 5rem 2rem;
}
.home-services h2 {
  font-family: var(--ff-h);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800; letter-spacing: -.025em;
  color: var(--g900); margin-bottom: 2.5rem;
}

.services-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .65rem;
}
.services-list li {
  font-family: var(--ff-b);
  font-size: 1rem; font-weight: 500;
  color: var(--g900); line-height: 1.45;
  padding: .85rem 1rem .85rem 2.75rem;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--g100);
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.services-list li::before {
  content: '✓';
  position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--azure); font-size: .95rem; font-weight: 700;
  font-family: var(--ff-b);
}
.services-list li:hover {
  box-shadow: 0 4px 16px rgba(2,132,199,.12);
  border-color: var(--azure-lt);
  transform: translateX(3px);
}

/* servizi page: lista lunga a colonna singola più spaziosa */
.services-list--page {
  grid-template-columns: 1fr;
  max-width: 800px;
  gap: .5rem;
}
.services-list--page li {
  font-size: 1rem;
}

/* ════════════════════════════════════════
   PAGE HERO (interno)
════════════════════════════════════════ */
.page-hero {
  padding: calc(var(--nav-h-exp) + 3.5rem) 2rem 3rem;
  background: linear-gradient(135deg, var(--g50) 0%, var(--azure-bg) 100%);
  border-bottom: 1px solid var(--g100);
}
.page-hero h1 {
  font-family: var(--ff-h);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -.035em;
  color: var(--g900);
}

/* ════════════════════════════════════════
   PAGE CONTENT
════════════════════════════════════════ */
.page-content {
  padding: 4rem 2rem 6rem;
}
.page-content > .container > h2 {
  font-family: var(--ff-h);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 700; letter-spacing: -.02em;
  color: var(--g900); margin-bottom: 2rem;
}

/* ════════════════════════════════════════
   ARTICLE BODY (il-sistemista)
════════════════════════════════════════ */
.content-grid { max-width: 860px; }

.article-body h3 {
  font-family: var(--ff-h);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 700; letter-spacing: -.015em;
  color: var(--g900); line-height: 1.4;
  margin: 2.5rem 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--azure);
}
.article-body h3:first-child { margin-top: 0; }

.article-body p {
  font-family: var(--ff-serif);
  font-size: 1.05rem; font-weight: 400;
  color: var(--g700); line-height: 1.8;
  margin-bottom: 1rem;
}
.article-body strong { color: var(--g900); font-weight: 500; }
.article-body em { font-style: italic; }

.article-list {
  list-style: none; margin: 1rem 0 1.5rem 0;
  display: flex; flex-direction: column; gap: .6rem;
}
.article-list li {
  font-family: var(--ff-b); font-size: 1rem; font-weight: 500;
  color: var(--g900); padding-left: 1.6rem;
  position: relative; line-height: 1.5;
}
.article-list li::before {
  content: '→'; position: absolute; left: 0;
  color: var(--azure); font-size: .9rem; font-weight: 700;
}

.article-figure {
  margin: 2.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.article-figure img {
  width: 100%; height: auto;
  display: block;
}

.article-cta { margin-top: 3rem; }

/* ════════════════════════════════════════
   CONTATTI
════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  max-width: 900px;
  margin-top: 1rem;
}
.contact-block {
  background: var(--g50);
  border: 1px solid var(--g100);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  transition: box-shadow .25s, transform .25s;
}
.contact-block:hover {
  box-shadow: 0 8px 32px rgba(2,132,199,.1);
  transform: translateY(-3px);
}
.contact-icon {
  width: 60px; height: 60px;
  background: var(--azure-bg); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--azure);
}
.contact-block h4 {
  font-family: var(--ff-h); font-size: 1rem; font-weight: 700;
  color: var(--g900);
}
.contact-block p {
  font-size: .9rem; color: var(--g500);
  font-weight: 400; line-height: 1.6;
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
footer {
  background: var(--g900);
  padding: 2rem 2rem;
}
.footer-inner {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-copy {
  font-size: .78rem; color: var(--g300);
  font-weight: 400;
}
.footer-privacy {
  font-size: .78rem; color: var(--g300);
  transition: color .2s;
}
.footer-privacy:hover { color: var(--azure-lt); }

/* ════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════ */
.fade-up {
  opacity: 0; transform: translateY(20px);
  transition: opacity .65s ease, transform .65s ease;
}
.fade-up.visible { opacity: 1; transform: none; }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-photo-col {
    flex-direction: row; align-items: center; gap: 1.5rem;
  }
  .hero-bg-shape, .hero-bg-dots { display: none; }
  .hero-nameplate { text-align: left; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Logo nav mobile: più piccolo per non sovraffollare la barra */
  :root { --logo-exp: 50px; --nav-h-exp: 72px; }

  .hero-photo-col { flex-direction: column; align-items: flex-start; }
  .hero-photo-frame { width: 180px; height: 220px; }

.footer-inner { flex-direction: column; align-items: flex-start; gap: .8rem; }

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