/* ==========================================================================
   Feib — Coming soon
   ========================================================================== */

:root {
  --bg: #0E0E0E;
  --fg: #F6F6F6;
  --fg-muted: rgba(246, 246, 246, 0.62);
  --fg-faint: rgba(246, 246, 246, 0.38);
  --line: rgba(246, 246, 246, 0.22);
  --accent: #F6F6F6;

  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 3vw, 40px);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Grana leggera su tutta la pagina */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Contenuto centrale
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px var(--gutter);
  text-align: center;
  pointer-events: none; /* lascia trascinare le foto sotto */
}

/* Alone scuro dietro al testo per mantenerlo leggibile */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, 120vw);
  height: min(620px, 90vh);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(14, 14, 14, 0.92) 35%, rgba(14, 14, 14, 0) 100%);
  z-index: -1;
}

.hero__logo {
  width: clamp(64px, 9vw, 104px);
  height: auto;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.hero__title {
  margin: 0;
  max-width: 14ch;
  font-weight: 500;
  font-size: clamp(2.4rem, 6.4vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero__contact {
  margin-top: clamp(40px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero__contact p {
  margin: 0;
  max-width: 34ch;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--fg-faint);
}

.mail-link {
  position: relative;
  pointer-events: auto;
  color: var(--fg);
  text-decoration: none;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 4px 2px;
}

.mail-link::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.mail-link::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
  z-index: 1;
}

.mail-link:hover::before,
.mail-link:focus-visible::before {
  transform: scaleX(1);
  transform-origin: left;
}

.mail-link:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 6px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Foto fluttuanti
   -------------------------------------------------------------------------- */

.floating {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.photo {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  width: var(--w, 160px);
  will-change: transform;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.photo.is-dragging {
  cursor: grabbing;
}

.photo__inner {
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 1.4s var(--ease-out),
    transform 1.4s var(--ease-out),
    filter 0.6s var(--ease-out);
  /* Le foto "lontane" sono più scure e meno sature.
     Niente blur: su iOS Safari crea artefatti (righe colorate). */
  filter:
    brightness(calc(0.45 + var(--d, 1) * 0.5))
    saturate(calc(0.5 + var(--d, 1) * 0.4));
}

.photo.is-in .photo__inner {
  opacity: 1;
  transform: scale(1);
}

.photo:hover .photo__inner,
.photo.is-dragging .photo__inner {
  filter: brightness(1) saturate(1);
  transform: scale(1.06);
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  pointer-events: none;
  -webkit-user-drag: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  pointer-events: none;
}

.footer__hint {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .footer__hint {
    display: inline;
  }
}

/* --------------------------------------------------------------------------
   Entrata del contenuto
   -------------------------------------------------------------------------- */

.hero > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 1.2s var(--ease-out) forwards;
}

.hero > :nth-child(1) { animation-delay: 0.1s; }
.hero > :nth-child(2) { animation-delay: 0.25s; }
.hero > :nth-child(3) { animation-delay: 0.4s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 700px) {
  .hero {
    padding: 72px var(--gutter);
  }

  .hero::before {
    width: 140vw;
    height: 70vh;
  }

  .hero__contact p {
    font-size: 0.9rem;
  }
}

/* --------------------------------------------------------------------------
   Movimento ridotto
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .hero > *,
  .photo__inner {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}
