/* ═══════════════════════════════════════════════════════════════
   EphyroMC — Global Stylesheet
   Contiene: variabili, reset, navbar, footer, componenti condivisi,
             utilities, responsive, accessibilità
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   0. FONT IMPORT
───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@700;900&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

/* ─────────────────────────────────────────────
   1. CSS VARIABLES
───────────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-0:       #04050a;
  --bg-1:       #07090f;
  --bg-2:       #0c0e1a;
  --bg-card:    #10131f;
  --bg-card2:   #141828;

  /* Gold palette */
  --gold:        #c9963a;
  --gold-bright: #e8b84b;
  --gold-pale:   #f5d98a;
  --gold-dim:    #7a5e22;
  --gold-border: rgba(201, 150, 58, 0.22);
  --gold-glow:   rgba(201, 150, 58, 0.12);

  /* Accent palette */
  --teal:   #4ab8b4;
  --purple: #9b72cf;
  --red:    #b84040;

  /* Text */
  --text-1: #ede0c8;
  --text-2: #a89880;
  --text-3: #6b6050;

  /* Layout */
  --nav-h:    64px;
  --container: 1180px;

  /* Typography */
  --ff-disp: 'Cinzel Decorative', serif;
  --ff-head: 'Cinzel', serif;
  --ff-body: 'Crimson Pro', serif;

  /* Misc */
  --radius:    6px;
  --ease:      200ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────
   2. RESET
───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a  { color: inherit; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─────────────────────────────────────────────
   3. SCROLLBAR
───────────────────────────────────────────── */
::-webkit-scrollbar          { width: 5px; }
::-webkit-scrollbar-track    { background: var(--bg-1); }
::-webkit-scrollbar-thumb    { background: var(--gold-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ─────────────────────────────────────────────
   4. FOCUS VISIBLE (accessibilità tastiera)
───────────────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ─────────────────────────────────────────────
   5. NAVBAR
───────────────────────────────────────────── */
#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  background: rgba(7, 9, 15, 0.92);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--gold-border);
  transition: background 300ms ease;
}

#navbar.scrolled {
  background: rgba(4, 5, 10, 0.98);
}

/* Nav inner wrapper */
.nav-main {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
  gap: 20px;
}

/* ── Logo ── */
.nav-logo {
  flex-shrink: 0;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-gem {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--ff-disp);
  font-size: 17px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-pale) 0%, var(--gold) 55%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ── Desktop links ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  font-family: var(--ff-head);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color var(--ease), background var(--ease);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold-bright);
  background: var(--gold-glow);
}

/* ── Dropdown ── */
.nav-dd {
  position: relative;
}

/*
 * Bridge: pseudo-elemento sul .nav-dd che copre il gap (10px)
 * tra il trigger e il menu. Mantiene :hover attivo mentre
 * il cursore si sposta dal trigger al menu, evitando il flicker.
 */
.nav-dd::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -16px;
  right: -16px;
  height: 14px;          /* copre il gap top: calc(100% + 10px) + margine */
  background: transparent;
  pointer-events: auto;  /* cattura il cursore mentre attraversa il gap */
}

.nav-dd-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  background: none;
  color: var(--text-2);
}

.nav-dd-trigger::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 280ms cubic-bezier(0.4,0,0.2,1),
              border-color 280ms cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}

.nav-dd[data-open="true"] .nav-dd-trigger,
.nav-dd:hover .nav-dd-trigger {
  color: var(--gold-bright);
  background: var(--gold-glow);
}

.nav-dd[data-open="true"] .nav-dd-trigger::after,
.nav-dd:hover .nav-dd-trigger::after {
  transform: rotate(-135deg) translateY(-1px);
  border-color: var(--gold);
}

.nav-dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(8, 10, 18, 0.98);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 154px;
  opacity: 0;
  pointer-events: none;
  /*
   * transition-delay sulla chiusura: 80ms di grazia prima
   * che il menu inizi a sparire, elimina il flicker.
   * Sull'apertura il delay è 0ms (vedi regola sotto).
   */
  transition:
    opacity   260ms cubic-bezier(0.4, 0, 0.2, 1) 80ms,
    transform 260ms cubic-bezier(0.4, 0, 0.2, 1) 80ms;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 44px rgba(0,0,0,0.72), 0 0 0 1px rgba(201,150,58,0.06);
}

/* Apertura: nessun delay, animazione fluida verso il basso */
.nav-dd[data-open="true"] .nav-dd-menu,
.nav-dd:hover .nav-dd-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity   280ms cubic-bezier(0.16, 1, 0.3, 1) 0ms,
    transform 300ms cubic-bezier(0.16, 1, 0.3, 1) 0ms;
}

.nav-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  font-family: var(--ff-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  border-radius: 4px;
  transition: color var(--ease), background var(--ease);
}

.nav-dd-item:hover {
  color: var(--gold-bright);
  background: var(--gold-glow);
}

.nav-dd-sep {
  height: 1px;
  background: var(--gold-border);
  margin: 5px 8px;
}

/* ── Right side ── */
.nav-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Hamburger (mobile) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  padding: 6px;
  transition: background var(--ease);
  cursor: pointer;
  border: none;
  background: none;
}

.nav-hamburger:hover { background: var(--gold-glow); }

.nav-hamburger span {
  display: block;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile menu overlay ── */
.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--gold-border);
  background: rgba(4, 5, 10, 0.99);
}

.nav-mobile.open { display: flex; }

.nav-mobile-link {
  font-family: var(--ff-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  padding: 13px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: color var(--ease);
}

.nav-mobile-link:hover { color: var(--gold-bright); }

.nav-mobile-sub {
  font-family: var(--ff-head);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  text-decoration: none;
  padding: 9px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: color var(--ease);
}

.nav-mobile-sub:hover { color: var(--text-2); }

/* ── IP bar ── */
.nav-ip-bar {
  display: flex;
  justify-content: center;
  padding: 0 0 8px;
}

/* ─────────────────────────────────────────────
   6. SHARED BUTTONS
───────────────────────────────────────────── */

/* Login button */
.btn-login {
  font-family: var(--ff-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-border);
  padding: 8px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn-login:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 18px var(--gold-glow);
}

/* Primary CTA */
.btn-primary {
  font-family: var(--ff-head);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0a0702;
  background: linear-gradient(135deg, var(--gold-pale) 0%, var(--gold-bright) 40%, var(--gold) 100%);
  border: none;
  padding: 14px 36px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.4,0,0.2,1), box-shadow 300ms cubic-bezier(0.4,0,0.2,1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 28px rgba(201,150,58,0.42), 0 0 0 1px rgba(201,150,58,0.18);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--ease);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(201,150,58,0.52);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: none; }

/* Ghost button */
.btn-ghost {
  font-family: var(--ff-head);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  background: transparent;
  border: 1px solid rgba(168,152,128,0.28);
  padding: 13px 28px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost:hover {
  color: var(--text-1);
  border-color: rgba(168,152,128,0.55);
  background: rgba(168,152,128,0.05);
}

/* ─────────────────────────────────────────────
   7. IP BUTTON
───────────────────────────────────────────── */
.ip-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(201,150,58,0.07);
  border: 1px solid var(--gold-border);
  border-radius: 99px;
  padding: 5px 20px;
  font-family: var(--ff-head);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--gold);
  cursor: pointer;
  transition: all var(--ease);
  user-select: none;
}

.ip-btn:hover {
  background: rgba(201,150,58,0.14);
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(201,150,58,0.18);
  color: var(--gold-bright);
}

/* Server status dot */
.ip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
  position: relative;
  transition: background 400ms;
}

.ip-dot.online  { background: #4caf50; box-shadow: 0 0 8px #4caf50; }
.ip-dot.offline { background: #c94040; }

.ip-dot.online::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.3);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(2); opacity: 0; }
}

.ip-copy {
  opacity: 0.4;
  font-size: 13px;
  transition: opacity var(--ease);
}

.ip-btn:hover .ip-copy { opacity: 1; }

/* ─────────────────────────────────────────────
   8. LAYOUT UTILITIES
───────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 36px;
}

section { position: relative; overflow: hidden; }

/* Section typography */
.s-label {
  font-family: var(--ff-head);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 10px;
}

.s-title {
  font-family: var(--ff-head);
  font-size: clamp(24px, 3.8vw, 42px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-1);
  line-height: 1.18;
  margin-bottom: 18px;
}

.s-title em {
  font-style: italic;
  color: var(--gold);
}

.s-text {
  font-size: 17px;
  line-height: 1.82;
  color: var(--text-2);
}

.s-text strong { color: var(--text-1); font-weight: 600; }

/* Gold divider */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 10px 0 24px;
}

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

.divider-gem {
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Colored text helpers */
.c-gold   { color: var(--gold); }
.c-teal   { color: var(--teal); }
.c-purple { color: var(--purple); }
.c-red    { color: var(--red); }

/* ─────────────────────────────────────────────
   9. SCROLL REVEAL
───────────────────────────────────────────── */
.rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.rv.vis { opacity: 1; transform: none; }

.d1 { transition-delay:  80ms; }
.d2 { transition-delay: 180ms; }
.d3 { transition-delay: 290ms; }
.d4 { transition-delay: 410ms; }

/* ─────────────────────────────────────────────
   GLOBAL KEYFRAMES
───────────────────────────────────────────── */

/* Pulsazione gemma divisore */
@keyframes gem-pulse {
  0%, 100% { opacity: 1;   transform: rotate(45deg) scale(1);    box-shadow: none; }
  50%       { opacity: 0.7; transform: rotate(45deg) scale(1.35); box-shadow: 0 0 10px var(--gold); }
}

/* Dot status online */
@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(2); opacity: 0; }
}

/* Glow subtile bordi card */
@keyframes border-glow {
  0%, 100% { box-shadow: 0 0 0px rgba(201,150,58,0); }
  50%       { box-shadow: 0 0 18px rgba(201,150,58,0.12); }
}

/* Navigazione: indicatore attivo */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* Gemme divisore: animazione continua */
.divider-gem {
  animation: gem-pulse 3.5s ease-in-out infinite;
}


/* ─────────────────────────────────────────────
   10. TOAST
───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-card2);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 11px 24px;
  font-family: var(--ff-head);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #4caf50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms, transform 280ms;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────
   11. FOOTER
───────────────────────────────────────────── */
#footer {
  background: var(--bg-1);
  border-top: 1px solid var(--gold-border);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 44px;
  margin-bottom: 44px;
}

.footer-brand-name {
  font-family: var(--ff-disp);
  font-size: 17px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.footer-brand-desc {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.72;
  max-width: 28ch;
}

.footer-col-title {
  font-family: var(--ff-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 14px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-link {
  font-size: 13.5px;
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--ease);
}

.footer-link:hover { color: var(--text-2); }

.footer-bottom {
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  text-align: center;
}

.footer-copy { font-size: 12.5px; color: var(--text-3); }

.footer-disclaimer {
  font-size: 11px;
  color: var(--text-3);
  opacity: 0.55;
  line-height: 1.65;
  max-width: 680px;
}

/* ─────────────────────────────────────────────
   12. ACCESSIBILITY — MOTION REDUCED
───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .rv { opacity: 1; transform: none; }
}

/* ─────────────────────────────────────────────
   13. RESPONSIVE — NAVBAR
───────────────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-main { padding: 0 20px; }
}

/* Mobile */
@media (max-width: 520px) {
  .nav-logo-text { font-size: 15px; }
  .ip-btn { font-size: 10px; padding: 5px 14px; letter-spacing: 0.1em; }
}

/* ─────────────────────────────────────────────
   14. RESPONSIVE — FOOTER
───────────────────────────────────────────── */
@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-grid > *:first-child {
    grid-column: 1 / -1;
  }
  .footer-brand-desc { max-width: none; }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  #footer { padding: 40px 0 24px; }
  .container { padding: 0 20px; }
}