:root {
  --bg: #faf7f2;        /* cream caldo */
  --bg-soft: #f2ede4;   /* sabbia leggera */
  --ink: #1c1a16;       /* warm black */
  --muted: #6b6356;     /* warm grey */
  --line: #e3ddd1;      /* warm divider */
  --accent: #c97b5a;    /* terracotta — divisori sezione e accenti */
  --max: 980px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 48px);
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
  font-family: "Newsreader", Georgia, serif;
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
}
.brand-name { letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 28px; font-size: 15px; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

.hero { padding: clamp(64px, 12vw, 130px) 0 clamp(40px, 7vw, 80px); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 22px;
}
.hero h1 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: clamp(38px, 6.5vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  max-width: 16ch;
}
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 56ch; margin: 0; }

.block {
  position: relative;
  padding: clamp(40px, 7vw, 72px) 0;
}
.block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 2px;
  background: var(--accent);
}
.kicker {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 28px;
}
.prose { max-width: 64ch; }
.prose p { margin: 0 0 18px; }
.prose strong { font-weight: 600; }
.section-note { color: var(--muted); margin: -14px 0 32px; max-width: 56ch; }

/* ---------- Approach ---------- */
.approach-creed {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 30ch;
  margin: -10px 0 40px;
}
.approach-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 48px;
  max-width: 800px;
}
.approach-item h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.approach-item p { margin: 0; color: var(--muted); }

/* ---------- Logo grids ---------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.logo-cell {
  position: relative;
  background: var(--bg);
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  transition: background 0.2s ease;
}
.logo-cell:hover { background: var(--bg-soft); }
.logo-cell img {
  max-width: 100%;
  max-height: 46px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.logo-cell:hover img { transform: scale(1.05); }
.logo-grid--muted .logo-cell img { max-height: 38px; }

.logo-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 100px;
  font-weight: 600;
}
.logo-badge--sold { background: var(--ink); color: var(--bg); }
.logo-cell--ghost { opacity: 0.3; }

/* Portfolio: nome sotto al logo */
.logo-cell--with-caption {
  flex-direction: column;
  gap: 12px;
  aspect-ratio: 4 / 3;
  padding: 22px 16px 16px;
}
.logo-cell--with-caption img { max-height: 42px; }
.logo-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.logo-fallback {
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Contact ---------- */
.contact {
  position: relative;
  padding: clamp(48px, 8vw, 88px) 0;
}
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 2px;
  background: var(--accent);
}
.contact-lede { color: var(--muted); max-width: 52ch; margin: 0 0 26px; }
.pitch summary {
  display: inline-block;
  cursor: pointer;
  font-weight: 500;
  padding: 11px 22px;
  border: 1px solid var(--ink);
  border-radius: 100px;
  transition: background 0.2s ease, color 0.2s ease;
  list-style: none;
}
.pitch summary::-webkit-details-marker { display: none; }
.pitch summary:hover { background: var(--ink); color: var(--bg); }
.pitch[open] summary { margin-bottom: 28px; }
.pitch-form { max-width: 460px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; color: var(--muted); }
.field input, .field textarea {
  font: inherit;
  font-size: 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.pitch-form button {
  justify-self: start;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 11px 26px;
  border: none;
  border-radius: 100px;
  background: var(--ink);
  color: var(--bg);
}
.pitch-form button:hover { opacity: 0.88; }
.form-fallback { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.form-fallback a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px clamp(20px, 5vw, 48px) 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer-brand { font-weight: 500; color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-links { gap: 18px; }
  .approach-grid { grid-template-columns: 1fr; gap: 28px; }
  .logo-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .nav-links a:not(:last-child) { display: none; }
}

/* ---------- Edit mode (?edit=1) ---------- */
#edit-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  z-index: 100;
  max-width: 280px;
}
#edit-controls button {
  font: inherit;
  font-weight: 500;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  border-radius: 100px;
  cursor: pointer;
}
.edit-help { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
