:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f7fa;
  --color-text: #1d2433;
  --color-muted: #5a6478;
  --color-primary: #0c2340;
  --color-primary-2: #1a3a6e;
  --color-accent: #c9a44b;
  --color-border: #e3e7ee;
  --shadow-sm: 0 1px 2px rgba(12, 35, 64, .05), 0 2px 8px rgba(12, 35, 64, .04);
  --shadow-md: 0 4px 12px rgba(12, 35, 64, .08), 0 12px 30px rgba(12, 35, 64, .06);
  --shadow-lg: 0 10px 25px rgba(12, 35, 64, .12), 0 30px 60px rgba(12, 35, 64, .08);
  --container: 1200px;
  --radius: 4px;
  --radius-lg: 8px;
  --transition: 220ms ease;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary-2); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 700; color: var(--color-primary); margin: 0 0 .6em; line-height: 1.25; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.3rem; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* === HEADER === */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.brand img { height: 50px; width: auto; }
.primary-nav ul { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; }
.primary-nav a {
  display: block; padding: 10px 16px;
  color: var(--color-text); font-weight: 600; font-size: .95rem;
  border-radius: var(--radius); position: relative;
}
.primary-nav a::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 4px;
  height: 2px; background: var(--color-accent);
  transform: scaleX(0); transform-origin: center; transition: transform var(--transition);
}
.primary-nav a:hover::after { transform: scaleX(1); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; gap: 5px; flex-direction: column; }
.nav-toggle span { display: block; width: 26px; height: 2px; background: var(--color-primary); transition: var(--transition); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 100%; right: 0; left: 0;
    background: #fff; border-bottom: 1px solid var(--color-border);
    max-height: 0; overflow: hidden; transition: max-height var(--transition);
  }
  .primary-nav.open { max-height: 60vh; box-shadow: var(--shadow-md); }
  .primary-nav ul { flex-direction: column; padding: 12px; gap: 4px; }
  .primary-nav a { padding: 14px 16px; }
}

/* === HERO === */
.hero {
  position: relative;
  min-height: 78vh; display: flex; align-items: center;
  background: var(--color-primary);
  color: #fff; overflow: hidden;
}
.hero-swiper { position: absolute; inset: 0; z-index: 1; }
.hero-swiper .swiper-slide { background-size: cover; background-position: center; }
.hero-swiper .swiper-slide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(12, 35, 64, .85) 0%, rgba(12, 35, 64, .55) 50%, rgba(12, 35, 64, .75) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; width: 100%; padding: 140px 24px 110px;
}
.hero-eyebrow {
  display: inline-block; letter-spacing: .25em; text-transform: uppercase;
  font-size: .8rem; font-weight: 600; opacity: .8; margin-bottom: 18px;
  color: var(--color-accent);
}
.hero h1 { color: #fff; max-width: 900px; margin: 0 auto .25em; }
.hero p.lead { font-size: 1.3rem; max-width: 700px; margin: 0 auto 2rem; opacity: .95; }
.hero-cta { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-swiper .swiper-pagination { bottom: 28px !important; }
.hero-swiper .swiper-pagination-bullet { background: #fff; opacity: .5; }
.hero-swiper .swiper-pagination-bullet-active { opacity: 1; background: var(--color-accent); }
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next { color: #fff; }
.hero-swiper .swiper-button-prev::after,
.hero-swiper .swiper-button-next::after { font-size: 22px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; letter-spacing: .02em;
  border: 2px solid transparent; cursor: pointer;
  transition: var(--transition); font-family: inherit;
}
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: #b18d34; color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn--ghost:hover { background: #fff; color: var(--color-primary); }

/* === SECTIONS === */
.section { padding: 90px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-eyebrow {
  display: inline-block; color: var(--color-accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: .25em; font-size: .8rem;
  margin-bottom: 12px;
}
.section-title { margin-bottom: 50px; }
.section-title h2 { margin-bottom: 0; }
.section-title.center { text-align: center; }
.section-title .subtitle { color: var(--color-muted); font-size: 1.1rem; max-width: 700px; margin-top: 1rem; }
.section-title.center .subtitle { margin-left: auto; margin-right: auto; }

/* === CHI SONO === */
.about-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; align-items: start; }
.about-portrait {
  position: relative; background: var(--color-primary); border-radius: var(--radius-lg);
  overflow: hidden; aspect-ratio: 4/5; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.about-portrait::before {
  content: 'GS'; font-family: var(--font-serif); font-size: 8rem; opacity: .3;
}
.about-portrait .badge {
  position: absolute; bottom: 20px; left: 20px; right: 20px;
  background: rgba(255,255,255,.95); color: var(--color-primary);
  padding: 16px 20px; border-radius: var(--radius); text-align: center;
  font-weight: 600; backdrop-filter: blur(4px);
}
.about-portrait .badge small { display: block; font-weight: 400; color: var(--color-muted); font-size: .85rem; }
.about-text p { color: var(--color-muted); margin-bottom: 1.1rem; font-size: 1.04rem; }
.about-text strong { color: var(--color-text); font-weight: 700; }
.about-stats { display: flex; gap: 30px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--color-border); }
.stat { flex: 1; }
.stat-num { font-family: var(--font-serif); font-size: 2.4rem; font-weight: 700; color: var(--color-primary); line-height: 1; }
.stat-label { color: var(--color-muted); font-size: .9rem; margin-top: 4px; }

@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; gap: 36px; } }

/* === PORTFOLIO === */
.portfolio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .portfolio-grid { grid-template-columns: 1fr; } }

.portfolio-card {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  background: var(--color-primary);
  cursor: pointer;
}
.portfolio-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 600ms ease, opacity 400ms ease;
}
.portfolio-card:hover img { transform: scale(1.05); }
.portfolio-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 22px;
  background: linear-gradient(180deg, transparent 30%, rgba(12, 35, 64, .35) 60%, rgba(12, 35, 64, .92) 100%);
  color: #fff; transition: var(--transition);
}
.portfolio-card h3 {
  color: #fff; margin: 0; font-size: 1.15rem; font-family: var(--font-sans);
  font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.portfolio-card .ico {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--color-primary);
  display: grid; place-items: center; font-size: 18px;
  opacity: 0; transform: translateY(-6px); transition: var(--transition);
  border: none; cursor: pointer; z-index: 3;
}
.portfolio-card:hover .ico { opacity: 1; transform: translateY(0); }
.portfolio-card__link {
  position: absolute; inset: 0; z-index: 2;
  text-decoration: none;
}
.portfolio-card__link::after { content: ""; }

/* Project detail page */
.project-hero { position: relative; }
.project-content { max-width: 980px; }
.project-lead {
  font-size: 1.1rem; line-height: 1.7;
  color: var(--color-muted);
  margin-bottom: 36px;
}
.project-gallery {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin: 24px 0;
}
.project-gallery__item {
  margin: 0; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); background: #f5f5f5;
}
.project-gallery__item img {
  display: block; width: 100%; height: auto;
}
.project-cta .btn { min-width: 200px; text-align: center; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(8, 18, 35, .92);
  display: none; align-items: center; justify-content: center;
  padding: 30px; z-index: 200;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 90vw; box-shadow: var(--shadow-lg); border-radius: 4px; }
.lightbox-caption {
  position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-weight: 500;
}
.lightbox-close {
  position: absolute; top: 22px; right: 26px;
  background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; padding: 6px 12px;
  line-height: 1;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: 0; color: #fff;
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer; font-size: 22px;
  transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* === CONTATTI === */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; align-items: start; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }

.contact-info { color: var(--color-muted); }
.contact-info h3 { color: var(--color-primary); margin-bottom: 14px; font-family: var(--font-sans); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .1em; }
.contact-info ul { list-style: none; padding: 0; margin: 0 0 30px; }
.contact-info li { padding: 10px 0; display: flex; gap: 14px; align-items: flex-start; }
.contact-info li svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--color-accent); margin-top: 2px; }
.contact-info a { color: var(--color-text); }

form.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
form.contact-form .field-full { grid-column: 1 / -1; }
form.contact-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; color: var(--color-text); }
form.contact-form .req { color: #d04848; }
form.contact-form input, form.contact-form textarea {
  width: 100%; padding: 12px 14px; font: inherit;
  border: 1.5px solid var(--color-border); border-radius: var(--radius);
  background: #fff; color: var(--color-text); transition: border-color var(--transition);
}
form.contact-form textarea { min-height: 140px; resize: vertical; }
form.contact-form input:focus, form.contact-form textarea:focus {
  outline: 0; border-color: var(--color-primary-2); box-shadow: 0 0 0 3px rgba(26, 58, 110, .12);
}
.honeypot { position: absolute !important; left: -10000px !important; height: 1px; width: 1px; overflow: hidden; }
.form-flash {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px;
  font-size: .98rem; font-weight: 500;
}
.form-flash--ok { background: #e6f6ec; color: #1f6e3a; border: 1px solid #b7e0c1; }
.form-flash--err { background: #fceaea; color: #a02b2b; border: 1px solid #f1c0c0; }

/* === FOOTER === */
.site-footer { background: var(--color-primary); color: rgba(255,255,255,.78); padding: 38px 0; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.footer-credit { opacity: .8; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-nav a { color: rgba(255,255,255,.78); }
.footer-nav a:hover { color: var(--color-accent); }
.site-footer a { color: #fff; }

/* === COOKIE BANNER === */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  background: var(--color-primary); color: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  transform: translateY(110%); transition: transform 350ms ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner__inner { display: flex; flex-wrap: wrap; gap: 18px; padding: 18px 24px; align-items: center; }
.cookie-banner p { margin: 0; flex: 1 1 460px; font-size: .92rem; }
.cookie-banner a { color: var(--color-accent); text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-banner .btn { padding: 9px 18px; font-size: .88rem; }
.cookie-banner .btn--ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.cookie-banner .btn--ghost:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.6); color: #fff; }

/* === LEGAL PAGES === */
.legal-hero {
  background: var(--color-primary); color: #fff; padding: 110px 0 60px;
}
.legal-hero h1 { color: #fff; margin: 0; }
.legal-content { padding: 60px 0 90px; max-width: 860px; margin: 0 auto; }
.legal-content h1, .legal-content h2, .legal-content h3, .legal-content h4 { font-family: var(--font-sans); margin-top: 1.6em; }
.legal-content h2 { font-size: 1.6rem; }
.legal-content h3 { font-size: 1.3rem; }
.legal-content p, .legal-content li { color: var(--color-muted); }
.legal-content ul, .legal-content ol { padding-left: 24px; }
.legal-content a { word-break: break-word; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .92rem; }
.legal-content th, .legal-content td { padding: 8px 12px; border: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.legal-content th { background: var(--color-bg-alt); font-weight: 600; color: var(--color-text); }
