/* ============================================================
   TA Web Studio — ấm, như phim, có chất liệu.
   Nền be, chữ nâu đen, một màu nhấn đỏ gạch. Font: Bricolage Grotesque.
   Tương phản (WCAG): chữ #1D1915 trên be 11:1 · chữ phụ #5A4E42 5.1:1 ·
   nhấn #C4482B chỉ cho chữ lớn/trang trí (3.1:1); chữ nhấn nhỏ dùng --accent-ink.
   ============================================================ */
/* Bricolage Grotesque (SIL Open Font License) — tự lưu trên site để tải nhanh */
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-stretch: 100%; font-display: swap;
  src: url("/assets/fonts/bricolage-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-stretch: 100%; font-display: swap;
  src: url("/assets/fonts/bricolage-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 400 800; font-stretch: 100%; font-display: swap;
  src: url("/assets/fonts/bricolage-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #d9ccb4;
  --bg-2: #e3d8c4;        /* thẻ sáng hơn nền một chút */
  --ink: #1d1915;
  --ink-soft: #5a4e42;
  --line: rgba(29, 25, 21, .16);
  --accent: #c4482b;
  --accent-ink: #96311a;  /* chữ nhấn nhỏ trên nền be — 4.8:1 */
  --on-accent: #ffffff;   /* chữ trên nút đỏ gạch — 4.9:1 */
  /* khối tối ấm */
  --dark: #1d1915;
  --dark-2: #27211c;
  --dark-ink: #d9ccb4;
  --dark-soft: #a89a84;   /* 6.3:1 */
  --dark-line: rgba(217, 204, 180, .16);
  --dark-accent: #e8704e; /* 5.7:1 */

  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --pad: 16px;
  --gap: 16px;
  --h1: clamp(52px, 9vw, 152px);
  --h2: clamp(40px, 6vw, 96px);
  --space: clamp(88px, 12vw, 176px);
  --radius: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
@view-transition { navigation: auto; } /* chuyển trang mượt giữa trang chủ và trang dự án */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 400;
  font-variation-settings: "opsz" 14;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Lớp hạt nhiễu như phim — SVG nhẹ, phủ toàn trang, không bắt chuột */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .08 0 0 0 0 .06 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .2; transform: translateZ(0); will-change: transform;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dark :focus-visible { outline-color: var(--dark-accent); }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 70; background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: 4px; font-weight: 600; transition: top .2s;
}
.skip:focus { top: 12px; }

.container { padding-inline: var(--pad); }
.dot { color: var(--accent); }
.link {
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px;
  text-underline-offset: 4px; transition: color .2s;
}
.link:hover { color: var(--accent-ink); }
.dark .link:hover { color: var(--dark-accent); }

/* Tiêu đề: rất lớn, đậm, giãn dòng chặt */
h1, h2 {
  font-weight: 750; font-variation-settings: "opsz" 96; letter-spacing: -0.045em; line-height: .92;
}
h2 { font-size: var(--h2); }

/* ---- Khối tối ấm ---- */
.dark { background: var(--dark); color: var(--dark-ink); }
.dark .dot { color: var(--dark-accent); }

/* ---- Logo ---- */
.logo { font-weight: 800; font-size: 21px; letter-spacing: -0.05em; line-height: 1; white-space: nowrap; font-variation-settings: "opsz" 48; }

/* ---- Thanh điều hướng ---- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding-inline: var(--pad);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s, transform .35s var(--ease);
}
.nav.scrolled, .nav.open {
  background: rgba(217, 204, 180, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.nav.hide { transform: translateY(-100%); }
.nav-right { display: flex; align-items: center; gap: 24px; }
.lang { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.lang button { color: var(--ink-soft); padding: 6px 2px; transition: color .2s; }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.lang button:hover { color: var(--ink); }
.menu-btn { font-weight: 600; padding: 6px 0; }
.menu {
  position: absolute; top: 58px; right: 0; left: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px var(--pad) 28px; background: var(--bg); border-bottom: 1px solid var(--line);
  font-size: clamp(32px, 4.6vw, 56px); font-weight: 750; letter-spacing: -0.045em; line-height: 1.08;
  font-variation-settings: "opsz" 96;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .5s var(--ease), visibility 0s .5s;
}
.nav.open .menu { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .5s var(--ease); }
.menu a { width: fit-content; transition: color .2s, transform .3s var(--ease); }
.menu a:hover { color: var(--accent); transform: translateX(6px); }

/* ---- Nút ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px; border-radius: 999px; font-size: 17px; font-weight: 650;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #ab3a20; }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-ghost { border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.dark .btn-ghost { border-color: var(--dark-ink); }
.dark .btn-ghost:hover { background: var(--dark-ink); color: var(--dark); }

/* ---- Hero: bảng tối bo góc, avatar 3D giữa mạng điểm nối ---- */
:root {
  --hero-bg: #0d0d11; --hero-fg: #f1eadb; --hero-accent: #e8684a; --hero-ok: #8fcf9a; --hero-muted: #a8a39a;
}
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero-wrap { padding-top: 74px; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(24px, 4vw, 64px);
  grid-template-areas: "status scene" "title scene" "sub scene" "cta scene" "commit scene";
  grid-template-rows: auto auto auto auto 1fr; align-items: start;
  background: var(--hero-bg); color: var(--hero-fg); border-radius: 20px;
  padding: clamp(28px, 4vw, 56px); overflow: hidden;
}
.hero[data-theme="light"] { --hero-bg: var(--bg-2); --hero-fg: var(--ink); --hero-muted: var(--ink-soft); }
.hero .status { grid-area: status; justify-self: start; border-color: rgba(241, 234, 219, .35); color: var(--hero-fg); }
.hero .status-dot { background: var(--hero-ok); }
.hero .status.booked .status-dot { background: var(--hero-muted); }
.hero h1 { grid-area: title; margin-top: clamp(18px, 3vh, 30px); }
.hero h1 .dot { color: var(--hero-accent); }
.hero-sub { grid-area: sub; color: #cfc8ba; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; max-width: 34em; margin-top: clamp(18px, 3vh, 28px); }
.hero-actions { grid-area: cta; display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(22px, 3.5vh, 34px); }
.hero .btn-ghost { border-color: rgba(241, 234, 219, .6); color: var(--hero-fg); }
.hero .btn-ghost:hover { background: var(--hero-fg); color: var(--hero-bg); }
.hero .btn-primary { background: var(--hero-accent); color: #160b07; }
.hero .btn-primary:hover { background: #f07a5d; }
.commit { grid-area: commit; display: grid; gap: 8px; margin-top: 26px; align-self: start; }
.commit li { position: relative; padding-left: 26px; color: var(--hero-fg); font-size: 16px; }
.commit li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 11px; height: 6px; border-left: 2px solid var(--hero-ok); border-bottom: 2px solid var(--hero-ok); transform: rotate(-45deg); }
.status { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; padding: 8px 14px 8px 11px; border: 1.5px solid var(--ink); border-radius: 999px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(40px, 6.4vw, 112px); text-wrap: balance; overflow-wrap: break-word; }

/* Scene */
.hero-scene {
  grid-area: scene; position: relative; align-self: center; width: 100%; aspect-ratio: 1; min-height: 420px; max-height: 640px;
  background: var(--hero-bg); border-radius: 16px; overflow: hidden; touch-action: pan-y; container-type: size; isolation: isolate;
}
.hero-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s ease; }
.hero-scene.live canvas { opacity: 1; }
.hero-front { pointer-events: none; z-index: 3; }
.av { position: absolute; left: 50%; top: 50%; width: 46cqmin; height: 46cqmin; translate: -50% -50%; perspective: 720px; z-index: 2; }
.av3 { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.pls { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--hero-accent); transform: translateZ(-30px); opacity: 0; }
.halo { position: absolute; inset: 0; border-radius: 50%; background: var(--hero-accent); opacity: .25; filter: blur(16px); transform: translateZ(-60px); }
.spr {
  position: absolute; inset: -10px; border-radius: 50%; transform: translateZ(-24px);
  background: conic-gradient(from 0deg, #e8684a, transparent 30%, #f1eadb 55%, transparent 75%, #e8684a);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
.av-photo { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; border: 2px solid var(--hero-fg); background: #1b1a20; }
.av-photo picture { position: absolute; left: -7%; top: -7%; width: 114%; height: 114%; display: block; will-change: transform; }
.av-photo img { width: 100%; height: 100%; object-fit: cover; }
.shn { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .42) 50%, transparent 65%); mix-blend-mode: overlay; pointer-events: none; }
.glass { position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgba(241, 234, 219, .35); transform: translateZ(26px); }
.orb { position: absolute; inset: 0; transform: translateZ(46px); }
.orb i { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--hero-accent); }
.orb i:nth-child(1) { transform: rotate(0deg) translateX(calc(23cqmin + 14px)); }
.orb i:nth-child(2) { transform: rotate(120deg) translateX(calc(23cqmin + 14px)); }
.orb i:nth-child(3) { transform: rotate(240deg) translateX(calc(23cqmin + 14px)); }
.av-tag {
  position: absolute; left: 50%; bottom: -6%; translate: -50% 0; transform: translateZ(70px); white-space: nowrap;
  background: var(--hero-fg); color: #17140f; font-size: clamp(11px, 3.4cqmin, 14px); font-weight: 700; padding: 5px 12px; border-radius: 999px;
}
.scene-ui { position: absolute; inset: 0; z-index: 4; pointer-events: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.scene-ui > span { position: absolute; font-size: clamp(10px, 2.9cqmin, 13px); letter-spacing: .08em; }
.s-brand { left: 16px; top: 14px; color: var(--hero-accent); font-weight: 700; }
.s-name { left: 16px; bottom: 14px; color: var(--hero-fg); font-family: var(--font); font-weight: 700; font-size: clamp(13px, 4cqmin, 18px) !important; letter-spacing: -.01em !important; line-height: 1.2; }
.s-name small { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 500; font-size: clamp(10px, 2.8cqmin, 12px); color: var(--hero-muted); letter-spacing: .06em; }
.s-status { right: 16px; bottom: 14px; color: var(--hero-fg); display: flex; align-items: center; gap: 7px; }
.s-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--hero-ok); }
.s-status.booked i { background: var(--hero-muted); }
@media (prefers-reduced-motion: no-preference) {
  .pls { animation: pl 2.8s ease-out infinite; }
  .pls2 { animation-delay: 1.4s; }
  .pls.once { animation: pl 1.4s ease-out 1; }
  .spr { animation: spn 6s linear infinite; }
  .orb { animation: spo 7s linear infinite; }
  .s-status i { animation: blink 1.6s infinite; }
}
@keyframes pl { from { transform: translateZ(-30px) scale(1); opacity: .75; } to { transform: translateZ(-30px) scale(1.9); opacity: 0; } }
@keyframes spn { from { transform: translateZ(-24px) rotate(0); } to { transform: translateZ(-24px) rotate(360deg); } }
@keyframes spo { from { transform: translateZ(46px) rotate(0); } to { transform: translateZ(46px) rotate(360deg); } }

/* ---- Section ---- */
.section { padding-top: var(--space); }
.section.work { margin-top: var(--space); padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(64px, 8vw, 120px); }
.sec-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 24px;
  padding-bottom: 18px; margin-bottom: clamp(24px, 3vw, 44px); border-bottom: 1.5px solid currentColor;
}
.sec-desc { color: var(--ink-soft); font-size: 18px; max-width: 30em; }
.dark .sec-desc { color: var(--dark-soft); }

/* ---- Giới thiệu ---- */
.about { display: grid; grid-template-columns: 4fr 3fr 5fr; gap: clamp(20px, 3vw, 48px); align-items: start; }
.about-lead {
  grid-column: 1 / -1; font-size: clamp(32px, 4.4vw, 68px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.02;
  font-variation-settings: "opsz" 96; max-width: 15em; text-wrap: balance; margin-bottom: clamp(16px, 3vw, 40px);
}
.about-img { grid-column: 2; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); }
.about-img img { width: 100%; height: 100%; object-fit: cover; }
.about-text { grid-column: 3; }
.about-p2 { color: var(--ink-soft); font-size: 18px; }
.about-how { font-size: 14px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; margin-top: 32px; color: var(--accent-ink); }
.how { margin-top: 10px; border-top: 1px solid var(--line); }
.how li { display: grid; gap: 2px; padding: 14px 0 14px 34px; border-bottom: 1px solid var(--line); position: relative; }
.how li::before {
  content: ""; position: absolute; left: 0; top: 19px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--accent); background: radial-gradient(circle, var(--accent) 0 3.5px, transparent 4px);
}
.how strong { font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.how span { color: var(--ink-soft); }

/* ---- Dự án: băng chuyền cong (điểm nhấn 2) ---- */
.work { overflow: hidden; }
.work-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: clamp(20px, 3vw, 36px); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button, .view-toggle {
  border: 1.5px solid var(--dark-line); border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 600;
  color: var(--dark-soft); transition: color .2s, border-color .2s, background .2s;
}
.filters button:hover, .view-toggle:hover { color: var(--dark-ink); border-color: var(--dark-ink); }
.filters button[aria-pressed="true"] { background: var(--dark-ink); color: var(--dark); border-color: var(--dark-ink); }
.view-toggle { display: inline-flex; align-items: center; gap: 8px; }
.view-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.view-toggle[aria-pressed="true"] { color: var(--dark-ink); border-color: var(--dark-ink); }

.carousel { position: relative; outline: none; }
.carousel:focus-visible { outline: 2px solid var(--dark-accent); outline-offset: -2px; }
.track {
  --slide-w: min(58vw, 880px);
  position: relative; height: calc(var(--slide-w) * .625 + 56px); margin-top: 8px;
  touch-action: pan-y; user-select: none; cursor: grab;
  -webkit-user-select: none;
}
.dragging .track { cursor: grabbing; }
.slide {
  position: absolute; left: 50%; top: 0; width: var(--slide-w);
  transform-origin: 50% 120%;
  transition: transform .7s var(--ease), opacity .7s var(--ease);
  will-change: transform;
}
.dragging .slide { transition: none; }
.slide-link { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: var(--dark-2); box-shadow: 0 0 0 1px rgba(217, 204, 180, .14), 0 40px 70px -30px rgba(0, 0, 0, .7); }
.slide-link img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); pointer-events: none; }
.slide.active .slide-link:hover img { transform: scale(1.03); }
.slide-arrow {
  position: absolute; right: 14px; top: 14px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 20px;
  opacity: 0; transform: scale(.8) rotate(-20deg); transition: opacity .3s, transform .4s var(--ease);
}
.slide.active .slide-link:hover .slide-arrow, .slide-link:focus-visible .slide-arrow { opacity: 1; transform: none; }
.badge {
  position: absolute; left: 14px; top: 14px; font-size: 12.5px; font-weight: 650; letter-spacing: .02em;
  padding: 4px 11px; border-radius: 999px; background: rgba(29, 25, 21, .85); color: var(--dark-ink); border: 1px solid var(--dark-line);
}
.badge.inline { position: static; display: inline-block; vertical-align: 2px; background: transparent; color: inherit; border-color: currentColor; }
.slide-meta { display: none; }
.empty { text-align: center; color: var(--dark-soft); padding: 80px var(--pad); font-size: 20px; }
.carousel-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-top: clamp(20px, 3vw, 40px); }
.caption { display: grid; gap: 6px; min-height: 64px; }
.caption strong { font-size: clamp(28px, 3.2vw, 48px); font-weight: 750; letter-spacing: -0.04em; color: var(--dark-accent); font-variation-settings: "opsz" 96; line-height: 1; }
.caption span { color: var(--dark-soft); }
.car-nav { display: flex; align-items: center; gap: 14px; }
.hint { color: var(--dark-soft); font-size: 14px; margin-right: 8px; }
.count { font-variant-numeric: tabular-nums; color: var(--dark-soft); min-width: 64px; text-align: center; }
.round {
  width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--dark-ink); font-size: 20px;
  transition: background .2s, color .2s;
}
.round:hover { background: var(--dark-ink); color: var(--dark); }

/* Chấm vị trí (dải cuộn ngang) */
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--dark-line); transition: background .25s, transform .25s; }
.dots i.on { background: var(--dark-accent); transform: scale(1.3); }

/* Dạng lưới & dạng phẳng (điện thoại) */
.carousel.flat .track { height: auto; cursor: auto; user-select: auto; touch-action: auto; }
.carousel.flat .slide { position: static; width: auto; transform: none !important; opacity: 1 !important; filter: none !important; transition: none; }
.carousel.flat .slide-meta { display: block; padding-top: 14px; }
.slide-meta h3 { font-size: 24px; font-weight: 750; letter-spacing: -0.035em; color: var(--dark-accent); font-variation-settings: "opsz" 48; }
.slide-meta p { color: var(--dark-soft); font-size: 15px; }
.carousel.flat .slide-arrow { opacity: 1; transform: none; }
.carousel.grid .track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px var(--gap); padding-inline: var(--pad); }
.carousel.grid .slide-link:hover img { transform: scale(1.03); }

/* ---- Gói dịch vụ ---- */
.packages { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.pkg {
  position: relative; display: flex; flex-direction: column;
  border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 30px 26px 26px; background: var(--bg-2);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.pkg:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -28px rgba(40, 25, 10, .5); }
.pkg.featured { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.pkg-tag {
  position: absolute; top: -13px; left: 24px; background: var(--accent); color: var(--on-accent);
  font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.pkg-icon svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pkg-icon svg .fill { fill: var(--accent); stroke: var(--accent); }
.pkg h3 { font-size: 26px; font-weight: 750; letter-spacing: -0.035em; margin-top: 18px; font-variation-settings: "opsz" 48; }
.pkg-desc { color: var(--ink-soft); margin-top: 6px; }
.pkg .muted { color: var(--ink-soft); }
.pkg.featured .pkg-desc, .pkg.featured .muted, .pkg.featured .pkg-inc li, .pkg.featured .pkg-inc-label { color: var(--dark-soft); }
.pkg-price { margin-top: 22px; font-size: 15px; }
.pkg-price strong { font-size: 48px; font-weight: 750; letter-spacing: -0.05em; margin: 0 2px; font-variation-settings: "opsz" 96; }
.pkg-time { margin-top: 4px; font-size: 15px; }
.pkg-inc-label { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.pkg.featured .pkg-inc-label { border-top-color: var(--dark-line); }
.pkg-inc { margin: 10px 0 24px; display: grid; gap: 8px; align-content: start; }
.pkg-inc li { position: relative; padding-left: 24px; color: var(--ink-soft); line-height: 1.4; }
.pkg-inc li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.pkg.featured .pkg-inc li::before { border-color: var(--dark-accent); }
.pkg .btn { margin-top: auto; width: 100%; }
.pkg.featured .btn-primary { border: 0; }
.pkg-other { margin-top: 24px; color: var(--ink-soft); }

/* Quy trình */
.process { margin-top: clamp(64px, 8vw, 110px); }
.sub-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 26px; }
.sub-head h3, .tech h3 { font-size: clamp(30px, 3.6vw, 52px); font-weight: 750; letter-spacing: -0.045em; line-height: 1; font-variation-settings: "opsz" 96; }
.sub-head .muted { color: var(--ink-soft); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.step { border-top: 1.5px solid var(--ink); padding-top: 18px; position: relative; }
.step-n { display: block; font-size: clamp(44px, 5vw, 72px); font-weight: 750; letter-spacing: -0.05em; line-height: 1; color: var(--accent); font-variation-settings: "opsz" 96; }
.step h4 { font-size: 23px; font-weight: 700; letter-spacing: -0.03em; margin-top: 10px; }
.step-time { color: var(--accent-ink); font-size: 15px; font-weight: 650; margin-top: 2px; }
.step .muted { margin-top: 10px; color: var(--ink-soft); line-height: 1.5; }

/* Công nghệ — một dòng, mở ra được */
.tech-wrap { padding-top: clamp(56px, 7vw, 96px); }
.tech { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--line); }
.tech summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 18px 0; min-height: 44px; }
.tech summary::-webkit-details-marker { display: none; }
.tech-title { font-size: clamp(22px, 2.4vw, 32px); font-weight: 750; letter-spacing: -0.035em; }
.tech-desc { color: var(--ink-soft); }
.tech-show { margin-left: auto; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.tech[open] .tech-show { opacity: .6; }
.tech .chips { padding: 0 0 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; color: var(--ink-soft); }

/* Mẫu có thể xem */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.tpl { display: grid; gap: 4px; }
.tpl-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); margin-bottom: 10px; }
.tpl-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tpl:hover .tpl-img img { transform: scale(1.03); }

/* Trước / Sau */
.ba-list { display: grid; gap: clamp(32px, 4vw, 56px); }
.ba-view { --pos: 50%; position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); }
.ba-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-before::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--accent); }
.ba-view input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-tag { position: absolute; top: 12px; font-size: 13px; font-weight: 650; background: var(--bg); padding: 3px 10px; border-radius: 999px; }
.ba-tag.l { left: 12px; } .ba-tag.r { right: 12px; }
.ba figcaption { margin-top: 12px; color: var(--ink-soft); }
.ba figcaption strong { color: var(--ink); }

/* ---- Khách hàng nói gì ---- */
.testis { display: grid; gap: var(--gap); }
.testi { position: relative; max-width: 960px; }
.testi blockquote { font-size: clamp(26px, 3.4vw, 50px); font-weight: 650; line-height: 1.12; letter-spacing: -0.035em; font-variation-settings: "opsz" 72; text-wrap: balance; }
.testi figcaption { display: flex; align-items: center; gap: 14px; margin-top: 28px; line-height: 1.35; }
.testi .muted { color: var(--ink-soft); }
.avatar {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 750; font-size: 17px;
}
.badge.sample { position: static; display: inline-block; margin-bottom: 18px; background: transparent; border: 1.5px solid var(--accent-ink); color: var(--accent-ink); }

/* ---- FAQ ---- */
.faq { margin-top: calc(-1 * clamp(24px, 3vw, 44px)); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 0; text-align: left; font-weight: 650; font-size: clamp(19px, 1.7vw, 24px); letter-spacing: -0.02em;
}
.faq-q:hover { color: var(--accent-ink); }
.faq-icon { position: relative; width: 20px; height: 20px; flex: none; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: currentColor; transition: transform .3s var(--ease);
}
.faq-icon::after { transform: rotate(90deg); }
.faq-item.open .faq-icon::after { transform: rotate(0); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p { color: var(--ink-soft); max-width: 640px; padding: 0 0 24px; line-height: 1.55; }
.faq-more { margin-top: 32px; color: var(--ink-soft); }

/* ---- Liên hệ (khối tối) ---- */
.contact.dark { margin-top: var(--space); padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(64px, 8vw, 120px); }
.contact-title { font-size: var(--h1); max-width: 11em; text-wrap: balance; }
.contact-head .sec-desc { margin-top: 20px; }
.contact-grid { display: grid; grid-template-columns: 7fr 4fr; gap: clamp(32px, 5vw, 80px); margin-top: clamp(32px, 4vw, 56px); align-items: start; }
.form { display: grid; gap: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: grid; gap: 8px; font-size: 15px; color: var(--dark-soft); }
.form input, .form select, .form textarea {
  width: 100%; background: var(--dark-2); border: 1.5px solid var(--dark-line); border-radius: var(--radius);
  padding: 14px; font-size: 17px; color: var(--dark-ink); transition: border-color .2s;
}
.form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #a89a84 50%), linear-gradient(135deg, #a89a84 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.form textarea { resize: vertical; min-height: 120px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--dark-accent); }
.form ::placeholder { color: #8c7f6c; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.form-status { font-size: 15px; color: var(--dark-soft); }
.form[data-state="success"] .form-status { color: #9fd3a6; }
.form[data-state="error"] .form-status { color: var(--dark-accent); }
.contact-side { display: grid; gap: 10px; }
.side-label { color: var(--dark-soft); font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.platforms { display: grid; gap: 10px; margin-bottom: 22px; }
.platforms .btn { justify-content: space-between; }
.direct { font-size: 18px; }

/* ---- Footer ---- */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  padding-top: 24px; padding-bottom: 30px; border-top: 1px solid var(--dark-line); font-size: 15px;
}
.footer .muted { color: var(--dark-soft); margin-right: auto; }

/* ---- Liên hệ nhanh: máy tính = nút nổi góc dưới phải ---- */
.quick { position: fixed; right: 18px; bottom: 18px; z-index: 25; display: flex; flex-direction: column; gap: 10px; transition: opacity .3s, transform .3s var(--ease); }
.quick.away { opacity: 0; transform: translateY(16px); pointer-events: none; }
.q-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); box-shadow: 0 10px 24px -10px rgba(40, 25, 10, .6); transition: transform .2s, background .2s;
}
.q-btn:hover { transform: translateY(-2px); background: var(--accent); color: #fff; }
.q-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.q-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.q-zalo { background: #0068ff; color: #fff; }
.q-whatsapp { background: #1f8a4c; color: #fff; }
.direct-list { display: grid; gap: 6px; }
.about-studio { margin-top: 14px; font-weight: 600; }
.pkg-sub { font-size: 14px; margin-top: 2px; }
.testi-result { margin-top: 14px; color: var(--accent-ink); font-weight: 600; }

/* ============================================================
   TRANG CHI TIẾT DỰ ÁN — 2 cột: hình cuộn dọc | thông tin dính cố định
   ============================================================ */
.case { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(24px, 4vw, 72px); padding-top: 88px; align-items: start; }
.case-media { display: grid; gap: var(--gap); }
.case-media figure { border-radius: var(--radius); overflow: hidden; background: var(--bg-2); box-shadow: 0 30px 60px -36px rgba(40, 25, 10, .5); }
.case-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.case-info { position: sticky; top: 84px; display: grid; gap: 22px; padding-bottom: 24px; }
.case-back { font-size: 15px; }
.case-title { font-size: clamp(44px, 5.4vw, 92px); color: var(--accent); }
.case-idea { font-size: clamp(22px, 2vw, 30px); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; font-variation-settings: "opsz" 48; }
.case-desc { color: var(--ink-soft); }
.case-result { border-left: 3px solid var(--accent); padding-left: 14px; }
.case-result b { display: block; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); }
.facts-table { border-top: 1.5px solid var(--ink); }
.facts-table div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts-table dt { color: var(--ink-soft); }
.facts-table dd { font-weight: 600; overflow-wrap: anywhere; }
.case-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; }
.case-concept { font-size: 14px; color: var(--ink-soft); }
.case-sec h2 { font-size: 14px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; line-height: 1.3; color: var(--accent-ink); margin-bottom: 4px; }
.case-sec p { color: var(--ink-soft); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.metrics dt { font-size: 36px; font-weight: 750; letter-spacing: -0.05em; }
.metrics dd { color: var(--ink-soft); font-size: 14px; }
.case-page .footer { margin-top: var(--space); }

/* ---- Hiện dần khi cuộn: chỉ khi JS chạy và người xem không giảm chuyển động ---- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .status-dot { animation: blink 2.4s infinite; }
  .status.booked .status-dot { animation: none; }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
@media (hover: none) {
  .slide-link:hover img, .pkg:hover { transform: none; }
}

/* ---- Tablet ---- */
@media (min-width: 768px) {
  :root { --pad: 28px; --gap: 20px; }
}
@media (max-width: 1099px) {
  .about { grid-template-columns: 2fr 3fr; }
  .about-img { grid-column: 1; }
  .about-text { grid-column: 2; }
  .track { --slide-w: 72vw; }
  .hint { display: none; }
  .carousel.grid .track { grid-template-columns: repeat(2, 1fr); }
  .packages { grid-template-columns: 1fr; }
  .pkg { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; align-content: start; }
  .pkg > :not(.pkg-inc-label):not(.pkg-inc) { grid-column: 1; }
  .pkg-inc-label { grid-column: 2; grid-row: 2 / span 2; margin-top: 0; }
  .pkg-inc { grid-column: 2; grid-row: 3 / span 4; }
  .pkg .btn { grid-column: 1 / -1; margin-top: 20px; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 36px; }
  .contact-grid { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr 1fr; }
}

/* ---- Điện thoại ---- */
@media (max-width: 767px) {
  body { font-size: 16px; }
  .nav { height: 54px; }
  .menu { top: 54px; }
  .nav-right { gap: 18px; }
  .hero-actions .btn { flex: 1 1 auto; min-height: 52px; padding: 0 20px; }
  .about { grid-template-columns: 1fr; }
  .about-img, .about-text { grid-column: 1; }
  .about-img { max-width: 440px; }
  /* Dự án: cuộn ngang có snap */
  .carousel.flat:not(.grid) .track {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--pad) 8px;
    scrollbar-width: none;
  }
  .carousel.flat:not(.grid) .track::-webkit-scrollbar { display: none; }
  .carousel.flat:not(.grid) .slide { flex: 0 0 84%; scroll-snap-align: center; }
  .carousel.grid .track { grid-template-columns: 1fr; }
  .carousel-foot { display: none; }
  .pkg { display: flex; }
  .filters { gap: 6px; }
  .filters button, .view-toggle { padding: 7px 12px; font-size: 14px; }
  .steps { grid-template-columns: 1fr; row-gap: 28px; }
  .row2 { grid-template-columns: 1fr; }
  .form-foot .btn { width: 100%; }
  .case { grid-template-columns: 1fr; padding-top: 76px; }
  .case-info { position: static; order: -1; }
  .facts-table div { grid-template-columns: 8em 1fr; }
  /* Liên hệ nhanh: thanh cố định cạnh dưới */
  .quick { left: 0; right: 0; bottom: 0; flex-direction: row; gap: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(29, 25, 21, .97); }
  .q-btn { flex: 1; width: auto; height: 48px; border-radius: 10px; margin: 0 4px; box-shadow: none; gap: 8px; display: flex; justify-content: center; align-items: center; font-weight: 650; font-size: 15px; }
  .q-btn span { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
  .q-btn:not(.q-zalo):not(.q-whatsapp) { background: var(--dark-ink); color: var(--dark); }
  body.has-quick { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
#caseRoot:empty { min-height: 100vh; } /* giữ chỗ trước khi JS dựng nội dung, tránh nhảy bố cục */

/* ---- Thiết bị cảm ứng (điện thoại, máy tính bảng): dải dự án cuộn ngang tự nhiên, có snap ---- */
@media (hover: none), (pointer: coarse), (max-width: 767px) {
  .carousel.flat:not(.grid) .track {
    display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); padding: 0 var(--pad) 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .carousel.flat:not(.grid) .track::-webkit-scrollbar { display: none; }
  .carousel.flat:not(.grid) .slide { flex: 0 0 min(84%, 560px); scroll-snap-align: start; }
  .carousel-foot { display: none; }
  .slide-link:hover img, .pkg:hover { transform: none; }
  .js .reveal { transform: translateY(10px); transition-duration: .5s; }
}

/* ---- Hero dưới 900px: một cột — trạng thái, tiêu đề, scene, mô tả, nút ---- */
@media (max-width: 899px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "status" "title" "scene" "sub" "cta" "commit"; grid-template-rows: none; padding: 22px 18px 26px; border-radius: 18px; }
  .hero-wrap { padding-inline: 10px; padding-top: 66px; }
  .hero-scene { aspect-ratio: 340 / 420; min-height: 0; max-height: 62vh; margin-top: 20px; justify-self: center; }
  .hero h1 { margin-top: 16px; }
  .tech-show { margin-left: 0; }
}
@media (max-width: 360px) {
  .hero h1 { font-size: 36px; }
  .logo { font-size: 18px; }
  .nav-right { gap: 12px; }
}

/* ---- Vùng bấm tối thiểu 44×44px ---- */
.logo { display: inline-flex; align-items: center; min-height: 44px; }
.lang button { min-width: 36px; min-height: 44px; }
.menu-btn { min-height: 44px; padding: 0 4px; }
.filters button, .view-toggle { min-height: 44px; }
.menu a { min-height: 44px; display: flex; align-items: center; }
.footer .link { display: inline-flex; align-items: center; min-height: 44px; }
.direct a, .faq-more a, .pkg-other a, .case-back a { display: inline-block; padding: 10px 0; }
@media (max-width: 899px) {
  .hero-scene { width: min(100%, calc(62vh * 340 / 420)); }
}
