/* ============================================================
   Lunae™ Network — Main Stylesheet
   Palette ufficiale: grigio + azzurro/blu/viola/giallo
   Background: pattern grigio Lunae (assets/img/bg-pattern.png)
   Display font: Lunae™ Network Font (brand custom font)
   ============================================================ */

/* Custom brand font, generato dal pack emoji @Lunaelayout di Telegram.
   Due weight: Regular (400) per UI sottile, Bold (700) per titoli/enfasi.
   I range coprono tutti i pesi CSS: il browser sceglie automaticamente
   il file giusto a seconda del font-weight specificato. */
@font-face {
  font-family: "Lunae™ Network Font";
  src: url("/assets/fonts/LunaeNetworkFont-Regular.woff2") format("woff2"),
       url("/assets/fonts/LunaeNetworkFont-Regular.ttf")   format("truetype");
  font-display: swap;
  font-weight: 100 600;
  font-style: normal;
}

@font-face {
  font-family: "Lunae™ Network Font";
  src: url("/assets/fonts/LunaeNetworkFont-Bold.woff2") format("woff2"),
       url("/assets/fonts/LunaeNetworkFont-Bold.ttf")   format("truetype");
  font-display: swap;
  font-weight: 601 900;
  font-style: normal;
}

/* ---------- Design tokens ---------- */
:root {
  /* Backgrounds — dark con leggera tonalità calda per non sembrare nero puro */
  --bg: #1a1a1c;
  --bg-overlay: rgba(26, 26, 28, 0.55);
  --surface: #232428;
  --surface-2: #2c2d33;
  --border: #353740;
  --border-strong: #4a4d57;

  /* Text — gerarchia su 4 livelli */
  --text: #f5f5f5;
  --text-soft: #D2D2D2;
  --text-muted: #A6A6A6;
  --text-dim: #6e7178;

  /* Accenti ufficiali dalla palette */
  --primary: #2E90EA;
  --primary-strong: #2E68EA;
  --primary-glow: rgba(46, 144, 234, 0.4);
  --primary-soft: rgba(46, 144, 234, 0.12);

  --purple: #A54DE2;
  --purple-glow: rgba(165, 77, 226, 0.35);
  --purple-soft: rgba(165, 77, 226, 0.12);

  --yellow: #E2CB40;
  --yellow-soft: rgba(226, 203, 64, 0.12);

  /* Typography
     Display: brand font (all-caps, lowercase mappato sui glifi maiuscoli).
     Body:    Manrope per prose e UI text. */
  --font-display: "Lunae™ Network Font", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t-mid: 320ms;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;

  /* Layered background:
     1. Dark overlay (rgba) to keep cards readable on top of the pattern
     2. The Lunae grey pattern PNG, fixed so it doesn't scroll with content */
  background-image:
    linear-gradient(var(--bg-overlay), var(--bg-overlay)),
    url("/assets/img/bg-pattern.png");
  background-size: auto, cover;
  background-position: center, center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* ============================================================
   NAVBAR — sticky pill
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-4) var(--space-3);
  background: linear-gradient(180deg, rgba(26, 26, 28, 0.92) 0%, rgba(26, 26, 28, 0.55) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-2);
  background: rgba(35, 36, 40, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.nav-link {
  flex: 1;
  text-align: center;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-weight: 400;  /* Regular per UI navbar: più sottile, elegante */
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  border-radius: var(--radius-full);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--primary-soft);
}

.nav-link.is-active {
  color: #fff;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  box-shadow: 0 0 24px var(--primary-glow);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - 100px);
  padding: var(--space-7) var(--space-5) var(--space-9);
}

.hero-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 14vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-5);

  /* Gradient text — fluid blue->purple matching palette */
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;

  /* Subtle drop-shadow via text-shadow doesn't work with background-clip — use filter on parent if needed */
  filter: drop-shadow(0 0 30px rgba(46, 144, 234, 0.35));
  animation: glow-pulse 4s ease-in-out infinite;
}

.hero-logo .tm {
  font-size: 0.35em;
  vertical-align: super;
  font-weight: 600;
  opacity: 0.85;
  /* Reset background-clip inheritance: the parent uses transparent text-fill
     to show the gradient, but the ™ should be a solid soft-grey instead. */
  -webkit-text-fill-color: var(--text-soft);
  background: none;
  color: var(--text-soft);
}

@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(46, 144, 234, 0.35)); }
  50%      { filter: drop-shadow(0 0 50px rgba(165, 77, 226, 0.4)); }
}

.hero-tagline {
  max-width: 540px;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: var(--space-7);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 460px;
}

@media (min-width: 540px) {
  .hero-cta {
    flex-direction: row;
  }
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  color: var(--primary);
  font-size: 1.5rem;
  animation: bounce 2s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-secondary {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: var(--space-4);
  text-align: left;
}

.btn-secondary:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-soft), 0 8px 32px rgba(46, 144, 234, 0.12);
}

.btn-secondary .btn-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  border-radius: 50%;
}

.btn-secondary .btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-transform: none;
  letter-spacing: 0;
}

.btn-secondary .btn-text small {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.btn-secondary .btn-text strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  text-transform: uppercase;
  box-shadow: 0 8px 32px rgba(46, 144, 234, 0.25);
  padding: var(--space-4) var(--space-7);
}

.btn-primary:hover {
  box-shadow: 0 12px 40px rgba(46, 144, 234, 0.45);
}

/* ============================================================
   SECTION headings
   ============================================================ */
.page-header {
  text-align: center;
  padding: var(--space-9) var(--space-5) var(--space-7);
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  max-width: 520px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: var(--space-7);
}

.section-title .accent {
  background: linear-gradient(90deg, var(--primary) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================================
   CARDS
   ============================================================ */
.cards {
  display: grid;
  gap: var(--space-5);
  padding: 0 var(--space-5);
  margin-bottom: var(--space-7);
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* News card — text-focused */
.news-card {
  position: relative;
  display: block;
  padding: var(--space-6) var(--space-5);
  background: rgba(35, 36, 40, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t-mid) var(--ease),
              border-color var(--t-mid) var(--ease),
              box-shadow var(--t-mid) var(--ease);
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
              0 0 0 1px var(--primary-soft);
}

.news-card-content {
  position: relative;
  z-index: 1;
}

.news-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

.news-card-desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
}

.news-card-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-4);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* TAG variants — each category gets a distinct color from the palette */
.tag {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid currentColor;
  background: var(--tag-bg, var(--primary-soft));
  color: var(--tag-color, var(--primary));
}

.tag.tag-blue    { --tag-color: var(--primary);  --tag-bg: var(--primary-soft); }
.tag.tag-purple  { --tag-color: var(--purple);   --tag-bg: var(--purple-soft); }
.tag.tag-yellow  { --tag-color: var(--yellow);   --tag-bg: var(--yellow-soft); }
.tag.tag-grey    { --tag-color: var(--text-muted); --tag-bg: rgba(166,166,166,0.12); }

/* Image card — full-bleed art */
.image-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--t-mid) var(--ease),
              border-color var(--t-mid) var(--ease),
              box-shadow var(--t-mid) var(--ease);
}

.image-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
              0 0 60px rgba(46, 144, 234, 0.15);
}

.image-card-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 800ms var(--ease);
}

.image-card:hover .image-card-art {
  transform: scale(1.05);
}

.image-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(26, 26, 28, 0.85) 80%, rgba(26, 26, 28, 0.95) 100%);
}

.image-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-6) var(--space-5);
}

.image-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.image-card-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* "Soon" variant: cards that aren't linkable yet (community pages, future
   guides). They get a small badge in the top-right corner and lose the hover
   lift effect — to signal clearly that they're not interactive. */
.image-card--soon {
  cursor: default;
}
.image-card--soon:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}
.image-card--soon:hover .image-card-art {
  transform: none;
}

.image-card-soon {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 3;
  /* Translucent black pill with the brand display font — feels like a
     marketing badge, not a button. */
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================
   INFO PAGE
   ============================================================ */
.info-blocks {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-5) var(--space-7);
}

.info-block {
  padding: var(--space-6) var(--space-5);
  background: rgba(35, 36, 40, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.info-block-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-4);

  background: linear-gradient(90deg, var(--primary) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.info-block p {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}

.info-block strong {
  color: var(--text);
  font-weight: 700;
}

.info-block a.inline-link {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast);
}

.info-block a.inline-link:hover {
  border-color: var(--primary);
}

/* ============================================================
   FILTER (news page)
   ============================================================ */
.filter-bar {
  display: flex;
  justify-content: flex-end;
  max-width: 1100px;
  margin: 0 auto var(--space-6);
  padding: 0 var(--space-5);
}

.filter-dropdown {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: border-color var(--t-fast);
}

.filter-dropdown:hover {
  border-color: var(--primary);
}

.filter-dropdown strong {
  color: var(--primary);
  font-weight: 700;
}

/* ============================================================
   FOOTER — with Lunae logo
   ============================================================ */
.site-footer {
  margin-top: var(--space-9);
  padding: var(--space-7) var(--space-5) var(--space-6);
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(26, 26, 28, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.footer-logo {
  display: block;
  margin: 0 auto var(--space-3);
  /* The PNG is roughly horizontal; we cap its height and let width auto-scale. */
  height: 38px;
  width: auto;
  /* The original logo is light-grey on transparent — we shift it toward white
     for visibility, and add a subtle glow that picks up the palette. */
  filter: brightness(1.6) drop-shadow(0 0 12px rgba(46, 144, 234, 0.3));
  opacity: 0.92;
}

/* Brand motto under the logo. Letterspacing and uppercase give it the
   feeling of a cinematic title card. */
.footer-tagline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 auto var(--space-5);
  opacity: 0.95;
}

.footer-tagline span {
  /* Gradient text to echo the hero logo styling. */
  background: linear-gradient(90deg, var(--primary) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: color var(--t-fast),
              border-color var(--t-fast),
              background var(--t-fast);
}

.social-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.social-icon svg {
  width: 20px;
  height: 20px;
}

.copyright {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ============================================================
   SCROLL-TO-TOP
   ============================================================ */
.scroll-top {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 90;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--primary);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--t-mid),
              transform var(--t-mid),
              border-color var(--t-fast);
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.scroll-top svg {
  width: 18px;
  height: 18px;
}

/* ============================================================
   Reveal on page load (CSS-only stagger)
   ============================================================ */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.on-view {
  animation: reveal-up 700ms var(--ease) backwards;
}

.cards .on-view:nth-child(1),
.info-blocks .on-view:nth-child(1) { animation-delay: 0ms; }
.cards .on-view:nth-child(2),
.info-blocks .on-view:nth-child(2) { animation-delay: 90ms; }
.cards .on-view:nth-child(3),
.info-blocks .on-view:nth-child(3) { animation-delay: 180ms; }
.cards .on-view:nth-child(4),
.info-blocks .on-view:nth-child(4) { animation-delay: 270ms; }
.cards .on-view:nth-child(5),
.info-blocks .on-view:nth-child(5) { animation-delay: 360ms; }
.cards .on-view:nth-child(6),
.info-blocks .on-view:nth-child(6) { animation-delay: 450ms; }

@media (prefers-reduced-motion: reduce) {
  .on-view { animation: none; }
}

/* ============================================================
   Utility
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive refinements ---------- */
@media (max-width: 480px) {
  .nav-pill {
    padding: 6px;
  }
  .nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: 0.7rem;
  }
}
