/* ============================================================
   phase 4 — services, info, contact, footer (+ legal pages)
   ============================================================ */

/* shared section title: "Servizi (4)", "Info" — same voice as "Lavori (3)" */
.section-title {
  display: flex;
  align-items: flex-start;
  gap: 0.12em;
  font-size: var(--fs-display);
  line-height: 0.82;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: clamp(40px, 6vw, 96px);
}
.section-title__count {
  font-size: 0.3em;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  margin-top: 0.12em;
}

/* ---------- services ---------- */
.services {
  --svc-size: clamp(2.2rem, 5.4vw, 9rem);
  padding: clamp(96px, 10vw, 160px) 0 clamp(96px, 10vw, 160px);
}
.services .section-title { padding: 0 var(--gutter); }
.svc-list { border-bottom: 1px solid var(--ink); }
.svc {
  border-top: 1px solid var(--ink);
  transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
}
.svc__h { font: inherit; }
.svc__btn {
  display: block;
  width: 100%;
  padding: clamp(10px, 1.4vw, 22px) var(--gutter);
  text-align: left;
  cursor: pointer;
}
.svc__name {
  --w: 78;
  display: block;
  font-size: var(--svc-size);
  line-height: 0.92;
  font-weight: 760;
  font-variation-settings: "wdth" var(--w), "wght" 760;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: font-variation-settings 0.6s var(--ease-out);
}
.svc__btn:focus-visible { outline-offset: -6px; }

/* the body opens by animating its grid row from 0fr to 1fr */
.svc__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease-out);
}
.svc__inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gutter);
  padding: 0 var(--gutter);
}
.svc__detail {
  max-width: 36ch;
  padding-bottom: clamp(18px, 2vw, 28px);
  font-size: var(--fs-l);
  line-height: 1.3;
}
.svc__strip {
  display: flex;
  gap: 8px;
  padding-bottom: clamp(18px, 2vw, 28px);
}
.svc__strip img {
  height: clamp(84px, 9vw, 140px);
  width: auto;
  max-width: none;
  object-fit: cover;
  background: #222;
}

/* open: hover / keyboard focus on desktop, tap anywhere */
.svc.is-open,
.svc:focus-within { background: var(--ink); color: var(--white); }
.svc.is-open .svc__name,
.svc:focus-within .svc__name { --w: 125; }
.svc.is-open .svc__body,
.svc:focus-within .svc__body { grid-template-rows: 1fr; }
@media (hover: hover) and (min-width: 721px) {
  .svc:hover { background: var(--ink); color: var(--white); }
  .svc:hover .svc__name { --w: 125; }
  .svc:hover .svc__body { grid-template-rows: 1fr; }
}
/* no JS: everything readable, nothing hidden */
html:not(.js) .svc__body { grid-template-rows: 1fr; }

@media (max-width: 720px) {
  .services { --svc-size: clamp(2rem, 10.5vw, 3.4rem); }
  .svc__name { white-space: normal; padding-right: 32px; position: relative; }
  /* a thin plus that turns into a minus */
  .svc__name::after, .svc__name::before {
    content: "";
    position: absolute;
    right: 2px; top: 50%;
    width: 16px; height: 1.5px;
    background: currentColor;
    transition: transform 0.35s var(--ease-out);
  }
  .svc__name::before { transform: rotate(90deg); }
  .svc.is-open .svc__name::before { transform: rotate(0deg); }
  .svc.is-open .svc__name { --w: 100; }
  .svc:focus-within:not(.is-open) { background: none; color: inherit; }
  .svc:focus-within:not(.is-open) .svc__body { grid-template-rows: 0fr; }
  .svc:focus-within:not(.is-open) .svc__name { --w: 78; }
  .svc__inner { flex-direction: column; align-items: stretch; gap: 0; }
  .svc__detail { padding-bottom: 16px; }
  .svc__strip { overflow-x: auto; padding-bottom: 20px; scrollbar-width: none; }
  .svc__strip img { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .svc, .svc__name, .svc__body { transition: none; }
}

/* ---------- info ---------- */
.info { padding: clamp(96px, 10vw, 160px) var(--gutter); }
.info__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 32px;
  align-items: start;
}
.info__portrait {
  grid-column: 1 / 5;
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
}
.info__portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.info__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.info__portrait.has-halftone img { visibility: hidden; }
.info__body { grid-column: 6 / 12; }
.info__text {
  font-family: var(--mono);
  font-size: clamp(1rem, 0.8rem + 0.7vw, 1.4rem);
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  max-width: 62ch;
}
.chips--info { margin-top: 28px; gap: 8px; }
.chips--info .chip {
  padding: 8px 15px 9px;
  font-size: var(--fs-s);
  background: var(--fog);
  touch-action: none;
  user-select: none;
  cursor: grab;
  will-change: transform;
}
.chips--info .chip.is-dragging { cursor: grabbing; background: var(--ink); color: var(--white); }
.info__label { margin-top: 28px; font-size: var(--fs-s); color: var(--graphite); }
.info__label + .chips--info { margin-top: 10px; }

@media (max-width: 900px) {
  /* phones: the portrait sits small beside the start of the text */
  .info__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .info__portrait { grid-column: 1 / 4; }
  .info__body { grid-column: 1 / -1; }
}

/* ---------- contact ---------- */
.contact {
  background: var(--ink);
  color: var(--white);
  padding: calc(var(--header-h) + clamp(64px, 8vw, 120px)) var(--gutter) clamp(64px, 8vw, 120px);
}
.contact__title {
  font-size: clamp(3rem, 1rem + 8.4vw, 11rem);
  /* enough room that the descenders of "progetto" clear "Parliamone" */
  line-height: 1;
  font-weight: 800;
  font-variation-settings: "wdth" 84;
  letter-spacing: -0.03em;
  max-width: 11ch;
  margin-bottom: clamp(48px, 6vw, 96px);
}
.contact__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 64px;
}
.contact__direct { grid-column: 1 / 7; }
.form { grid-column: 8 / 13; }

/* the address is sized from its column (container units), so it
   always fits on one line and is never broken inside */
.contact__direct { container-type: inline-size; }
.contact__email {
  display: inline-block;
  font-size: clamp(1rem, 6.6cqi, 3.4rem);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  border-bottom: 2px solid currentColor;
  transition: color 0.2s;
}
.contact__email:hover { color: rgba(255, 255, 255, 0.75); }
.contact__email.is-copied { color: var(--finder); }
.contact__hint { margin-top: 10px; font-size: var(--fs-s); color: rgba(255, 255, 255, 0.6); }
.contact__links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 28px; font-size: var(--fs-l); }
.steps {
  margin: clamp(40px, 5vw, 72px) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}
.steps li {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  font-size: var(--fs-l);
}
.steps__n { color: rgba(255, 255, 255, 0.6); min-width: 1.4em; font-variant-numeric: tabular-nums; }

/* form */
.field { margin-bottom: 22px; }
.field label { display: block; font-size: var(--fs-s); color: rgba(255, 255, 255, 0.72); margin-bottom: 6px; }
.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 10px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0;
  color: var(--white);
  font: inherit;
  font-size: var(--fs-l);
  transition: border-color 0.2s;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.4; }
.field textarea::placeholder { color: rgba(255, 255, 255, 0.4); }
.field input:focus, .field textarea:focus { border-bottom-color: var(--white); }
/* keyboard focus: the same finder-blue ring as everywhere else */
.field input:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--finder);
  outline-offset: 4px;
}
.field.is-invalid input, .field.is-invalid textarea { border-bottom-color: #ff8a80; }
.field__err { min-height: 1.2em; margin-top: 6px; font-size: var(--fs-s); color: #ff9e95; }
.field--check { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start; }
.field--check input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin: 2px 0 0;
  border: 1px solid var(--white);
  border-radius: 2px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.field--check input:checked { background: var(--white); }
.field--check input:checked::after {
  content: "";
  width: 10px; height: 5px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-1px) rotate(-45deg);
}
.field--check label { margin: 0; font-size: var(--fs-s); color: var(--white); line-height: 1.45; }
.field--check .field__err { grid-column: 2; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; }
.btn-pill--light { height: 48px; padding: 0 28px; font-size: var(--fs-m); }
.contact .btn-pill:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn-pill[disabled] { opacity: 0.6; cursor: progress; }
.form__send-err { font-size: var(--fs-s); color: #ff9e95; }
.form__done:focus { outline: none; }
.form__done-title { font-size: var(--fs-xl); line-height: 1; font-weight: 700; margin-bottom: 14px; }
.form__done .link { margin-top: 18px; }

@media (max-width: 900px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact__direct, .form { grid-column: 1 / -1; }
}

/* ---------- footer: one line ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px clamp(16px, 2.4vw, 36px);
  padding: 22px var(--gutter);
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  font-size: var(--fs-s);
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 8px clamp(14px, 2vw, 28px); }
.footer__copy { margin-left: auto; color: rgba(255, 255, 255, 0.6); }
.footer__eye { width: 19px; height: 24px; opacity: 0.9; }
@media (max-width: 720px) {
  .footer__nav { order: 3; width: 100%; }
}

/* ---------- legal pages ---------- */
.legal {
  padding: calc(var(--header-h) + 64px) var(--gutter) 96px;
  max-width: 820px;
}
.legal h1 {
  font-size: clamp(2.6rem, 1rem + 6vw, 6rem);
  line-height: 0.9;
  font-weight: 800;
  font-variation-settings: "wdth" 84;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.legal__intro { font-size: var(--fs-l); color: var(--graphite); max-width: 60ch; margin-bottom: 48px; }
.legal section { padding: 20px 0; border-top: 1px solid rgba(0, 0, 0, 0.16); }
.legal h2 { font-size: var(--fs-l); font-weight: 650; margin-bottom: 8px; }
.legal p { max-width: 68ch; line-height: 1.55; }
.legal__updated { margin-top: 32px; font-size: var(--fs-s); color: var(--graphite); }
.svc__strip picture { display: contents; }

/* keyboard: a focused row looks exactly like a hovered one, at once
   (no colour fade, so it is never grey on grey mid-transition) */
.svc:has(.svc__btn:focus-visible) {
  background: var(--ink);
  color: var(--white);
  transition: none;
}
.svc:has(.svc__btn:focus-visible) .svc__name { --w: 125; }
.svc:has(.svc__btn:focus-visible) .svc__body { grid-template-rows: 1fr; }
.svc__btn:focus-visible { outline-color: var(--white); }
@media (max-width: 720px) {
  .svc:has(.svc__btn:focus-visible) .svc__name { --w: 100; }
}
