/* === Esordia site — base styles === */

html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* === Mobile menu drawer === */
.esordia-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(37, 40, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease-out;
}
.esordia-mobile-panel {
  position: fixed;
  top: 5rem;
  right: 0;
  width: 84vw;
  max-width: 340px;
  height: calc(100vh - 5rem);
  background: #25282A;
  border-left: 1px solid rgba(248, 247, 242, 0.1);
  padding: 1.5rem;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
  overflow-y: auto;
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}
.esordia-mobile-panel[data-open="true"] {
  transform: translateX(0);
}
.esordia-mobile-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

/* Rimuove il tap-delay e l'highlight su iOS/Android per i target tappabili */
#mobileMenuButton,
.esordia-mobile-panel a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.esordia-mobile-panel a {
  display: block;
  min-height: 44px; /* target tap accessibile */
}

/* grain overlay sottile su tutto il sito */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* reveal animation default state */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* === Cookie banner === */
.esordia-cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  padding: 1rem;
  pointer-events: none;
  display: flex;
  justify-content: center;
}
.esordia-cookie-banner[hidden] {
  display: none;
}
.esordia-cookie-card {
  pointer-events: auto;
  width: 100%;
  max-width: 980px;
  background: rgba(37, 40, 42, 0.96);
  color: #F8F7F2;
  border: 1px solid rgba(248, 247, 242, 0.12);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  animation: cookieBannerIn 0.28s ease-out;
}
.esordia-cookie-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(248, 247, 242, 0.6);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: color 0.2s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.esordia-cookie-close:hover,
.esordia-cookie-close:focus-visible {
  color: #F8F7F2;
  background: rgba(248, 247, 242, 0.08);
  outline: none;
}
@media (min-width: 768px) {
  .esordia-cookie-card {
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
    padding: 1.25rem 1.75rem;
    padding-right: 2.75rem;
  }
}
@keyframes cookieBannerIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.esordia-cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.esordia-cookie-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
.esordia-cookie-btn--primary {
  background: transparent;
  color: #F8F7F2;
  border: 1px solid rgba(248, 247, 242, 0.25);
}
.esordia-cookie-btn--primary:hover {
   background: rgba(248, 247, 242, 0.08);
  border-color: rgba(248, 247, 242, 0.4);
}
.esordia-cookie-btn--ghost {
  background: transparent;
  color: #F8F7F2;
  border: 1px solid rgba(248, 247, 242, 0.25);
}
.esordia-cookie-btn--ghost:hover {
  background: rgba(248, 247, 242, 0.08);
  border-color: rgba(248, 247, 242, 0.4);
}
@media (max-width: 767px) {
  .esordia-cookie-actions {
    width: 100%;
  }
  .esordia-cookie-btn {
    flex: 1;
  }
}

/* === Submit button tooltip (privacy non accettata) === */
.esordia-submit-wrap {
  position: relative;
}
.esordia-submit-wrap[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: #25282A;
  color: #F8F7F2;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  text-align: center;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 5;
}
.esordia-submit-wrap[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #25282A;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 5;
}
.esordia-submit-wrap[data-tooltip]:hover::after,
.esordia-submit-wrap[data-tooltip]:hover::before,
.esordia-submit-wrap[data-tooltip]:focus-within::after,
.esordia-submit-wrap[data-tooltip]:focus-within::before {
  opacity: 1;
}

/* ticker */
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker {
  animation: ticker 38s linear infinite;
  width: max-content;
}

/* selection */
::selection { background:#E15A2B; color:#F5F1EA; }

/* link underline accent */
a { -webkit-tap-highlight-color: transparent; }

/* === vCard QR page === */
.vcard-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background: #25282A;
  color: #F8F7F2;
  font-family: Raleway, ui-sans-serif, system-ui, sans-serif;
}
.vcard-page [hidden] {
  display: none !important;
}
.vcard-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(120deg, rgba(37, 40, 42, 0.98), rgba(37, 40, 42, 0.9) 42%, rgba(14, 76, 94, 0.92)),
    repeating-linear-gradient(90deg, rgba(248, 247, 242, 0.055) 0 1px, transparent 1px 110px),
    repeating-linear-gradient(0deg, rgba(248, 247, 242, 0.04) 0 1px, transparent 1px 110px);
}
.vcard-bg::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 32vh;
  background: linear-gradient(0deg, rgba(220, 88, 42, 0.16), transparent);
}
.vcard-portrait,
.vcard-card,
.vcard-directory {
  position: relative;
}
.vcard-page header,
.vcard-page section {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.vcard-page header {
  padding-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vcard-page section {
  padding-top: clamp(3rem, 7vw, 5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
#vcardProfile {
  display: grid;
  gap: 2rem;
  align-items: stretch;
}
#vcardProfile > .vcard-portrait,
#vcardProfile > .vcard-card {
  grid-column: auto;
}
@media (min-width: 1024px) {
  #vcardProfile {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 2.5rem;
  }
}
.vcard-portrait-inner {
  min-height: 100%;
  border: 1px solid rgba(248, 247, 242, 0.14);
  background: rgba(248, 247, 242, 0.07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: clamp(2rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.vcard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  color: #DC582A;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.vcard-kicker span {
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: currentColor;
}
.vcard-avatar {
  width: clamp(5.5rem, 12vw, 8rem);
  aspect-ratio: 1;
  border-radius: 50%;
  margin-bottom: 2rem;
  display: grid;
  place-items: center;
  background: #DC582A;
  color: #F8F7F2;
  box-shadow: 0 24px 70px -28px rgba(220, 88, 42, 0.9);
  font-family: "Libre Franklin", ui-sans-serif, system-ui;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 900;
}
#vcardName {
  font-family: "Libre Franklin", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(3rem, 8vw, 6.8rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}
.vcard-card {
  background: #F8F7F2;
  color: #25282A;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 32px 90px -45px rgba(0, 0, 0, 0.72);
}
.vcard-primary-btn,
.vcard-secondary-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.vcard-primary-btn {
  flex: 0 0 auto;
  background: #0E4C5E;
  color: #F8F7F2;
  padding: 0.95rem 1.35rem;
}
.vcard-primary-btn:hover {
  background: #DC582A;
  transform: translateY(-1px);
}
.vcard-secondary-btn {
  border: 1px solid rgba(37, 40, 42, 0.16);
  color: rgba(37, 40, 42, 0.76);
  padding: 0.78rem 1rem;
}
.vcard-secondary-btn:hover {
  border-color: #25282A;
  color: #25282A;
  background: rgba(37, 40, 42, 0.05);
}
.vcard-details {
  margin-top: 1.6rem;
  border-top: 1px solid rgba(37, 40, 42, 0.1);
}
.vcard-detail-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.34fr) 1fr;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid rgba(37, 40, 42, 0.1);
}
.vcard-detail-row span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(37, 40, 42, 0.52);
}
.vcard-detail-row strong {
  overflow-wrap: anywhere;
  font-weight: 700;
  color: #25282A;
}
.vcard-qr-note {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(14, 76, 94, 0.07);
  border-left: 3px solid #DC582A;
}
.vcard-qr-note span {
  display: block;
  margin-bottom: 0.35rem;
  color: rgba(37, 40, 42, 0.55);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.vcard-qr-note code {
  color: #0E4C5E;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.vcard-directory {
  padding: clamp(1rem, 4vw, 2.5rem) 0 4rem;
}
.vcard-message {
  margin-top: 2rem;
  color: #F8F7F2;
  background: rgba(220, 88, 42, 0.2);
  border: 1px solid rgba(220, 88, 42, 0.35);
  padding: 1rem 1.25rem;
}
.vcard-list {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.75rem;
}
.vcard-list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: rgba(248, 247, 242, 0.08);
  border: 1px solid rgba(248, 247, 242, 0.12);
  color: #F8F7F2;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.vcard-list-item:hover {
  background: rgba(248, 247, 242, 0.14);
  border-color: rgba(248, 247, 242, 0.28);
}
.vcard-list-initials {
  width: 3rem;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #DC582A;
  font-weight: 900;
}
.vcard-list-item strong,
.vcard-list-item small {
  display: block;
}
.vcard-list-item small {
  margin-top: 0.2rem;
  color: rgba(248, 247, 242, 0.62);
}
.vcard-list-item code {
  color: #CBC1AE;
  font-size: 0.78rem;
}
@media (max-width: 720px) {
  .vcard-detail-row,
  .vcard-list-item {
    grid-template-columns: 1fr;
  }
  .vcard-list-item code {
    overflow-wrap: anywhere;
  }
}
