/* =====================
   Variables
===================== */
:root {
  --bg-image: url('assets/bg-ardubx.jpg');
  --accent: #e3002a;
  --text: #e3002a;
  --artg-accent: #00e3a3;
}

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

html, body {
  height: 100%;
  min-height: 100dvh;
  margin: 0;

  background-color: #000;

  color: #fff;
  font-family: 'Syne Mono', monospace;

  /* background image moved to `body::before` to allow smooth transform-based slowzoom */
}

/* full-screen background layer used for a smooth transform-based slow zoom */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('images/UFOWall.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  transform-origin: center center;
  will-change: transform;
  transform: scale(1);
  /* play once over 10s and keep final (stopped zoom) */
  animation: slowzoom 10s ease-in-out forwards;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
}

@keyframes slowzoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}
/* =====================
   Layout principal
===================== */
.wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 6vh 4vw;
  position: relative;
  z-index: 1;
  overflow: hidden;

  background:
    radial-gradient(65% 45% at 50% 50%, rgba(0,0,0,.2), transparent 60%);
  background-size: cover;
  background-position: center;
}

/* =====================
   Grain / noise
===================== */
.noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  mix-blend-mode: overlay;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.5"/></svg>');
}

/* =====================
   Logo + scanner K2000
===================== */
.k2000-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
}

.brand {
  font-family: 'Revalia', cursive;
  font-size: clamp(28px, 5.2vw, 57px); /* –5% */
  font-weight: 200;
  color: var(--text);
  text-shadow:
    0 0 3px rgba(227,0,42,.22),
    0 0 8px rgba(227,0,42,.25);
  padding-bottom: 6px;
  animation: pulse 6s ease-in-out infinite;
}


/* Scanner */
.scanner-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3.5px;
  opacity: 1.8;

  background: linear-gradient(
    to right,
    transparent 0%,
    var(--text) 55%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: k2000-scan 2s infinite linear alternate;
}

@keyframes k2000-scan {
  0%   { background-position:-100% 0; }
  100% { background-position:100% 0; }
}

@keyframes pulse {
  0% {
    text-shadow:
      0 0 3px rgba(227,0,42,.22),
      0 0 8px rgba(227,0,42,.25);
  }
  50% {
    text-shadow:
      0 0 6px rgba(227,0,42,.4),
      0 0 14px rgba(227,0,42,.45);
  }
  100% {
    text-shadow:
      0 0 3px rgba(227,0,42,.22),
      0 0 8px rgba(227,0,42,.25);
  }
}


/* =====================
   Boutons
===================== */
.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  max-width: 520px;
  justify-items: center;
}

.link {
  position: relative;
  width: 150px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: .05em;

  border-radius: 10px;
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, #141414 0%, #050505 100%);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.08),
    inset 0 -2px 4px rgba(0,0,0,.6),
    0 0 10px rgba(227,0,42,.35);
  transition: all .25s ease;
}

.link::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  border: 1px solid rgba(227,0,42,.3);
  pointer-events: none;
}

.link:hover {
  transform: translateY(-3px);
  color: var(--artg-accent);
  letter-spacing: 0.08em;
  box-shadow:
    0 0 20px rgba(227,0,42,.9),
    inset 0 0 12px rgba(227,0,42,.5);
}

.link:last-child {
  grid-column: 1 / -1;
}

/* Artgorithme specific styling */
.link.artgorithme {
  border-color: var(--artg-accent);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.08),
    inset 0 -2px 4px rgba(0,0,0,.6),
    0 0 10px rgba(0,227,163,.35);
}

.link.artgorithme::before {
  border-color: rgba(0,227,163,.3);
}

.link.artgorithme:hover {
  transform: translateY(-3px);
  color: var(--artg-accent);
  box-shadow:
    0 0 20px rgba(0,227,163,.9),
    inset 0 0 12px rgba(0,227,163,.5);
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::before,
  .brand,
  .scanner-bar {
    animation: none !important;
  }
}

/* Mobile / small screens adjustments */
@media (max-width: 600px) {
  /* Stop heavy background animation on mobile and keep a slight scale */
  body::before {
    /* enable slowzoom on mobile too (gentler on small screens) */
    animation: slowzoom 10s ease-in-out forwards;
    transform-origin: center center;
    background-position: center top;
    -webkit-transform: translateZ(0);
  }

  /* Make wrap less padded and ensure it sits above the bg */
  .wrap {
    padding: 5vh 4vw;
  }

  /* Links stack full width on small screens */
  .links {
    grid-template-columns: 1fr;
    gap: .75rem;
    max-width: 420px;
    width: 100%;
    padding: 0 1rem;
  }

  .link {
    width: 100%;
    max-width: 100%;
    height: 48px;
    font-size: 16px;
  }

  .link::before {
    inset: 2px;
  }

  .brand {
    font-size: clamp(24px, 8vw, 40px);
  }

  .scanner-bar {
    height: 2px;
  }

  .noise {
    opacity: .06;
  }
}

/* Tablet adjustments (portrait and small landscape tablets) */
@media (min-width: 601px) and (max-width: 1024px) {
  /* Keep a gentle animation but shorter and less intense on tablets */
  body::before {
    animation: slowzoom 10s ease-in-out forwards;
    transform-origin: center center;
    /* final scale slightly reduced for tablets */
  }

  /* Layout: two columns of links on tablets for better balance */
  .links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 760px;
  }

  .link {
    width: 100%;
    max-width: 100%;
    height: 48px;
    font-size: 15px;
  }

  .brand {
    font-size: clamp(26px, 6.5vw, 52px);
  }

  .wrap {
    padding: 6vh 6vw;
  }
}
