:root {
  --navy: #0c1e38;
  --navy-deep: #071527;
  --ink: #0b1a2e;
  --muted: #5a6b82;
  --accent: #1a5fcc;
  --accent-soft: rgba(26, 95, 204, 0.12);
  --line: rgba(11, 26, 46, 0.1);
  --radius: 12px;
  --font-display: "Manrope", "Be Vietnam Pro", sans-serif;
  --font-body: "Be Vietnam Pro", sans-serif;
  --shadow: 0 8px 20px rgba(7, 21, 39, 0.08);
  --page-pad-x: clamp(12px, 2.2vw, 28px);
}

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

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #dfe7f2;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  position: relative;
  display: flex;
  flex-direction: column;
}

.welcome-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(26, 95, 204, 0.22), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(12, 30, 56, 0.18), transparent 50%),
    linear-gradient(165deg, #e8eef8 0%, #d5e0ef 45%, #c9d6e8 100%);
}

.welcome-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(12, 30, 56, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 30, 56, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

.welcome-top {
  position: absolute;
  top: 10px;
  right: var(--page-pad-x);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.welcome-lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
}

.welcome-lang button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.welcome-lang button.is-active {
  background: var(--navy);
  color: #fff;
}

.welcome-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px var(--page-pad-x) 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.welcome-hero {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 16px;
  flex: 0 0 auto;
  animation: rise 0.7s ease both;
}

.welcome-logo {
  display: block;
  width: min(200px, 48vw);
  height: auto;
  margin: 0 auto 10px;
  filter: drop-shadow(0 6px 14px rgba(7, 21, 39, 0.1));
}

.welcome-hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--navy-deep);
}

.welcome-lead {
  margin: 0 auto;
  max-width: 560px;
  font-size: clamp(0.82rem, 1.2vw, 0.95rem);
  color: var(--muted);
}

.welcome-apps {
  flex: 0 1 auto;
  min-height: 0;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.welcome-card {
  --card-bg: #edf3fb;
  --card-border: rgba(11, 26, 46, 0.1);
  --card-title: #0c1e38;
  --card-desc: #5a6b82;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  height: 100px;
  min-height: 100px;
  padding: 12px 10px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
  animation: rise 0.55s ease both;
}

.welcome-card:hover,
.welcome-card:focus-visible {
  transform: translateY(-3px);
  filter: brightness(1.03);
  box-shadow: 0 12px 26px rgba(7, 21, 39, 0.12);
  outline: none;
}

.welcome-card:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft), 0 12px 26px rgba(7, 21, 39, 0.12);
}

.welcome-card-name {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.15vw, 1.12rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--card-title);
  line-height: 1.2;
}

.welcome-card-desc {
  margin: 0;
  font-size: 0.72rem;
  color: var(--card-desc);
  line-height: 1.3;
}

.welcome-card-url {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.welcome-foot {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 6px var(--page-pad-x) 10px;
  font-size: 0.7rem;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* Desktop: khóa 1 màn hình, không cần scroll */
@media (min-width: 901px) {
  body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .welcome-main {
    padding-top: 8px;
    padding-bottom: 4px;
  }

  .welcome-hero {
    margin-bottom: 14px;
  }

  .welcome-logo {
    width: 200px;
    margin-bottom: 8px;
  }

  .welcome-grid {
    gap: clamp(8px, 1vw, 12px);
  }

  .welcome-card {
    height: 96px;
    padding: clamp(10px, 1.1vh, 14px) 10px;
  }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .welcome-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    height: auto;
    overflow: auto;
  }

  .welcome-top {
    position: sticky;
    top: 0;
    right: auto;
    width: 100%;
    justify-content: flex-end;
    padding: 10px var(--page-pad-x) 0;
    background: linear-gradient(180deg, rgba(232, 238, 248, 0.95), rgba(232, 238, 248, 0));
  }

  .welcome-main {
    justify-content: flex-start;
    padding-top: 8px;
    padding-bottom: 20px;
  }

  .welcome-logo {
    width: min(200px, 56vw);
  }

  .welcome-hero {
    margin-bottom: 18px;
  }

  .welcome-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .welcome-card {
    height: 104px;
    min-height: 104px;
    padding: 14px 10px;
  }
}

@media (max-width: 560px) {
  .welcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .welcome-hero h1 {
    font-size: 1.28rem;
  }

  .welcome-lead {
    font-size: 0.84rem;
  }

  .welcome-card {
    height: 96px;
    min-height: 96px;
    padding: 12px 8px;
  }

  .welcome-card-name {
    font-size: 0.98rem;
  }

  .welcome-card-desc {
    font-size: 0.7rem;
  }

  .welcome-foot {
    padding-bottom: 16px;
  }
}

@media (max-width: 360px) {
  .welcome-grid {
    grid-template-columns: 1fr;
  }
}

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