:root {
  --paper: #f5f2ec;
  --band: #ece7df;
  --ink: #30291d;
  --muted: #4a4332;
  --space-xs: 16px;
  --space-sm: 32px;
  --space-md: 64px;
  --space-lg: 96px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: var(--paper);
  z-index: 9;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.scrolled::before {
  opacity: 1;
}

body.scrolled .header-logo .logo-light {
  display: none;
}

body.scrolled .header-logo .logo-dark {
  display: block;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.header-logo {
  position: fixed;
  top: 28px;
  left: 48px;
  z-index: 10;
  display: block;
  width: 190px;
}

.header-logo img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease;
}

.header-logo .logo-dark {
  display: none;
}

.header-logo.on-light .logo-light {
  display: none;
}

.header-logo.on-light .logo-dark {
  display: block;
}

.header-studio-link {
  position: fixed;
  top: 38px;
  right: 120px;
  z-index: 10;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #aaa;
  transition: color 0.3s ease;
}

.header-studio-link:hover {
  color: var(--ink);
}

body:has(.menu-toggle.is-open) .header-studio-link {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-15px);
}

.menu-toggle {
  position: fixed;
  top: 32px;
  right: 58px;
  z-index: 12;
  width: 26px;
  height: 26px;
  border: 1.5px solid #1f1e1a;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-toggle::before,
.menu-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1px;
  background: #1f1e1a;
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-toggle::before { transform: translate(-50%, -50%) rotate(45deg); }
.menu-toggle::after  { transform: translate(-50%, -50%) rotate(-45deg); }

.menu-toggle.is-open {
  background: #1f1e1a;
  border-color: #1f1e1a;
  transform: scale(0.75);
}

.menu-toggle.is-open::before,
.menu-toggle.is-open::after {
  opacity: 1;
  background: var(--paper);
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 11;
  width: 260px;
  min-height: 100vh;
  padding: 80px 48px 50px;
  background: rgb(245 242 236 / 94%);
  pointer-events: none;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.side-menu.is-open {
  pointer-events: auto;
  transform: translateX(0);
}

.brand {
  display: block;
  width: 160px;
  margin-bottom: 66px;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.side-menu-links {
  display: grid;
  gap: 42px;
  padding-left: 28px;
}

.side-menu-links section {
  display: grid;
  gap: 10px;
}

.side-menu-links h2,
.side-menu-links span {
  width: max-content;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
}

.opening-gallery {
  display: grid;
  grid-template-columns: 50vw 1fr;
  gap: 154px;
  min-height: 100vh;
  padding: 0 149px 0 0;
  align-items: stretch;
}

.opening-gallery img,
.wide-pair img,
.gallery-strip img,
.editorial-grid img,
.variant-card img {
  display: block;
  object-fit: cover;
}

.opening-left {
  width: 100%;
  height: auto;
  align-self: start;
}

.opening-right {
  align-self: center;
  height: 750px;
  object-position: center;
  transform: scale(1.12) translateX(30px);
}

.product-description {
  display: grid;
  grid-template-columns: 220px minmax(560px, 860px) 300px;
  gap: 46px;
  padding: 150px 82px 60px 180px;
  align-items: start;
}

@font-face {
  font-family: "Baskervville";
  src: url("fonts/Baskervville-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

.description-title h1 {
  font-family: "Baskervville";
  font-size: 76px;
  font-weight: 400;
  line-height: 0.9;
}

.description-copy p {
  margin-bottom: 28px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.18;
  text-align: justify;
}

.description-copy .meta {
  margin-bottom: 28px;
  text-align: left;
}

.download-links {
  display: grid;
  gap: 34px;
  padding-top: 197px;
  padding-left: 40px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  line-height: 0.96;
}

.download-links a {
  width: max-content;
  border-bottom: 2px solid currentColor;
}

.variants-section {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  gap: 120px;
  padding: 5px 0 60px 0;
  align-content: start;
  align-items: stretch;
}

.variant-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  line-height: 1.2;
}

.variant-card img {
  object-fit: contain;
  margin-bottom: 22px;
  margin-top: auto;
}

/* dimensioni diverse */
.img-small {
  width: 400px;
  height: auto;
}

.img-large {
  width: 500px;
  height: auto;
}

@font-face {
  font-family: "HelveticaLight";
  src: url("fonts/Helvetica-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
}

.variant-card p {
  font-family: "HelveticaLight", Helvetica, Arial, sans-serif;
  font-size: 22px;
  font-weight: 50;
  letter-spacing: 0.02em;
  margin-bottom: 35px;
}

.purchase-line {
  display: flex;
  align-items: center;
  gap: 48px;
}

.purchase-line button {
  border: 0;
  background: transparent;
  color: #031021;
  cursor: pointer;
  font-family: "Inter", Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.arrow {
  position: relative;
  width: 84px;
  height: 1px;
  background: var(--ink);
}

.arrow::after {
  content: "";
  position: absolute;
  top: -4px;
  right: 0;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  transform: rotate(45deg);
}

.wide-pair {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 78px;
  padding: 0 164px 100px 0;
  background: var(--paper);
}

.wide-pair img:first-child {
  height: 882px;
  transform: none;
}

.wide-pair img:last-child {
  align-self: center;
  height: 634px;
  transform: none;
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  justify-content: center;
  gap: 78px;
  padding: 98px 0 80px 0;
  background: var(--band);
}

.gallery-strip img {
  width: 100%;
  height: auto;
}

.editorial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 88px;
  padding: 96px 84px 116px 389px;
}

.editorial-grid figure {
  margin: 0;
}

.editorial-grid img {
  height: 560px;
}

.editorial-wide {
  grid-column: span 2;
}

.editorial-wide img {
  height: 680px;
}

.site-footer {
  background: #d5cfc6;
  color: var(--ink);
  font-family: "HelveticaLight", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.footer-main {
  padding: 80px 80px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
}

.footer-title {
  font-family: "Inter", Arial, sans-serif;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--ink);
}

.footer-columns {
  display: flex;
  gap: 140px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 4px;
}

.footer-col a {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
  transition: opacity 0.2s;
}

.footer-col a:hover {
  opacity: 0.5;
}

.variant-card p a {
  border-bottom: 1px solid currentColor;
  transition: opacity 0.2s;
}

.variant-card p a:hover {
  opacity: 0.5;
}

.footer-divider {
  border: none;
  border-top: 1px solid var(--band);
  margin: 0 80px;
}

.footer-address {
  padding: 40px 80px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.footer-bottom {
  padding: 24px 80px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

@media (max-width: 1400px) {
  .opening-gallery {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 100px 20px 40px;
    min-height: auto;
    width: 100%;
  }

  .opening-right {
    height: auto;
    transform: none;
    width: 100%;
  }

  .opening-left {
    width: 100%;
    height: auto;
  }


  .product-description {
    grid-template-columns: 180px minmax(470px, 1fr) 260px;
    padding-left: 270px;
    margin-bottom: var(--space-lg);

  }

  .variants-section {
    margin-bottom: var(--space-lg);
  }

  .editorial-grid {
    padding-left: 270px;
  }

  .variants-section {
    padding-right: 86px;
    gap: 52px;
  }
}

@media (max-width: 1000px) {

  /* NAV */
  body::before {
    height: 56px;
  }

  .header-logo {
    top: 20px !important;
    transform: none !important;
    left: 16px !important;
    width: 110px !important;
  }

  .header-logo img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* mobile: mostra solo il logo nero */
  .header-logo .logo-light,
  .header-logo .logo-light.logo-light {
    display: none !important;
  }

  .header-logo .logo-dark,
  .header-logo .logo-dark.logo-dark {
    display: block !important;
  }

  .menu-toggle {
    top: 19px;
    right: 14px;
    width: 17px;
    height: 17px;
  }

  .header-studio-link {
    top: 20px;
    right: 40px;
  }

  .side-menu {
    width: 100%;
    padding: 90px 24px 40px;
  }

  section {
    margin-bottom: var(--space-md);
  }

  /* LAYOUT GENERALE */
  .opening-gallery,
  .product-description,
  .variants-section,
  .gallery-strip,
  .editorial-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 20px;
  }

  .wide-pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 20px;
    margin-top: 60px;
  }

  /* HERO */
  .opening-gallery {
    min-height: auto;
    height: auto;
    padding-top: 100px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
  }

  .opening-right {
    height: auto;
    transform: none;
  }

  /* TITOLO PRODOTTO */
  .product-description {
    padding-top: 60px;
  }

  .description-title h1 {
    font-size: 44px;
  }

  .description-copy p {
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
  }

  .site-content {
    position: relative;
    z-index: 1;
    overflow-x: hidden;
  }

  /* DOWNLOAD */
  .download-links {
    padding: 20px 0 0;
    font-size: 22px;
  }

  /* VARIANTI */
  .variants-section {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px 20px 20px;
    gap: 60px;
  }

  .img-small {
    width: 100%;
    max-width: 280px;
    height: auto;
  }

  .img-large {
    width: 100%;
    max-width: 500px;
    height: auto;
  }


  .variant-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    overflow: visible;
  }

  .variant-card img:not(.img-large) {
    width: 100%;
    max-width: 260px;
    height: auto;
  }

  .variant-card p {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    margin: 0;
    opacity: 1;
    visibility: visible;
  }

  /* IMMAGINI GRANDI */
  .wide-pair img,
  .wide-pair img:first-child,
  .wide-pair img:last-child {
    width: 100%;
    height: auto !important;
    transform: none;
  }


  .gallery-strip img,
  .editorial-grid img {
    width: 100%;
    height: auto;
    transform: none;
  }

  .gallery-strip {
    grid-template-columns: 1fr;
  }

  /* Fix grid overflow su mobile (Chrome/Firefox: min-width: auto di default) */
  .opening-gallery > *,
  .wide-pair > *,
  .gallery-strip > * {
    min-width: 0;
  }

  .opening-gallery img,
  .wide-pair img,
  .gallery-strip img {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-width: 0;
  }

  .opening-gallery {
    align-items: start;
  }

  .opening-right {
    align-self: auto;
  }

  /* FOOTER */
  .site-footer,
  .site-footer * {
    text-align: center !important;
  }

  .site-footer {
    width: 100%;
    box-sizing: border-box;
  }

  .footer-main {
    width: 100%;
    padding: 50px 20px 36px;
    gap: 36px;
    align-items: center;
  }

  .footer-columns {
    width: 100%;
    gap: 32px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-col {
    gap: 8px;
    align-items: center;
    min-width: 120px;
  }

  .footer-divider {
    margin: 0 20px;
  }

  .footer-address {
    padding: 28px 20px;
  }

  .footer-bottom {
    padding: 18px 20px;
  }
}