:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.18);
  --gold: #f1c54b;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

p,
h1,
h2,
h3,
figure {
  margin: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  padding: 28px clamp(24px, 5vw, 72px);
  background: rgba(0, 0, 0, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 13px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

/* STRUTTURA SEZIONI */

.mobile-brand-intro {
  display: none;
}

.section {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 110px 0;
}

.section + .section {
  margin-top: 0;
}

.section-inner {
  width: min(var(--max), calc(100% - clamp(48px, 10vw, 144px)));
  margin: 0 auto;
}

.hero {
  overflow: hidden;
}

.hero-watermark {
  position: fixed;
  right: -8vw;
  top: 50%;
  width: min(86vw, 1180px);
  height: auto;
  transform: translateY(-50%);
  opacity: 0.055;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.section-inner,
.portfolio-item,
.site-footer {
  position: relative;
  z-index: 2;
}


.hero-copy,
.text-block,
.contact-main {
  position: relative;
  z-index: 2;
}

.hero-copy {
  max-width: 940px;
}

.text-block,
.contact-main {
  max-width: 920px;
}

.eyebrow,
.section-number {
  color: var(--gold);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 34px;
}

h1,
h2,
h3 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

h1 {
  max-width: 980px;
  font-size: clamp(56px, 7.4vw, 126px);
}

h2 {
  max-width: 900px;
  font-size: clamp(42px, 5vw, 82px);
}

h3 {
  max-width: 640px;
  font-size: clamp(31px, 3.2vw, 56px);
}

p {
  color: var(--muted);
  font-size: clamp(18px, 1.28vw, 23px);
  line-height: 1.7;
}

p strong {
  color: var(--text);
  font-weight: 700;
}

.lead-block,
.body-copy,
.contact-copy {
  margin-top: 38px;
  max-width: 760px;
}

.lead-block p + p,
.body-copy p + p,
.contact-copy p + p {
  margin-top: 10px;
}

/* BOTTONI */

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  width: fit-content;
  padding: 0 26px;
  margin-top: 34px;
  border: 1px solid var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button-primary {
  background: var(--text);
  color: var(--bg);
}

.button-secondary {
  background: transparent;
  color: var(--text);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: transparent;
  color: var(--text);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: var(--text);
  color: var(--bg);
}

/* PORTFOLIO */

.section-heading {
  margin-bottom: 64px;
}

.portfolio-grid {
  display: grid;
  gap: 72px;
}

.portfolio-item {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.82fr);
  gap: clamp(36px, 5vw, 76px);
  align-items: center;
}

.portfolio-item:nth-child(even) {
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.48fr);
}

.portfolio-item:nth-child(even) .portfolio-image-wrapper {
  order: 2;
}

.portfolio-item:nth-child(even) .portfolio-copy {
  order: 1;
}

.portfolio-image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}

.portfolio-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: none;
  opacity: 1;
  transform: none;
}

.portfolio-copy {
  max-width: 640px;
}

.portfolio-copy p:last-child {
  margin-top: 30px;
}

/* CONTATTI E FOOTER */

.contact-section {
  padding-bottom: 100px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.contact-actions .button-primary,
.contact-actions .button-secondary {
  margin-top: 34px;
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.social-icons a:hover,
.social-icons a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

.site-footer {
  display: block;
  position: static;
  width: min(var(--max), calc(100% - clamp(48px, 10vw, 144px)));
  margin: 0 auto;
  padding: 32px 0 38px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
}

.site-footer p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.legal-links {
  margin-top: 8px;
}

.legal-links a {
  color: var(--muted);
}

.legal-links a:hover,
.legal-links a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

/* RESPONSIVE TABLET */

@media (max-width: 980px) {
  .section {
    padding: 86px 0;
  }

  .portfolio-item,
  .portfolio-item:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .portfolio-item:nth-child(even) .portfolio-image-wrapper,
  .portfolio-item:nth-child(even) .portfolio-copy {
    order: initial;
  }

  .portfolio-copy,
  .portfolio-copy h3 {
    max-width: 760px;
  }
}

/* RESPONSIVE MOBILE — VERSIONE CONTROLLATA */

@media (max-width: 720px) {
  :root {
    --mobile-pad: 22px;
    --mobile-header: 117px;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    background: #000;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 19px;
    padding: 20px var(--mobile-pad) 18px;
    background: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  }

  .brand {
    gap: 12px;
    font-size: 11px;
    line-height: 1.05;
    letter-spacing: 0.075em;
  }

  .brand-mark {
    width: 23px;
    height: 23px;
  }

  .site-nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.105em;
  }

  .site-nav a {
    white-space: nowrap;
  }

  #main,
  #home,
  #problema,
  #metodo,
  #progetti,
  #contatti,
  #per-chi {
    scroll-margin-top: var(--mobile-header);
  }

  .mobile-brand-intro {
    position: sticky;
    top: var(--mobile-header);
    z-index: 0;
    display: block;
    overflow: hidden;
    min-height: calc(82vh - var(--mobile-header));
    min-height: calc(82svh - var(--mobile-header));
    min-height: calc(82dvh - var(--mobile-header));
    margin-bottom: -18svh;
    padding: 0;
    background: #000;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0.65) 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0.65) 78%, transparent 100%);
  }

  .mobile-brand-intro img {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 132vw;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    opacity: 0.12;
    pointer-events: none;
    user-select: none;
  }

  .section {
    padding: 76px 0;
  }

  .section-inner,
  .site-footer {
    width: calc(100% - 44px);
  }

  .hero {
    position: relative;
    z-index: 2;
    margin-top: 0;
    padding-top: 18svh;
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, #000 18%, #000 100%);
  }

  .hero-watermark {
    display: none;
  }

  .eyebrow,
  .section-number {
    font-size: 10.5px;
    line-height: 1.18;
    letter-spacing: 0.24em;
    margin-bottom: 28px;
  }

  h1,
  h2,
  h3 {
    letter-spacing: -0.052em;
    line-height: 0.96;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(44px, 12.9vw, 64px);
  }

  h2 {
    max-width: 100%;
    font-size: clamp(36px, 10.3vw, 54px);
  }

  h3 {
    max-width: 100%;
    font-size: clamp(31px, 8.7vw, 43px);
  }

  p {
    font-size: clamp(18px, 5vw, 22px);
    line-height: 1.58;
  }

  .lead-block,
  .body-copy,
  .contact-copy {
    max-width: 100%;
    margin-top: 34px;
  }

  .lead-block p + p,
  .body-copy p + p,
  .contact-copy p + p {
    margin-top: 14px;
  }

  .lead-block p:last-child {
    margin-top: 28px;
  }

  .button-primary,
  .button-secondary {
    min-height: 56px;
    width: 100%;
    padding: 0 22px;
    font-size: 11px;
    letter-spacing: 0.17em;
  }

  .hero .button-primary {
    margin-top: 44px;
  }

  .text-section {
    padding-top: 86px;
    padding-bottom: 86px;
  }

  .section-heading {
    margin-bottom: 52px;
  }

  .portfolio-grid {
    gap: 66px;
  }

  .portfolio-item,
  .portfolio-item:nth-child(even) {
    gap: 34px;
  }

  .portfolio-image-wrapper {
    aspect-ratio: 3 / 2;
  }

  .portfolio-copy p:last-child {
    margin-top: 24px;
  }

  .contact-section {
    padding-top: 88px;
    padding-bottom: 72px;
  }

  .contact-actions {
    display: grid;
    gap: 16px;
    margin-top: 46px;
  }

  .contact-actions .button-primary,
  .contact-actions .button-secondary {
    margin-top: 0;
  }

  .contact-actions .button-secondary {
    min-height: 50px;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.72);
    color: rgba(255, 255, 255, 0.86);
  }

  .social-icons {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    margin-top: 44px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    color: rgba(255, 255, 255, 0.58);
    font-size: 9.5px;
    line-height: 1.35;
    letter-spacing: 0.13em;
    text-transform: uppercase;
  }

  .social-icons::-webkit-scrollbar {
    display: none;
  }

  .social-icons a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .social-icons a + a::before {
    content: "·";
    display: inline-block;
    padding: 0 9px;
    color: rgba(255, 255, 255, 0.38);
  }

  .site-footer {
    margin-top: 0;
    padding: 32px 0 42px;
    text-align: left;
  }

  .site-footer p {
    font-size: 11px;
    line-height: 1.62;
  }

  .legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 10px;
  }
}

@media (max-width: 380px) {
  .site-nav {
    font-size: 10px;
    letter-spacing: 0.085em;
  }

  h1 {
    font-size: clamp(42px, 12.4vw, 58px);
  }

  h2 {
    font-size: clamp(34px, 10vw, 50px);
  }
}
