/* =========================================
   CSS CUSTOM PROPERTIES
   ========================================= */
:root {
  --color-primary: #1c3555;
  --color-accent: #5590a0;
  --color-bg: #f6f8fb;
  --color-text: #2a3444;
  --color-text-light: #6b7a8d;
  --color-border: #dce3ea;
  --transition-base: 0.3s ease;
  --shadow-soft: 0 8px 32px rgba(28, 53, 85, 0.10);
  --shadow-photo: 0 16px 48px rgba(28, 53, 85, 0.14);
  --radius-photo: 20px;
}

/* =========================================
   BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   TYPOGRAPHY UTILITIES
   ========================================= */
.font-heading { font-family: 'Raleway', sans-serif; }

.section-tag {
  display: inline-block;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

/* =========================================
   SECTION SPACING
   ========================================= */
.section-pad {
  padding: 6rem 0;
}

@media (max-width: 768px) {
  .section-pad { padding: 4rem 0; }
}

/* =========================================
   NAVIGATION
   ========================================= */
#navbar {
  background: transparent;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 1px 0 var(--color-border);
  backdrop-filter: blur(8px);
}

.nav-link {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition-base);
  opacity: 0.75;
}

.nav-link:hover { opacity: 1; }

.nav-brand {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-brand span { color: var(--color-accent); }

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary {
  display: inline-block;
  background-color: var(--color-primary);
  color: #ffffff;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.8rem 1.75rem;
  border-radius: 4px;
  transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(85, 144, 160, 0.35);
}

.btn-primary-lg {
  font-size: 0.85rem;
  padding: 1rem 2.25rem;
}

.btn-outline-white {
  display: inline-block;
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255,255,255,0.45);
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.8rem 1.75rem;
  border-radius: 4px;
  transition: all var(--transition-base);
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.75);
}

/* =========================================
   HERO PHOTO
   ========================================= */
.hero-photo-wrap {
  position: relative;
  display: inline-block;
}

.hero-photo-wrap::before {
  content: '';
  position: absolute;
  top: -18px;
  right: -18px;
  bottom: 18px;
  left: 18px;
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-photo);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  height: 540px;
  object-fit: cover;
  border-radius: var(--radius-photo);
  box-shadow: var(--shadow-photo);
  display: block;
}

@media (max-width: 768px) {
  .hero-photo { height: 360px; max-width: 100%; }
  .hero-photo-wrap { width: 100%; }
  .hero-photo-wrap::before { display: none; }
}

/* =========================================
   SECTION PHOTO (chi sono)
   ========================================= */
.section-photo {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: var(--radius-photo);
  box-shadow: var(--shadow-photo);
  display: block;
}

@media (max-width: 768px) {
  .section-photo { height: 300px; }
}

/* =========================================
   SERVICE CARDS
   ========================================= */
.service-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
}

.service-icon {
  width: 52px;
  height: 52px;
  background: var(--color-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--color-accent);
}

.service-card h3 {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
}

.service-card p {
  color: var(--color-text-light);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* =========================================
   GALLERY
   ========================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.g-item {
  overflow: hidden;
  border-radius: 10px;
}

.g-item:nth-child(1) {
  grid-row: span 2;
}

.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.g-item:nth-child(1) img { height: 528px; }
.g-item:not(:nth-child(1)) img { height: 257px; }

.g-item:hover img { transform: scale(1.04); }

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .g-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
  }
  .g-item:nth-child(1) img { height: 240px; }
  .g-item:not(:nth-child(1)) img { height: 160px; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .g-item:nth-child(1) { grid-column: span 1; }
  .g-item:nth-child(1) img,
  .g-item:not(:nth-child(1)) img { height: 200px; }
}

/* =========================================
   CONTACT SECTION
   ========================================= */
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  color: #ffffff;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 6px;
  outline: none;
  transition: border-color var(--transition-base), background var(--transition-base);
  -webkit-appearance: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255,255,255,0.35);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.10);
}

.contact-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.4rem;
  font-family: 'Raleway', sans-serif;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  line-height: 1.6;
}

.contact-info-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.07);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
  background: #0f1a26;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
  padding: 1.75rem 0;
  letter-spacing: 0.02em;
}

footer a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color var(--transition-base);
}

footer a:hover { color: rgba(255,255,255,0.85); }

/* =========================================
   ACCENT DIVIDER
   ========================================= */
.accent-divider {
  width: 36px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

/* =========================================
   HERO BG DECORATION
   ========================================= */
#hero {
  position: relative;
  overflow: hidden;
}

#hero::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -200px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(85,144,160,0.05) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

#hero > .inner { position: relative; z-index: 1; }

/* =========================================
   SCROLL FADE-IN ANIMATION
   ========================================= */
.fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.d1 { transition-delay: 0.10s; }
.fade-in.d2 { transition-delay: 0.20s; }
.fade-in.d3 { transition-delay: 0.30s; }
.fade-in.d4 { transition-delay: 0.40s; }

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
