@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  --brand: #e72667;
  --brand-dark: #b81b4f;
  --ink: #1d1d1f;
  --white: #ffffff;
  --white-70: rgba(255, 255, 255, 0.7);
  --white-50: rgba(255, 255, 255, 0.5);
  --glass: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.28);
  --gutter: clamp(1.5rem, 4vw, 5rem);
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  overflow: hidden;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--white);
  background: var(--brand) url("../images/company.jpg") center / cover no-repeat;
  -webkit-font-smoothing: antialiased;
}

/* Leggera vignettatura per dare profondità e leggibilità al testo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 65%, rgba(0, 0, 0, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.22) 100%);
  pointer-events: none;
}

.screen {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 32rem);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "logo   status"
    "clock  info"
    "footer info";
  gap: var(--gutter);
  padding: var(--gutter);
}

/* ---------- LOGO ---------- */
.logo {
  grid-area: logo;
  width: clamp(14rem, 24vw, 30rem);
  height: auto;
}

/* ---------- STATO APERTO / CHIUSO ---------- */
.status {
  grid-area: status;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.6em 1.2em;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: clamp(1rem, 1.2vw, 1.4rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-dot {
  width: 0.65em;
  height: 0.65em;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
  animation: dot-pulse 2s infinite;
}

.status.is-closed .status-dot {
  background: var(--white-50);
  animation: none;
}

@keyframes dot-pulse {
  70% { box-shadow: 0 0 0 0.6em rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ---------- OROLOGIO ---------- */
.clock {
  grid-area: clock;
  align-self: center;
}

.time {
  font-size: clamp(7rem, 16vw, 20rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.time .minutes {
  color: var(--white-50);
}

.date {
  margin-top: 0.6em;
  font-size: clamp(1.4rem, 2.2vw, 2.6rem);
  font-weight: 300;
  color: var(--white-70);
  text-transform: capitalize;
}

/* ---------- PANNELLO INFO ---------- */
.info {
  grid-area: info;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: clamp(1.75rem, 2.5vw, 3rem);
  border-radius: 28px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.info-item {
  display: grid;
  grid-template-columns: 3rem 1fr;
  column-gap: 1.1rem;
  align-items: center;
}

.info-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
}

.info-icon img {
  width: 1.5rem;
  height: 1.5rem;
}

.info-label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white-70);
}

.info-value {
  font-size: clamp(1.15rem, 1.4vw, 1.6rem);
  font-weight: 500;
  line-height: 1.3;
}

.info-value small {
  display: block;
  font-size: 0.8em;
  font-weight: 300;
  color: var(--white-70);
}

/* ---------- FOOTER ---------- */
.footer {
  grid-area: footer;
  align-self: end;
  font-size: clamp(1rem, 1.2vw, 1.4rem);
  font-weight: 300;
  color: var(--white-70);
}

.footer strong {
  font-weight: 600;
  color: var(--white);
}

/* ---------- OVERLAY BENVENUTO (apertura porta) ---------- */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: var(--gutter);
  background: var(--white);
  color: var(--ink);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.welcome.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease;
}

.welcome-mark {
  width: clamp(9rem, 16vw, 16rem);
  height: auto;
}

.welcome.is-visible .welcome-mark {
  animation: mark-in 1s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.welcome-message {
  margin: 0;
  font-size: clamp(3rem, 7vw, 8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.welcome.is-visible .welcome-message {
  animation: slide-up 0.7s 0.15s ease-out both;
}

@keyframes mark-in {
  from { opacity: 0; transform: scale(0.6) rotate(-90deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- SCHERMI VERTICALI / PICCOLI ---------- */
@media (max-aspect-ratio: 1/1) {
  .screen {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
      "logo"
      "status"
      "clock"
      "info"
      "footer";
    gap: 2rem;
  }

  .status {
    justify-self: start;
  }

  .time {
    font-size: 28vw;
  }

  body {
    overflow-y: auto;
  }

  .screen {
    height: auto;
    min-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
