/* =========================================================================
   VeraMart — pagina di manutenzione
   Palette calda, logo al centro, orbita di immagini in rotazione lenta.
   ========================================================================= */

/* ------------------------------------------------------------------ font */
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin-wdth-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ----------------------------------------------------------------- token */
:root {
  --bg: #0c0b09;
  --bg-warm: #15120e;

  --cream: #f1eadc;
  --cream-bright: #fbf7ee;
  --gold: #c3a36a;
  --gold-deep: #9c7b43;

  --muted: rgba(241, 234, 220, 0.66);
  --faint: rgba(241, 234, 220, 0.46);
  --line: rgba(241, 234, 220, 0.13);
  --hairline: rgba(195, 163, 106, 0.3);

  --ff-display: 'Archivo', 'Archivo Variable', system-ui, sans-serif;
  --ff-body: 'Inter', 'Inter Variable', system-ui, sans-serif;
  --ff-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --ff-mono: 'Geist Mono', 'Geist Mono Variable', ui-monospace, Menlo, monospace;

  --tile: clamp(86px, 12vw, 140px);
  --logo: clamp(180px, 26vw, 252px);
  --ease: cubic-bezier(0.16, 0.84, 0.3, 1);
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--ff-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* pagina fissa, sempre alta quanto lo schermo */
.page {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(
      ellipse 42% 40% at 50% 47%,
      rgba(195, 163, 106, 0.14) 0%,
      rgba(195, 163, 106, 0.05) 42%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 110% 95% at 50% 50%,
      transparent 34%,
      rgba(0, 0, 0, 0.34) 74%,
      rgba(0, 0, 0, 0.7) 100%
    ),
    linear-gradient(178deg, var(--bg-warm) 0%, var(--bg) 52%, #080706 100%);
}

/* grana fotografica molto leggera */
.grain {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  opacity: 0.065;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* --------------------------------------------------------------- topbar */
.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(22px, env(safe-area-inset-top)) clamp(20px, 4vw, 56px) 0;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  animation: fade-in 1s ease 0.25s both;
}

.brandmark {
  font-family: var(--ff-display);
  font-size: 12px;
  font-weight: 720;
  font-stretch: 118%;
  letter-spacing: 0.18em;
  color: var(--cream);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.status-dot {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(195, 163, 106, 0.9);
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(195, 163, 106, 0.4);
  border-radius: 50%;
  animation: pulse 2.8s ease-out infinite;
}

/* ---------------------------------------------------------------- orbita */
.orbit {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease 0.15s;
}

.orbit.is-ready {
  opacity: 1;
}

.orbit-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0.9;
}

.ring {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.ring-a {
  opacity: 0.55;
  animation: ring-spin 170s linear infinite;
}

.ring-b {
  opacity: 0.55;
  stroke-dasharray: 2 10;
  animation: ring-spin 220s linear infinite reverse;
}

.ring-c {
  opacity: 0.35;
  stroke-dasharray: 1 14;
  animation: ring-spin 260s linear infinite;
}

.orbit-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tile);
  opacity: 0;
  will-change: transform;
  transform-origin: center;
}

.orbit.is-ready .orbit-item {
  opacity: 1;
  transition: opacity 0.7s ease calc(var(--i, 0) * 55ms);
}

.orbit-item.is-off {
  display: none;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  padding: 4px;
  border: 1px solid rgba(195, 163, 106, 0.42);
  background: #f4eee1;
  box-shadow:
    0 24px 55px -22px rgba(0, 0, 0, 0.9),
    0 4px 14px -6px rgba(0, 0, 0, 0.55);
}

.tile::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(24, 20, 14, 0.12);
  pointer-events: none;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.94) contrast(1.015);
}

/* ---------------------------------------------------------------- centro */
.center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(92vw, 660px);
  padding: 0 16px;
  text-align: center;
  transform: translate(-50%, -50%);
}

/* la pagina resta centrata: nessun alone scuro sulle foto */

.plaque {
  position: relative;
  width: var(--logo);
  background: #fff;
  outline: 1px solid rgba(195, 163, 106, 0.38);
  outline-offset: 10px;
  box-shadow:
    0 50px 95px -40px rgba(0, 0, 0, 0.95),
    0 0 90px -30px rgba(195, 163, 106, 0.35);
  animation: plaque-in 1.1s var(--ease) both 0.05s;
}

.plaque::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(156, 123, 67, 0.22);
  pointer-events: none;
}

.plaque img {
  width: 100%;
  height: auto;
  filter: saturate(0.96) contrast(1.01);
}

/* testi raggruppati: su mobile ricevono un velo scuro per restare leggibili
   quando le foto dell'orbita passano dietro */
.copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.eyebrow {
  margin: clamp(28px, 4.2vh, 46px) 0 0;
  font-family: var(--ff-mono);
  font-size: clamp(9px, 0.8vw, 10.5px);
  font-weight: 450;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  animation: rise-in 0.8s var(--ease) both 0.3s;
}

.title {
  margin: 12px 0 0;
  font-family: var(--ff-display);
  font-size: clamp(2rem, 4.4vw, 3.55rem);
  font-weight: 600;
  font-stretch: 112%;
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--cream-bright);
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.65);
  animation: rise-in 0.9s var(--ease) both 0.4s;
}

.title em {
  font-family: var(--ff-serif);
  font-size: 1.17em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--gold);
}

.lead {
  max-width: 37ch;
  margin: 18px 0 0;
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  line-height: 1.72;
  color: var(--muted);
  text-shadow:
    0 1px 12px rgba(0, 0, 0, 0.95),
    0 0 26px rgba(0, 0, 0, 0.8);
  text-wrap: balance;
  animation: rise-in 0.9s var(--ease) both 0.5s;
}

/* --------------------------------------------------------------- footer */
.footer {
  position: absolute;
  inset: auto 0 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 clamp(20px, 4vw, 56px) max(22px, env(safe-area-inset-bottom));
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--faint);
  animation: fade-in 1s ease 0.55s both;
}

.footer-sep {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* ----------------------------------------------------------- animazioni */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes plaque-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.65;
    transform: scale(0.6);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes ring-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------- mobile */
@media (max-width: 640px) {
  :root {
    --tile: clamp(56px, 18vw, 72px);
    --logo: clamp(162px, 44vw, 188px);
  }

  .topbar {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-inline: 18px;
    font-size: 9px;
    letter-spacing: 0.16em;
  }

  .brandmark {
    font-size: 11px;
  }

  .status {
    gap: 7px;
  }

  .center {
    width: 94vw;
    padding-inline: 10px;
  }

  .copy::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -14px;
    bottom: -22px;
    z-index: -1;
    width: min(108vw, 520px);
    transform: translateX(-50%);
    pointer-events: none;
    background: radial-gradient(
      ellipse 52% 56% at 50% 50%,
      rgba(10, 9, 7, 0.9) 0%,
      rgba(10, 9, 7, 0.76) 42%,
      rgba(10, 9, 7, 0.38) 66%,
      rgba(10, 9, 7, 0) 82%
    );
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    -webkit-mask-image: radial-gradient(ellipse 50% 52% at 50% 50%, #000 54%, transparent 82%);
    mask-image: radial-gradient(ellipse 50% 52% at 50% 50%, #000 54%, transparent 82%);
  }

  .plaque {
    outline-offset: 7px;
  }

  .eyebrow {
    margin-top: 26px;
    font-size: 8.5px;
    letter-spacing: 0.24em;
  }

  .title {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }

  .lead {
    max-width: 31ch;
    margin-top: 14px;
    font-size: 0.79rem;
    line-height: 1.65;
  }

  .footer {
    padding-inline: 18px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    font-size: 8px;
    letter-spacing: 0.14em;
  }

  .footer-sep {
    min-width: 8px;
  }
}

/* su telefono il footer resta su una riga: copyright e credit, senza tagline */
@media (max-width: 520px) {
  .footer span:last-child {
    display: none;
  }
}

@media (max-width: 380px) {
  :root {
    --logo: 150px;
  }

  .eyebrow,
  .lead {
    display: none;
  }

  .title {
    margin-top: 22px;
  }

  .status {
    letter-spacing: 0.1em;
  }
}

/* schermi non altissimi: logo e testi più compatti per lasciare aria all'orbita */
@media (max-height: 820px) {
  :root {
    --logo: clamp(180px, 26vh, 220px);
  }

  .eyebrow {
    margin-top: 24px;
  }

  .title {
    font-size: clamp(1.9rem, 4.8vh, 3.1rem);
  }

  .lead {
    margin-top: 12px;
    line-height: 1.62;
  }
}

@media (max-height: 820px) and (min-width: 641px) {
  :root {
    --tile: clamp(86px, 11.5vw, 132px);
  }
}

/* schermi bassi (portatili piccoli, orizzontale) */
@media (max-height: 660px) {
  :root {
    --logo: clamp(128px, 20vh, 190px);
  }

  .eyebrow {
    margin-top: 20px;
  }

  .title {
    font-size: clamp(1.6rem, 4vh, 2.5rem);
  }

  .lead {
    margin-top: 10px;
    line-height: 1.55;
  }
}

@media (max-height: 580px) {
  .lead {
    display: none;
  }

  .eyebrow {
    margin-top: 16px;
  }

  .plaque {
    outline-offset: 6px;
  }
}

/* orizzontale su telefono: tutto più piccolo, orbita comunque leggibile */
@media (max-height: 500px) {
  :root {
    --logo: clamp(96px, 26vh, 140px);
    --tile: clamp(58px, 8vw, 80px);
  }

  .topbar {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .eyebrow {
    display: none;
  }

  .title {
    margin-top: 14px;
    font-size: 1.5rem;
  }

  .copy::before {
    display: none;
  }

  .footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* ------------------------------------------------------ movimento ridotto */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .ring {
    animation: none;
  }
}
