/* ==========================================================================
   Ngô Đức Tính · Căn hộ Đà Nẵng
   Token: hoàng hôn Đà Nẵng — xanh biển đêm, nắng chiều hổ phách, sông Hàn ngọc.
   ========================================================================== */

:root {
  --bg: #0A1220;          /* biển đêm */
  --bg-2: #111B2D;
  --text: #F3F1EC;        /* 16.6:1 trên --bg */
  --text-2: #AEB8C8;      /* 9.4:1 trên --bg */
  --accent: #F2B46B;      /* nắng chiều, chỉ dành cho nút chính */
  --on-accent: #1E1405;   /* 10.0:1 trên --accent */
  --accent-ink: #F2B46B;  /* chữ nhấn trên nền tối, 10.3:1 */
  --signal: #6FD6CA;      /* sông Hàn: nhãn "có sa bàn 3D" */
  --on-signal: #062421;
  --line: rgba(255, 255, 255, .12);
  --shadow: 0 24px 60px rgba(2, 6, 14, .45);

  --glass-tint: rgba(16, 26, 44, .16);
  --glass-tint-strong: rgba(16, 26, 44, .3);
  --glass-rim-hi: rgba(255, 255, 255, .7);
  --glass-border: rgba(255, 255, 255, .26);
  --glass-frost: 10px;

  --r-lg: 30px;
  --r-md: 22px;
  --r-sm: 14px;

  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Nền trang: quầng nắng chiều + sông Hàn, phủ dưới bản vẽ công trình (xem .bp). Dùng chung cho kính khúc xạ. */
  --glow-a: rgba(242, 160, 90, .22);
  --glow-b: rgba(80, 190, 200, .16);
  --scene-bg:
    radial-gradient(46% 38% at 12% 18%, var(--glow-a), transparent 62%),
    radial-gradient(42% 40% at 88% 72%, var(--glow-b), transparent 64%),
    linear-gradient(170deg, #0A1220, #0D1628 50%, #0A1220);

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #EEF1F5;
    --bg-2: #FFFFFF;
    --text: #0E1726;      /* 15.9:1 trên --bg */
    --text-2: #46526A;    /* 6.9:1 trên --bg */
    --accent: #EFA95C;
    --on-accent: #1E1405; /* 9.1:1 */
    --accent-ink: #94500F;/* 5.4:1 trên --bg */
    --signal: #0F7A70;
    --on-signal: #FFFFFF;
    --line: rgba(14, 23, 38, .12);
    --shadow: 0 24px 60px rgba(30, 40, 60, .18);
    --glass-tint: rgba(255, 255, 255, .26);
    --glass-tint-strong: rgba(255, 255, 255, .42);
    --glass-rim-hi: rgba(255, 255, 255, .9);
    --glass-border: rgba(255, 255, 255, .6);
    --glow-a: rgba(239, 169, 92, .28);
    --glow-b: rgba(15, 122, 112, .14);
    --scene-bg:
      radial-gradient(46% 38% at 12% 18%, var(--glow-a), transparent 62%),
      radial-gradient(42% 40% at 88% 72%, var(--glow-b), transparent 64%),
      linear-gradient(170deg, #F3F5F8, #E9EDF3 50%, #F1F3F7);
    color-scheme: light;
  }
}

/* ---------- Nền bản vẽ công trình (vector) ---------- */
body, .glass--page .glass__bg > i {
  background-image: url("../img/blueprint-dark.svg"), var(--scene-bg);
  background-size: 1440px auto, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-attachment: fixed;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body,
  :root:not([data-theme="dark"]) .glass--page .glass__bg > i { background-image: url("../img/blueprint-light.svg"), var(--scene-bg); }
}
@media (max-width: 760px) {
  body, .glass--page .glass__bg > i { background-size: 1000px auto, 100% 100%, 100% 100%, 100% 100%; }
}

/* ---------- Nền tảng ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
svg { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

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

.skip {
  position: fixed; left: 16px; top: -100px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 12px; font-weight: 600;
}
.skip:focus { top: 16px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

.eyebrow {
  font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 14px;
}
.lede { font-size: clamp(1.0625rem, 1.3vw, 1.25rem); color: var(--text-2); max-width: 46ch; }
.lede--narrow { max-width: 52ch; }
.note { font-size: .9375rem; color: var(--text-2); }

/* ---------- Kính lỏng ---------- */
.glass { position: relative; isolation: isolate; border-radius: var(--r, var(--r-lg)); }
.glass > .glass__bg,
.glass > .glass__tint,
.glass > .glass__specular,
.glass > .glass__rim { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.glass__bg { overflow: hidden; z-index: -4; }
.glass__bg > i { position: absolute; display: block; filter: url(#liquidWarp); }
.glass__tint {
  z-index: -3;
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(var(--glass-frost)) saturate(170%);
  backdrop-filter: blur(var(--glass-frost)) saturate(170%);
}
.glass__specular {
  z-index: -2;
  background: radial-gradient(260px 200px at var(--mx, 24%) var(--my, 0%), rgba(255, 255, 255, .26), transparent 64%);
  mix-blend-mode: screen; opacity: .9;
}
.glass__rim {
  z-index: -1;
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-rim-hi),
    inset 0 -1px 0 rgba(0, 0, 0, .16),
    inset 0 22px 34px -26px rgba(255, 255, 255, .5),
    inset 0 -18px 30px -24px rgba(255, 255, 255, .18),
    var(--shadow);
}
.glass--strong > .glass__tint { background: var(--glass-tint-strong); }
.glass--strong .glass__bg > i { filter: url(#liquidWarpStrong); }

/* Kính đặt trên nền trang: bản sao nền cố định khớp pixel rồi bẻ cong */
.glass--page .glass__bg > i {
  inset: -30%;
  background-color: var(--bg);
}
.glass--page > .glass__tint { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* iOS Safari không hỗ trợ background-attachment: fixed → bỏ lớp khúc xạ nền trang, giữ kính mờ */
@supports (-webkit-touch-callout: none) {
  .glass--page .glass__bg { display: none; }
  .glass--page > .glass__tint { -webkit-backdrop-filter: blur(var(--glass-frost)) saturate(170%); }
}

/* ---------- Nút ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 24px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .2s, box-shadow .25s;
}
.btn:active { transform: scale(.97); }
.btn--sm { --h: 44px; padding: 0 18px; font-size: .9375rem; }
.btn--lg { --h: 60px; padding: 0 30px; font-size: 1.0625rem; }
.btn--accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px rgba(242, 160, 80, .28), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn--accent:hover { background: #F6C489; }
.btn--glass { color: #F3F1EC; --r: 999px; }
.btn--glass > .glass__tint { background: rgba(255, 255, 255, .12); }
.btn--glass:hover > .glass__tint { background: rgba(255, 255, 255, .2); }
.btn__label { position: relative; }
.btn--ghost { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.btn--ghost:hover { background: rgba(255, 255, 255, .24); }
.btn--light { background: #fff; color: #0E1726; box-shadow: inset 0 0 0 1px rgba(14, 23, 38, .16), 0 8px 24px rgba(14, 23, 38, .12); }
.btn--light:hover { background: #F1F3F7; }

.iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.iconbtn:hover { background: rgba(255, 255, 255, .24); }
.iconbtn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Thanh điều hướng ---------- */
.topbar {
  position: fixed; z-index: 40; top: max(12px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: center; padding-inline: 16px; pointer-events: none;
}
.nav {
  --r: 999px;
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  width: min(1120px, 100%); padding: 8px 8px 8px 10px; color: #F3F1EC;
}
.nav > .glass__tint { background: rgba(10, 18, 32, .2); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; padding-right: 8px; min-height: 44px; }
.brand__mark {
  width: 40px; height: 40px; border-radius: 999px; object-fit: cover; flex: none;
  box-shadow: 0 0 0 2px rgba(242, 180, 107, .85), 0 4px 12px rgba(0, 0, 0, .3);
}
.brand__text { display: grid; line-height: 1.15; }
.brand__text strong { font-size: .975rem; font-weight: 700; }
.brand__text small { font-size: .8125rem; color: rgba(243, 241, 236, .78); }
.nav__links { display: flex; gap: 2px; }
.nav__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  text-decoration: none; font-size: .9375rem; font-weight: 500; color: rgba(243, 241, 236, .9);
  transition: background-color .2s;
  white-space: nowrap;
}
.nav__links a:hover, .nav__links a[aria-current="true"] { background: rgba(255, 255, 255, .14); color: #fff; }
.nav__call { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: max(640px, 100svh); overflow: hidden;
  display: grid; align-content: end; padding: 120px var(--gutter) 88px;
  background: #0A1220; color: #F3F1EC;
}
.hero__stage { position: absolute; inset: 0; }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--ease); }
.hero.is-live .hero__canvas { opacity: 1; }
.hero__fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .8s; }
.hero.is-live .hero__fallback { opacity: 0; }
.hero__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 14, 26, .82) 0%, rgba(8, 14, 26, .5) 38%, rgba(8, 14, 26, 0) 66%),
    linear-gradient(0deg, rgba(8, 14, 26, .9) 0%, rgba(8, 14, 26, 0) 42%);
}
.hero__copy { position: relative; z-index: 3; width: min(var(--wrap), 100%); margin-inline: auto; pointer-events: none; }
.hero__copy > * { pointer-events: auto; }
.hero__copy .eyebrow { color: #F2B46B; }
.hero h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.6rem); font-weight: 700; letter-spacing: -.035em;
  max-width: 13ch; margin-bottom: 22px;
}
.hero .lede { color: rgba(243, 241, 236, .86); max-width: 44ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__hint {
  position: absolute; z-index: 3; right: var(--gutter); bottom: 28px; max-width: 360px;
  font-size: .8125rem; color: rgba(243, 241, 236, .72); text-align: right;
}
.hint-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 99px; background: #F2B46B; box-shadow: 0 0 0 4px rgba(242, 180, 107, .25); vertical-align: 1px; }

/* Ghim dự án trên sa bàn */
.pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pin {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 8px;
  border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  font-size: .8125rem; font-weight: 600; color: #F3F1EC;
  background: rgba(12, 20, 36, .46);
  -webkit-backdrop-filter: blur(10px) saturate(170%); backdrop-filter: blur(10px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 0 0 1px rgba(255, 255, 255, .2), 0 8px 24px rgba(0, 0, 0, .35);
  transform: translate3d(var(--x, -999px), var(--y, -999px), 0) translate(-50%, -100%);
  transition: background-color .2s, opacity .3s;
  opacity: 0;
}
.hero.is-live .pin { opacity: 1; }
.pin::after { /* chân ghim */
  content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 14px;
  background: linear-gradient(rgba(242, 180, 107, .9), rgba(242, 180, 107, 0));
}
.pin__dot { width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; background: rgba(242, 180, 107, .25); }
.pin__dot::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: #F2B46B; }
.pin--3d .pin__dot { background: rgba(111, 214, 202, .25); }
.pin--3d .pin__dot::before { background: #6FD6CA; }
.pin:hover, .pin:focus-visible, .pin.is-hot { background: rgba(12, 20, 36, .72); z-index: 2; }
.pin.is-behind { opacity: 0 !important; pointer-events: none; }

.pin-card {
  --x: -999px; --y: -999px;
  position: absolute; z-index: 4; left: 0; top: 0; width: 260px; pointer-events: none;
  border-radius: 20px; overflow: hidden; color: #F3F1EC;
  background: rgba(12, 20, 36, .6);
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 0 0 1px rgba(255, 255, 255, .2), 0 20px 50px rgba(0, 0, 0, .45);
  transform: translate3d(var(--x), var(--y), 0) translate(-50%, calc(-100% - 52px)) scale(.96);
  opacity: 0; transition: opacity .2s, transform .25s var(--ease);
}
.pin-card.is-on { opacity: 1; transform: translate3d(var(--x), var(--y), 0) translate(-50%, calc(-100% - 52px)); }
.pin-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pin-card div { padding: 12px 14px 14px; }
.pin-card strong { display: block; font-size: .975rem; }
.pin-card span { font-size: .8125rem; color: rgba(243, 241, 236, .78); }

/* ---------- Section ---------- */
.section { padding: clamp(80px, 11vw, 140px) 0 0; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.section__head--stack { display: block; }
.section__head--stack h2 { margin-bottom: 16px; }
h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 700; max-width: 20ch; }

/* Segmented control lọc dự án */
.seg { --r: 999px; display: inline-flex; padding: 5px; gap: 4px; }
.seg__btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-size: .9375rem; font-weight: 600; color: var(--text-2);
  transition: background-color .25s, color .25s;
}
.seg__btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg__count { font-size: .8125rem; font-weight: 600; opacity: .72; }

/* Lưới dự án */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; overflow: hidden; border-radius: var(--r-lg); min-height: 480px;
  background: var(--bg-2); box-shadow: var(--shadow);
  display: flex; align-items: flex-end; padding: 12px;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.card--wide { grid-column: span 2; }
.card__img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transition: transform 1.2s var(--ease); }
.card:hover .card__img { transform: scale(1.035); }
.card[hidden] { display: none; }
.card.is-flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 4px var(--accent), var(--shadow); } }

.card__glass { --r: var(--r-md); z-index: 2; width: 100%; color: #F3F1EC; }
.card__glass > .glass__tint { background: rgba(10, 18, 32, .14); -webkit-backdrop-filter: blur(1.5px) saturate(150%); backdrop-filter: blur(1.5px) saturate(150%); }
/* lớp tối nhẹ trên ảnh (nằm dưới kính) giữ chữ đọc được dù kính gần như trong suốt */
.card::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(5, 10, 20, .62), rgba(5, 10, 20, .18) 45%, rgba(5, 10, 20, 0) 65%); }
.card__glass .glass__bg > i { background-size: cover; background-repeat: no-repeat; }
.card__body { position: relative; padding: 18px 20px 20px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 18px rgba(0, 0, 0, .3); }
.card__body .btn, .card__body .tag { text-shadow: none; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; background: rgba(255, 255, 255, .16); color: #F3F1EC;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.tag--signal { background: #6FD6CA; color: #062421; box-shadow: none; }
.card h3 { font-size: clamp(1.375rem, 2vw, 1.75rem); font-weight: 700; margin-bottom: 6px; }
.card p { font-size: .9375rem; color: rgba(243, 241, 236, .86); max-width: 52ch; }
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- Sa bàn 3D ---------- */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.split__text h2 { margin-bottom: 28px; }
.feature-list { display: grid; gap: 14px; margin-bottom: 24px; }
.feature-list li { position: relative; padding-left: 28px; color: var(--text-2); }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 4px;
  border: 2px solid var(--signal); transform: rotate(45deg) scale(.8);
}
.feature-list strong { color: var(--text); font-weight: 600; }

.viewer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Ô sa bàn là nội dung, không phải lớp điều khiển → bề mặt đặc, không dùng kính (HIG: liquid-glass › Content layer) */
.viewer {
  position: relative; width: 100%; aspect-ratio: 4 / 3.4; padding: 8px; cursor: pointer; text-align: left;
  display: grid; grid-template-rows: 1fr auto; gap: 10px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-2); box-shadow: var(--shadow);
  transition: transform .35s var(--ease);
}
.viewer:hover { transform: translateY(-4px); }
.viewer img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 16px; min-height: 0; }
.viewer__label { position: relative; display: grid; padding: 0 8px 6px; line-height: 1.3; }
.viewer__label strong { font-size: 1rem; }
.viewer__label small { font-size: .8125rem; color: var(--text-2); }
.viewer__go {
  position: absolute; right: 14px; bottom: 14px; width: 36px; height: 36px; border-radius: 99px;
  display: grid; place-items: center; background: var(--text); color: var(--bg);
}
.viewer__go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Căn hộ mẫu 360 ---------- */
.tours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tour {
  position: relative; overflow: hidden; border-radius: var(--r-lg); box-shadow: var(--shadow);
  aspect-ratio: 4 / 5; display: flex; align-items: flex-end; padding: 12px; background: var(--bg-2);
}
.tour__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tour:hover .tour__poster { transform: scale(1.04); }
.tour::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(5, 10, 20, .55), rgba(5, 10, 20, 0) 50%); }
.tour__cta { --r: var(--r-md); z-index: 2; width: 100%; color: #F3F1EC; }
.tour__cta > .glass__tint { background: rgba(10, 18, 32, .14); -webkit-backdrop-filter: blur(1.5px) saturate(150%); backdrop-filter: blur(1.5px) saturate(150%); }
.tour__cta .glass__bg > i { background-size: cover; background-repeat: no-repeat; }
.tour__cta-body { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 16px rgba(0, 0, 0, .3); }
.tour__cta-body > div { flex: 1; min-width: 0; }
.tour__cta-body .btn { text-shadow: none; }
.tour__cta-body .btn svg { width: 16px; height: 16px; }
.tour__title { font-weight: 700; font-size: 1.125rem; line-height: 1.3; }
.tour__meta { font-size: .8125rem; color: rgba(243, 241, 236, .86); }

/* ---------- Về tôi ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
/* ảnh đại diện tròn, viền vòng nắng chiều → sông Hàn */
.about__photo { position: relative; margin: 0; width: min(420px, 100%); aspect-ratio: 1; justify-self: center; display: grid; place-items: center; }
.about__ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 210deg, #F2B46B, #6FD6CA, #2B4C7E, #F2B46B);
  -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));
}
.about__photo img { width: calc(100% - 20px); height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.about__tag { --r: 999px; position: absolute; left: 50%; bottom: 4%; translate: -50% 0; white-space: nowrap; color: #F3F1EC; text-align: center; }
.about__tag > .glass__tint { background: rgba(10, 18, 32, .22); }
.about__tag-body { position: relative; display: grid; padding: 10px 20px; line-height: 1.25; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.about__tag-body strong { font-size: .975rem; }
.about__tag-body small { font-size: .8125rem; opacity: .9; }
.about__text h2 { margin-bottom: 18px; }
.about__text .lede { max-width: 58ch; }
.promise { margin-top: 32px; border-top: 1px solid var(--line); }
.promise li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.promise__k { font-weight: 600; }
.promise__v { color: var(--text-2); font-size: .975rem; }

/* ---------- Liên hệ + yêu cầu tư vấn ---------- */
.section--contact { padding-bottom: clamp(80px, 10vw, 120px); }
.contact { --r: 36px; overflow: hidden; }
.contact__body { position: relative; padding: clamp(24px, 5vw, 64px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.contact h2 { margin-bottom: 14px; max-width: 16ch; }
.contact #ask-line { margin-top: 8px; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.contact__actions svg { width: 22px; height: 22px; }

.lead {
  display: grid; gap: 18px; padding: clamp(20px, 3vw, 32px); border-radius: 26px;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line);
}
.lead h3 { font-size: 1.375rem; font-weight: 700; }
.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-size: .9375rem; font-weight: 600; padding: 0; }
.field legend { margin-bottom: 8px; }
.field legend small { font-weight: 400; color: var(--text-2); }
.field input[type="text"], .field input[type="tel"] {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); color: var(--text); font: inherit; font-size: 1.0625rem;
  transition: border-color .2s, background-color .2s;
}
.field input::placeholder { color: var(--text-2); opacity: .75; }
.field input:focus { outline: none; border-color: var(--accent); background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 3px rgba(242, 180, 107, .25); }
.field input[aria-invalid="true"] { border-color: #FF8A7A; }
.field__error { font-size: .875rem; color: #FF9C8F; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-size: .9375rem; font-weight: 600; color: var(--text); background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s, color .2s, box-shadow .2s;
}
.chip input:checked + span { background: var(--text); color: var(--bg); box-shadow: none; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.lead__submit { justify-self: start; }
.lead__submit:disabled { opacity: .6; cursor: progress; }
.lead__status { font-size: .9375rem; color: var(--signal); min-height: 1.2em; }
.lead__status:empty { display: none; }

.footer { border-top: 1px solid var(--line); padding: 28px 0 32px; font-size: .875rem; color: var(--text-2); }
.footer__row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- Thanh tab điện thoại ---------- */
.tabbar {
  --r: 30px;
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: max(10px, env(safe-area-inset-bottom));
  display: none; justify-content: space-around; padding: 6px; color: #F3F1EC;
}
.tabbar > .glass__tint { background: rgba(10, 18, 32, .3); }
.tab {
  position: relative; flex: 1; display: grid; justify-items: center; gap: 2px; min-height: 52px; padding: 6px 4px;
  text-decoration: none; font-size: .75rem; font-weight: 600; border-radius: 22px; color: rgba(243, 241, 236, .82);
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="true"] { background: rgba(255, 255, 255, .16); color: #F2B46B; }

/* ---------- Khung xem sa bàn / 360 ---------- */
.viewer-dialog {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #05090F; color: #F3F1EC;
}
.viewer-dialog::backdrop { background: rgba(5, 9, 15, .7); }
.viewer-dialog[open] { display: block; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.viewer-dialog__bar {
  --r: 999px;
  position: absolute; z-index: 2; top: max(12px, env(safe-area-inset-top)); left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 20px; width: max-content; max-width: calc(100% - 24px);
}
.viewer-dialog__bar > .glass__tint { background: rgba(10, 18, 32, .55); }
.viewer-dialog__title { position: relative; font-weight: 700; font-size: .975rem; margin-right: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-dialog__bar .btn, .viewer-dialog__bar .iconbtn { position: relative; }
.viewer-dialog__frame { position: absolute; inset: 0; }
.viewer-dialog iframe { width: 100%; height: 100%; border: 0; display: block; background: #05090F; }
.viewer-dialog__loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: rgba(243, 241, 236, .8); font-size: .9375rem; }
.viewer-dialog__loading[hidden] { display: none; }
.viewer-dialog [hidden] { display: none !important; }
.pano { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
.pano:active { cursor: grabbing; }
.rooms {
  --r: 999px;
  position: absolute; z-index: 2; left: 50%; translate: -50% 0; bottom: max(16px, env(safe-area-inset-bottom));
  max-width: calc(100% - 24px); padding: 6px;
}
.rooms > .glass__tint { background: rgba(10, 18, 32, .32); }
.rooms__scroll { position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.rooms__scroll::-webkit-scrollbar { display: none; }
.room {
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer; scroll-snap-align: center;
  background: transparent; color: rgba(243, 241, 236, .86); font-size: .9375rem; font-weight: 600; white-space: nowrap;
}
.room:hover { background: rgba(255, 255, 255, .12); }
.room[aria-pressed="true"] { background: #F3F1EC; color: #0E1726; }
.spinner { width: 34px; height: 34px; border-radius: 99px; border: 3px solid rgba(255, 255, 255, .18); border-top-color: #F2B46B; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Xuất hiện khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Đáp ứng ---------- */
@media (max-width: 1000px) {
  .projects { grid-template-columns: repeat(2, 1fr); }
  .split, .about, .contact__body { grid-template-columns: 1fr; }
  .tours { grid-template-columns: repeat(3, minmax(260px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
  .tours::-webkit-scrollbar { display: none; }
  .tour { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .nav__links, .nav__cta { display: none; }
  .nav__call { display: inline-grid; }
  .tabbar { display: flex; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .hero { padding-bottom: calc(150px + env(safe-area-inset-bottom)); align-content: end; }
  .hero__shade {
    background:
      linear-gradient(0deg, rgba(8, 14, 26, .96) 0%, rgba(8, 14, 26, .86) 48%, rgba(8, 14, 26, 0) 74%),
      linear-gradient(180deg, rgba(8, 14, 26, .55) 0%, rgba(8, 14, 26, 0) 22%);
  }
  .hero__hint { left: var(--gutter); right: auto; bottom: calc(104px + env(safe-area-inset-bottom)); text-align: left; max-width: none; }
  .hint-fine { display: none; }
  .pin { min-height: 30px; padding: 0 10px 0 6px; font-size: .75rem; }
  .pin__dot { width: 16px; height: 16px; }
  .pin-card { display: none; }
  .projects { grid-template-columns: 1fr; gap: 16px; }
  .card--wide { grid-column: auto; }
  .card { min-height: 440px; }
  .viewer-grid { gap: 12px; }
  .promise li { grid-template-columns: 1fr; gap: 4px; }
  .tours { grid-template-columns: repeat(3, 78%); gap: 12px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .tour { aspect-ratio: 4 / 5.2; }
  .viewer-dialog__bar .btn { display: none; }
  .about__photo { width: min(320px, 82%); }
  .tour__cta-body { flex-wrap: wrap; padding: 14px; }
  .tour__cta-body .btn { width: 100%; }
  .contact { --r: 28px; }
  .lead { padding: 18px; }
  .lead__submit { justify-self: stretch; }
  .contact__actions .btn { flex: 1 1 100%; }
  /* điện thoại: kính nhẹ hơn để cuộn mượt */
  .glass__tint { -webkit-backdrop-filter: blur(8px) saturate(150%); backdrop-filter: blur(8px) saturate(150%); }
}
@media (max-width: 420px) {
  .brand__text small { display: none; }
  .hero h1 { font-size: 2.35rem; }
  .card__actions .btn { flex: 1; }
}
@media (min-width: 761px) {
  .projects.is-3d #p-sun-solar-residence { grid-column: span 2; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  #p-newtown-diamond { grid-column: span 2; }
  .projects.is-3d #p-newtown-diamond { grid-column: auto; }
}

/* Giao diện sáng: thanh điều hướng chuyển sang kính trắng khi đã qua hero */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .topbar.is-past .nav { color: var(--text); }
  :root:not([data-theme="dark"]) .topbar.is-past .nav > .glass__tint { background: rgba(255, 255, 255, .4); }
  :root:not([data-theme="dark"]) .topbar.is-past .brand__text small { color: var(--text-2); }
  :root:not([data-theme="dark"]) .topbar.is-past .nav__links a { color: var(--text); }
  :root:not([data-theme="dark"]) .topbar.is-past .nav__links a:hover,
  :root:not([data-theme="dark"]) .topbar.is-past .nav__links a[aria-current="true"] { background: rgba(14, 23, 38, .08); }
  :root:not([data-theme="dark"]) .topbar.is-past .iconbtn { background: rgba(14, 23, 38, .08); color: var(--text); box-shadow: inset 0 0 0 1px rgba(14, 23, 38, .12); }
  :root:not([data-theme="dark"]) .tabbar.is-past { color: var(--text); }
  :root:not([data-theme="dark"]) .tabbar.is-past > .glass__tint { background: rgba(255, 255, 255, .46); }
  :root:not([data-theme="dark"]) .tabbar.is-past .tab { color: var(--text-2); }
  :root:not([data-theme="dark"]) .tabbar.is-past .tab[aria-current="true"] { background: rgba(14, 23, 38, .07); color: var(--accent-ink); }
  :root:not([data-theme="dark"]) .lead { background: rgba(255, 255, 255, .45); }
  :root:not([data-theme="dark"]) .field input[type="text"],
  :root:not([data-theme="dark"]) .field input[type="tel"],
  :root:not([data-theme="dark"]) .chip span { background: rgba(255, 255, 255, .7); }
  :root:not([data-theme="dark"]) .chip input:checked + span { background: var(--text); color: var(--bg); }
  :root:not([data-theme="dark"]) .field__error { color: #B3261E; }
  :root:not([data-theme="dark"]) .lead__status { color: var(--signal); }
  :root:not([data-theme="dark"]) .about__tag { color: #F3F1EC; }
  :root:not([data-theme="dark"]) .viewer-dialog__bar,
  :root:not([data-theme="dark"]) .card__glass,
  :root:not([data-theme="dark"]) .tour__cta { color: #F3F1EC; }
}

/* ---------- Trợ năng ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass__bg { display: none; }
  .glass__tint, .pin, .pin-card { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .glass > .glass__tint, .nav > .glass__tint, .tabbar > .glass__tint, .card__glass > .glass__tint, .tour__cta > .glass__tint, .rooms > .glass__tint, .about__tag > .glass__tint { background: #101A2C; }
  .pin, .pin-card { background: #101A2C; }
}
@media (prefers-contrast: more) {
  :root { --glass-border: rgba(255, 255, 255, .7); --text-2: var(--text); }
  .glass__bg { display: none; }
  .card__glass > .glass__tint, .tour__cta > .glass__tint { background: rgba(6, 10, 18, .88); }
}

/* Thẻ cảm ơn sau khi gửi form */
.thanks { border: 0; padding: 16px; background: none; max-width: min(440px, 100vw); width: 100%; margin: auto; color: #F3F1EC; overflow: visible; }
.thanks::backdrop { background: rgba(5, 9, 15, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.thanks[open] { animation: rise .35s var(--ease); }
.thanks__card { position: relative; border-radius: 28px; overflow: hidden; }
.thanks__card > .glass__tint { background: rgba(14, 24, 40, .78); }
.thanks__body { position: relative; display: grid; justify-items: center; gap: 12px; padding: 32px 24px 24px; text-align: center; }
.thanks__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(111, 214, 202, .16); box-shadow: inset 0 0 0 1px rgba(111, 214, 202, .5); }
.thanks__icon svg { width: 28px; height: 28px; fill: none; stroke: #6FD6CA; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.thanks h2 { margin: 4px 0 0; font-size: 1.375rem; line-height: 1.25; text-wrap: balance; }
.thanks p { margin: 0; font-size: .9375rem; line-height: 1.5; color: rgba(243, 241, 236, .82); text-wrap: pretty; }
.thanks__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .thanks[open] { animation: none; } }
@media (prefers-reduced-transparency: reduce) { .thanks::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; } }
