/* =========================================================
   KLAR Architecture — website công ty
   Bảng màu lấy từ "Logo & Naming Version 2.pdf":
   Alabaster #F6F5F2 · Graphite #1A1A1A · Concrete #8C8C8C · Raw Umber #C5BEB3

   Ngôn ngữ trình bày (bản K): ảnh là chính, mỗi ảnh là một thẻ bo góc; tiêu đề mục
   viết hoa căn giữa; nút bo tròn; chân trang là một mảng màu Raw Umber nhạt.
   Chữ trên ảnh dùng lớp tối chuyển dần, KHÔNG blur ảnh.
   ========================================================= */

:root {
  --alabaster: #F6F5F2;
  --graphite: #1A1A1A;
  --concrete: #8C8C8C;
  --umber: #C5BEB3;

  --bg: var(--alabaster);
  --fg: var(--graphite);
  --muted: #696865;              /* concrete tối hơn một chút để chữ nhỏ đủ tương phản */
  --line: rgba(26, 26, 26, .14);
  --ring: rgba(26, 26, 26, .32);          /* viền vòng tròn mũi tên */
  --panel: #E4E0D9;                       /* Raw Umber pha nhạt: mảng chân trang */
  --chip: #E9E6E0;                        /* nền nút lọc */
  --placeholder: #E9E7E2;

  --pad: clamp(20px, 4vw, 64px);
  --gap: clamp(12px, 1.3vw, 22px);
  /* THANG KHOẢNG CÁCH — mọi khoảng trống theo chiều dọc đều lấy từ hai số này */
  --sec: clamp(56px, 5.6vw, 100px);     /* giữa hai mục lớn */
  --blk: clamp(32px, 3.4vw, 60px);      /* giữa các khối trong cùng một mục */
  --maxw: 1600px;                       /* bề rộng tối đa của nội dung (đã thử 2000px: user thấy xấu hơn) */
  --header-h: 72px;
  --inset: clamp(8px, .8vw, 14px);      /* lề của thẻ ảnh đầu trang và mảng chân trang so với mép màn hình */
  --rad: 10px;                          /* bo góc của mọi thẻ ảnh */
  --edge: max(var(--pad), calc((100% - var(--maxw)) / 2));   /* lề ngoài = lề của khối nội dung */
  --ease: cubic-bezier(.2, .7, .1, 1);
  --fit-h: calc(100vh - 96px);          /* chiều cao tối đa của một ảnh: luôn xem trọn trong một màn hình */

  color-scheme: light;
}
@supports (height: 100svh) { :root { --fit-h: calc(100svh - 96px); } }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151515;
    --fg: #ECEAE6;
    --muted: #A3A09A;
    --line: rgba(236, 234, 230, .15);
    --ring: rgba(236, 234, 230, .34);
    --panel: #201F1D;
    --chip: #262523;
    --placeholder: #222120;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  word-spacing: .05em;            /* Plus Jakarta Sans để khoảng trắng hẹp, tiếng Việt cần thoáng hơn */
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; }
h1, h2, h3 { font-weight: inherit; }
::selection { background: var(--umber); color: var(--graphite); }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--muted);
}
.muted { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  max-width: var(--maxw);
  margin: 0 auto;
}
.col-label { grid-column: 1 / span 3; padding-top: .55em; }
.col-main  { grid-column: 5 / span 8; }

.section { padding: var(--sec) var(--pad); }
/* Hai mục liền nhau: khoảng cách chỉ tính một lần (lề dưới của mục trên) */
.section + .section { padding-top: 0; }

/* ---------- Tiêu đề mục: viết hoa, căn giữa ---------- */
.sec-head {
  max-width: var(--maxw); margin: 0 auto clamp(28px, 3vw, 48px);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.h-sec {
  font-size: clamp(24px, 2.3vw, 38px); font-weight: 400; line-height: 1.22; letter-spacing: -.012em;
  text-transform: uppercase; text-wrap: balance; max-width: 18em;
}
.h-sub {
  font-size: 14px; font-weight: 500; line-height: 1.55; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); max-width: 32em; text-wrap: balance;
}
.sec-more { margin-top: clamp(28px, 3vw, 44px); text-align: center; }

/* ---------- Nút bo tròn ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), opacity .35s;
}
.pill.sm { min-height: 38px; padding: 0 18px; }
.pill.solid { background: var(--fg); color: var(--bg); }
.pill.solid:hover { opacity: .82; }
.pill.line { border-color: var(--fg); }
.pill.line:hover { background: var(--fg); color: var(--bg); }
.pill.light { background: #F6F5F2; color: #1A1A1A; }
.pill.light:hover { background: #fff; }
.pill.glass { background: rgba(20, 20, 20, .5); color: #F6F5F2; border-color: rgba(246, 245, 242, .4); }
.pill.glass:hover { background: rgba(20, 20, 20, .78); }

/* Vòng tròn mũi tên trên thẻ dự án và dòng lĩnh vực */
.circ {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ring);
  display: grid; place-items: center;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.circ svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.2; }   /* mũi tên chiếm ~40% vòng tròn: trước đây chỉ ~15%, trông lạc trong vòng */
a:hover > .circ, a:hover .arc-row .circ { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- Đầu trang con (Dự án, Lĩnh vực, Về KLAR, Liên hệ): căn giữa ---------- */
.page-head {
  padding: calc(var(--header-h) + var(--blk)) var(--pad) 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.page-head + .section { padding-top: var(--blk); }
.page-title {
  font-size: clamp(30px, 3.2vw, 52px); font-weight: 400; line-height: 1.18; letter-spacing: -.015em;
  text-transform: uppercase;
}
.page-lead { font-size: clamp(17px, 1.25vw, 20px); line-height: 1.6; color: var(--muted); max-width: 34em; text-wrap: balance; }

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.js [data-reveal].in { opacity: 1; transform: none; }

/* Chuyển trang: hiện dần thay vì đổi phụt */
.view:not([hidden]) { animation: viewIn .7s var(--ease); }
@keyframes viewIn { from { opacity: 0; } }

/* ---------- Intro (chỉ lần đầu mỗi phiên) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg); color: var(--fg);
  transition: transform 1.1s var(--ease);
}
.intro.done { transform: translateY(-100%); }
.intro svg {
  width: min(260px, 52vw); height: auto;
  opacity: 0; transform: translateY(8px);
  animation: introIn 1s var(--ease) .15s forwards;
}
@keyframes introIn { to { opacity: 1; transform: none; } }

/* ---------- Header: menu bên trái, logo ở giữa, nút Liên hệ bên phải ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--header-h);
  padding: 0 var(--edge);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  color: var(--fg); background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: background-color .5s var(--ease), border-color .5s var(--ease), transform .55s var(--ease);
}
/* Blur chỉ dùng ở đây: thanh đầu trang thành kính mờ khi nội dung cuộn bên dưới.
   Không bao giờ blur ảnh công trình. */
.site-header.solid {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  backdrop-filter: saturate(1.6) blur(20px);
  border-bottom-color: var(--line);
}
/* Tự ẩn khi cuộn xuống để nhường chỗ cho ảnh, hiện lại khi cuộn lên */
.site-header.hide { transform: translateY(-101%); }
.site-header:focus-within { transform: none; }
.brand { justify-self: center; display: block; line-height: 0; position: relative; z-index: 2; }
.brand svg { height: 19px; width: auto; }
.h-right { justify-self: end; display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }

.nav { justify-self: start; display: flex; gap: clamp(22px, 2.4vw, 40px); }
.nav a {
  position: relative;
  padding: 6px 0;
  font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); transform-origin: left; }
.nav .nav-m { display: none; }                 /* "Liên hệ" trong menu: chỉ hiện ở menu điện thoại */

.menu-btn { display: none; }
.menu-close-txt { display: none; }
.nav-contact { display: none; }

/* Dưới 900px không đủ chỗ cho menu + logo giữa + nút: chuyển sang menu mở toàn màn hình */
@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  .brand { justify-self: start; }
  .h-cta { display: none; }
  .menu-btn {
    display: block;
    font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
    min-height: 44px; padding: 0 0 0 16px; margin-right: -2px;      /* đủ cỡ ngón tay */
  }
  .nav {
    position: fixed; inset: 0; justify-self: stretch;      /* stretch: nếu để start, lớp menu chỉ rộng bằng chữ */
    flex-direction: column; justify-content: center; gap: 6px;
    padding: 0 var(--pad);
    background: color-mix(in srgb, var(--bg) 86%, transparent); color: var(--fg);
    -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
    opacity: 0; pointer-events: none;
    transition: opacity .45s var(--ease);
  }
  .nav a { font-size: 40px; font-weight: 300; letter-spacing: -.02em; text-transform: none; }
  .nav .nav-m { display: block; }
  .nav a::after { display: none; }
  /* liên hệ nhanh ở chân menu */
  .nav-contact {
    display: flex; flex-direction: column; gap: 6px;
    position: absolute; left: var(--pad); right: var(--pad);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
    padding-top: 20px; border-top: 1px solid var(--line);
  }
  .nav .nav-contact a { font-size: 17px; font-weight: 400; letter-spacing: 0; padding: 4px 0; color: var(--muted); }
  body.menu-open { overflow: hidden; }
  body.menu-open .nav { opacity: 1; pointer-events: auto; }
  body.menu-open .site-header { transform: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: transparent; }
  body.menu-open .menu-open-txt { display: none; }
  body.menu-open .menu-close-txt { display: inline; }
}

/* ---------- Ảnh đầu trang: một thẻ ảnh bo góc dưới thanh menu, cao vừa đúng phần màn hình còn lại ---------- */
.hero {
  position: relative;
  margin: var(--header-h) var(--inset) 0;
  height: calc(100vh - var(--header-h) - var(--inset)); min-height: 460px;
  border-radius: var(--rad); overflow: hidden;
  background: #151515; color: #F6F5F2;
}
@supports (height: 100svh) { .hero { height: calc(100svh - var(--header-h) - var(--inset)); } }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s var(--ease); }
.slide.active { opacity: 1; }
.slide img {
  width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%);
  transform: scale(1.035);
  transition: transform 9s cubic-bezier(.25, .1, .25, 1);
}
.slide.active img { transform: scale(1); }
/* Lớp tối chuyển mượt (nhiều điểm dừng, không lộ vệt) để chữ trắng đọc được; ảnh giữ nguyên độ nét */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(to top,
    rgba(10,10,10,.68) 0%, rgba(10,10,10,.55) 10%, rgba(10,10,10,.39) 22%,
    rgba(10,10,10,.22) 34%, rgba(10,10,10,.09) 46%, rgba(10,10,10,.02) 56%, rgba(10,10,10,0) 64%);
}
.hero-content {
  position: absolute; z-index: 2;
  left: max(calc(var(--pad) - var(--inset)), calc((100% - var(--maxw)) / 2));
  right: max(calc(var(--pad) - var(--inset)), calc((100% - var(--maxw)) / 2));
  bottom: clamp(16px, 1.8vw, 28px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: clamp(18px, 2vw, 30px) 40px;
}
.hero-statement {
  font-size: clamp(28px, 3.3vw, 52px);
  font-weight: 400; line-height: 1.13; letter-spacing: -.02em; word-spacing: .06em;
}
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; text-align: right; }
.hero-btns { display: flex; gap: 10px; }
.hero-caption { font-size: 15px; line-height: 1.5; transition: opacity .6s; }
.hero-caption b { font-weight: 500; margin-right: .5em; }
.hero-caption > span:not(.cap-in), .hero-caption .cap-in > span { opacity: .8; }
.hero-caption.fade { opacity: 0; }
/* Hàng dưới cùng: mũi tên, số ảnh và một đường kẻ chạy hết bề ngang (thanh tiến độ của ảnh đang hiện) */
.hero-counter {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; letter-spacing: .14em; font-variant-numeric: tabular-nums;
}
.hero-arrow { width: 32px; height: 32px; display: grid; place-items: center; opacity: .75; transition: opacity .3s, transform .5s var(--ease); }
.hero-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.hero-arrow:hover { opacity: 1; }
#heroPrev { margin-left: -6px; } #heroNext { margin-right: -6px; }
#heroPrev:hover { transform: translateX(-3px); }
#heroNext:hover { transform: translateX(3px); }
.hero-counter .bar { position: relative; flex: 1; height: 1px; background: rgba(246,245,242,.35); overflow: hidden; }
.hero-counter .bar i { position: absolute; inset: 0; background: #F6F5F2; transform: scaleX(0); transform-origin: left; }
.hero-counter .bar i.run { transform: scaleX(1); transition: transform var(--slide-ms, 6500ms) linear; }

/* ---------- Trang chủ: câu giới thiệu ở giữa, hai ảnh nhỏ hai bên (ảnh phải thấp hơn ảnh trái) ---------- */
.intro3 {
  max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 3fr); column-gap: var(--gap); align-items: center;
}
.intro-img { width: 80%; aspect-ratio: 4 / 5; max-height: var(--fit-h); border-radius: var(--rad); overflow: hidden; background: var(--placeholder); }
.intro-img img { width: 100%; height: 100%; object-fit: cover; }
.intro-img.a { justify-self: start; align-self: start; }
.intro-img.b { justify-self: end; align-self: end; margin-top: 24%; }
.intro-img.no-img { visibility: hidden; }
.intro-text { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.intro-text .h-sec { max-width: 13em; }
.intro-text .pill { margin-top: 10px; }

/* ---------- Dòng chữ chạy (các con số). Rê chuột vào thì dừng ---------- */
.ticker { overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: tick 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker ul { display: flex; flex-shrink: 0; }
.ticker li {
  display: flex; align-items: center; white-space: nowrap;
  font-size: clamp(17px, 1.5vw, 22px); line-height: 1.4; letter-spacing: .01em; text-transform: uppercase;
}
.ticker b { font-weight: 500; margin-right: .45em; }
.ticker li::after { content: ""; width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; margin: 0 clamp(28px, 3.2vw, 60px); }
@keyframes tick { to { transform: translateX(-25%); } }      /* nội dung lặp 4 lần: trượt đúng một lần lặp */

/* ---------- Thẻ dự án: lưới 3 cột ---------- */
.card-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap); row-gap: clamp(28px, 2.8vw, 44px);
}
.arc a { display: block; }
.arc-img { aspect-ratio: 4 / 3; border-radius: var(--rad); overflow: hidden; background: var(--placeholder); }
.arc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease); }
.arc a:hover .arc-img img { transform: scale(1.035); }
.arc-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; }
.arc-name { font-size: clamp(17px, 1.3vw, 21px); font-weight: 400; line-height: 1.3; letter-spacing: -.005em; }
.arc-loc { margin-top: 2px; padding-right: 48px; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* Trạng thái: chấm đặc = xong · nửa = đang thi công · rỗng = ý tưởng / sắp khởi công */
.status { display: inline-flex; align-items: flex-start; gap: 9px; }
.status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--fg); flex-shrink: 0;
  margin-top: .5em; margin-top: calc((1lh - 8px) / 2);
}
.s-done::before { background: var(--fg); }
.s-building::before { background: linear-gradient(90deg, var(--fg) 50%, transparent 50%); }

/* ---------- Bộ lọc ở trang Dự án: hàng nút bo tròn căn giữa ---------- */
.filters {
  max-width: var(--maxw); margin: 0 auto clamp(28px, 3vw, 48px);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px;
}
.flt {
  min-height: 42px; padding: 0 20px; border-radius: 999px; background: var(--chip);
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.flt sup { margin-left: 8px; font-size: 12px; letter-spacing: 0; opacity: .6; vertical-align: baseline; font-variant-numeric: tabular-nums; }
.flt:hover { background: color-mix(in srgb, var(--fg) 16%, var(--bg)); }
.flt[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* ---------- Bốn tiêu chí: bốn thẻ ảnh, tên tiêu chí ở góc dưới ---------- */
.tiles {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap);
}
.tile { position: relative; aspect-ratio: 10 / 11; max-height: var(--fit-h); border-radius: var(--rad); overflow: hidden; background: var(--placeholder); color: #F6F5F2; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(10,10,10,.66) 0%, rgba(10,10,10,.44) 14%, rgba(10,10,10,.2) 30%, rgba(10,10,10,.05) 44%, rgba(10,10,10,0) 54%);
}
.tile span {
  position: absolute; z-index: 1; left: clamp(14px, 1.3vw, 22px); right: 14px; bottom: clamp(12px, 1.2vw, 20px);
  font-size: clamp(18px, 1.7vw, 26px); font-weight: 500; line-height: 1.2; letter-spacing: -.005em; text-transform: uppercase;
}

/* ---------- Lĩnh vực ở trang chủ: ảnh bên trái, danh sách bên phải cao bằng ảnh ---------- */
.svc-split {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(24px, 4vw, 72px); align-items: stretch;
}
.svc-fig { aspect-ratio: 5 / 4; max-height: var(--fit-h); border-radius: var(--rad); overflow: hidden; background: var(--placeholder); }
.svc-fig img { width: 100%; height: 100%; object-fit: cover; transition: opacity .22s ease; }
.svc-fig img.swap { opacity: 0; }
.svc-split.no-img { grid-template-columns: minmax(0, 1fr); }
.svc-split.no-img .svc-fig { display: none; }
.svc-list { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.svc-list li { flex: 1; display: flex; }
.svc-list a {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.svc-name { font-size: clamp(20px, 1.9vw, 30px); font-weight: 400; line-height: 1.25; letter-spacing: -.012em; }

/* ---------- Lĩnh vực: trang riêng ---------- */
.svc-blocks { max-width: var(--maxw); margin: 0 auto; border-bottom: 1px solid var(--line); }
.svc-block { padding: var(--blk) 0; border-top: 1px solid var(--line); }
.svc-title {
  font-size: clamp(22px, 1.8vw, 30px); font-weight: 400; line-height: 1.2; letter-spacing: -.01em;
  text-transform: none; padding-top: 0;
}
.svc-text { font-size: 18px; line-height: 1.75; max-width: 38em; }
.svc-ex { margin-top: clamp(28px, 2.8vw, 44px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.svc-ex a { display: block; }
.svc-ex figure { aspect-ratio: 4 / 3; border-radius: var(--rad); overflow: hidden; background: var(--placeholder); }
.svc-ex img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease); }
.svc-ex a:hover img { transform: scale(1.035); }
.svc-ex span { display: block; margin-top: 12px; font-size: 15px; line-height: 1.4; color: var(--muted); transition: color .4s; }
.svc-ex a:hover span { color: var(--fg); }

/* ---------- Câu trích lời ngỏ trên một ảnh lớn ---------- */
.quote-card {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  height: min(var(--fit-h), clamp(380px, 40vw, 680px));        /* không dùng aspect-ratio: màn hẹp sẽ đẩy thẻ rộng quá trang */
  border-radius: var(--rad); overflow: hidden; background: #151515; color: #F6F5F2;
}
.quote-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.quote-card.no-img img { display: none; }
/* Chữ nằm góc dưới trái (giống ảnh đầu trang), nút ở góc dưới phải: chữ không đè lên chiếc đèn trắng giữa ảnh.
   Lớp tối chuyển dần từ đáy lên. */
.quote-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(10,10,10,.76) 0%, rgba(10,10,10,.62) 18%, rgba(10,10,10,.4) 36%, rgba(10,10,10,.15) 54%, rgba(10,10,10,.02) 68%, rgba(10,10,10,0) 76%);
}
.quote-card figcaption {
  position: absolute; z-index: 1; inset: 0; padding: clamp(22px, 3vw, 48px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: end; align-items: end; column-gap: 24px;
}
.quote-card blockquote {
  grid-column: 1;
  font-size: clamp(21px, 2.1vw, 34px); font-weight: 400; line-height: 1.26; letter-spacing: -.012em; word-spacing: .05em;
  max-width: 19em; text-wrap: balance;
}
.quote-sign { grid-column: 1; margin-top: 18px; font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; opacity: .86; }
.quote-card .pill { grid-column: 2; grid-row: 1 / span 2; align-self: end; }

/* ---------- Từ khoá thương hiệu (trang Về KLAR) ---------- */
.keywords {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  grid-template-rows: repeat(4, minmax(clamp(60px, 4.8vw, 84px), auto));
  gap: 1px;                                 /* khe 1px để lộ nền = đường kẻ mảnh */
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.kw, .kw-center { background: var(--bg); }
.kw {
  display: grid; place-items: center; text-align: center;
  font-size: clamp(17px, 1.35vw, 21px); font-weight: 300; letter-spacing: .04em;
  transition: letter-spacing .7s var(--ease);
}
.kw:hover { letter-spacing: .16em; }
.k11 { grid-area: 1 / 1; } .k12 { grid-area: 1 / 2; } .k13 { grid-area: 1 / 3; }
.k21 { grid-area: 2 / 1; } .k23 { grid-area: 2 / 3; }
.k31 { grid-area: 3 / 1; } .k33 { grid-area: 3 / 3; }
.k41 { grid-area: 4 / 1; } .k42 { grid-area: 4 / 2; } .k43 { grid-area: 4 / 3; }
.kw-center { grid-area: 2 / 2 / 4 / 3; display: grid; place-items: center; padding: 24px; }
.kw-center svg { width: min(62%, 230px); height: auto; }

/* ---------- Lời ngỏ (trang Về KLAR) ----------
   Nhãn bên trái (cột 1–3), nội dung bên phải (cột 5–12); chữ chảy liền thành đoạn. */
.fw-quote {
  font-size: clamp(24px, 2.3vw, 38px); font-weight: 300; line-height: 1.22; letter-spacing: -.012em; word-spacing: .07em;
  text-wrap: balance;
}
.fw-sign { display: flex; align-items: center; gap: 14px; }
.fw-sign::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.fw-lead {
  font-size: clamp(21px, 1.75vw, 28px); font-weight: 300; line-height: 1.34; letter-spacing: -.006em; word-spacing: .06em;
  text-wrap: balance;
}
.fw-body {
  margin-top: clamp(28px, 2.6vw, 44px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap);   /* cùng lưới hai cột với danh sách bên dưới */
  font-size: 18px; line-height: 1.75; color: var(--muted);
}
.fw-list {
  margin-top: calc(var(--blk) * .75);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto);
  grid-auto-flow: column; column-gap: var(--gap);
}
.fw-list li {
  padding: 16px 0 18px; border-top: 1px solid var(--line);
  font-size: clamp(17px, 1.22vw, 20px); font-weight: 300; line-height: 1.42; text-wrap: balance;
}
.fw-list li:nth-child(3n) { border-bottom: 1px solid var(--line); }
.fw-list b { font-weight: 500; }
.foreword .fw-quote { margin-top: calc(var(--blk) * 1.15); }
.foreword .fw-sign { margin-top: clamp(28px, 2.8vw, 48px); }

/* ---------- Liên hệ ---------- */
.contact-name { font-size: clamp(20px, 1.6vw, 25px); font-weight: 400; letter-spacing: -.01em; }
.contact-list { margin-top: 32px; border-top: 1px solid var(--line); }
.contact-list div {
  display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 16px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.contact-list dt { font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.contact-list dd { font-size: clamp(18px, 1.55vw, 22px); overflow-wrap: anywhere; text-wrap: balance; }
.contact-list a, .p-top .label a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease);
}
.contact-list a:hover, .p-top .label a:hover { background-size: 100% 1px; }
.contact-list .sep, .f-social .sep { display: inline-block; width: 1.4em; }
.c-actions { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 32px; }
.c-brief-wrap { margin-top: var(--blk); }
.c-brief-wrap .col-label { padding-top: calc(.55em + 17px); }   /* nhãn thẳng hàng với dòng chữ đầu tiên (sau đường kẻ + lề trong của dòng) */
.c-brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); }
.c-brief li {
  padding: 16px 0 18px; border-top: 1px solid var(--line);
  font-size: clamp(17px, 1.22vw, 20px); font-weight: 300; line-height: 1.42;
}
.c-brief li:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }

/* ---------- Chân trang: một mảng màu bo góc ----------
   Câu mời liên hệ + menu + thông tin → bản quyền → chữ KLAR lớn hết bề ngang */
.site-footer { padding: 0 var(--inset) var(--inset); font-size: 15px; line-height: 1.6; }
.f-panel {
  background: var(--panel); border-radius: var(--rad); overflow: hidden;
  padding: clamp(32px, 3.6vw, 64px) max(calc(var(--pad) - var(--inset)), calc((100% - var(--maxw)) / 2)) clamp(22px, 2.4vw, 40px);
}
.f-top { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 2fr) minmax(0, 4fr); column-gap: var(--gap); align-items: start; }
.f-cta-text {
  font-size: clamp(22px, 2.1vw, 34px); font-weight: 400; line-height: 1.24; letter-spacing: -.012em; text-transform: uppercase;
  max-width: 15em; text-wrap: balance;
}
.f-cta .pill { margin-top: clamp(20px, 2vw, 32px); }
body[data-view="contact"] .f-cta .pill { display: none; }
.f-nav { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 14px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.f-nav a, .f-contact a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease);
}
.f-nav a:hover, .f-contact a:hover { background-size: 100% 1px; }
.f-contact { display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; text-wrap: balance; }
.f-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: clamp(32px, 4vw, 64px); padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px;
}
.to-top { font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; min-height: 44px; }
.f-word { display: block; margin-top: clamp(20px, 2.6vw, 44px); line-height: 0; }
.f-word svg { width: 100%; height: auto; }

/* ---------- Project page ---------- */
/* Màn hình đầu: chữ + thông số bên trái, ảnh bìa bên phải, ảnh luôn nằm trọn trong màn hình */
.project-page {
  --p-top: clamp(24px, 3vw, 48px);
  --cover-h: calc(100vh - var(--header-h) - 2 * var(--p-top));
  padding-top: calc(var(--header-h) + var(--p-top));
}
@supports (height: 100svh) { .project-page { --cover-h: calc(100svh - var(--header-h) - 2 * var(--p-top)); } }
.p-top {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad);
}
.p-top-text { grid-column: 1 / span 4; display: flex; flex-direction: column; }
.p-top .label { display: flex; gap: 20px; }
.p-title {
  margin-top: 26px;
  font-size: clamp(34px, 3.5vw, 60px); font-weight: 300; letter-spacing: -.025em; line-height: 1.05;
  text-wrap: balance;
}
.p-loc { margin: 14px 0 40px; font-size: 18px; color: var(--muted); }
/* Bảng thông số: một lưới chung, cột nhãn rộng vừa bằng nhãn dài nhất */
.specs {
  margin-top: auto;
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
.specs div { display: contents; }
.specs dt, .specs dd { padding: 13px 0; border-top: 1px solid var(--line); line-height: 26px; }
.specs dt { padding-right: clamp(20px, 2.4vw, 44px); font-size: 13px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.specs dd { font-size: 17px; }
.p-cover { grid-column: 5 / span 8; display: flex; justify-content: flex-end; align-items: flex-start; }
.p-cover .g-btn { width: min(100%, calc(var(--r) * var(--cover-h))); }
/* cùng bề rộng với .p-top để đường kẻ của đoạn ghi chú thẳng hàng với mép trái ảnh bìa */
.p-note-wrap { max-width: calc(var(--maxw) + 2 * var(--pad)); padding: var(--blk) var(--pad) 0; }
.p-note {
  padding-left: 24px; border-left: 1px solid var(--fg);
  font-size: 18px; line-height: 1.75; max-width: 40em;
}
/* Bộ ảnh: một cột ở giữa trang, mọi hàng rộng bằng nhau và kín, khe đều nhau.
   Bề rộng cột = tỷ lệ của hàng cao nhất (--r, do app.js tính) × chiều cao màn hình,
   nên không hàng nào cao hơn một màn hình. */
.p-gallery {
  --g-gap: clamp(10px, 1.2vw, 20px);
  width: min(100% - 2 * var(--pad), var(--maxw), calc(var(--r) * var(--fit-h)));
  margin: var(--sec) auto 0;
  display: flex; flex-direction: column; gap: clamp(48px, 4.8vw, 92px);   /* khoảng nghỉ giữa các chặng */
}
/* Một chặng của kịch bản: nhãn + các hàng ảnh của cùng một không gian */
.g-chapter { display: flex; flex-direction: column; gap: var(--g-gap); }
.g-title {
  display: flex; gap: 18px;
  padding-top: 16px; margin-bottom: 6px;
  border-top: 1px solid var(--line);
  color: var(--fg);
}
.g-title span { color: var(--muted); font-variant-numeric: tabular-nums; }
.g-row { display: flex; align-items: flex-start; gap: var(--g-gap); }
.g-row.alone { align-self: center; width: min(100%, calc(var(--ra) * var(--fit-h))); }
.g-fig { min-width: 0; background: var(--placeholder); }
.g-btn { display: block; width: 100%; cursor: zoom-in; }
.g-btn img { width: 100%; transition: opacity .5s; }
.g-btn:hover img { opacity: .92; }

.p-next { margin-top: var(--sec); border-top: 1px solid var(--line); }
.p-next a {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end;
  max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto;
  padding: var(--blk) var(--pad);
}
.p-next-text { grid-column: 1 / span 7; }
.p-next-name {
  display: block; margin-top: 24px;
  font-size: clamp(32px, 4vw, 64px); font-weight: 300; letter-spacing: -.03em; line-height: 1.05;
  transition: transform .8s var(--ease);
}
.p-next a:hover .p-next-name { transform: translateX(12px); }
.p-next figure { grid-column: 9 / span 4; aspect-ratio: 3 / 2; overflow: hidden; background: var(--placeholder); }
.p-next figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease); }
.p-next a:hover figure img { transform: scale(1.04); }
.p-all { max-width: calc(var(--maxw) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad) var(--blk); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: grid;
  grid-template-columns: clamp(56px, 7vw, 110px) minmax(0, 1fr) clamp(56px, 7vw, 110px);
  grid-template-rows: 72px minmax(0, 1fr) 72px;
  background: #0F0F0F; color: #F6F5F2;
  opacity: 0; transition: opacity .35s var(--ease);
}
.lightbox.open { opacity: 1; }
.lb-fig { grid-area: 2 / 2; position: relative; align-self: stretch; justify-self: stretch; min-height: 0; }
.lb-fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lightbox button { display: grid; place-items: center; opacity: .75; transition: opacity .3s; }
.lightbox button:hover { opacity: 1; }
.lightbox svg { fill: none; stroke: currentColor; stroke-width: 1.2; }
.lb-close { grid-area: 1 / 3; } .lb-close svg { width: 22px; }
.lb-prev { grid-area: 2 / 1; } .lb-next { grid-area: 2 / 3; }
.lb-prev svg, .lb-next svg { width: 36px; }
.lb-cap {
  grid-area: 3 / 2; align-self: center; justify-self: center;
  display: flex; gap: 28px;
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.lb-cap span + span { opacity: .6; }

/* Thẻ ảnh trong trang dự án cũng bo góc như mọi nơi khác */
.g-fig, .p-next figure { border-radius: var(--rad); overflow: hidden; }
.p-cover .g-btn { border-radius: var(--rad); overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .col-label, .col-main { grid-column: 1 / -1; }
  .col-label, .c-brief-wrap .col-label { margin-bottom: 28px; padding-top: 0; }
  .svc-title { margin-bottom: 20px; }
  .fw-body { grid-template-columns: minmax(0, 1fr); row-gap: 1.1em; }
  .fw-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .fw-list li:nth-child(3n) { border-bottom: 0; }
  .fw-list li:last-child { border-bottom: 1px solid var(--line); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* câu giới thiệu lên trên, hai ảnh nhỏ nằm cạnh nhau bên dưới */
  .intro3 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--blk); }
  .intro-text { grid-column: 1 / -1; order: -1; }
  .intro-img { width: 100%; }
  .intro-img.b { margin-top: 18%; }
  .svc-split { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .svc-fig { aspect-ratio: 16 / 10; }
  .svc-list a { padding: 18px 0; }
  .f-top { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .f-cta { grid-column: 1 / -1; }
  .p-next-text, .p-next figure { grid-column: 1 / -1; }
  .p-next figure { order: -1; margin-bottom: 32px; }
  /* trang dự án xếp dọc: tiêu đề → ảnh bìa → thông số */
  .p-top-text { display: contents; }
  .p-top-text > * { grid-column: 1 / -1; }
  .p-cover { grid-column: 1 / -1; order: 4; margin-top: 28px; justify-content: flex-start; }
  .p-loc { margin-bottom: 0; }
  .specs { order: 5; margin-top: 32px; }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; --sec: 56px; --blk: 32px; --rad: 8px; }
  .brand svg { height: 16px; }
  .h-sec { font-size: clamp(22px, 6.4vw, 28px); }
  .page-title { font-size: clamp(28px, 8.4vw, 36px); }
  /* ảnh đầu trang: chữ, chú thích, nút xếp dọc; nút đủ cỡ ngón tay */
  .hero-content { grid-template-columns: minmax(0, 1fr); gap: 18px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); left: 14px; right: 14px; }
  .hero-statement { font-size: clamp(22px, 6.6vw, 30px); }
  .hero-side { align-items: flex-start; text-align: left; }
  .hero-arrow { width: 44px; height: 44px; }
  .hero-counter { gap: 8px; }
  #heroPrev { margin-left: -12px; } #heroNext { margin-right: -12px; }
  .slide img { object-position: var(--pos-m, var(--pos, 50% 50%)); }
  .ticker li { font-size: 16px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .tile span { font-size: 17px; }
  .svc-name { font-size: 21px; }
  .svc-ex { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* số ảnh lẻ: ảnh cuối trải hết bề ngang, không để lại ô trống bên cạnh */
  .svc-ex li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .svc-ex li:last-child:nth-child(odd) figure { aspect-ratio: 2 / 1; }
  /* khối lời ngỏ: thẻ cao hơn, lớp tối phủ từ trên xuống để chữ đọc được */
  .quote-card { height: min(var(--fit-h), 440px); }
  .quote-card::after { background: linear-gradient(to top, rgba(10,10,10,.8) 0%, rgba(10,10,10,.7) 30%, rgba(10,10,10,.46) 52%, rgba(10,10,10,.16) 72%, rgba(10,10,10,0) 86%); }
  .quote-card figcaption { grid-template-columns: minmax(0, 1fr); }
  .quote-card blockquote { font-size: 21px; line-height: 1.32; }
  .quote-card .pill { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 20px; }
  .keywords { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .kw, .kw-center { grid-area: auto !important; min-height: 76px; }
  .kw-center { grid-column: 1 / -1 !important; order: -1; min-height: 180px; }
  .contact-list div { grid-template-columns: 1fr; gap: 4px; }
  .c-brief { grid-template-columns: minmax(0, 1fr); }
  .c-brief li:nth-last-child(2) { border-bottom: 0; }
  .c-actions .pill { flex: 1 1 100%; min-height: 52px; }
  .g-row { flex-direction: column; }
  .g-row .g-fig { flex: none !important; width: 100%; }
  .g-row.alone { width: 100%; }
  .f-top { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .f-cta-text { font-size: 23px; }
  .f-bottom { flex-direction: column-reverse; align-items: flex-start; gap: 2px; }
  .fw-quote { font-size: 23px; line-height: 1.28; }
  .fw-lead { font-size: 20px; line-height: 1.4; }
  .fw-body { font-size: 17px; margin-top: 28px; }
  .fw-list li { font-size: 18px; }

  /* xem ảnh lớn: ảnh rộng hết màn hình, mũi tên xuống hàng dưới (hoặc vuốt ngang) */
  .lightbox {
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    grid-template-rows: 60px minmax(0, 1fr) calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .lb-fig { grid-area: 2 / 1 / 3 / 4; }
  .lb-close { grid-area: 1 / 3; }
  .lb-prev { grid-area: 3 / 1; } .lb-next { grid-area: 3 / 3; }
  .lb-prev, .lb-next, .lb-cap { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .lb-prev svg, .lb-next svg { width: 28px; }
  .lb-cap { flex-direction: column; align-items: center; gap: 2px; text-align: center; }
}

/* Điện thoại xoay ngang / màn thấp: thẻ ảnh đầu trang không được cao hơn màn hình */
@media (max-height: 600px) {
  .hero { min-height: 0; }
  .hero-statement { font-size: clamp(20px, 3vw, 30px); }
  .hero-content { gap: 10px 24px; }
}

/* Điện thoại xoay ngang: giữ chữ bên trái, ảnh bìa bên phải để ảnh vẫn nằm trọn màn hình */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 600px) {
  .p-top-text { display: flex; grid-column: 1 / span 5; }
  .p-top-text > * { grid-column: auto; }
  .p-cover { grid-column: 6 / span 7; order: 0; margin-top: 0; justify-content: flex-end; }
  .p-loc { margin-bottom: 24px; }
  .specs { order: 0; margin-top: auto; grid-template-columns: minmax(0, 1fr); }
  .specs dt { padding-bottom: 0; }
  .specs dd { border-top: 0; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .slide img, .slide.active img { transform: none; transition: none; }
  .view:not([hidden]) { animation: none; }
  .site-header { transition: none; }
  .slide { transition-duration: .6s; }
  .intro { display: none; }
  /* dòng chữ chạy đứng yên, chỉ hiện một lần nội dung, căn giữa */
  .ticker-track { animation: none; width: auto; justify-content: center; flex-wrap: wrap; }
  .ticker ul[aria-hidden] { display: none; }
  .ticker ul { flex-wrap: wrap; justify-content: center; }
}

/* =========================================================
   CHUYỂN ĐỘNG (bản FX) — "mạnh" là mặc định, "vừa" là bản nhẹ hơn
   Công tắc: đầu assets/app.js có FX_LEVEL = 'strong' | 'medium' | 'off'.
   Xem thử không cần sửa code: thêm ?fx=manh, ?fx=vua hoặc ?fx=tat vào sau index.html.
   JS gắn lên <html>:  .fx (mọi mức) · .fx-strong (mức mạnh) · .fx-par (chuột thật: parallax)
                       · .fx-ptr (mức mạnh + chuột thật: con trỏ, nam châm, nghiêng ảnh)
   Mọi quy tắc dưới đây đều bắt đầu bằng một trong các lớp đó: gỡ lớp là về đúng như cũ.
   Không có lớp nào khi người xem bật "giảm chuyển động" hoặc JS không chạy.
   Chỉ animate transform / opacity / clip-path (kể cả các thuộc tính độc lập translate, scale). KHÔNG blur ảnh, KHÔNG bóng đổ.
   ========================================================= */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-snap: cubic-bezier(.76, 0, .24, 1);
  --curtain: var(--umber);
}
@media (prefers-color-scheme: dark) { :root { --curtain: #2D2B28; } }

/* thông số theo mức */
.fx { --dur: 1.1s; --lift: 22px; --zoom: 1.08; --wipe-from: inset(12% 0 0 0 round var(--rad)); }
.fx-strong { --dur: 1.4s; --lift: 34px; --zoom: 1.2; --wipe-from: inset(100% 0 0 0 round var(--rad)); }

@keyframes fxFrame { from { clip-path: var(--wipe-from); } to { clip-path: inset(0 0 0 0 round var(--rad)); } }
@keyframes fxImg   { from { transform: scale(var(--zoom, 1.08)); } to { transform: scale(1); } }
@keyframes fxView  { from { opacity: 0; transform: translateY(12px); } }
@keyframes fxFade  { from { opacity: 0; transform: translateY(16px); } }
@keyframes fxOpacity { from { opacity: 0; } }
@keyframes fxRiseM { from { opacity: 0; transform: translateY(.55em); } }
@keyframes fxRiseS { from { transform: translateY(125%); } }
@keyframes fxHero  { from { clip-path: inset(24% 30% 24% 30% round 32px); } to { clip-path: inset(0 0 0 0 round var(--rad)); } }
@keyframes fxHeroImg { from { scale: 1.45; } to { scale: 1; } }
@keyframes fxSlide { from { opacity: 0; clip-path: inset(5% 0 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes fxIntroOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-14px); } }

/* ---------- 1. Nhịp xuất hiện khi cuộn: so le theo nhóm (app.js đặt --d) ---------- */
.fx [data-reveal] { transform: translateY(var(--lift)); transition: opacity calc(var(--dur) * .8) var(--ease-out), transform var(--dur) var(--ease-out); }
.fx [data-reveal].in { transition-delay: var(--d, 0s); }

/* ---------- 2. Ảnh "mở màn" bằng clip-path: khung mở dần, ảnh bên trong thu từ --zoom về 1 ----------
   Khung tự là phần tử reveal (ảnh nhỏ, thẻ tiêu chí, ảnh lời ngỏ...) thì ẩn bằng clip-path chứ không mờ. */
.fx .arc.in .arc-img, .fx .svc-ex .in figure, .fx [data-reveal].in .g-fig, .fx .p-cover.in .g-btn {
  animation: fxFrame calc(var(--dur) * 1.15) var(--ease-snap) var(--d, 0s) backwards;
}
.fx :is(.intro-img, .svc-fig, .tile, .quote-card, .p-next figure)[data-reveal].in img,
.fx .arc.in .arc-img img, .fx .svc-ex .in img, .fx [data-reveal].in .g-btn img {
  animation: fxImg calc(var(--dur) * 1.6) var(--ease-out) var(--d, 0s) backwards;
}
/* mức mạnh: khung ảnh không mờ dần mà được "kéo màn" — một tấm phủ màu nền trang (::before) rút đi theo hướng riêng.
   (Không clip-path chính phần tử đang được IntersectionObserver theo dõi: bị cắt hết thì trình duyệt coi như không nhìn thấy, sẽ không bao giờ hiện.) */
.fx-strong :is(.intro-img, .svc-fig, .tile, .quote-card, .p-next figure)[data-reveal] { opacity: 1; transform: none; transition: none; position: relative; }
.fx-strong :is(.intro-img, .svc-fig, .tile, .quote-card, .p-next figure)[data-reveal]::before {
  content: ""; position: absolute; inset: 0; z-index: 5; background: var(--bg); pointer-events: none; clip-path: inset(0 0 0 0);
}
.fx-strong :is(.intro-img, .svc-fig, .tile, .quote-card, .p-next figure)[data-reveal].in::before { animation: fxCover calc(var(--dur) * 1.15) var(--ease-snap) var(--d, 0s) forwards; }
@keyframes fxCover { to { clip-path: var(--cover-to, inset(0 0 100% 0)); } }
.fx-strong .intro-img.a { --cover-to: inset(0 0 0 100%); }
.fx-strong .intro-img.b { --cover-to: inset(0 100% 0 0); }
.fx-strong .svc-fig { --cover-to: inset(0 0 0 100%); }
.fx-strong .tile:nth-child(even) { --cover-to: inset(100% 0 0 0); }
.fx-strong .quote-card { --cover-to: inset(0 100% 0 0); }
.fx .circ { overflow: hidden; }

/* ---------- 3. Tiêu đề hiện theo từng chữ (app.js tách chữ: .lw bọc ngoài chỉ cắt đáy, .ln bên trong trồi lên) ---------- */
.fx [data-lines]:not(.in) { visibility: hidden; }
.fx .lw { display: inline-block; clip-path: inset(-.6em -.25em -.16em -.25em); }
.fx .ln { display: inline-block; }
.fx [data-lines] .ln { opacity: 0; transform: translateY(.5em); }
.fx-strong [data-lines] .ln { opacity: 1; transform: translateY(125%); }
.fx [data-lines].in .ln {
  opacity: 1; transform: none;
  transition: opacity calc(var(--dur) * .8) var(--ease-out) calc(var(--d, 0s) + min(var(--l, 0), 3) * .12s + min(var(--w, 0), 6) * .035s),
              transform var(--dur) var(--ease-out) calc(var(--d, 0s) + min(var(--l, 0), 3) * .12s + min(var(--w, 0), 6) * .035s);
}

/* ---------- 4. Mở màn: logo mờ đi, thẻ ảnh đầu trang nở ra như một ô cửa từ giữa, ảnh bên trong thu về, câu thương hiệu trồi lên ---------- */
.fx .intro { transition: transform 1.2s var(--ease-io); }
.fx .intro.done { transition-delay: .18s; }
.fx .intro.done svg { animation: fxIntroOut .55s var(--ease-io) forwards; }
.fx-strong .intro.done { transform: none; opacity: 0; transition: opacity .7s ease .1s; }
.fx:not(.hero-done) .site-header { animation: fxOpacity 1.2s ease calc(var(--hero-delay, .15s) + .6s) backwards; }
.fx-strong:not(.hero-done) .hero { animation: fxHero 1.9s var(--ease-snap) var(--hero-delay, .15s) backwards; }
.fx-strong:not(.hero-done) .slide.active:first-child img { animation: fxHeroImg 2.8s var(--ease-out) var(--hero-delay, .15s) backwards; }
.fx .hero-statement .ln { display: inline-block; }
.fx:not(.hero-done) .hero-statement .ln { animation: fxRiseM 1.3s var(--ease-out) calc(var(--hero-delay, .15s) + var(--l, 0) * .13s) backwards; }
.fx-strong:not(.hero-done) .hero-statement .ln { animation: fxRiseS 1.5s var(--ease-out) calc(var(--hero-delay, .15s) + .8s + var(--l, 0) * .16s + min(var(--w, 0), 6) * .045s) backwards; }
.fx:not(.hero-done) .hero-side    { animation: fxFade 1.1s var(--ease-out) calc(var(--hero-delay, .15s) + .5s) backwards; }
.fx:not(.hero-done) .hero-counter { animation: fxFade 1.1s var(--ease-out) calc(var(--hero-delay, .15s) + .65s) backwards; }
.fx-strong:not(.hero-done) .hero-side    { animation-delay: calc(var(--hero-delay, .15s) + 1.3s); }
.fx-strong:not(.hero-done) .hero-counter { animation-delay: calc(var(--hero-delay, .15s) + 1.5s); }

/* Chuyển ảnh: ảnh mới hiện đè lên ảnh cũ (ảnh cũ giữ nguyên độ đậm tới khi ảnh mới phủ kín → không có chỗ tối giữa hai ảnh) */
.fx .slide { transition: none; z-index: 0; }
.fx .slide.prev { opacity: 1; z-index: 1; }
.fx .slide.active { opacity: 1; z-index: 2; }
.fx .slide.active.enter { animation: fxSlide 1.5s var(--ease-io) backwards; }
.fx .hero-caption { transition: opacity .6s, transform .8s var(--ease-out); }
.fx .hero-caption.fade { transform: translateY(8px); }

/* ---------- 5. Thẻ ảnh đầu trang phản ứng với cuộn (mức mạnh): thu nhỏ, bo góc tăng, ảnh trôi + phóng dần, chữ trôi chậm hơn ----------
   app.js đặt --hp (0 → 1) theo vị trí cuộn. Lúc nghỉ hp = 0: mọi thứ về đúng trạng thái gốc. */
.fx-strong .hero { --hp: 0; transform-origin: 50% 0; scale: calc(1 - var(--hp) * .07); clip-path: inset(0 0 0 0 round calc(var(--rad) + var(--hp) * 42px)); }
.fx-strong .hero-slides { position: absolute; inset: 0; translate: 0 calc(var(--hp) * 5%); scale: calc(1 + var(--hp) * .12); }
.fx-strong .hero-content { translate: 0 calc(var(--hp) * 90px); opacity: calc(1 - var(--hp) * 1.15); }

/* ---------- 6. Chuyển trang ---------- */
.fx .view:not([hidden]) { animation: fxView .7s var(--ease-out); }
.cur-run .view, .vt-on .view, .view.still { animation: none !important; }   /* still: trang mở dưới tấm màn, giữ nguyên sau khi màn kéo đi (không hiện dần lại → không nháy) */
/* Tấm màn đổi trang: một mảng phẳng, mép THẲNG, cùng ngôn ngữ với các thẻ chữ nhật và kiểu ảnh quét mở trong trang
   (bản đầu có mép cong kiểu vòm, user chê không đồng bộ). Logo KLAR hiện ở giữa lúc màn phủ kín, như màn mở đầu. */
.curtain {
  position: fixed; inset: 0; z-index: 95; pointer-events: none; visibility: hidden;
  display: grid; place-items: center;
  background: var(--curtain); color: var(--fg); transform: translateY(100%);
}
.curtain svg { width: min(170px, 38vw); height: auto; opacity: 0; }
/* View Transitions: ảnh thẻ dự án nở thành ảnh bìa */
.vt-on .p-cover, .vt-on .p-cover .g-btn, .vt-on .p-cover img { transition: none !important; animation: none !important; clip-path: none !important; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .6s; animation-timing-function: var(--ease-out); }
::view-transition-group(proj-cover) { animation-duration: 1s; animation-timing-function: var(--ease-snap); }
::view-transition-old(proj-cover), ::view-transition-new(proj-cover) { height: 100%; object-fit: cover; }

/* ---------- 7. Vòng tròn mũi tên: mũi tên bay chéo ra, mũi tên mới bay vào từ góc đối diện ---------- */
.circ svg + svg { display: none; }
.fx .circ svg { grid-area: 1 / 1; transition: transform .6s var(--ease-out); }
.fx .circ svg + svg { display: block; transform: translate(-135%, 135%); }
.fx a:hover .circ svg:first-child, .fx a:focus-visible .circ svg:first-child, .fx li.is-on .circ svg:first-child { transform: translate(135%, -135%); }
.fx a:hover .circ svg + svg, .fx a:focus-visible .circ svg + svg, .fx li.is-on .circ svg + svg { transform: none; }
.fx li.is-on .circ { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- 8. Nút viền: nền đổ lên từ đáy; con trỏ chuột thật: nút bị "hút" theo (app.js đặt translate) ---------- */
.fx .pill.line { position: relative; overflow: hidden; isolation: isolate; transition: color .4s var(--ease-out) .06s, border-color .4s var(--ease-out); }
.fx .pill.line::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; background: var(--fg);
  transform: translateY(102%); transition: transform .55s var(--ease-out);
}
.fx .pill.line:hover { background: transparent; color: var(--bg); }
.fx .pill.line:hover::before { transform: none; }

/* ---------- 9. Con trỏ tròn "Xem" trên ảnh bấm được (mức mạnh + chuột thật) ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 120; width: 0; height: 0; pointer-events: none; }
.cursor i {
  position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%;      /* 48px; 96px rồi 64px đều bị chê to */
  display: grid; place-items: center; background: var(--bg); color: var(--fg);
  font-style: normal; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
  transform: scale(0); opacity: 0; transition: transform .55s var(--ease-out), opacity .3s;
}
.cursor.on i { transform: scale(1); opacity: 1; }
.fx-ptr .arc a, .fx-ptr .svc-ex a, .fx-ptr .p-next a, .fx-ptr .g-btn { cursor: none; }

/* ---------- 10. Bốn thẻ tiêu chí: ảnh phóng nhẹ và dịch theo chuột (mức mạnh + chuột thật) ---------- */
.fx-ptr .tile img { transition: scale .9s var(--ease-out), translate .7s var(--ease-out); translate: var(--tx, 0px) var(--ty, 0px); }
.fx-ptr .tile:hover img { scale: 1.1; }

/* ---------- 11. Hai ảnh nhỏ cạnh câu giới thiệu trôi với hai tốc độ khác nhau theo cuộn (chuột thật; app.js đặt --dy) ---------- */
.fx-par .intro-img { translate: 0 var(--dy, 0px); }

/* Parallax trong thẻ: ảnh phóng 1.06 và trôi ±2,5% chiều cao khung; app.js đặt --py */
.fx-par .arc-img img, .fx-par .intro-img img, .fx-par .quote-card img { scale: 1.06; translate: 0 var(--py, 0px); }
.fx-par .par-on img { will-change: translate; }

/* ---------- 12. Dòng lĩnh vực: tên trượt khi rê hoặc khi tới lượt (đoạn ghim) ---------- */
.fx .svc-name { transition: transform .7s var(--ease-out); }
.fx .svc-list a:hover .svc-name, .fx .svc-list li.is-on .svc-name { transform: translateX(12px); }
.fx .svc-fig img { transition: opacity .25s ease; }
/* Đoạn ghim (mức mạnh): mục Lĩnh vực ở trang chủ dính lại khoảng 0,85 màn hình, mỗi dòng lần lượt sáng lên và ảnh đổi theo. app.js bật .pin-on chỉ khi mục vừa một màn hình. */
.fx-strong .svc-pin.pin-on::after { content: ""; display: block; height: var(--pin-extra, 80vh); }
.fx-strong .svc-pin.pin-on .svc-sticky { position: sticky; top: calc(var(--header-h) + 14px); }

/* ---------- 13. Dòng số liệu: mức mạnh do app.js điều khiển theo vận tốc cuộn (chạy nhanh khi cuộn, đảo chiều khi cuộn lên) ---------- */
.fx-strong .ticker-track { animation: none; will-change: transform; }
.fx .ticker.off .ticker-track { animation-play-state: paused; }

/* ---------- 14. Chân trang: mảng chân trang nằm sau nội dung và lộ ra khi cuộn hết trang; chữ KLAR lớn: từng chữ trồi lên so le ---------- */
.fx-strong .view { position: relative; z-index: 1; background: var(--bg); }
.fx-strong .site-footer { position: sticky; bottom: 0; z-index: 0; }
.fx-strong.foot-tall .site-footer { position: static; }
.fx .f-word { overflow: hidden; color: var(--fg); transition: color .6s var(--ease-out); }
.fx .f-word svg path:not([transform]) { transform: translateY(112%); transform-box: fill-box; }
.fx .f-word svg path[transform] { opacity: 0; }
.fx .f-word.in svg path:not([transform]) { transform: none; transition: transform 1.5s var(--ease-out) calc(var(--i, 0) * 80ms); }
.fx .f-word.in svg path[transform] { opacity: 1; transition: opacity 1s ease .9s; }
.fx .f-word:hover { color: var(--muted); }
.fx .to-top span { display: inline-block; transition: transform .5s var(--ease-out); }
.fx .to-top:hover span { transform: translateY(-4px); }

/* ---------- 15. Ảnh trong trang dự án: rê chuột thì phóng nhẹ trong khung ---------- */
@media (hover: hover) and (pointer: fine) {
  .fx .g-btn img { transition: transform 1.4s var(--ease-out); }
  .fx .g-btn:hover img { opacity: 1; transform: scale(1.02); }
}

/* ---------- 16. Xem ảnh lớn: ảnh bay ra từ đúng vị trí ảnh nhỏ (app.js) ---------- */
.fx .lightbox { transition: opacity .45s var(--ease-out); }

/* =========================================================
   CHUYỂN ĐỘNG — BỔ SUNG: đưa các animation sẵn có về cùng một họ
   Một họ easing (--ease-out để vào, --ease-snap để quét/mở, --ease-io để cân bằng) và ba bậc thời lượng
   (--t-fast phản hồi, --t-med chuyển trạng thái, --t-slow cảnh lớn).
   ========================================================= */
:root { --t-fast: .35s; --t-med: .7s; --t-slow: 1.4s; }

/* Đổi ảnh đầu trang: ảnh mới mở ra bằng clip-path theo hướng bấm/chạy, ảnh mới và ảnh cũ trôi lệch tốc độ (mức mạnh) */
@keyframes fxWipeL { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes fxWipeR { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fxInL  { from { translate: 9% 0; } }
@keyframes fxInR  { from { translate: -9% 0; } }
@keyframes fxOutL { to { translate: -14% 0; } }
@keyframes fxOutR { to { translate: 14% 0; } }
.fx-strong .slide.active.enter { animation: fxWipeL 1.6s var(--ease-snap) backwards; }
.fx-strong #hero[data-dir="-1"] .slide.active.enter { animation-name: fxWipeR; }
.fx-strong .slide.active.enter img { animation: fxInL 1.6s var(--ease-snap) backwards; }
.fx-strong #hero[data-dir="-1"] .slide.active.enter img { animation-name: fxInR; }
.fx-strong .slide.prev img { animation: fxOutL 1.6s var(--ease-snap) forwards; }
.fx-strong #hero[data-dir="-1"] .slide.prev img { animation-name: fxOutR; }
/* Chú thích và số đếm: chữ cũ trượt lên qua đường cắt, chữ mới trồi lên từ dưới (app.js) */
.fx .hero-caption { clip-path: inset(0 -1em); }
.fx .hero-caption .cap-in { display: block; }
.fx #heroIdx { overflow: hidden; }
.fx #heroIdx .num { display: block; }
.fx .hero-counter .bar i.run { transition-duration: calc(var(--slide-ms, 6500ms) - 500ms); }
.fx .hero-counter .bar i.out { transform: scaleX(0); transition: transform .5s var(--ease-snap); }
.fx .hero-arrow { transition: opacity var(--t-fast), transform var(--t-med) var(--ease-out); }

/* Màn intro: logo hiện từng nét so le */
@keyframes fxPathUp { to { transform: translateY(0); } }
.fx .intro svg { opacity: 1; transform: none; animation: none; }
.fx .intro svg path { transform: translateY(118%); transform-box: fill-box; animation: fxPathUp 1.2s var(--ease-out) calc(.15s + var(--i, 0) * .07s) forwards; }

/* Thanh đầu trang, menu, nút */
.fx .site-header { transition: background-color var(--t-med) var(--ease-out), border-color var(--t-med) var(--ease-out), transform .8s var(--ease-out); }
.fx .nav a::after { transition: transform .7s var(--ease-out); }
.fx .pill.solid, .fx .pill.light, .fx .pill.glass { position: relative; overflow: hidden; isolation: isolate; transition: color .4s var(--ease-out) .06s, border-color .4s var(--ease-out); }
.fx .pill.solid::before, .fx .pill.light::before, .fx .pill.glass::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; transform: translateY(102%); transition: transform .55s var(--ease-out);
}
.fx .pill.solid::before, .fx .pill.light::before { background: var(--umber); }
.fx .pill.glass::before { background: #F6F5F2; }
.fx .pill.solid:hover, .fx .pill.light:hover, .fx .pill.glass:hover { opacity: 1; color: #1A1A1A; }
.fx .pill.light:hover { background: #F6F5F2; }
.fx .pill.glass:hover { background: rgba(20, 20, 20, .5); }
.fx .pill.solid:hover::before, .fx .pill.light:hover::before, .fx .pill.glass:hover::before { transform: none; }
.fx .flt { transition: background-color .5s var(--ease-out), color .5s var(--ease-out), transform var(--t-med) var(--ease-out); }
.fx .flt:hover { transform: translateY(-3px); }
.fx .flt:active { transform: scale(.96); }

@keyframes fxBtn { from { opacity: 0; transform: translateY(55%); } }
@media (max-width: 900px) {
  /* Menu điện thoại: các dòng vào so le từ dưới lên, nút Menu/Đóng đổi chữ có chuyển động */
  .fx .nav > a { opacity: 0; transform: translateY(34px); transition: opacity .25s ease, transform .25s ease; }
  .fx .nav .nav-contact { opacity: 0; transform: translateY(20px); transition: opacity .25s ease, transform .25s ease; }
  .fx body.menu-open .nav > a, .fx body.menu-open .nav .nav-contact {
    opacity: 1; transform: none;
    transition: opacity var(--t-med) var(--ease-out) calc(.14s + var(--n, 0) * .08s), transform 1s var(--ease-out) calc(.14s + var(--n, 0) * .08s);
  }
  .fx .nav > :nth-child(2) { --n: 1; } .fx .nav > :nth-child(3) { --n: 2; } .fx .nav > :nth-child(4) { --n: 3; } .fx .nav > :nth-child(5) { --n: 4; }
  .fx body.menu-open .menu-btn .menu-close-txt, .fx body:not(.menu-open) .menu-btn .menu-open-txt { display: inline-block; animation: fxBtn .5s var(--ease-out) backwards; }
}

/* Thẻ dự án, ảnh minh hoạ, "Dự án tiếp theo": rê chuột phản hồi rõ hơn */
.fx .arc-img img, .fx .svc-ex img { transition: transform 1.8s var(--ease-out); }
.fx .arc a:hover .arc-img img, .fx .svc-ex a:hover img { transform: scale(1.06); }
.fx .arc-name { transition: transform var(--t-med) var(--ease-out); }
.fx .arc a:hover .arc-name { transform: translateX(6px); }
.fx .p-next-name { transition: transform 1s var(--ease-out); }
.fx .p-next a:hover .p-next-name { transform: translateX(18px); }
.fx .p-next figure img { transition: transform 1.8s var(--ease-out); }
.fx .p-next a:hover figure img { transform: scale(1.07); }

/* Ảnh khối Lĩnh vực: lớp ảnh mới mở ra đè lên (app.js) */
.fx .svc-fig { position: relative; }
.svc-ov { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Xem ảnh lớn: nền tối nhạt dần riêng, ảnh bay từ/đến ảnh nhỏ, nút chữ hiện sau */
.fx .lightbox { opacity: 1; background: rgba(15, 15, 15, 0); transition: background-color .6s var(--ease-out); }
.fx .lightbox.open { background: #0F0F0F; }
.fx .lightbox:not(.open) button, .fx .lightbox:not(.open) .lb-cap { opacity: 0; }
.fx .lightbox button, .fx .lb-cap { transition: opacity .6s var(--ease-out) .15s; }

/* =========================================================
   MỨC "CÂN BẰNG" (.fx-strong.fx-soft) — nằm giữa mạnh và vừa, đang là mặc định.
   Cùng bộ hiệu ứng nhìn thấy rõ của mức mạnh, nhưng biên độ nhỏ hơn và nhanh hơn để không lấn át nội dung.
   Chỉ ghi đè thông số; muốn chỉnh mạnh/nhẹ thêm thì sửa các số ở đây.
   ========================================================= */
.fx-strong.fx-soft { --dur: 1s; --lift: 26px; --zoom: 1.1; }

/* mở màn: thẻ ảnh nở ra nhanh hơn, ảnh bên trong thu từ 1,18 (mạnh: 1,45), chữ vào sớm hơn */
@keyframes fxHeroImgSoft { from { scale: 1.18; } to { scale: 1; } }
.fx-strong.fx-soft:not(.hero-done) .hero { animation-duration: 1.35s; }
.fx-strong.fx-soft:not(.hero-done) .slide.active:first-child img { animation-name: fxHeroImgSoft; animation-duration: 1.9s; }
.fx-strong.fx-soft:not(.hero-done) .hero-statement .ln {
  animation-duration: 1.15s;
  animation-delay: calc(var(--hero-delay, .15s) + .5s + var(--l, 0) * .12s + min(var(--w, 0), 6) * .035s);
}
.fx-strong.fx-soft:not(.hero-done) .hero-side    { animation-delay: calc(var(--hero-delay, .15s) + .9s); }
.fx-strong.fx-soft:not(.hero-done) .hero-counter { animation-delay: calc(var(--hero-delay, .15s) + 1.05s); }

/* thẻ ảnh đầu trang khi cuộn: co 3% (mạnh: 7%), bo góc thêm 14px (mạnh: 42px), ảnh phóng thêm 5% (mạnh: 12%) */
.fx-strong.fx-soft .hero { scale: calc(1 - var(--hp) * .03); clip-path: inset(0 0 0 0 round calc(var(--rad) + var(--hp) * 14px)); }
.fx-strong.fx-soft .hero-slides { translate: 0 calc(var(--hp) * 3%); scale: calc(1 + var(--hp) * .05); }
.fx-strong.fx-soft .hero-content { translate: 0 calc(var(--hp) * 40px); }

/* đổi ảnh đầu trang: quét nhanh hơn */
.fx-strong.fx-soft .slide.active.enter,
.fx-strong.fx-soft .slide.active.enter img,
.fx-strong.fx-soft .slide.prev img { animation-duration: 1.2s; }

/* thẻ tiêu chí khi rê chuột: chỉ phóng nhẹ, không chạy theo chuột */
.fx-ptr.fx-soft .tile:hover img { scale: 1.05; }

/* =========================================================
   ĐIỆN THOẠI & IPAD (bản Q) — màn cảm ứng
   Đo bằng giả lập cảm ứng: iPhone 375×667, 390×844, xoay ngang 844×390; iPad 820×1180, 1180×820, 1024×1366, 1366×1024.
   ========================================================= */

/* Tai thỏ khi xoay ngang (trang dùng viewport-fit=cover): lề chữ không lọt vào vùng khuyết. Ảnh vẫn được tràn ra mép. */
:root { --pad: max(clamp(20px, 4vw, 64px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }

/* Ảnh đầu trang trên màn nhỏ: cụm chữ + nút chiếm gần nửa dưới ảnh, lại hay nằm trên biển / tường sáng
   → lớp tối chuyển dần cao hơn, đậm hơn để chữ trắng đọc rõ (không blur ảnh). */
@media (max-width: 640px) {
  .hero::after {
    background: linear-gradient(to top,
      rgba(10,10,10,.8) 0%, rgba(10,10,10,.7) 14%, rgba(10,10,10,.54) 26%, rgba(10,10,10,.36) 37%,
      rgba(10,10,10,.18) 48%, rgba(10,10,10,.06) 58%, rgba(10,10,10,0) 67%);
  }
}
/* Điện thoại xoay ngang: thanh đầu trang thấp lại (72 → 56px), lớp tối phủ cao hơn vì cụm chữ chiếm quá nửa ảnh */
@media (max-height: 600px) and (orientation: landscape) {
  :root { --header-h: 56px; }
  .hero::after {
    background: linear-gradient(to top,
      rgba(10,10,10,.82) 0%, rgba(10,10,10,.7) 18%, rgba(10,10,10,.52) 34%, rgba(10,10,10,.32) 50%,
      rgba(10,10,10,.13) 64%, rgba(10,10,10,0) 78%);
  }
}

/* Menu điện thoại trên màn thấp: chữ menu 40px + khối liên hệ ở đáy từng đè lên nhau (xoay ngang: "Liên hệ" chồng lên email) */
@media (max-width: 900px) and (max-height: 640px) and (orientation: portrait) {
  .nav { padding-bottom: 110px; }
  .nav a { font-size: 32px; }
}
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .nav { padding-top: var(--header-h); gap: 0; align-items: flex-start; }     /* dòng menu chỉ rộng bằng chữ, không chạm sang khối liên hệ */
  .nav a { font-size: 28px; line-height: 1.3; padding: 5px 0; }
  /* liên hệ nhanh sang góc dưới bên phải, không còn nằm dưới danh sách */
  .nav-contact { left: auto; right: var(--pad); bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); padding-top: 0; border-top: 0; align-items: flex-end; text-align: right; }
}

/* Bộ lọc dự án trên điện thoại: MỘT hàng vuốt ngang (trước đây rớt thành 3 dòng lệch nhau), tràn ra hai mép màn hình,
   mép hàng mờ dần để biết còn nút phía sau. Nút vừa chọn tự trượt vào giữa (app.js). */
@media (max-width: 640px) {
  .filters {
    position: relative;
    flex-wrap: nowrap; justify-content: flex-start; gap: 8px;
    margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad));
    padding: 4px var(--pad);
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
            mask-image: linear-gradient(to right, transparent, #000 var(--pad), #000 calc(100% - var(--pad)), transparent);
  }
  .filters::-webkit-scrollbar { display: none; }
  .flt { flex-shrink: 0; }
}

/* Chỗ chạm đủ cỡ ngón tay (≥ 40–44px) mà không đổi hình thức: nới vùng bấm bằng padding, bù lại bằng margin âm */
@media (pointer: coarse) {
  .brand { padding: 12px 0; }
  .hero-arrow { width: 44px; height: 44px; }
  #heroPrev { margin-left: -12px; } #heroNext { margin-right: -12px; }
  .hero-caption { padding: 10px 0; margin: -10px 0; }
  .fx .hero-caption { clip-path: inset(10px -1em); }       /* đường cắt của chữ trượt đi vẫn nằm sát chữ, không lùi ra theo phần đệm */
  .p-top .label a, .p-all .label { display: inline-block; padding: 13px 0; margin: -13px 0; }
  .contact-list dd a { display: inline-block; padding: 10px 0; margin: -10px 0; }
  .f-nav { gap: 0; }
  .f-nav a { padding: 9px 0; }
  .f-contact { gap: 0; }
  .f-contact a { display: inline-block; padding: 9px 0; }
  .nav .nav-contact { gap: 0; }
  .nav .nav-contact a { padding: 10px 0; }
  .pill.sm { min-height: 44px; }                          /* nút "Liên hệ" trên thanh đầu trang (iPad ngang) */
}

/* Điện thoại xoay ngang, trang dự án: khối "Dự án tiếp theo" về hai cột như màn lớn — xếp dọc thì ảnh cao 518px trên màn cao 390px */
@media (max-width: 900px) and (max-height: 600px) and (orientation: landscape) {
  .p-next-text { grid-column: 1 / span 7; }
  .p-next figure { grid-column: 8 / span 5; order: 0; margin-bottom: 0; }
}

/* Màn cảm ứng không có "rê chuột": sau một cú chạm, trình duyệt giữ nguyên trạng thái :hover cho tới lần chạm sau
   (thẻ dự án kẹt ở ảnh phóng to + vòng tròn đen, nút lọc kẹt ở màu rê, dòng số liệu chạm vào là đứng luôn).
   Ở đây trả các trạng thái đó về như cũ; thay bằng phản hồi lúc ĐANG chạm (:active). */
@media (hover: none) {
  .pill.solid:hover { opacity: 1; }
  .pill.line:hover { background: transparent; color: inherit; }
  .pill.light:hover { background: #F6F5F2; }
  .pill.glass:hover { background: rgba(20, 20, 20, .5); }
  .fx .pill.solid:hover { color: var(--bg); }
  .fx .pill.light:hover { color: #1A1A1A; }
  .fx .pill.glass:hover { color: #F6F5F2; }
  .fx .pill.line:hover { color: inherit; }
  .fx .pill.line:hover::before, .fx .pill.solid:hover::before, .fx .pill.light:hover::before, .fx .pill.glass:hover::before { transform: translateY(102%); }

  a:hover > .circ, a:hover .arc-row .circ { background: transparent; color: inherit; border-color: var(--ring); }
  .fx a:hover .circ svg:first-child { transform: none; }
  .fx a:hover .circ svg + svg { transform: translate(-135%, 135%); }

  .arc a:hover .arc-img img, .fx .arc a:hover .arc-img img,
  .svc-ex a:hover img, .fx .svc-ex a:hover img,
  .p-next a:hover figure img, .fx .p-next a:hover figure img { transform: none; }
  .fx .arc a:hover .arc-name, .fx .svc-list a:hover .svc-name,
  .p-next a:hover .p-next-name, .fx .p-next a:hover .p-next-name { transform: none; }
  .svc-ex a:hover span { color: var(--muted); }
  .g-btn:hover img { opacity: 1; }

  .flt:hover { background: var(--chip); }
  .flt[aria-pressed="true"]:hover { background: var(--fg); }
  .fx .flt:hover:not(:active) { transform: none; }

  .kw:hover { letter-spacing: .04em; }
  .ticker:hover .ticker-track { animation-play-state: running; }
  .nav a:not(.active):hover::after { transform: scaleX(0); }
  .contact-list a:hover, .p-top .label a:hover, .f-nav a:hover, .f-contact a:hover { background-size: 0 1px; }
  .fx .f-word:hover { color: var(--fg); }
  .fx .to-top:hover span { transform: none; }
  .hero-arrow:hover { opacity: .75; }
  #heroPrev:hover, #heroNext:hover { transform: none; }

  /* phản hồi khi đang chạm */
  .pill:active { transform: scale(.97); }
  .arc a:active .arc-img img, .svc-ex a:active img, .p-next a:active figure img { opacity: .86; }
  .svc-list a:active .circ, .arc a:active .circ { background: var(--fg); color: var(--bg); border-color: var(--fg); }
}
