*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #0e0e0e;
  --ink-soft: #4a4a44;
  --ink-muted: #8a8a82;
  --paper: #f5f2eb;
  --paper-warm: #ede9df;
  --accent: #1a3a2a;
  --accent-bright: #2d6a4f;
  --accent-light: #e8f0eb;
  --gold: #c9a84c;
  --gold-light: #f5edda;
  --border: rgba(14,14,14,0.12);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 3rem;
  background: rgba(245,242,235,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 0.5px solid var(--border);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--gold); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 2px;
  font-weight: 500 !important;
  font-size: 13px !important;
  letter-spacing: 0.04em !important;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: var(--accent-bright) !important; }
.nav-hamburger {
  display: none;
  background: none; border: none;
  font-size: 1.4rem; cursor: pointer;
  color: var(--ink);
}

/* HERO */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 8rem 3rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(26,58,42,0.06) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(14,14,14,0.04) 79px, rgba(14,14,14,0.04) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(14,14,14,0.04) 79px, rgba(14,14,14,0.04) 80px);
}
.hero-content { max-width: 680px; position: relative; }
.hero-eyebrow {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before {
  content: ''; display: block;
  width: 32px; height: 1px; background: var(--gold);
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.05; letter-spacing: -0.03em;
  color: var(--ink); margin-bottom: 1.5rem;
}
h1 em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-size: 18px; font-weight: 300;
  color: var(--ink-soft); line-height: 1.7;
  max-width: 520px; margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent); color: #fff;
  padding: 14px 32px; border: none; border-radius: 2px;
  font-family: var(--font-body); font-size: 14px;
  font-weight: 500; letter-spacing: 0.04em;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  display: inline-block;
}
.btn-primary:hover { background: var(--accent-bright); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--ink-soft);
  padding: 14px 24px; border: 0.5px solid var(--border);
  border-radius: 2px; font-family: var(--font-body);
  font-size: 14px; font-weight: 400; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-stat-row {
  display: flex; gap: 3rem; margin-top: 4rem;
  padding-top: 2rem; border-top: 0.5px solid var(--border);
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem; color: var(--accent); line-height: 1;
}
.hero-stat-label {
  font-size: 12px; font-weight: 400;
  color: var(--ink-muted); margin-top: 4px; letter-spacing: 0.04em;
}

/* SECTIONS */
section { padding: 6rem 3rem; }
.section-eyebrow {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1; letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 1rem;
}
h2 em { font-style: italic; color: var(--accent); }
.section-lead {
  font-size: 17px; font-weight: 300;
  color: var(--ink-soft); max-width: 560px;
  margin-bottom: 3.5rem; line-height: 1.7;
}

/* SERVIZI */
#servizi { background: var(--paper-warm); }
.servizi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5px; border: 1.5px solid var(--border);
}
.servizio-card {
  background: var(--paper); padding: 2.5rem 2rem;
  position: relative; overflow: hidden;
  transition: background 0.2s;
}
.servizio-card:hover { background: var(--accent-light); }
.servizio-card:hover .servizio-num { color: var(--accent); }
.servizio-num {
  font-family: var(--font-display); font-size: 3rem;
  color: rgba(14,14,14,0.08); line-height: 1;
  margin-bottom: 1rem; transition: color 0.2s;
}
.servizio-title {
  font-family: var(--font-display); font-size: 1.3rem;
  color: var(--ink); margin-bottom: 0.75rem; letter-spacing: -0.01em;
}
.servizio-desc {
  font-size: 14px; color: var(--ink-soft);
  line-height: 1.65; font-weight: 300;
}
.servizio-tag {
  display: inline-block; margin-top: 1.25rem;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); border-bottom: 1px solid var(--accent-bright);
  padding-bottom: 1px;
}

/* ABOUT */
.about-section { background: var(--accent); }
.about-section .section-eyebrow { color: var(--gold); }
.about-section h2 { color: #fff; }
.about-section h2 em { color: var(--gold); }
.about-section .section-lead { color: rgba(255,255,255,0.72); }
.about-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: start;
}
.about-text {
  font-size: 16px; font-weight: 300;
  color: rgba(255,255,255,0.85); line-height: 1.75;
}
.about-text p { margin-bottom: 1rem; }
.about-pillars { display: flex; flex-direction: column; gap: 1px; }
.pillar {
  padding: 1.5rem; border-left: 2px solid var(--gold);
  background: rgba(255,255,255,0.05); transition: background 0.2s;
}
.pillar:hover { background: rgba(255,255,255,0.09); }
.pillar-title {
  font-family: var(--font-display); font-size: 1.1rem;
  color: #fff; margin-bottom: 0.4rem;
}
.pillar-text {
  font-size: 13px; color: rgba(255,255,255,0.6);
  font-weight: 300; line-height: 1.6;
}

/* CHAT */
#chat { background: var(--paper); }
.quick-questions {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.5rem; max-width: 760px;
}
.quick-btn {
  padding: 7px 14px; border: 0.5px solid var(--border);
  border-radius: 20px; background: transparent;
  font-family: var(--font-body); font-size: 12px;
  color: var(--ink-soft); cursor: pointer; transition: all 0.15s;
}
.quick-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.chat-container {
  max-width: 760px; border: 0.5px solid var(--border);
  border-radius: 6px; overflow: hidden; background: #fff;
}
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 1rem 1.5rem; background: var(--accent);
}
.chat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}
.chat-header-text { font-size: 13px; font-weight: 500; color: #fff; letter-spacing: 0.04em; }
.chat-header-sub { font-size: 11px; color: rgba(255,255,255,0.6); margin-left: auto; }
.chat-messages {
  height: 340px; overflow-y: auto; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--paper);
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.msg {
  max-width: 78%; padding: 10px 14px; border-radius: 3px;
  font-size: 14px; line-height: 1.55;
  animation: fadeUp 0.25s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-ai {
  background: #fff; color: var(--ink);
  border: 0.5px solid var(--border);
  align-self: flex-start; border-bottom-left-radius: 0;
}
.msg-user {
  background: var(--accent); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 0;
}
.msg-label {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 6px; color: var(--ink-muted);
}
.msg-user .msg-label { color: rgba(255,255,255,0.6); }
.typing {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; background: #fff;
  border: 0.5px solid var(--border); border-radius: 3px;
  border-bottom-left-radius: 0; align-self: flex-start; max-width: 78%;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-muted); animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.chat-input-row {
  display: flex; border-top: 0.5px solid var(--border); background: #fff;
}
#chat-input {
  flex: 1; padding: 1rem 1.25rem; border: none; outline: none;
  font-family: var(--font-body); font-size: 14px;
  color: var(--ink); background: transparent; resize: none;
}
#chat-input::placeholder { color: var(--ink-muted); }
#chat-send {
  padding: 0 1.5rem; background: var(--accent);
  color: #fff; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 13px;
  font-weight: 500; letter-spacing: 0.04em; transition: background 0.2s;
}
#chat-send:hover { background: var(--accent-bright); }
#chat-send:disabled { background: var(--ink-muted); cursor: not-allowed; }
.chat-disclaimer {
  font-size: 11px; color: var(--ink-muted);
  text-align: center; margin-top: 1rem; letter-spacing: 0.02em;
}

/* CONTATTI */
#contatti { background: var(--paper-warm); }
.contatti-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: start;
}
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted);
}
.form-field input,
.form-field textarea,
.form-field select {
  padding: 11px 14px; border: 0.5px solid var(--border);
  border-radius: 2px; background: #fff;
  font-family: var(--font-body); font-size: 14px;
  color: var(--ink); outline: none; transition: border-color 0.2s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus { border-color: var(--accent); }
.form-field textarea { resize: vertical; min-height: 100px; }
.form-success {
  padding: 14px; background: var(--accent-light);
  border: 0.5px solid var(--accent); border-radius: 2px;
  font-size: 14px; color: var(--accent); display: none;
}
.contact-info { display: flex; flex-direction: column; gap: 2rem; }
.contact-item { border-left: 2px solid var(--gold); padding-left: 1rem; }
.contact-item-label {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 4px;
}
.contact-item-value {
  font-family: var(--font-display); font-size: 1.1rem; color: var(--ink);
}

/* FOOTER */
footer {
  background: var(--ink); color: rgba(255,255,255,0.5);
  padding: 2rem 3rem; display: flex;
  align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: 0.04em;
}
.footer-logo { font-family: var(--font-display); font-size: 1.1rem; color: #fff; }
.footer-logo span { color: var(--gold); }

/* MOBILE */
@media (max-width: 700px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; flex-direction: column; gap: 1rem; position: absolute; top: 100%; left: 0; right: 0; background: rgba(245,242,235,0.98); padding: 1.5rem; border-bottom: 0.5px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: block; }
  section { padding: 4rem 1.5rem; }
  .hero { padding: 6rem 1.5rem 3rem; }
  .hero-stat-row { gap: 1.5rem; }
  .about-cols, .contatti-grid { grid-template-columns: 1fr; gap: 2rem; }
  footer { flex-direction: column; gap: 1rem; text-align: center; }
}
