/* ===== Motion system — smooth, jitter-free, GPU-friendly ===== */

/* ---------- Keyframes ---------- */
@keyframes pulseGold    { 0%, 100% { box-shadow: 0 0 0 0 rgba(251, 146, 60, .50); } 50% { box-shadow: 0 0 0 14px rgba(251, 146, 60, 0); } }
@keyframes scrollLine   { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes kenburns     { 0% { transform: scale(1.05) translate3d(0, 0, 0); } 100% { transform: scale(1.15) translate3d(-1.5%, -1%, 0); } }
@keyframes kenburnsAlt  { 0% { transform: scale(1.08) translate3d(0, 0, 0); } 100% { transform: scale(1.18) translate3d(1%, -1%, 0); } }
@keyframes marquee      { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@keyframes shimmer      { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float        { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -6px, 0); } }
@keyframes gradientShift{ 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ---------- Reveal — opacity + translate only (no clip-path → no jitter) ---------- */
.reveal,
.mask-reveal,
.mask-up,
.mask-down,
.frame-in {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
}
.reveal.in-view,
.mask-reveal.in-view,
.mask-up.in-view,
.mask-down.in-view,
.frame-in.in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Slight side reveal for variety */
.mask-reveal { transform: translate3d(-14px, 0, 0); }
.mask-reveal.in-view { transform: translate3d(0, 0, 0); }

/* Stagger delays */
.reveal[data-delay="100"].in-view,
.mask-up[data-delay="100"].in-view,
.mask-reveal[data-delay="100"].in-view { transition-delay: .05s; }
.reveal[data-delay="200"].in-view,
.mask-up[data-delay="200"].in-view,
.mask-reveal[data-delay="200"].in-view { transition-delay: .10s; }
.reveal[data-delay="300"].in-view,
.mask-up[data-delay="300"].in-view,
.mask-reveal[data-delay="300"].in-view { transition-delay: .15s; }
.reveal[data-delay="400"].in-view,
.mask-up[data-delay="400"].in-view,
.mask-reveal[data-delay="400"].in-view { transition-delay: .20s; }
.reveal[data-delay="500"].in-view,
.mask-up[data-delay="500"].in-view,
.mask-reveal[data-delay="500"].in-view { transition-delay: .25s; }
.reveal[data-delay="600"].in-view { transition-delay: .30s; }

/* ---------- Image presentation ---------- */
.kenburns img,
.kenburns > img {
  animation: kenburns 18s ease-in-out infinite alternate;
  will-change: transform;
}
.kenburns-alt img,
.kenburns-alt > img {
  animation: kenburnsAlt 22s ease-in-out infinite alternate;
}

/* ---------- Lift card — hover effect with image zoom + caption slide ---------- */
/* transform-only transition + SMOOTH shadow via pseudo opacity (no per-frame box-shadow repaint) */
.lift {
  position: relative;
  transition: transform .45s var(--ease-out), opacity .5s var(--ease-out), border-color .35s var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.lift::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .45s var(--ease-out);
  pointer-events: none;
}
.lift:hover { transform: translate3d(0, -8px, 0); }
.lift:hover::after { opacity: 1; }
/* Note: .lift cards with bg images often have inline crop transforms; avoid overriding them on hover. Lift translate alone is the hover signal. */

/* ---------- Tile (gallery) — hover lift + caption slide + overlay ---------- */
.tile {
  cursor: pointer;
  transition: transform .5s var(--ease-out), opacity .5s var(--ease-out);
}
.tile:hover {
  transform: translate3d(0, -4px, 0);
  z-index: 2;
}
.tile::after {
  /* gradient overlay — gets darker on hover, base style already defined in base.css */
  transition: opacity .5s var(--ease-out);
}
.tile:hover::after { opacity: .7; }
.tile .cap {
  transform: translate3d(0, 14px, 0);
  opacity: .82;
  transition: transform .55s var(--ease-out), opacity .45s var(--ease-out);
}
.tile:hover .cap {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}
/* Gold underline accent on tile hover */
.tile::before {
  content: "";
  position: absolute;
  left: 16px; bottom: 8px;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width .55s var(--ease-out);
  z-index: 2;
  pointer-events: none;
}
.tile:hover::before { width: 40px; }

/* ---------- Image wrap — single transform transition (promoted layer); no animated shadow ---------- */
.img-wrap { position: relative; overflow: hidden; }
.img-wrap img { transition: transform .7s var(--ease-out), filter .6s var(--ease-out); }

/* ---------- Buttons — magnetic feel ---------- */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform .3s var(--ease-out), background .3s var(--ease-out), color .3s var(--ease-out);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .7s var(--ease-out);
  pointer-events: none;
}
.btn:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 18px 32px -14px rgba(16, 33, 60, .30);
}
.btn:hover::before { transform: translateX(100%); }
.btn:active { transform: translate3d(0, 0, 0); transition-duration: .1s; }
.btn .arrow { transition: transform .35s var(--ease-out); }
.btn:hover .arrow { transform: translateX(6px); }

/* ---------- Underline link grow ---------- */
.link-u {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 0;
  transition: color .3s var(--ease-out);
}
.link-u::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.link-u:hover::after { transform: scaleX(0.7); transform-origin: right; }

.link-arrow { display: inline-flex; align-items: center; gap: 10px; transition: gap .4s var(--ease-out); }
.link-arrow .arrow,
.link-arrow > span:last-child { transition: transform .45s var(--ease-out); }
.link-arrow:hover .arrow,
.link-arrow:hover > span:last-child { transform: translateX(6px); }

/* ---------- Tabs underline ---------- */
.tab-trigger { position: relative; padding: 14px 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-secondary); transition: color .35s; }
.tab-trigger::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-emph); }
.tab-trigger[aria-selected="true"] { color: var(--text-primary); }
.tab-trigger[aria-selected="true"]::after { transform: scaleX(1); }
.tab-trigger:hover { color: var(--text-primary); }

/* ---------- Stat cell hover ---------- */
.stat-cell { transition: border-color .4s; }
.stat-cell .num { transition: color .35s var(--ease-out), transform .35s var(--ease-out); }
.stat-cell:hover { border-top-color: var(--gold); }
.stat-cell:hover .num { color: var(--gold); transform: translate3d(0, -2px, 0); }

/* ---------- Floating / drifting micro-motion ---------- */
.float-slow  { animation: float 6s var(--ease-out) infinite; }
.pulse-gold  { animation: pulseGold 2.4s var(--ease-out) infinite; }

/* ---------- Timeline ---------- */
.tl-wrap { padding-top: 4px; }

/* Connector drawn per-node so it always aligns dot-to-dot (single-row lg layout only).
   width = node column width (100%) + grid gap (gap-6 = 1.5rem) → reaches the next dot's centre. */
.tl-node::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 6px;
  width: calc(100% + 1.5rem);
  height: 2px;
  background: var(--border-strong);
  display: none;
  z-index: 0;
}
@media (min-width: 1024px) {
  .tl-node::before { display: block; }
  .tl-node:last-child::before { display: none; }
}
/* completed segments (start → into MỞ BÁN) in teal, grow-in on reveal */
.tl-node.tl-done::before {
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease-emph);
}
.reveal.in-view .tl-node.tl-done::before { transform: scaleX(1); }

/* Node container */
.tl-node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  cursor: pointer;
  padding-top: 2px;
}

/* Dot — default empty ring */
.tl-node .t-dot {
  width: 12px; height: 12px;
  border-radius: 999px;
  border: 1.5px solid var(--divider);
  background: var(--bg-primary);
  position: relative;
  transition: transform .5s var(--ease-out), background .35s var(--ease-out), border-color .35s var(--ease-out), box-shadow .45s var(--ease-out);
  z-index: 2;
}
.tl-node:hover .t-dot {
  transform: scale(1.55);
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 0 6px rgba(251, 146, 60, .18);
}
/* Inner shine on hover */
.tl-node .t-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background .4s var(--ease-out);
}
.tl-node:hover .t-dot::after { background: var(--emerald-deep); }

/* Date — mono uppercase, animates color + letter-spacing on hover */
.tl-node .t-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: color .35s var(--ease-out), transform .45s var(--ease-out);
}
.tl-node:hover .t-date {
  color: var(--gold);
  transform: translate3d(0, -1px, 0);
}

/* Label */
.tl-node .t-label {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-primary);
  font-weight: 500;
  transition: color .35s var(--ease-out), transform .45s var(--ease-out);
  position: relative;
}
.tl-node:hover .t-label {
  color: var(--emerald-deep);
  transform: translate3d(0, -2px, 0);
}
/* Gold underline grows in from left on hover */
.tl-node .t-label::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  height: 1px;
  width: 0;
  background: var(--gold);
  transition: width .55s var(--ease-out);
}
.tl-node:hover .t-label::after { width: 28px; }

/* Active node — 09/2026 MỞ BÁN — gold + pulse */
.tl-active .t-dot {
  background: var(--gold);
  border-color: var(--gold);
  animation: pulseGold 2.4s var(--ease-out) infinite;
}
.tl-active .t-date { color: var(--gold); font-weight: 700; }
.tl-active .t-label { color: var(--text-primary); font-weight: 700; }
.tl-active:hover .t-dot { transform: scale(1.45); }

/* Final node — 08/2028 BÀN GIAO — emerald solid */
.tl-final .t-dot {
  background: var(--emerald);
  border-color: var(--emerald);
}
.tl-final .t-date { color: var(--emerald); font-weight: 700; }
.tl-final .t-label { color: var(--emerald); font-weight: 700; }
.tl-final:hover .t-dot {
  background: var(--gold);
  border-color: var(--gold);
}
.tl-final:hover .t-date,
.tl-final:hover .t-label { color: var(--gold); }

/* ---------- Marquee ticker ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  --speed: 38s;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 56px;
  animation: marquee var(--speed) linear infinite;
  will-change: transform;
}
.marquee--reverse .marquee__track { animation-direction: reverse; }
.marquee__item { display: inline-flex; align-items: center; gap: 14px; }
.marquee__sep  { width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: .55; flex: none; }

/* ---------- Gradient + shimmer accents ---------- */
.gold-shimmer {
  background: linear-gradient(110deg, var(--teal) 0%, var(--teal-bright) 40%, var(--teal) 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
.on-dark .gold-shimmer, section.dark .gold-shimmer {
  background: linear-gradient(110deg, var(--mint-accent) 0%, #FFE0C2 45%, var(--mint-accent) 85%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.gradient-band {
  background: linear-gradient(120deg, rgba(16, 39, 68, .94) 0%, rgba(22, 58, 102, .86) 50%, rgba(16, 39, 68, .94) 100%);
  background-size: 200% 200%;
  animation: gradientShift 14s ease-in-out infinite;
}

/* ---------- Hero parallax wrapper ---------- */
.parallax-wrap { overflow: hidden; will-change: transform; }
.parallax-wrap > img { transform: translate3d(0, var(--py, 0px), 0) scale(1.10); transition: transform 0s linear; }

/* Soft scroll indicator */
.scroll-indicator { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.scroll-indicator .line { width: 1px; height: 40px; background: var(--gold); transform-origin: top; animation: scrollLine 2.2s var(--ease-out) infinite; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%); background: var(--emerald-deep); color: var(--text-on-dark); padding: 16px 24px; border-left: 3px solid var(--gold); font-size: 14px; font-weight: 500; box-shadow: 0 24px 48px -16px rgba(0,0,0,.4); opacity: 0; transition: all .6s var(--ease-out); z-index: 100; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Photo treatment (light theme — gentle) ---------- */
.photo-bright        { filter: brightness(1.06) saturate(1.08) contrast(1.02); }
.photo-bright-soft   { filter: brightness(1.03) saturate(1.04); }
.photo-bright-strong { filter: brightness(1.10) saturate(1.12) contrast(1.03); }

/* ---------- Hero scroll progress bar ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; }
.scroll-progress::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); background: linear-gradient(90deg, transparent 0%, var(--gold) 40%, var(--gold-soft) 100%); transition: width .12s linear; }

/* ---------- Vertical label ---------- */
.label-v {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.label-v.on-dark { color: var(--text-on-dark-muted); }

/* ---------- Accessibility ---------- */
/* Respect reduced-motion by removing only LARGE / looping / auto motion.
   Short, user-initiated hover & collapse transitions are kept (they're not
   vestibular triggers) so the UI still feels responsive, not dead. */
@media (prefers-reduced-motion: reduce) {
  /* Only stop continuous / looping / auto-playing motion.
     Hover, collapse and scroll-reveal transitions are kept intact. */
  .marquee__track,
  .kenburns img, .kenburns > img,
  .kenburns-alt img, .kenburns-alt > img,
  .gold-shimmer, .pulse-gold, .float-slow,
  .gradient-band, .scroll-indicator .line,
  .tl-active .t-dot { animation: none !important; }
  html { scroll-behavior: auto; }
}
