#s03 { padding-top: 0; background: var(--bg); }
#s03 .s03-viewport { position: relative; overflow: hidden; }
#s03 .s03-track { width: 100%; }
#s03 .s03-panel { position: relative; min-width: 0; }
#s03 .s03-panel + .s03-panel { margin-top: 36px; }
#s03 .s03-heading { max-width: 880px; padding: clamp(80px, 12vh, 140px) var(--gutter) 0; margin: 0 auto 48px; }
#s03 .s03-main-figure { position: relative; margin: 0; }
#s03 .s03-media { position: relative; overflow: hidden; background: var(--bg-2); }
#s03 .s03-media img { width: 100%; height: auto; }
#s03 .s03-main-figure > .caption { display: flex; gap: 18px; align-items: baseline; margin: 0; padding: 16px var(--gutter) 0; }
#s03 .s03-view-number { flex-shrink: 0; color: var(--bronze-soft); font-size: 10px; letter-spacing: 0.14em; }
#s03 .s03-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: clamp(64px, 10vh, 120px); }
#s03 .s03-detail { min-width: 0; margin: 0; }
#s03 .s03-detail-media { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
#s03 .s03-detail-media img { width: 100%; height: auto; }
#s03 .s03-detail .caption { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
/* Every rendering carries a banner in its bottom 6% of height: keep the badge above it. */
#s03 .s03-media .ai-badge,
#s03 .s03-detail-media .ai-badge { bottom: calc(6.5% + 8px); }

/* "Residenza Bramante" marker, anchored to image coordinates (--x, --y as fractions of the picture).
   --s is the on-screen size of one image pixel: here the frame shows the whole picture,
   in the pinned gallery it is the object-fit: cover scale (see the media query below). */
#s03 .s03-frame { position: relative; container-type: inline-size; }
#s03 .s03-pin {
  --s: calc(100cqw / var(--iw));
  position: absolute;
  z-index: 3;
  left: calc(50% + (var(--x) - 0.5) * var(--iw) * var(--s));
  top: calc(50% + (var(--y) - 0.5) * var(--ih) * var(--s));
  width: 0;
  height: 0;
  pointer-events: none;
}
#s03 .s03-pin-sud-est { --iw: 2048; --ih: 1152; --x: 0.48; --y: 0.4; --rise: 0.15; }
#s03 .s03-pin-sud-ovest { --iw: 2048; --ih: 1152; --x: 0.52; --y: 0.4; --rise: 0.16; }
#s03 .s03-pin-quartiere { --iw: 2016; --ih: 1344; --x: 0.497; --y: 0.488; --rise: 0.065; }
#s03 .s03-pin-dot {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--bronze);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
#s03 .s03-pin-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--bronze);
  opacity: 0;
}
#s03 .s03-pin.is-live .s03-pin-dot::after { animation: s03-pulse 2.4s cubic-bezier(0.2, 0.6, 0.35, 1) infinite; }
#s03 .s03-pin-line {
  position: absolute;
  left: -0.5px;
  bottom: 9px;
  width: 1px;
  height: calc(var(--rise) * var(--ih) * var(--s));
  background: rgba(255, 248, 239, 0.85);
  transform-origin: 50% 100%;
}
#s03 .s03-pin-label {
  position: absolute;
  left: 0;
  bottom: calc(var(--rise) * var(--ih) * var(--s) + 9px);
  padding: 6px 12px;
  border: 1px solid rgba(241, 231, 214, 0.22);
  border-radius: 2px;
  background: rgba(20, 16, 12, 0.88);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
  translate: -50% 0;
}

@keyframes s03-pulse {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.2); }
}

@media (min-width: 1024px) and (min-height: 600px) and (min-aspect-ratio: 4/3) and (prefers-reduced-motion: no-preference) {
  #s03.s03-motion .s03-viewport { height: 100vh; height: 100svh; }
  #s03.s03-motion .s03-track { display: flex; height: 100%; }
  #s03.s03-motion .s03-panel { flex: 0 0 100%; height: 100%; margin: 0; overflow: hidden; }
  #s03.s03-motion .s03-main-figure { height: 100%; }
  #s03.s03-motion .s03-media { height: 100%; }
  #s03.s03-motion .s03-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
  #s03.s03-motion .s03-frame { position: absolute; inset: 0; container-type: size; }
  #s03.s03-motion .s03-pin { --s: max(100cqw / var(--iw), 100cqh / var(--ih)); }
  #s03.s03-motion .s03-heading {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    /* The building starts at ~32% of the frame: the text column stays left of it at every desktop size. */
    width: min(30vw, 460px);
    margin: 0;
    padding: clamp(34px, 7vh, 84px) clamp(18px, 2vw, 32px) 70px var(--gutter);
    pointer-events: none;
  }
  #s03.s03-motion .s03-opening::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0 60% 0 0;
    background: linear-gradient(90deg, rgba(20, 16, 12, 0.92), rgba(20, 16, 12, 0.72) 62%, transparent);
    pointer-events: none;
  }
  #s03.s03-motion .mod-title { font-size: clamp(30px, 3.2vw, 50px); line-height: 1.05; }
  #s03.s03-motion .mod-lead { font-size: clamp(14px, 1.12vw, 17px); line-height: 1.6; margin-top: 18px; }
  #s03.s03-motion .s03-main-figure > .caption {
    position: absolute;
    z-index: 4;
    right: var(--gutter);
    /* Just above the banner baked into the bottom 6% of each rendering. */
    bottom: calc(6.5% + 8px);
    padding: 10px 16px;
    border: 1px solid rgba(241, 231, 214, 0.2);
    background: rgba(20, 16, 12, 0.86);
    color: var(--ink);
  }
  #s03.s03-motion .s03-main-figure .ai-badge { z-index: 4; left: var(--gutter); bottom: calc(6.5% + 17px); }
}

@media (max-width: 767px) {
  #s03 .s03-details { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  #s03 .s03-main-figure > .caption { font-size: 12px; gap: 12px; }
  #s03 .s03-pin-label { padding: 4px 9px; font-size: 11px; }
  #s03 .s03-pin-dot { left: -6px; top: -6px; width: 12px; height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #s03 .s03-pin.is-live .s03-pin-dot::after { animation: none; }
}
