/* La nostra storia: a photographic journey from 1979 to today.
   Archive photos emerge from the anthracite through radial fades; colour returns gradually towards the present. */
.history { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.history h2 { font-size: clamp(3.4rem, 8vw, 7.4rem); line-height: .92; margin: 0 0 18px; }
.history-lead { max-width: 560px; color: var(--text-secondary); font-size: 1.05rem; line-height: 1.85; margin: 0; }
.history-subtitle { margin: 0 0 30px; font-size: .8125rem; letter-spacing: .3em; color: #f1f1ee; }

/* Opening: a wide black-and-white photograph that slowly settles. */
.history-intro { position: relative; isolation: isolate; min-height: min(92svh, 860px); display: flex; align-items: flex-end; padding: clamp(120px, 14vw, 200px) 0 clamp(70px, 9vw, 120px); }
.history-intro-photo, .history-present-photo { position: absolute; inset: 0; z-index: -1; overflow: hidden; transform: translate3d(0, var(--parallax, 0px), 0); }
.history-intro-photo img, .history-present-photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.09); transition: transform 18s cubic-bezier(.2, .6, .2, 1), opacity 1.8s ease, filter 3.5s ease; opacity: 0; }
.history-intro-photo img { filter: grayscale(1) contrast(1.08) brightness(.78); }
.history-intro.is-visible .history-intro-photo img, .history-present.is-visible .history-present-photo img { opacity: 1; transform: scale(1); }
.history-intro-photo::after, .history-present-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--site-bg) 0%, rgb(var(--site-bg-rgb) / 35%) 22%, rgb(var(--site-bg-rgb) / 20%) 45%, rgb(var(--site-bg-rgb) / 75%) 78%, var(--site-bg) 100%),
    linear-gradient(to right, rgb(var(--site-bg-rgb) / 85%) 0%, rgb(var(--site-bg-rgb) / 35%) 50%, transparent 80%);
}
.history-intro-copy > * { opacity: 0; transform: translateY(26px); transition: opacity 1.2s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.history-intro.is-visible .history-intro-copy > * { opacity: 1; transform: none; }
.history-intro.is-visible .history-intro-copy > :nth-child(2) { transition-delay: .15s; }
.history-intro.is-visible .history-intro-copy > :nth-child(3) { transition-delay: .3s; }
.history-intro.is-visible .history-intro-copy > :nth-child(4) { transition-delay: .45s; }

/* Timeline: a hairline that draws itself while scrolling, photos alternating left and right. */
.history-timeline { position: relative; padding: clamp(60px, 8vw, 110px) 0 clamp(40px, 6vw, 80px); }
.history-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); }
.history-line span { position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(227 38 48 / 0%), #e32630 12%, rgb(227 38 48 / 55%)); transform-origin: top; transform: scaleY(var(--history-progress, 0)); }
.history-step { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(50px, 9vw, 150px); align-items: center; margin-bottom: clamp(110px, 14vw, 200px); }
.history-step:last-of-type { margin-bottom: 0; }
.history-step.right .history-photo { order: 2; }
.history-step.right .history-copy { text-align: right; justify-self: end; }
.history-step.right .history-copy p:not(.history-year) { margin-left: auto; }
.history-photo { position: relative; margin: 0; justify-self: center; width: min(420px, 100%); aspect-ratio: 1; transform: translate3d(0, var(--parallax, 0px), 0); }
.history-photo > img:first-child {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(closest-side, #000 46%, rgb(0 0 0 / 55%) 72%, rgb(0 0 0 / 15%) 86%, transparent 93%);
  mask-image: radial-gradient(closest-side, #000 46%, rgb(0 0 0 / 55%) 72%, rgb(0 0 0 / 15%) 86%, transparent 93%);
  transform: scale(1.04);
  transition: transform 9s cubic-bezier(.2, .6, .2, 1);
}
.history-step.is-visible .history-photo > img:first-child { transform: scale(1); }
/* Some photographs also dissolve, much larger and fainter, into the background. */
.history-ghost { position: absolute; z-index: 0; inset: -45%; width: 190%; height: 190%; max-width: none; object-fit: cover; opacity: 0; filter: grayscale(1) brightness(.7); -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%); mask-image: radial-gradient(closest-side, #000 20%, transparent 100%); transition: opacity 2.4s ease; pointer-events: none; }
.history-step:nth-of-type(odd).is-visible .history-ghost { opacity: .1; }
.history-photo figcaption { position: absolute; z-index: 2; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; font-size: .625rem; letter-spacing: .3em; color: var(--text-muted); }
/* From black and white to colour as the years go by. */
.era-0 > img:first-child, .era-1 > img:first-child, .era-2 > img:first-child { filter: grayscale(1) sepia(.18) contrast(1.05); }
.era-3 > img:first-child { filter: grayscale(1) contrast(1.05); }
.era-4 > img:first-child { filter: grayscale(.7); }
.era-5 > img:first-child { filter: grayscale(.4); }
.era-6 > img:first-child { filter: grayscale(.2) brightness(.82); }
.era-7 > img:first-child { filter: none; }
.history-copy { max-width: 470px; }
.history-year { margin: 0 0 6px; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: clamp(5rem, 11vw, 9.6rem); font-weight: 500; line-height: .85; letter-spacing: .01em; color: #f1f1ee; opacity: 0; transform: translateX(-34px); transition: opacity 1.4s ease, transform 1.4s cubic-bezier(.2, .7, .2, 1); }
.history-step.right .history-year { transform: translateX(34px); }
.history-step.is-visible .history-year { opacity: .92; transform: none; }
.history-copy h3 { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; font-size: clamp(1.2rem, 1.7vw, 1.5rem); letter-spacing: .16em; }
.history-step.right .history-copy h3 { justify-content: flex-end; }
.history-copy h3::before { content: ''; width: 34px; height: 2px; background: #e32630; flex-shrink: 0; }
.history-step.right .history-copy h3::before { order: 2; }
.history-copy p:not(.history-year) { margin: 0; max-width: 430px; color: var(--text-muted); line-height: 1.85; }

/* Present: the modern showroom slowly regains its colours. */
.history-present { position: relative; isolation: isolate; min-height: min(90svh, 820px); display: flex; align-items: flex-end; padding: clamp(140px, 16vw, 220px) 0 clamp(80px, 10vw, 130px); }
.history-present-photo img { filter: grayscale(1) brightness(.8); }
.history-present.is-visible .history-present-photo img { filter: grayscale(0) brightness(.9); }
.history-present-copy .history-lead { margin-bottom: 18px; }
.history-quote { max-width: 560px; margin: 0 0 34px; font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif; font-size: clamp(1.3rem, 2vw, 1.7rem); font-weight: 300; line-height: 1.45; color: #e8e8e5; }
.about-history-link { margin-left: 26px; }

@media (max-width: 1000px) {
  .history-line { left: 8px; }
  .history-step, .history-step.right { grid-template-columns: 1fr; gap: 30px; padding-left: 34px; }
  .history-step.right .history-photo { order: 0; }
  .history-step.right .history-copy { text-align: left; justify-self: start; }
  .history-step.right .history-copy p:not(.history-year) { margin-left: 0; }
  .history-step.right .history-copy h3 { justify-content: flex-start; }
  .history-step.right .history-copy h3::before { order: 0; }
  .history-photo { justify-self: start; width: min(340px, 100%); transform: none; }
  .history-step:not(.is-visible) .history-year, .history-step.right:not(.is-visible) .history-year { transform: translateY(20px); }
}
@media (max-width: 700px) {
  .history h2 { font-size: clamp(3rem, 15vw, 4.2rem); }
  .history-intro, .history-present { min-height: 0; padding-top: 200px; }
  .history-intro-photo, .history-present-photo { transform: none; }
  .history-intro-photo::after, .history-present-photo::after { background: linear-gradient(to bottom, var(--site-bg) 0%, rgb(var(--site-bg-rgb) / 25%) 25%, rgb(var(--site-bg-rgb) / 70%) 60%, var(--site-bg) 92%); }
  .history-step, .history-step.right { padding-left: 26px; margin-bottom: 90px; }
  .history-photo { width: min(280px, 100%); }
  .history-year { font-size: 4.6rem; }
  .history-step:nth-of-type(odd).is-visible .history-ghost { opacity: .06; }
  .about-history-link { margin-left: 0; margin-top: 10px; display: table; }
}
@media (prefers-reduced-motion: reduce) {
  .history-intro-photo, .history-present-photo, .history-photo { transform: none !important; }
  .history-intro-photo img, .history-present-photo img, .history-photo > img:first-child, .history-intro-copy > *, .history-year { transition: none !important; transform: none !important; opacity: 1; }
  .history-ghost { transition: none; }
  .history-step:nth-of-type(odd) .history-ghost { opacity: .1; }
  .history-present-photo img { filter: grayscale(0) brightness(.9); }
  .history-line span { transform: none; }
}
