/* Trung tâm dữ liệu Solina. Khung gốc PSD 1440 x 900; 1 đơn vị --u = 1px trên khung đó. */
@font-face {
  font-family: "Exemplar Pro";
  src: url("/fonts/ExemplarPro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --u: clamp(0.5px, min(100vw / 1440, 100svh / 900), 1.6px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #3f5f9a;
  color: #fff;
  font-family: "Exemplar Pro", "Cormorant Garamond", Georgia, serif;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
}

/* Ảnh nền: phủ kín, neo mép trên, lệch trái như PSD (ảnh 1830 x 1022 đặt tại x = -60) */
.nen {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.nen img {
  display: block;
  width: 100%;
  height: 113.6%;
  object-fit: cover;
  object-position: 15% 0;
}

.khung {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 54.98%;
  width: calc(933 * var(--u));
  transform: translateX(-50%);
}

.dau { text-align: center; transform: translateX(calc(3.8 * var(--u))); }

.logo {
  display: block;
  width: calc(309 * var(--u));
  height: auto;
  margin: calc(44 * var(--u)) auto 0;
  filter: drop-shadow(0 calc(1 * var(--u)) calc(3 * var(--u)) rgba(20, 30, 60, 0.35));
}

h1 {
  margin: calc(24 * var(--u)) 0 0;
  font-weight: 400;
  font-size: calc(49.2 * var(--u));
  line-height: calc(60 * var(--u));
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 calc(2 * var(--u)) calc(5 * var(--u)) rgba(20, 30, 70, 0.55);
}

.luoi {
  display: grid;
  grid-template-columns: repeat(5, calc(137.6 * var(--u)));
  column-gap: calc(61.25 * var(--u));
  row-gap: calc(16.5 * var(--u));
  margin-top: calc(18.6 * var(--u));
}

.o {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 18%;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  animation: hien 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(0.12s + var(--i) * 0.05s);
}
.o img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.28s ease;
  will-change: transform;
}
.o:hover img,
.o:focus-visible img {
  transform: translateY(-4%) scale(1.07);
  filter: brightness(1.1) drop-shadow(0 8px 14px rgba(15, 25, 60, 0.45));
}
.o:active img { transform: scale(0.98); }
.o:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #fff;
  border-radius: 18%;
  transform: translateY(-4%) scale(1.07);
}

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

/* Điện thoại và màn dọc: 2 cột x 5 hàng */
@media (max-width: 720px), (max-aspect-ratio: 1/1) {
  :root {
    --o: min(38vw, 190px, calc((100svh - 190px) / 5 - 12px));
  }
  body { overflow: auto; }
  .nen img {
    height: 100%;
    object-position: 60% 50%;
  }
  .nen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(30, 45, 90, 0.28) 0%, rgba(30, 45, 90, 0) 30%);
  }
  .khung {
    position: relative;
    left: auto;
    transform: none;
    width: 100%;
    min-height: 100svh;
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .dau { transform: none; }
  .logo {
    width: min(58vw, 250px);
    margin-top: 4px;
    filter: drop-shadow(0 1px 3px rgba(20, 30, 60, 0.4));
  }
  h1 {
    margin-top: 14px;
    font-size: clamp(24px, 7.6vw, 40px);
    line-height: 1.1;
    text-shadow: 0 2px 5px rgba(20, 30, 70, 0.55);
  }
  .luoi {
    grid-template-columns: repeat(2, var(--o));
    gap: 12px clamp(14px, 6vw, 36px);
    margin: auto 0;
    padding: 14px 0;
  }
}

/* Màn ngang rất thấp (điện thoại xoay ngang): giữ bố cục 5 cột, thu theo chiều cao */
@media (max-height: 420px) and (min-aspect-ratio: 1/1) {
  :root { --u: min(100vw / 1440, 100svh / 560); }
  .logo { margin-top: calc(20 * var(--u)); }
  h1 { margin-top: calc(12 * var(--u)); }
  .luoi { margin-top: calc(24 * var(--u)); }
}

@media (prefers-reduced-motion: reduce) {
  .o { animation: none; }
  .o img { transition: none; }
}
