/* ==========================================================================
   NX Media — Portail multimédia
   ========================================================================== */

:root {
  --nx-black: #0e0e10;
  --nx-black-2: #131317;
  --nx-gray: #7b7b81;
  --nx-purple: #aa5cc3;
  --nx-purple-2: #7c6ff0;
  --nx-blue: #4f8dfd;
  --nx-text: #f4f4f6;
  --nx-text-dim: #a9a9b3;

  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.09);

  --radius-lg: 22px;
  --radius-md: 14px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

/* Respect a light-preference browser but keep dark as the visual default,
   per brief: "dark mode par défaut" with optional system detection. */
@media (prefers-color-scheme: light) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 8%, rgba(170, 92, 195, 0.16), transparent 45%),
    radial-gradient(circle at 85% 88%, rgba(79, 141, 253, 0.14), transparent 50%),
    var(--nx-black);
  color: var(--nx-text);
  font-family: "Space Grotesk", "Inter", "Outfit", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Reduced motion: freeze animations, keep layout */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- background atmosphere ---------- */

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.glow-a {
  width: 480px;
  height: 480px;
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, rgba(170, 92, 195, 0.35), transparent 70%);
}
.glow-b {
  width: 520px;
  height: 520px;
  bottom: -200px;
  right: -160px;
  background: radial-gradient(circle, rgba(79, 141, 253, 0.3), transparent 70%);
}

/* ---------- layout ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6vh 6vw 4vh;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 8vh;
  opacity: 0;
  animation: rise 0.7s var(--ease) 0.05s forwards;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(170, 92, 195, 0.45));
}

.brand-name {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--nx-text-dim);
}
.brand-name strong {
  font-weight: 700;
  color: var(--nx-text);
}

.tagline {
  margin: 0;
  color: var(--nx-text-dim);
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ---------- cards ---------- */

.services {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 720px) {
  .services {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 38px 32px 32px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.7s var(--ease) forwards;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:nth-of-type(1) { animation-delay: 0.16s; }
.card:nth-of-type(2) { animation-delay: 0.26s; }

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.18);
}

.card:focus-visible {
  outline: 2px solid var(--nx-purple-2);
  outline-offset: 3px;
}

.card-jellyfin:hover { box-shadow: 0 20px 60px -20px rgba(170, 92, 195, 0.5); }
.card-seerr:hover    { box-shadow: 0 20px 60px -20px rgba(79, 141, 253, 0.5); }

.card-glow {
  position: absolute;
  inset: -40% -40% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: -1;
  transition: opacity 0.35s var(--ease);
}
.card-jellyfin .card-glow { background: radial-gradient(circle, var(--nx-purple), transparent 70%); }
.card-seerr .card-glow    { background: radial-gradient(circle, var(--nx-blue), transparent 70%); }
.card:hover .card-glow { opacity: 0.85; }

.card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  margin-bottom: 6px;
  transition: transform 0.35s var(--ease);
}
.card:hover .card-icon { transform: scale(1.06); }

.card-icon svg { width: 26px; height: 26px; }
.card-jellyfin .card-icon { color: var(--nx-purple); }
.card-seerr .card-icon    { color: var(--nx-blue); }

.card-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0;
  color: var(--nx-text-dim);
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 2.8em;
}

.card-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--nx-black);
  transition: gap 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.card-jellyfin .card-cta { background: linear-gradient(135deg, var(--nx-purple), var(--nx-purple-2)); }
.card-seerr .card-cta    { background: linear-gradient(135deg, var(--nx-blue), #6ea8ff); }

.card-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease);
}

.card:hover .card-cta { gap: 12px; }
.card:hover .card-cta svg { transform: translateX(2px); }

.card-jellyfin:hover .card-cta { box-shadow: 0 8px 24px -6px rgba(170, 92, 195, 0.6); }
.card-seerr:hover .card-cta    { box-shadow: 0 8px 24px -6px rgba(79, 141, 253, 0.6); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: auto;
  padding-top: 8vh;
  opacity: 0;
  animation: rise 0.7s var(--ease) 0.4s forwards;
}

.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(169, 169, 179, 0.6);
  letter-spacing: 0.02em;
}

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
