/* ═══════════════════════════════════════════════════════
   Cards MLBB — Landing Page
   ═══════════════════════════════════════════════════════ */

/* ── Fonts ── */

@font-face {
  font-family: "Griffy";
  src: url("/static/site/fonts/Griffy-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Reza Zulmi Serif";
  src: url("/static/site/fonts/RezaZulmiSerif.ttf") format("truetype");
  font-display: swap;
}

/* ── Variables ── */

:root {
  --font-body: "Inter", system-ui, sans-serif;
  --font-title: "Griffy", cursive;
  --font-btn: "Reza Zulmi Serif", serif;

  --color-bg: #0a0a12;
  --color-text: rgba(255, 255, 255, 0.88);
  --color-text-muted: rgba(255, 255, 255, 0.4);

  --radius-card: clamp(24px, 6vw, 36px);
  --radius-btn: clamp(14px, 3.5vw, 20px);

  --parallax-strength: 20px;
}

/* ── Reset ── */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* ── Background ── */

.bg {
  position: fixed;
  inset: calc(var(--parallax-strength) * -1);
  z-index: 0;
  pointer-events: none;
}

.bg__image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  transition: opacity 0.8s ease;
  opacity: 0;
}

.bg__image.loaded {
  opacity: 1;
}

.bg__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(10, 10, 18, 0.3) 0%,
    rgba(10, 10, 18, 0.7) 70%,
    rgba(10, 10, 18, 0.85) 100%
  );
}

/* ── Language switcher ── */

.lang-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.lang-switch:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── Landing layout ── */

.landing {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}

/* ── Card ── */

.card {
  position: relative;
  width: min(92vw, 440px);
  padding: clamp(32px, 8vw, 56px) clamp(24px, 6vw, 40px) clamp(20px, 4vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-card);
  backdrop-filter: blur(20px) saturate(1.3) brightness(0.9);
  -webkit-backdrop-filter: blur(20px) saturate(1.3) brightness(0.9);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    rgba(0, 0, 0, 0.08) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 4px 16px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: card-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
}

/* ── Title ── */

@property --title-hue-1 {
  syntax: "<number>";
  inherits: false;
  initial-value: 270;
}

@property --title-hue-2 {
  syntax: "<number>";
  inherits: false;
  initial-value: 200;
}

@property --title-hue-3 {
  syntax: "<number>";
  inherits: false;
  initial-value: 40;
}

@property --title-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 120deg;
}

.card__title {
  line-height: 1;
  margin-bottom: 8px;
}

.card__title-text {
  font-family: var(--font-title);
  font-size: clamp(48px, 12vw, 68px);
  font-weight: 400;
  background-image: linear-gradient(
    var(--title-angle),
    hsl(var(--title-hue-1), 80%, 78%),
    hsl(var(--title-hue-2), 80%, 78%),
    hsl(var(--title-hue-3), 80%, 78%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    title-pulse 3s ease-in-out infinite alternate,
    title-color 8s linear infinite alternate;
}

@keyframes title-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.04);
  }
}

@keyframes title-color {
  from {
    --title-angle: 120deg;
    --title-hue-1: 270;
    --title-hue-2: 200;
    --title-hue-3: 40;
  }
  to {
    --title-angle: 240deg;
    --title-hue-1: 200;
    --title-hue-2: 40;
    --title-hue-3: 270;
  }
}

/* ── Subtitle ── */

.card__subtitle {
  font-size: clamp(14px, 3.5vw, 17px);
  color: var(--color-text-muted);
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: clamp(28px, 7vw, 48px);
}

/* ── Buttons ── */

.card__actions {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.5vw, 14px);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: clamp(48px, 12vw, 58px);
  font-family: var(--font-btn);
  font-size: clamp(18px, 5vw, 24px);
  text-decoration: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.btn:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

.btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Primary */

.btn--primary {
  background: linear-gradient(
    135deg,
    hsl(330, 52%, 58%),
    hsl(15, 80%, 55%),
    hsl(40, 85%, 55%)
  );
  background-size: 200% 200%;
  color: #1a0810;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 -1px 0 rgba(0, 0, 0, 0.1) inset,
    0 4px 16px rgba(200, 80, 60, 0.3);
  animation: btn-shimmer 4s ease infinite;
}

.btn--primary .btn__icon {
  stroke: #1a0810;
}

@keyframes btn-shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Secondary */

.btn--secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn--secondary .btn__icon {
  stroke: var(--color-text);
  opacity: 0.6;
}

/* Hover — desktop only */

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: scale(1.03);
  }

  .btn--primary:hover {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.4) inset,
      0 -1px 0 rgba(0, 0, 0, 0.1) inset,
      0 8px 24px rgba(200, 80, 60, 0.35);
  }

  .btn--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.15) inset,
      0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

/* ── Footer ── */

.card__footer {
  margin-top: clamp(24px, 6vw, 40px);
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.card__link {
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.card__link:hover {
  color: var(--color-text);
}

/* ── Responsive ── */

@media (max-width: 360px) {
  .card {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Mobile: disable parallax offset */
@media (hover: none) {
  :root {
    --parallax-strength: 0px;
  }

  .bg {
    inset: 0;
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .landing {
    align-items: flex-start;
    padding-top: 12px;
  }

  .card {
    padding-top: 20px;
    padding-bottom: 16px;
  }

  .card__subtitle {
    margin-bottom: 16px;
  }
}

/* Tablets */
@media (min-width: 768px) {
  .card {
    width: min(80vw, 480px);
  }

  .lang-switch {
    top: 28px;
    right: 28px;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .card {
    width: 480px;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .bg__image {
    will-change: auto;
  }
}
