/* Kho skill dựng video. Màu, chữ, nút, đầu trang, chân trang lấy từ /giao-dien.css;
   tệp này chỉ giữ phần riêng của trang kho và trang một skill. */

.an-chu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dau-duong { padding-top: 28px; }
.nut-nho { min-height: 44px; }

/* ---- Phần đầu ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; padding-top: 40px; padding-bottom: 80px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); line-height: 1.06; }
.hero h1 em { font-style: normal; color: var(--nhan); }
.mo-dau { margin-top: 20px; font-size: 1.12rem; color: var(--chu-mo); max-width: 40ch; }
.o-tim { position: relative; margin-top: 32px; max-width: 460px; }
.o-tim i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: var(--chu-mo); pointer-events: none; }
.o-tim input {
  width: 100%; height: 54px; box-sizing: border-box; padding: 0 16px 0 46px;
  border-radius: var(--bk-nut); border: 1px solid var(--vien-manh); background: var(--be-mat); color: var(--chu);
  font: inherit; font-size: 1rem; outline: none; transition: border-color .2s, box-shadow .2s;
}
.o-tim input::placeholder { color: var(--chu-mo); }
.o-tim input:focus { border-color: var(--nhan); box-shadow: 0 0 0 3px var(--nhan-nen); }
.dem-kho { margin-top: 12px; font-size: .88rem; color: var(--chu-mo); }
.dem-kho strong { color: var(--chu); }
.nut-huong-dan {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 16px; padding: 0 18px;
  border-radius: var(--bk-nut); border: 1.5px solid var(--nhan); background: var(--nhan-nen); color: var(--chu);
  font-size: .92rem; font-weight: 600; text-decoration: none;
}
.nut-huong-dan i { color: var(--nhan); font-size: 1.15rem; }
.nut-huong-dan:hover { background: var(--nhan); color: #fff; }
.nut-huong-dan:hover i { color: inherit; }
.nut-huong-dan:focus-visible { outline: 3px solid var(--nhan); outline-offset: 3px; }

.san { position: relative; padding: 36px 104px 36px 0; }
.quat { position: absolute; width: 150px; height: auto; aspect-ratio: 9 / 16; border-radius: 14px; border: 1px solid var(--vien); box-shadow: var(--bong); background: #0f1013; }
.quat-1 { right: 0; top: 0; transform: rotate(7deg); animation: noi-1 6s ease-in-out infinite; }
.quat-2 { right: 60px; top: 46px; transform: rotate(-3deg); animation: noi-2 6s ease-in-out infinite; }
@keyframes noi-1 { 0%, 100% { transform: rotate(7deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-8px); } }
@keyframes noi-2 { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(6px); } }
.video-goc { position: relative; z-index: 1; aspect-ratio: 16 / 9; border-radius: var(--bk-the); overflow: hidden; background: #111216; border: 1px solid var(--vien); box-shadow: var(--bong-noi); }
.video-goc img { width: 100%; height: 100%; object-fit: cover; }
/* Chừa phần bên phải cho hai khung xoè, để chú thích không nằm dưới chúng. */
.chu-thich { position: relative; z-index: 1; margin-top: 14px; font-size: .92rem; color: var(--chu-mo); max-width: min(48ch, calc(100% - 96px)); }
.chu-thich strong { color: var(--chu); }
/* Video gốc quay dọc: khung đứng bên trái, hai video mẫu xoè ra bên phải như thứ dựng ra từ nó. */
.san.doc { padding: 12px 0 0; }
.san.doc .video-goc { aspect-ratio: 9 / 16; width: min(270px, 100%); }
.san.doc .quat { width: 170px; }
.san.doc .quat-1 { right: 0; top: 24px; }
.san.doc .quat-2 { right: 110px; top: 88px; }
.san.doc .chu-thich { max-width: 48ch; }

/* Nút phát tròn đặt giữa ảnh bìa: dùng chung cho video gốc, ô skill và trang một skill. */
.nut-phat {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border: 0; padding: 0; background: transparent; cursor: pointer;
}
.nut-phat .vong {
  position: relative; width: 68px; height: 68px; border-radius: 50%; background: #f2a93b; color: #17120a;
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: transform .25s cubic-bezier(.16,1,.3,1);
}
.nut-phat .vong svg { width: 44%; height: 44%; margin-left: 6%; }
.nut-phat .vong::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(242, 169, 59, .6); animation: vong-phat 2.4s cubic-bezier(.16,1,.3,1) infinite; }
.nut-phat:hover .vong, .nut-phat:focus-visible .vong { transform: scale(1.06); }
/* Nút phủ kín khung ảnh có overflow hidden nên viền focus chung bị cắt: vẽ viền lên vòng tròn. */
.nut-phat:focus-visible { outline: none; }
.nut-phat:focus-visible .vong { outline: 3px solid var(--nhan); outline-offset: 4px; }
.nut-phat.nho .vong { width: 48px; height: 48px; font-size: 1.2rem; }
@keyframes vong-phat { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

/* ---- Danh mục ---- */
.kho { padding: 8px 0 104px; }
.nhan-loc { margin: 28px 0 10px; font-size: .88rem; font-weight: 600; color: var(--chu-mo); }
.hang-loc { display: flex; flex-wrap: wrap; gap: 8px; }
.loc {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--vien-manh); background: var(--be-mat); color: var(--chu);
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; transition: border-color .2s, background .2s, color .2s;
}
.loc:hover { border-color: var(--nhan); }
.loc .so { font-size: .75rem; color: var(--chu-mo); }
.loc[aria-pressed="true"] { background: var(--chu); border-color: var(--chu); color: var(--nen); }
.loc[aria-pressed="true"] .so { color: var(--nen); opacity: .75; }

.luoi-skill { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 32px; }
.the-skill {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; padding: 16px;
  border-radius: var(--bk-the); background: var(--be-mat); border: 1px solid var(--vien);
  transition: border-color .2s, box-shadow .35s, transform .35s cubic-bezier(.16,1,.3,1);
}
.the-skill:hover { border-color: var(--vien-manh); box-shadow: var(--bong); transform: translateY(-2px); }
.anh-skill { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: var(--bk-nho); overflow: hidden; background: #0f1013; }
.anh-skill img { width: 100%; height: 100%; object-fit: cover; }
.tin { display: flex; flex-direction: column; min-width: 0; padding: 4px 4px 2px 0; }
.tin h3 { font-size: 1.15rem; line-height: 1.3; }
.tin h3 a { text-decoration: none; }
.tin h3 a:hover { color: var(--nhan); }
.so-skill { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; color: var(--nhan); margin-right: .5em; font-size: .9em; }
.so-lon { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--nhan); margin-bottom: 10px; }
.ma-skill { margin-top: 2px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .74rem; color: var(--chu-mo); overflow-wrap: anywhere; }
.mo-ta { margin-top: 10px; font-size: .93rem; line-height: 1.55; color: var(--chu-mo); }
.dau-vao { margin: 14px 0 0; font-size: .86rem; line-height: 1.45; }
.dau-vao dt { font-weight: 600; }
.dau-vao dd { margin: 2px 0 0; color: var(--chu-mo); }
.hanh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: auto; padding-top: 18px; }
.trang-thai { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--chu-mo); }
.trang-thai.co { color: var(--luc); }

.the-moi { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 12px; padding: 32px; border-radius: var(--bk-the); border: 1.5px dashed var(--vien-manh); }
.the-moi p { color: var(--chu-mo); font-size: .93rem; max-width: 40ch; }
.cong { width: 48px; height: 48px; border-radius: 12px; background: var(--nhan-nen); color: var(--nhan); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.trong-kho { grid-column: 1 / -1; padding: 40px; border-radius: var(--bk-the); border: 1px solid var(--vien); background: var(--be-mat); text-align: center; color: var(--chu-mo); }
.trong-kho strong { display: block; color: var(--chu); font-size: 1.05rem; margin-bottom: 4px; }

/* ---- Cách dùng ---- */
.cach { background: var(--be-mat); border-top: 1px solid var(--vien); border-bottom: 1px solid var(--vien); padding: 88px 0; }
.ba-cot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 44px; }
.cot { padding: 0 32px; border-left: 1px solid var(--vien); }
.cot:first-child { padding-left: 0; border-left: 0; }
.cot p { margin-top: 6px; color: var(--chu-mo); font-size: .95rem; max-width: 32ch; }
.lenh { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 6px 6px 14px; border-radius: var(--bk-nut); background: var(--nen); border: 1px solid var(--vien); }
.lenh code { flex: 1; min-width: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .8rem; line-height: 1.5; overflow-wrap: anywhere; }
.nut-chep {
  flex: none; min-height: 40px; min-width: 92px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--vien-manh);
  background: var(--be-mat); color: var(--chu); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.nut-chep:hover { border-color: var(--nhan); }

/* ---- Hai đường chạy ---- */
.duong-chay { padding: 104px 0 16px; }
.hai-o { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.o-duong { padding: 32px; border-radius: var(--bk-the); border: 1px solid var(--vien); background: var(--be-mat); }
.o-duong.nong { background: var(--nhan-nen); }
.o-duong h3 { margin-top: 18px; font-size: 1.2rem; }
.o-duong p { margin-top: 8px; color: var(--chu-mo); font-size: .95rem; }
.o-duong ul { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .92rem; }
.o-duong li { display: flex; gap: 10px; align-items: flex-start; }
.o-duong li i { margin-top: 4px; color: var(--nhan); }
.bieu-tuong { width: 48px; height: 48px; border-radius: 12px; background: var(--be-mat); color: var(--nhan); border: 1px solid var(--vien); display: flex; align-items: center; justify-content: center; font-size: 1.45rem; }

/* ---- Trang một skill ---- */
.ve-kho { display: inline-flex; align-items: center; gap: 6px; padding-top: 28px; font-size: .9rem; color: var(--chu-mo); text-decoration: none; }
.ve-kho:hover { color: var(--nhan); }
.khung.ct { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; padding-top: 24px; padding-bottom: 88px; }
.cot-xem { max-width: 400px; }
.chon-xem { display: inline-flex; padding: 4px; border-radius: var(--bk-nut); background: var(--be-mat); border: 1px solid var(--vien); margin-bottom: 14px; }
.chon-xem button { min-height: 40px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; color: var(--chu-mo); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.chon-xem button[aria-pressed="true"] { background: var(--chu); color: var(--nen); }
.may { position: relative; aspect-ratio: 9 / 16; border-radius: var(--bk-the); overflow: hidden; background: #0f1013; border: 1px solid var(--vien); box-shadow: var(--bong-noi); }
.may img { width: 100%; height: 100%; object-fit: cover; }
.may.ngang img { object-fit: contain; }
.ghi-may { margin-top: 12px; font-size: .88rem; color: var(--chu-mo); }
.khung.ct h1 { font-size: clamp(2rem, 3.8vw, 3rem); }
.khung.ct .ma-skill { margin-top: 6px; font-size: .82rem; }
.khung.ct .gioi { margin-top: 18px; font-size: 1.08rem; color: var(--chu-mo); max-width: 56ch; overflow-wrap: anywhere; }
.su-kien { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; margin: 32px 0 0; padding: 24px 0; border-top: 1px solid var(--vien); border-bottom: 1px solid var(--vien); }
.su-kien dt { font-size: .82rem; font-weight: 600; color: var(--chu-mo); }
.su-kien dd { margin: 2px 0 0; font-weight: 600; }
.lay { margin-top: 32px; padding: 24px; border-radius: var(--bk-the); background: var(--be-mat); border: 1px solid var(--vien); }
.lay h2 { font-size: 1.25rem; }
.lay > p { margin-top: 8px; color: var(--chu-mo); font-size: .93rem; }
.lay .lenh code { font-size: .95rem; font-weight: 700; color: var(--chu); }
.lay .hang-nut { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 16px; }
.ghi-nho, .lay > .ghi-nho { margin-top: 12px; font-size: .84rem; color: var(--chu-mo); }
.tinh-nang { background: var(--be-mat); border-top: 1px solid var(--vien); border-bottom: 1px solid var(--vien); padding: 80px 0; }
.luoi-tinh { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 40px; margin: 40px 0 0; padding: 0; list-style: none; }
.luoi-tinh li { display: flex; gap: 14px; align-items: flex-start; }
.luoi-tinh .bt { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--nhan-nen); color: var(--nhan); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.luoi-tinh strong { display: block; font-weight: 700; }
.luoi-tinh span { display: block; margin-top: 2px; color: var(--chu-mo); font-size: .9rem; }
.skill-khac { padding: 80px 0 16px; }
.hang-khac { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.the-nho { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: var(--bk-the); background: var(--be-mat); border: 1px solid var(--vien); text-decoration: none; transition: border-color .2s, transform .35s cubic-bezier(.16,1,.3,1); }
.the-nho:hover { border-color: var(--nhan); transform: translateY(-2px); }
.the-nho img { flex: none; width: 54px; height: auto; aspect-ratio: 9 / 16; border-radius: 8px; object-fit: cover; }
.the-nho strong { display: block; }
.the-nho span span { display: block; font-size: .85rem; color: var(--chu-mo); }

/* ---- Hộp phát video ---- */
/* Bề ngang tính theo cả bề cao màn hình để khung 16:9 hay 9:16 không tràn đáy và che thanh điều khiển. */
.hop-phat { width: min(92vw, 1100px, calc(88vh * 16 / 9)); width: min(92vw, 1100px, calc(88dvh * 16 / 9)); max-height: 92vh; padding: 0; border: 0; border-radius: var(--bk-the); background: #000; overflow: hidden; }
.hop-phat.doc { width: min(92vw, calc(88vh * 9 / 16)); width: min(92vw, calc(88dvh * 9 / 16)); }
.hop-phat::backdrop { background: rgba(8, 10, 14, .78); }
.khung-phat { aspect-ratio: 16 / 9; border-radius: var(--bk-the); overflow: hidden; }
.hop-phat.doc .khung-phat { aspect-ratio: 9 / 16; }
.khung-phat iframe, .khung-phat video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.dong-phat { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--be-mat); color: var(--chu); font-size: 1.2rem; cursor: pointer; box-shadow: var(--bong); display: flex; align-items: center; justify-content: center; }

/* ---- Màn hẹp ---- */
@media (max-width: 980px) {
  .hero, .khung.ct { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero { padding-top: 24px; padding-bottom: 56px; }
  .san { padding: 0; }
  .quat { display: none; }
  .chu-thich { max-width: 48ch; }
  .luoi-skill { grid-template-columns: minmax(0, 1fr); }
  .cot-xem { max-width: 360px; }
  .luoi-tinh { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hang-khac { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ba-cot { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cot { padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--vien); }
  .cot:first-child { padding-top: 0; border-top: 0; }
  .hai-o { grid-template-columns: minmax(0, 1fr); }
  .cach, .tinh-nang { padding: 64px 0; }
  .duong-chay, .skill-khac { padding-top: 72px; }
  .kho { padding-bottom: 72px; }
}
@media (max-width: 640px) {
  .the-skill { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 12px; }
  .mo-ta { font-size: .88rem; }
  .hanh .nut { width: 100%; }
  .o-duong, .the-moi { padding: 24px; }
  .luoi-tinh, .su-kien { grid-template-columns: minmax(0, 1fr); }
  .lay { padding: 18px; }
  .lay .lenh { flex-wrap: wrap; padding: 10px 6px 6px 14px; }
  .lay .lenh code { flex-basis: 100%; font-size: .86rem; white-space: nowrap; }
  .lay .lenh .nut-chep { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .quat, .nut-phat .vong::after { animation: none; }
  .the-skill, .the-nho, .nut-phat .vong { transition: none; }
}
