/* ==========================================================================
   arXte — "Carteggio" · base.css (Shell styles)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset & Global Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: auto; /* Lenis handles smooth scrolling */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.preloader-active {
  overflow: hidden;
}

/* `hidden` always wins over a component's display rule (forms, confirmations, JS-only controls) */
[hidden] {
  display: none !important;
}

/* Accessible focus styling */
:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* Targets that only receive focus programmatically (skip link, in-page anchors, confirmations) */
main:focus,
section[tabindex="-1"]:focus,
.envelope-confirmation:focus {
  outline: none;
}

/* Native in-page jumps (reduced motion, no Lenis) clear the fixed header, like Lenis' offset */
main section[id] {
  scroll-margin-top: 50px;
}

/* Skip link: off-screen until it receives keyboard focus */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10001;
  padding: 0.75rem 1.1rem;
  background-color: var(--ink);
  color: var(--paper);
  border-radius: 2px;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease-out);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--wax);
  outline-offset: 2px;
}

/* Elegant selection */
::selection {
  background-color: var(--wax);
  color: var(--paper);
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   2. Layout & Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  position: relative;
  padding: clamp(60px, 9vw, 130px) 0;
}

.section-num-label {
  display: block;
  margin-bottom: 1.25rem;
}

.section-header {
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-title {
  font-size: var(--fs-h2);
  line-height: 0.95;
  margin-bottom: 1.25rem;
}

.section-intro {
  font-size: clamp(1.15rem, 1.4vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 48ch;
}

.text-right {
  text-align: right;
}

.brand-x {
  color: var(--wax);
  font-style: italic;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Subtle viewport vignette */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 85;
  box-shadow: inset 0 0 130px rgba(40, 30, 15, 0.11);
}

/* Fallback card for missing or loading components */
.component-fallback {
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--hairline-strong);
  background: rgba(233, 225, 209, 0.45);
  margin: 20px 0;
  border-radius: 4px;
}

.component-fallback em {
  font-family: var(--font-text);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   3. Custom Cursor (Desktop fine-pointer only)
   -------------------------------------------------------------------------- */
@media (pointer: fine) {
  body {
    cursor: default;
  }

  .artxe-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 99999;
    will-change: transform;
  }

  .cursor-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    background: var(--ink);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s;
  }

  .cursor-ring {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 1px solid var(--hairline-strong);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), border-color 0.3s, background-color 0.3s;
  }

  .artxe-cursor.cursor-hover .cursor-ring {
    width: 54px;
    height: 54px;
    border-color: var(--wax);
    background-color: rgba(142, 27, 27, 0.04);
  }

  .cursor-label {
    position: absolute;
    left: 28px;
    top: -12px;
    font-family: var(--font-text);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--ink);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    text-shadow: 0 1px 2px var(--paper);
  }

  .artxe-cursor.has-label .cursor-label {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (pointer: coarse), (hover: none) {
  .artxe-cursor {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   4. Il filo della provenienza (Continuous Gold Thread & Eyelets)
   -------------------------------------------------------------------------- */
.gold-thread-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
  overflow: visible;
}

.eyelet {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 1px 2px rgba(28, 26, 22, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.6);
  z-index: 20;
  pointer-events: none;
}

.eyelet--ivory {
  background: var(--paper-2);
  border-color: rgba(242, 236, 224, 0.4);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Section margin eyelet placements */
[data-eyelet="hero-in"] { right: clamp(20px, 3.5vw, 60px); top: 220px; }
[data-eyelet="hero-out"] { right: clamp(20px, 3.5vw, 60px); top: 310px; }

[data-eyelet="man-in"] { right: clamp(20px, 3.5vw, 60px); top: 60px; }
[data-eyelet="man-out"] { right: clamp(20px, 3.5vw, 60px); top: 140px; }

[data-eyelet="par-in"] { right: clamp(20px, 3.5vw, 60px); top: 80px; }
[data-eyelet="par-out"] { right: clamp(20px, 3.5vw, 60px); top: 160px; }

[data-eyelet="cart-in"] { right: clamp(20px, 3.5vw, 60px); top: 90px; }
[data-eyelet="cart-out"] { right: clamp(20px, 3.5vw, 60px); top: 180px; }

[data-eyelet="len-in"] { right: clamp(20px, 3.5vw, 60px); top: 90px; }
[data-eyelet="len-out"] { right: clamp(20px, 3.5vw, 60px); top: 180px; }

[data-eyelet="bil-in"] { right: clamp(20px, 3.5vw, 60px); top: 90px; }
[data-eyelet="bil-out"] { right: clamp(20px, 3.5vw, 60px); top: 180px; }

[data-eyelet="reg-in"] { right: clamp(20px, 3.5vw, 60px); top: 90px; }
[data-eyelet="reg-out"] { right: clamp(20px, 3.5vw, 60px); top: 180px; }

[data-eyelet="cat-in"] { right: clamp(20px, 3.5vw, 60px); top: 90px; }
[data-eyelet="cat-out"] { right: clamp(20px, 3.5vw, 60px); top: 180px; }

[data-eyelet="inv-in"] { right: clamp(20px, 3.5vw, 60px); top: 90px; }
[data-eyelet="inv-out"] { right: clamp(20px, 3.5vw, 60px); top: 180px; }

[data-eyelet="cta-in"] { left: calc(50% - 140px); top: 52px; }
[data-eyelet="cta-out"] { left: calc(50% - 90px); top: 52px; }

@media (max-width: 699px) {
  .gold-thread-svg,
  .eyelet {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   5. Preloader (#preloader)
   -------------------------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  overflow: hidden;
  background-color: transparent;
  /* Failsafe: if main.js never runs (a module missing, blocked or with the wrong MIME type),
     the preloader still lifts. JS normally removes it long before; nothing applies during the delay. */
  animation: preloader-failsafe 0.6s ease 8s forwards;
}

@keyframes preloader-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.preloader-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  height: 100%;
  backface-visibility: hidden;
  box-shadow: 0 0 35px rgba(28, 26, 22, 0.18);
  z-index: 1;
}

.preloader-panel--left {
  left: 0;
  transform-origin: left center;
  border-right: 1px solid var(--hairline);
}

.preloader-panel--right {
  right: 0;
  transform-origin: right center;
  border-left: 1px solid var(--hairline);
}

.preloader-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  pointer-events: none;
}

.preloader-seal-mount {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-sub {
  color: var(--ink-soft);
  letter-spacing: 0.22em;
}

.preloader-counter {
  position: absolute;
  bottom: clamp(24px, 4vw, 48px);
  right: clamp(24px, 4vw, 56px);
  z-index: 2;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

/* --------------------------------------------------------------------------
   6. Header (#header)
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 900;
  border-bottom: 1px solid var(--hairline);
  transition: transform 0.4s var(--ease-out);
  background-color: var(--paper);
}

.site-header.header--hidden {
  transform: translateY(-100%);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.15rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-left .brand {
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.header-center {
  flex: 1;
  text-align: center;
  color: var(--ink-soft);
}

@media (max-width: 1099px) {
  .header-center {
    display: none;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--ink);
  transition: color 0.25s, opacity 0.25s;
}

.nav-link:hover {
  color: var(--wax);
}

.btn-invito {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  color: var(--wax);
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
  white-space: nowrap;
}

.btn-invito:hover {
  border-color: var(--wax);
  background-color: rgba(142, 27, 27, 0.04);
}

.btn-menu {
  display: none;
  font-size: var(--fs-label);
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
}

@media (max-width: 860px) {
  .header-nav,
  .btn-invito {
    display: none;
  }
  .btn-menu {
    display: inline-block;
  }
}

/* Mobile Full-Screen Paper Sheet */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem var(--gutter) 2.5rem;
  background-color: var(--paper);
  transform: translateY(-100%);
  /* closed: also invisible (out of the tab order even where `inert` is unsupported), after the slide */
  visibility: hidden;
  transition: transform 0.5s var(--ease-in-out), visibility 0s linear 0.5s;
  pointer-events: none;
}

.mobile-nav.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.5s var(--ease-in-out), visibility 0s;
  pointer-events: auto;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.mobile-nav-header .brand {
  font-size: 2rem;
}

.btn-close-menu {
  color: var(--wax);
  padding: 0.5rem;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: auto 0;
}

.mobile-link {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  line-height: 1.1;
  color: var(--ink);
  transition: color 0.2s, transform 0.2s;
}

.mobile-link:hover {
  color: var(--wax);
  transform: translateX(8px);
}

.mobile-nav-footer {
  color: var(--ink-soft);
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}

/* --------------------------------------------------------------------------
   7. Hero Section (#hero)
   -------------------------------------------------------------------------- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(100px, 12vh, 150px) 0 clamp(60px, 8vh, 100px);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: center;
  width: 100%;
}

.hero-text-col {
  grid-column: 1 / span 7;
}

.hero-art-col {
  grid-column: 8 / span 5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hero-tag {
  margin-bottom: 1.5rem;
  color: var(--ink-soft);
}

.hero-headline {
  font-size: var(--fs-hero);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.hero-paragraph {
  max-width: 34ch;
  font-size: clamp(1.15rem, 1.3vw, 1.35rem);
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 2.75rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.85rem;
  background-color: var(--wax);
  color: var(--paper);
  border-radius: 2px;
  box-shadow: 0 4px 14px rgba(142, 27, 27, 0.28);
  transition: background-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.btn-primary:hover {
  background-color: var(--wax-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(142, 27, 27, 0.35);
}

.link-scopri {
  color: var(--ink);
  transition: color 0.25s, transform 0.25s;
  display: inline-flex;
  align-items: center;
}

.link-scopri:hover {
  color: var(--wax);
  transform: translateX(4px);
}

/* Fiction disclaimer: discreet, but in the first screen (right under the tag line) */
.hero-tag:has(+ .hero-disclaimer) {
  margin-bottom: 0.55rem;
}

.hero-disclaimer {
  margin-bottom: 1.6rem;
  line-height: 1.7;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.hero-disclaimer::before {
  content: '';
  display: inline-block;
  width: 1.6rem;
  height: 1px;
  margin-right: 0.7rem;
  vertical-align: middle;
  background-color: var(--wax);
}

/* Pause controls for auto-advancing content (hero paintings, ledger) — shown by main.js */
.hero-art-controls {
  display: flex;
  justify-content: flex-end;
}

.hero-pause,
.ledger-pause {
  padding: 0.5rem 0 0.3rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline-strong);
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s;
}

.hero-pause {
  margin-top: 0.6rem;
}

.hero-pause:hover,
.ledger-pause:hover {
  color: var(--wax);
  border-bottom-color: var(--wax);
}

.raking-mount {
  width: 100%;
  aspect-ratio: 4 / 5;
  position: relative;
  background: rgba(28, 26, 22, 0.03);
  border-radius: 3px;
  overflow: hidden;
}

/* Museum Wall Label (.cartel) */
.cartel {
  margin-top: 1.25rem;
  padding: 1.25rem 1.4rem;
  background-color: var(--paper-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  box-shadow: var(--shadow-paper);
  max-width: 440px;
}

.cartel-header {
  margin-bottom: 0.65rem;
}

.cartel-artist {
  margin-bottom: 0.2rem;
  color: var(--ink-soft);
}

.cartel-title-row {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
}

.cartel-rule {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 0.75rem 0;
}

.cartel-provenance-box {
  margin-bottom: 0.85rem;
}

.cartel-prov-label {
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
  color: var(--ink-soft); /* --ink-faint is for hairlines only: 2.5:1 fails at this size */
}

.cartel-prov-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cartel-prov-line {
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--ink);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.7s var(--ease-out);
}

.cartel-prov-line.is-revealed {
  clip-path: inset(0 0 0 0);
}

.cartel-lei-line {
  font-size: 1.25rem;
  line-height: 1.2;
  margin-top: 0.35rem;
  color: var(--wax);
  display: flex;
  align-items: center;
}

.cartel-ink-caret {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background-color: var(--ink);
  margin-left: 3px;
  animation: inkCaretBlink 1s infinite steps(2, start);
}

@keyframes inkCaretBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cartel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--hairline);
  font-size: var(--fs-label);
}

.cartel-owner-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cartel-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
}

.cartel-owner {
  color: var(--ink);
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-text-col,
  .hero-art-col {
    grid-column: 1 / -1;
  }
  .hero-art-col {
    max-width: 480px;
    margin: 0 auto;
  }
}

/* --------------------------------------------------------------------------
   8. Manifesto Section (#manifesto)
   -------------------------------------------------------------------------- */
.manifesto-section {
  padding: clamp(90px, 13vw, 180px) 0;
  position: relative;
}

.manifesto-container {
  max-width: 920px;
}

.manifesto-text {
  font-size: clamp(1.8rem, 3.4vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-bottom: 2rem;
  text-wrap: balance;
}

.drop-cap {
  float: left;
  font-family: var(--font-display);
  font-size: clamp(5.4rem, 10vw, 9.5rem);
  line-height: 0.72;
  padding-right: 0.12em;
  padding-top: 0.06em;
  color: var(--wax);
  font-weight: 400;
}

.manifesto-signature {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  text-align: right;
  color: var(--ink);
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   9. Component Sections (Parete, Carteggio, Bilancia)
   -------------------------------------------------------------------------- */
.wall-mount {
  min-height: 380px;
  position: relative;
}

.carteggio-mount {
  min-height: 600px;
  position: relative;
}

.scale-mount {
  min-height: 480px;
  position: relative;
}

/* --------------------------------------------------------------------------
   10. La lente (#lente) — Dark Section (--night, ivory text)
   -------------------------------------------------------------------------- */
.lente-section {
  background-color: var(--night);
  color: var(--paper);
  padding: clamp(90px, 12vw, 160px) 0;
  position: relative;
}

.deckled-edge {
  position: absolute;
  left: 0;
  width: 100%;
  height: 24px;
  overflow: hidden;
  z-index: 10;
}

.deckled-edge svg {
  display: block;
  width: 100%;
  height: 100%;
}

.deckled-edge--top {
  top: 0;
}

.deckled-edge--bottom {
  bottom: 0;
}

.text-ivory {
  color: var(--paper) !important;
}

.text-ivory-soft {
  color: rgba(242, 236, 224, 0.72) !important;
}

.loupe-mount {
  min-height: 520px;
  position: relative;
}

/* --------------------------------------------------------------------------
   11. Il registro (#registro)
   -------------------------------------------------------------------------- */
.registro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4.5vw, 4.5rem);
  align-items: center;
}

.registro-globe-col {
  display: flex;
  justify-content: center;
}

.globe-mount {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1;
  position: relative;
  background: radial-gradient(circle at center, rgba(233, 225, 209, 0.45) 0%, transparent 68%);
  border-radius: 50%;
}

/* Engraved Globe Fallback */
.globe-fallback-engraved {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.globe-fallback-svg {
  width: 90%;
  height: 90%;
  stroke: var(--hairline-strong);
  fill: none;
}

/* Account Book Ledger */
.registro-ledger-col {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.ledger-card {
  background-color: var(--paper-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 3px;
  box-shadow: var(--shadow-paper);
  padding: 1.5rem 1.6rem;
  position: relative;
  overflow: hidden;
  background-image: repeating-linear-gradient(0deg, rgba(28, 26, 22, 0.055) 0px, rgba(28, 26, 22, 0.055) 1px, transparent 1px, transparent 38px);
}

/* Red double margin line on the left like old account books */
.ledger-card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 64px;
  width: 1px;
  background-color: rgba(142, 27, 27, 0.38);
  box-shadow: 4px 0 0 0 rgba(142, 27, 27, 0.38);
}

.ledger-header {
  /* sits above the red margin rule of .ledger-card::before, so the rule never crosses the title or the pause button */
  position: relative;
  z-index: 1;
  background-color: var(--paper-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--hairline-strong);
}

.ledger-title {
  color: var(--ink-soft);
  letter-spacing: 0.18em;
}

.ledger-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 270px;
}

.ledger-row {
  display: grid;
  grid-template-columns: 46px 26px 1fr;
  align-items: center;
  gap: 0.75rem;
  height: 38px;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--ink);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.ledger-time {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.ledger-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
}

.ledger-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-text b {
  font-weight: 600;
}

.ledger-text i {
  font-style: italic;
}

.ledger-deal-highlight {
  color: var(--wax);
  font-weight: 600;
}

/* Metrics figures */
.registro-figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.figure-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.figure-num {
  font-size: clamp(1.8rem, 2.8vw, 2.8rem);
  line-height: 1;
  color: var(--ink);
}

.figure-label {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .registro-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   12. Il catalogo (#catalogo)
   -------------------------------------------------------------------------- */
.catalogo-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  position: relative;
}

.catalogo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.catalogo-header-row th {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
  white-space: nowrap;
}

.catalogo-row {
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background-color 0.25s;
}

.catalogo-row:hover {
  background-color: rgba(233, 225, 209, 0.4);
}

.catalogo-row td {
  padding: 1.15rem 1rem;
  vertical-align: middle;
  transition: transform 0.3s var(--ease-out);
}

.catalogo-row:hover td {
  transform: translateX(12px);
}

.catalogo-col-lotto {
  font-size: 1.15rem;
  color: var(--ink-soft);
  width: 70px;
}

.catalogo-col-artist {
  width: 180px;
}

.catalogo-col-title {
  font-size: 1.15rem;
  font-style: italic;
}

.catalogo-col-year {
  color: var(--ink-soft);
  width: 80px;
}

.catalogo-col-custode {
  width: 180px;
}

.catalogo-custode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  transition: background-color 0.2s, color 0.2s;
}

.catalogo-custode-btn:hover {
  background-color: rgba(142, 27, 27, 0.08);
  color: var(--wax);
}

.catalogo-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
}

.catalogo-col-status {
  width: 140px;
}

.catalogo-col-price {
  font-size: 1.15rem;
  white-space: nowrap;
  width: 140px;
}

/* Floating cursor image preview */
.catalogo-floating-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  pointer-events: none;
  z-index: 500;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  box-shadow: var(--shadow-lift);
  border: 4px solid var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
  background-color: var(--paper-3);
}

.catalogo-floating-preview.is-visible {
  opacity: 1;
  transform: scale(1);
}

.catalogo-floating-preview img {
  width: 100%;
  height: auto;
  display: block;
}

/* Mobile catalogue layout */
.catalogo-thumb-mobile {
  display: none;
}

@media (max-width: 768px) {
  .catalogo-floating-preview {
    display: none !important;
  }

  .catalogo-table thead {
    display: none;
  }

  .catalogo-table,
  .catalogo-table tbody,
  .catalogo-row {
    display: block;
  }

  .catalogo-row {
    padding: 1rem 0;
    position: relative;
  }

  .catalogo-row:hover td {
    transform: none;
  }

  .catalogo-row td {
    display: block;
    padding: 0.15rem 0;
    width: 100% !important;
  }

  .catalogo-col-lotto {
    font-size: 0.95rem;
    display: inline-block !important;
    width: auto !important;
    margin-right: 0.5rem;
  }

  .catalogo-col-artist {
    display: inline-block !important;
    width: auto !important;
  }

  .catalogo-col-title {
    font-size: 1.2rem;
    margin: 0.2rem 0;
  }

  .catalogo-col-year {
    display: inline-block !important;
    width: auto !important;
    margin-right: 1rem;
  }

  .catalogo-col-custode {
    display: inline-block !important;
    width: auto !important;
    margin-right: 1rem;
  }

  .catalogo-col-status {
    display: inline-block !important;
    width: auto !important;
    margin-right: 1rem;
  }

  .catalogo-col-price {
    display: block !important;
    text-align: left !important;
    font-size: 1.25rem;
    margin-top: 0.35rem;
  }
}

/* --------------------------------------------------------------------------
   13. Gli inviti (#inviti)
   -------------------------------------------------------------------------- */
.inviti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  perspective: 1200px;
}

/* Heavy cotton letterpress card */
.invito-card {
  background-color: var(--paper-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  box-shadow: var(--shadow-paper);
  padding: clamp(2rem, 3.5vw, 3rem) clamp(1.5rem, 2.5vw, 2.2rem);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.35s var(--ease-out), transform 0.25s var(--ease-out);
  will-change: transform;
  transform-style: preserve-3d;
  position: relative;
  /* Debossed text effect */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.invito-card:hover {
  box-shadow: var(--shadow-lift);
}

/* Deckled heavy cotton card border effect */
.invito-card::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--hairline);
  pointer-events: none;
  border-radius: 2px;
}

.invito-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1.8rem;
}

.invito-tier-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.invito-tier-name {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-style: italic;
  font-size: clamp(2.1rem, 3vw, 2.9rem);
  line-height: 1;
}

/* Gold foil element whose highlight follows pointer */
.card-foil {
  /* deep gold on ivory, with a narrow bright band that the pointer moves across */
  background: linear-gradient(115deg, #5e451d 0%, #8a6a35 24%, #b8924f 40%, #d9bd7e 50%, #b8924f 60%, #8a6a35 76%, #5e451d 100%);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.6));
  text-shadow: none; /* the card's letterpress shadow would show through the transparent fill */
  background-size: 200% 200%;
  background-position: 100% 50%; /* at rest the bright band sits off the word (touch devices never move it) */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding-right: 0.08em; /* italic overhang inside the clipped background */
}

.invito-price {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.invito-perks {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  flex: 1;
}

.invito-card-action {
  padding-top: 1rem;
}

.btn-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 2px;
  color: var(--wax);
  transition: background-color 0.25s, border-color 0.25s, transform 0.2s;
}

.btn-tier:hover {
  background-color: var(--wax);
  color: var(--paper);
  border-color: var(--wax);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .inviti-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   14. Final CTA (#invito)
   -------------------------------------------------------------------------- */
.cta-section {
  padding: clamp(90px, 14vw, 190px) 0;
}

.cta-container {
  display: flex;
  justify-content: center;
}

/* Envelope element */
.envelope {
  width: 100%;
  max-width: 640px;
  background-color: var(--paper-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  box-shadow: var(--shadow-paper);
  position: relative;
  transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}

.envelope.envelope--sealed {
  transform: translateY(-12px) scale(1.02);
  box-shadow: var(--shadow-lift);
}

/* Envelope triangular flap */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 140px;
  background-color: var(--paper-3);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top center;
  transform: rotateX(180deg);
  transition: transform 0.75s var(--ease-in-out);
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(28, 26, 22, 0.12);
}

.envelope.envelope--flap-closed .envelope-flap {
  transform: rotateX(0deg);
}

/* A sibling of the flap (whose clip-path would halve it), centred on the flap's tip */
.envelope-seal-mount {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  pointer-events: none;
}

.envelope-body {
  padding: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4.5vw, 3.5rem);
}

.envelope-header {
  margin-bottom: 2.25rem;
  transition: opacity 0.3s var(--ease-out);
}

/* The closing flap would cover the title: it fades out, and once sealed the confirmation
   takes its place below the seal (flap tip 140px + half the seal + a breath) */
.envelope--flap-closed .envelope-header {
  opacity: 0;
}

.envelope--sealed .envelope-header {
  display: none;
}

.envelope--sealed .envelope-body {
  padding-top: calc(140px + 50px + 1.25rem);
}

.envelope-title {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  line-height: 0.95;
}

.envelope-form {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.envelope-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Newsreader italic, not a script face: the visitor must be able to read back what they typed */
.envelope-input {
  font-family: var(--font-text);
  font-style: italic;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline-strong);
  border-radius: 0;
  padding: 0.4rem 0;
  width: 100%;
  outline: none;
  transition: border-color 0.25s;
}

.envelope-input:focus {
  border-bottom-color: var(--ink);
}

.envelope-input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.envelope-input[aria-invalid="true"] {
  border-bottom-color: var(--wax);
}

.envelope-note {
  margin-top: 0.45rem;
  font-family: var(--font-text);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.envelope-error {
  min-height: 1.5rem;
  font-family: var(--font-text);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--wax);
}

.btn-seal-request {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background-color: var(--wax);
  color: var(--paper);
  border-radius: 2px;
  box-shadow: 0 4px 14px rgba(142, 27, 27, 0.28);
  transition: background-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.btn-seal-request:hover {
  background-color: var(--wax-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(142, 27, 27, 0.35);
}

.btn-seal-request:disabled {
  cursor: default;
  background-color: var(--wax-deep);
  transform: none;
}

.envelope-confirmation {
  padding: 2rem 0;
  text-align: center;
}

.confirmation-quote {
  font-size: clamp(1.6rem, 2.5vw, 2.3rem);
  line-height: 1.35;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   15. Footer (#footer)
   -------------------------------------------------------------------------- */
.site-footer {
  padding: clamp(80px, 12vw, 150px) 0 clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--hairline);
  position: relative;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 6vw, 5.5rem);
}

.footer-wordmark {
  font-size: clamp(4.5rem, 24vw, 24rem);
  line-height: 0.78;
  letter-spacing: -0.04em;
  text-align: center;
  overflow: hidden;
  user-select: none;
}

.footer-wordmark .char {
  display: inline-block;
  transform: translateY(0);
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.footer-col-title {
  color: var(--ink-soft); /* --ink-faint (2.5:1) fails WCAG 1.4.3 at label size */
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-list a {
  color: var(--ink);
  transition: color 0.25s;
}

.footer-links-list a:hover {
  color: var(--wax);
}

.footer-colophon {
  text-align: center;
  max-width: 68ch;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-colophon p {
  font-style: italic;
}

@media (max-width: 640px) {
  .footer-links-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
}

/* ── Integration: the shell already titles each section, so components' own headings are hidden here
   (they stay visible in the standalone demos). Filters and controls remain. */
#wall-mount .wl-eyebrow,
#wall-mount .wl-title,
#wall-mount .wl-subtitle,
#loupe-mount .lp-header,
#scale-mount .sc-header {
  display: none;
}

/* ── arXte: the X reads "per" (×) — ar·X·te = "arte, per te". Revealed in ink on hover. */
.brand-x {
  position: relative;
  display: inline-block;
}
.brand .brand-x::after {
  content: 'per';
  position: absolute;
  left: 50%;
  top: 88%;
  transform: translate(-50%, -4px);
  font-family: var(--font-hand);
  font-style: normal;
  font-size: 0.62em;
  color: var(--wax);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.brand:hover .brand-x::after,
.brand:focus-visible .brand-x::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.footer-motto {
  margin: clamp(10px, 1.5vw, 22px) auto 0;
  text-align: center;
  font-family: var(--font-text);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.footer-motto-x {
  font-family: var(--font-text);
  font-weight: 600;
  color: var(--wax);
  font-size: 1.35em;
  line-height: 1;
  vertical-align: -0.06em;
}

/* ── Type system: Bodoni is reserved for the arXte wordmark (header, footer) and the wax seals */
.brand,
.footer-wordmark,
.footer-wordmark .char {
  font-family: var(--font-brand);
  font-weight: 400;
  font-variation-settings: normal;
}

/* --------------------------------------------------------------------------
   16. Standalone pages (note-legali.html, 404.html): same paper, no preloader, no heavy JS
   -------------------------------------------------------------------------- */
.page-header {
  border-bottom: 1px solid var(--hairline);
}

.page-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.15rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.page-header .brand {
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.page-back {
  color: var(--ink);
  transition: color 0.25s;
}

.page-back:hover {
  color: var(--wax);
}

.legal {
  max-width: 760px;
  padding-top: clamp(56px, 8vw, 110px);
  padding-bottom: clamp(70px, 10vw, 140px);
}

.legal-title {
  font-size: clamp(2.6rem, 6.5vw, 5.2rem);
  line-height: 0.95;
  margin: 0.9rem 0 1.5rem;
}

.legal-lead {
  font-size: clamp(1.15rem, 1.4vw, 1.35rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 52ch;
}

.legal-toc {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin: 2.5rem 0 0;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.legal-toc a,
.legal a.legal-link {
  color: var(--ink);
  transition: color 0.25s;
}

.legal-toc a:hover,
.legal a.legal-link:hover {
  color: var(--wax);
}

.legal-section {
  padding-top: clamp(2.5rem, 5vw, 3.75rem);
  scroll-margin-top: 1rem;
}

.legal-section h2 {
  font-size: var(--fs-h3);
  line-height: 1.05;
  margin: 0.6rem 0 1.1rem;
}

.legal-section h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 1.9rem 0 0.7rem;
}

.legal-section p,
.legal-section li {
  max-width: 64ch;
}

.legal-section p + p {
  margin-top: 0.9rem;
}

.legal-section a:not(.t-label) {
  color: var(--wax);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.legal-list {
  margin: 0.9rem 0 0;
  padding-left: 1.25rem;
}

.legal-list li + li {
  margin-top: 0.45rem;
}

.legal-list li::marker {
  color: var(--wax);
}

.legal-credits {
  list-style: none;
  border-top: 1px solid var(--hairline);
}

.legal-credits li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--hairline);
  line-height: 1.45;
}

.legal-credits .credit-source {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}

.page-footer {
  border-top: 1px solid var(--hairline);
  padding: 2rem 0 2.5rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.page-footer p {
  font-style: italic;
}

/* 404 */
.notfound {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.4rem;
  padding-top: clamp(60px, 10vw, 120px);
  padding-bottom: clamp(60px, 10vw, 120px);
}

.notfound-code {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(4.5rem, 16vw, 11rem);
  line-height: 0.85;
  color: var(--wax);
}

.notfound-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1;
}

.notfound-text {
  color: var(--ink-soft);
  max-width: 40ch;
}

/* --------------------------------------------------------------------------
   17. Reduced motion: no transitions or looping animations anywhere
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Catalogue: the visitor's own work shows the custodian without a write action */
.catalogo-custode-self {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-soft);
}
