/* ══════════════════════════════════════════════════════════════════════════
   Rikkei TomoLive - trang QR cho Global Summit (index.html)
   Dựng theo docs/landing-page-new.jpg. Một màn hình, nền sáng, dồn toàn bộ
   sự chú ý vào 4 mã QR.
   Trang giới thiệu sản phẩm (nền tối) nằm riêng ở about.html + about.css.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --font-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
             "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  --font-display: "Be Vietnam Pro", var(--font-jp), system-ui, sans-serif;
  --font-body: Inter, "Be Vietnam Pro", var(--font-jp), system-ui, sans-serif;

  /* Nền đỏ + vàng nhấn: lấy mẫu từ globalsummit.rikkeisoft.com để trang này
     đứng cạnh site sự kiện không bị lạc. */
  --red-deep: #6e0000;
  --red: #a80000;
  --red-bright: #c40400;
  --gold: #ffd447;

  /* Mực trên thẻ trắng - lấy mẫu từ file thiết kế */
  --ink: #0b1444;
  --ink-body: #35406d;

  /* Bốn seminar: nền thẻ nhạt + màu nhấn đậm */
  --s1-tint: #fcecf8;  --s1: #f5156b;
  --s2-tint: #f4ecfc;  --s2: #7b2ff7;
  --s3-tint: #e4f0fc;  --s3: #0a6cf5;
  --s4-tint: #fcf0e8;  --s4: #f57000;

  --shell: 1180px;
  --gut: 40px;
}

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

html { overflow-x: clip; }

body {
  position: relative;        /* mốc cho .waves */
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 85% at 88% 2%, rgba(214, 12, 4, .92) 0%, rgba(214,12,4,0) 58%),
    linear-gradient(142deg, var(--red-deep) 0%, var(--red) 52%, var(--red-bright) 100%);
  /* KHÔNG dùng background-attachment:fixed: nó neo nền theo khung nhìn, nên
     trang nào dài hơn màn hình sẽ hụt nền ở phần dưới. iOS Safari lại còn xử
     lý thuộc tính này sai. Để mặc định thì nền trải đúng chiều cao tài liệu. */
  color: #fff;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }
img { max-width: 100%; display: block; }
a { text-decoration: none; }

:focus-visible { outline: 3px solid var(--s3); outline-offset: 3px; border-radius: 6px; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 22px; height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico--sm { width: 15px; height: 15px; }
.ico--lg { width: 26px; height: 26px; }

/* ─── phông nền trang trí ──────────────────────────────────────────────────
   Sóng chỉ là trang trí: aria-hidden, không nhận chuột, nằm dưới mọi thứ.

   absolute chứ không fixed: trang có thể dài hơn màn hình trên laptop thấp,
   và fixed sẽ làm sóng trôi đè lên giữa các thẻ khi cuộn. */
.waves {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
.waves { left: 0; right: 0; bottom: 0; line-height: 0; }
.waves svg { width: 100%; height: clamp(120px, 17vh, 210px); display: block; }

/* ─── header ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px 0;
}
.brand { display: block; line-height: 0; }
/* Nền đỏ nên dùng thẳng bản trắng được giao, không cần lật mực nữa. */
.brand img { height: 58px; width: auto; }

.topbar__actions { display: flex; align-items: center; gap: 10px; }

.langpick { position: relative; }
.langpick__btn, .pillbtn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding-inline: 20px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: 600 15px var(--font-body);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .16s ease;
}
.langpick__btn:hover, .pillbtn:hover { background: rgba(255, 255, 255, .22); }
.pillbtn .ico { color: var(--gold); }
.pillbtn__label { white-space: nowrap; }
.langpick__btn .ico { color: var(--gold); }
.langpick__caret { color: #fff; transition: transform .16s ease; }
.langpick__btn[aria-expanded="true"] .langpick__caret { transform: rotate(180deg); }

.langpick__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 186px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(11, 20, 68, .18);
}
.langpick__opt {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 500 15px var(--font-body);
  text-align: left;
  cursor: pointer;
}
.langpick__opt:hover { background: #f1f5fd; }
.langpick__opt .ico { color: var(--s3); opacity: 0; }
.langpick__opt[aria-checked="true"] .ico { opacity: 1; }

/* ─── phần chữ dẫn ───────────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
/* KHÔNG đặt max-width lên .intro: nó cũng là .shell, mà .shell có
   margin-inline:auto - hai thứ cộng lại sẽ căn giữa cả khối thay vì để nó
   thẳng hàng với logo. Giới hạn bề ngang đặt lên từng dòng chữ. */
.intro { padding-block: 22px 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--gold);
  font-weight: 700;
  font-size: 19px;
}
.h1 {
  /* max-width giữ text-wrap:balance chia tiêu đề thành 2 dòng như thiết kế.
     Cỡ chữ đã hạ xuống 40px để cả trang vừa một màn hình desktop, không cuộn. */
  max-width: 820px;
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.16;
  letter-spacing: -.5px;
  text-wrap: balance;
}

.lead {
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .9);
  text-wrap: pretty;
}

/* ─── 4 thẻ seminar ──────────────────────────────────────────────────────── */
.seminars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  padding-block: 24px 0;
}
.seminar {
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  border-radius: 22px;
  /* Khai màu mực NGAY TRÊN THẺ: body là chữ trắng (nền đỏ) còn thẻ thì nền
     trắng, nên mọi thứ bên trong phải tự lật lại. Đặt ở đây thay vì từng con
     để phần tử thêm sau này không lặng lẽ thành trắng-trên-trắng. */
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--tint) 100%);
  box-shadow: 0 14px 34px rgba(60, 0, 0, .28);
  min-width: 0;
}
.seminar__head { display: flex; align-items: center; gap: 13px; }
.seminar__n {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}
.seminar__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
}
.seminar__topic {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  /* Tiêu đề thật dài hơn hẳn bản nháp - seminar 2 tới 86 ký tự - nên cỡ chữ
     nhỏ hơn thiết kế một nấc để không đội thẻ lên quá cao. */
  font-size: 16.5px;
  line-height: 1.34;
}

/* Giờ và phòng: thứ giúp khách đang ngồi trong phòng chọn đúng luồng dịch.
   margin-bottom:auto nuốt hết khoảng trống còn lại, nên QR và nút của cả bốn
   thẻ luôn nằm cùng một mốc dù tiêu đề dài ngắn khác nhau. */
.seminar__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* margin-top:auto (chứ không phải bottom): khoảng trống dồn lên PHÍA TRÊN
     dòng này, nên giờ/phòng của cả bốn thẻ nằm cùng một mốc ngay trên mã QR,
     thay vì trôi theo độ dài tiêu đề. */
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--accent) 55%, #46527c);
}
.seminar__meta span:first-child { font-weight: 600; }
.seminar__qr {
  width: min(150px, 100%);
  aspect-ratio: 1;
  margin: 16px auto 0;
  padding: 9px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(11, 20, 68, .07);
}
.seminar__qr svg { width: 100%; height: 100%; display: block; }

.seminar__go {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  height: 46px;
  padding-inline: 18px;
  border-radius: 999px;
  background: linear-gradient(100deg,
              color-mix(in srgb, var(--accent) 84%, #fff) 0%,
              var(--accent) 62%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: filter .16s ease, transform .16s ease;
}
.seminar__go:hover { filter: brightness(1.07); transform: translateY(-1px); }
.seminar__go .ico--sm:last-child { margin-left: auto; }

/* Màn lớn luôn thấy đủ 4 mã QR nên không cần nút này. */
.qrtoggle-row { display: none; }

/* ─── chân trang ─────────────────────────────────────────────────────────── */
.site-foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding-block: 24px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}
.site-foot::before, .site-foot::after {
  content: "";
  width: clamp(40px, 7vw, 86px);
  height: 1.5px;
  background: var(--gold);
  opacity: .8;
}

/* ══════════════════════════ RESPONSIVE ══════════════════════════════════ */

/* Màn hình THẤP (laptop 1366×768 và tương tự): nén khoảng đệm để cả trang vẫn
   gọn trong một màn hình, không phải cuộn.

   Chủ ý KHÔNG đụng tới kích thước mã QR. Hạ nó xuống là mật độ tụt từ
   2.93 xuống ~2.6 px/module, phá đúng thứ cả trang này sinh ra để phục vụ.
   Chiều cao lấy lại từ khoảng đệm, không lấy từ chức năng. */
@media (min-width: 721px) and (max-height: 820px) {
  .topbar { padding-block: 14px 0; }
  .brand img { height: 50px; }
  .langpick__btn, .pillbtn { height: 40px; }

  .intro { padding-block: 14px 0; }
  .h1 { font-size: clamp(28px, 3.2vw, 36px); }
  .lead { font-size: 16px; }

  .seminars { padding-block: 16px 0; gap: 18px; }
  .seminar { padding: 13px 20px; }
  .seminar__topic { margin-top: 8px; }
  .seminar__qr { margin-top: 12px; }
  .seminar__go { margin-top: 12px; height: 42px; }

  .site-foot { padding-block: 15px 13px; }
}

/* Nấc hai, cho 720p - độ phân giải hay gặp khi chiếu màn hình. Vẫn không
   đụng tới mã QR. */
@media (min-width: 721px) and (max-height: 745px) {
  .topbar { padding-block: 10px 0; }
  .brand img { height: 46px; }
  .h1 { font-size: clamp(26px, 3vw, 34px); }
  .seminars { padding-block: 13px 0; }
  .site-foot { padding-block: 11px 10px; }
}


@media (max-width: 1100px) {
  :root { --gut: 28px; }
  .seminars { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}

/* Điện thoại: thẻ chuyển thành hàng ngang - chữ bên trái, QR và nút bên phải,
   đúng như cột mobile trong file thiết kế. */
@media (max-width: 720px) {
  :root { --gut: 18px; }

  .topbar { padding-block: 20px 0; }
  .brand img { height: 42px; }
  .langpick__btn, .pillbtn { height: 40px; padding-inline: 14px; font-size: 14px; }
  /* Topbar hẹp: bỏ chữ, giữ icon. Icon chia sẻ đủ quen để tự nói lên việc. */
  .pillbtn__label { display: none; }
  .pillbtn { padding-inline: 12px; }

  .intro { padding-block: 26px 0; }
  .eyebrow { font-size: 16px; }
  .lead { margin-top: 12px; font-size: 14.5px; }

  .seminars { grid-template-columns: 1fr; gap: 12px; padding-block: 24px 0; }

  .seminar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    column-gap: 12px;
    padding: 16px;
    border-radius: 18px;
  }
  /* display:contents gỡ hộp của .seminar__head đi, để badge và tên trở thành
     ô lưới trực tiếp. Không có dòng này thì cả cụm badge+tên nằm gọn trong
     cột 1, và tiêu đề ở cột 2 bị thụt hẳn sang phải, lệch khỏi chữ "Seminar N". */
  .seminar__head { display: contents; }
  .seminar__n { grid-column: 1; grid-row: 1; width: 34px; height: 34px; font-size: 16px; }
  .seminar__name { grid-column: 2; grid-row: 1; font-size: 16px; align-self: center; }
  .seminar__topic {
    grid-column: 2; grid-row: 2;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.35;
  }
  .seminar__meta {
    grid-column: 2; grid-row: 3;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin: 6px 0 0;
    font-size: 12.5px;
  }
  .seminar__qr {
    grid-column: 3; grid-row: 1 / span 3;
    width: 84px;
    margin: 0;
    padding: 6px;
    border-radius: 10px;
  }
  .seminar__go {
    grid-column: 2 / -1;
    grid-row: 4;
    justify-self: end;
    width: min(100%, 190px);
    margin-top: 12px;
    height: 36px;
    font-size: 13px;
  }

  /* Vào trang này nghĩa là vừa quét một mã QR xong; bày thêm bốn mã nữa trên
     điện thoại chỉ làm rối. Ẩn đi, để sau một nút cho ai cần đưa người khác xem. */
  .seminars:not(.is-open) .seminar__qr { display: none; }

  .qrtoggle-row { display: flex; justify-content: center; padding-top: 16px; }
  .qrtoggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font: 600 13.5px var(--font-body);
    cursor: pointer;
    backdrop-filter: blur(6px);
  }
  .qrtoggle:hover { background: rgba(255, 255, 255, .22); }
  .qrtoggle .ico { color: var(--gold); }

  .site-foot { padding-block: 32px 24px; font-size: 14px; }
}

@media (max-width: 400px) {
  .seminar { column-gap: 9px; padding: 13px; }
  .seminar__qr { width: 78px; }
  .seminar__go { width: 100%; }
}

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

/* Bản in: bỏ nền trang trí, cho QR to và nét */
@media print {
  .waves, .langpick { display: none !important; }
  .seminars { grid-template-columns: repeat(2, 1fr); }
  .seminar { break-inside: avoid; }
}
