/* ==========================================================================
   Studio Legale Ronchetti — modern restyle
   Sober classic: burgundy + warm neutrals, serif display, clean sans body.
   Hand-written, no framework dependency.
   ========================================================================== */

:root {
  --ink: #1f1b18;
  --ink-soft: #5b524c;
  --paper: #faf7f2;
  --paper-2: #f3ede3;
  --line: #e6ded1;
  --burgundy: #7c2d2d;
  --burgundy-deep: #5f2020;
  --burgundy-tint: rgba(124, 45, 45, 0.07);
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(31, 27, 24, 0.06);
  --shadow-md: 0 18px 40px -24px rgba(31, 27, 24, 0.35);
  --radius: 14px;
  --maxw: 1180px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

p {
  margin: 0;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--burgundy);
  padding: 0.4em 0.8em;
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--burgundy-deep);
}

.btn-ghost {
  background: transparent;
  color: var(--burgundy);
  border-color: rgba(124, 45, 45, 0.35);
}

.btn-ghost:hover {
  background: var(--burgundy-tint);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(150%) blur(10px);
  box-shadow: var(--shadow-sm);
  border-bottom-color: var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.nav-logo img {
  height: 34px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 38px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--burgundy);
  transition: width 0.25s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--burgundy);
}

.nav-cta {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
}

/* mobile drawer */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 28px clamp(20px, 6vw, 48px);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-top img {
  height: 30px;
}

.mobile-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.mobile-close svg {
  width: 26px;
  height: 26px;
}

.mobile-links {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-links a {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.mobile-links a:hover {
  color: var(--burgundy);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 150px;
  padding-bottom: 90px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, var(--burgundy-tint), transparent 60%),
    var(--paper);
  z-index: -2;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 22px;
}

.hero-logo {
  max-width: min(560px, 82%);
  margin: 0 auto 26px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  max-width: 16ch;
  margin: 0 auto;
}

.hero h1 em {
  font-style: italic;
  color: var(--burgundy);
}

.hero-sub {
  margin: 22px auto 0;
  max-width: 56ch;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* colored-pencil decorative band */
.pencil-band {
  margin-top: 64px;
  height: clamp(200px, 50vw, 250px);
  background: url("../public/image.png") center bottom / auto clamp(200px, 50vw, 250px) repeat-x;
  /* -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent); */
  box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.2);
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(64px, 10vw, 120px) 0;
}

.section-alt {
  background: var(--paper-2);
}

.section-head {
  max-width: 62ch;
  margin-bottom: 52px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
}

.section-head p {
  margin-top: 18px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* ---------- Chi siamo ---------- */
.about-lead {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.about-lead .quote {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.25;
}

.about-lead .quote .accent {
  color: var(--burgundy);
  font-style: italic;
}

.about-points {
  margin-top: 28px;
  display: grid;
  gap: 20px;
}

.about-points .item p:first-child {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.about-points .item p:last-child {
  color: var(--ink-soft);
}

.about-figure {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
}

.about-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.burano-strip {
  margin: 0 auto 64px;
}

/* ---------- Servizi ---------- */
.service {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(36px, 6vw, 64px) 0;
  border-top: 1px solid var(--line);
}

.service:first-of-type {
  border-top: 0;
}

.service.reverse .service-media {
  order: 2;
}

.service-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 3 / 2;
}

.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-num {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--burgundy);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.service h3 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  margin: 10px 0 16px;
}

.service p {
  color: var(--ink-soft);
}

.service p+p {
  margin-top: 14px;
}

.service strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Formazione ---------- */
.edu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.edu-figure {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
}

.edu-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.edu-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.edu-list li {
  position: relative;
  padding: 16px 0 16px 34px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.edu-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--burgundy);
}

/* ---------- Contatti ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.contact-info {
  display: grid;
  gap: 26px;
}

.contact-block .label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--burgundy);
  margin-bottom: 6px;
}

.contact-block a:hover {
  color: var(--burgundy);
}

.contact-meta {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.9;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field textarea {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 3px var(--burgundy-tint);
}

.field textarea {
  resize: vertical;
  min-height: 130px;
}

.form-consent {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 4px 0 18px;
}

.form-consent a {
  color: var(--burgundy);
  text-decoration: underline;
}

.form-note {
  margin-top: 14px;
  font-size: 0.85rem;
  display: none;
}

.form-note.ok {
  display: block;
  color: #2f6d3a;
}

.form-note.err {
  display: block;
  color: var(--burgundy);
}

.map-wrap {
  margin-top: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.map-wrap iframe {
  display: block;
  width: 100%;
  height: 380px;
  border: 0;
  filter: grayscale(0.15);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #d8cfc6;
  padding: 64px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}

.site-footer .footer-logo {
  height: 30px;
  filter: brightness(0) invert(1);
  opacity: 0.92;
  margin-bottom: 18px;
}

.site-footer h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b9a89c;
  margin: 0 0 14px;
  font-weight: 600;
}

.site-footer p,
.site-footer a {
  font-size: 0.95rem;
  line-height: 1.85;
  color: #d8cfc6;
}

.site-footer a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  color: #9a8e84;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .about-lead,
  .service,
  .service.reverse,
  .edu,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .service.reverse .service-media {
    order: 0;
  }

  .about-figure,
  .edu-figure {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}