/* ==========================================================================
   KTP Solutions — Landing Page Prototype
   Global design tokens + reusable component classes (dark mode signature)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand colors — derived directly from the real KTP logo (see assets/img/ktp-logo.svg) */
  --primary: #4C5FFF;
  --primary-dark: #00084A;      /* exact navy from logo */
  --primary-50: #EEF0FF;
  --primary-100: #DCE0FF;
  --accent: #019770;            /* exact teal from logo */
  --accent-dark: #016B52;
  --signature-red: #AA0124;     /* exact crimson from logo — signature use only, not a UI accent */

  --success: #22C55E;
  --success-bg: #0F2A1C;
  --warning: #F5A524;
  --warning-bg: #2B2210;
  --error: #F04438;
  --error-bg: #2B1414;

  /* Dark-mode surfaces */
  --bg: #0A0D1A;
  --surface: #111528;
  --surface-2: #171B33;
  --surface-3: #1E2340;
  --border: #262B4D;
  --border-light: #333962;

  /* Neutral scale */
  --gray-50: #F5F6FA;
  --gray-100: #E7E9F2;
  --gray-200: #CBCFE0;
  --gray-300: #A7ACC7;
  --gray-400: #7D82A3;
  --gray-500: #5C6180;
  --gray-600: #434765;
  --gray-700: #2D3050;
  --gray-800: #1B1E38;
  --gray-900: #12142A;

  --text-primary: #F5F6FA;
  --text-secondary: #A7ACC7;
  --text-muted: #7D82A3;
  --text-strong: #fff;          /* tiêu đề, mục đang chọn */

  /* Token đổi theo theme (light theme ghi đè ở cuối file) */
  --header-bg: rgba(10, 13, 26, 0.92);
  --hero-scrim: 10,13,26;       /* RGB lớp phủ ảnh hero */

  /* Typography scale */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --h1: 700 clamp(32px, 4vw, 52px)/1.15 var(--font-sans);
  --h2: 700 clamp(26px, 3vw, 36px)/1.2 var(--font-sans);
  --h3: 600 20px/1.35 var(--font-sans);
  --body: 400 15px/1.6 var(--font-sans);
  --body-lg: 400 17px/1.6 var(--font-sans);
  --caption: 500 13px/1.4 var(--font-sans);

  /* Spacing scale (4px grid) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* Radius */
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 24px; --radius-full: 999px;

  /* Elevation (shadow tinted with primary-dark) */
  --shadow-0: none;
  --shadow-1: 0 1px 2px rgba(0,8,74,0.24), 0 1px 3px rgba(0,8,74,0.16);
  --shadow-2: 0 4px 12px rgba(0,8,74,0.32), 0 2px 4px rgba(0,8,74,0.24);
  --shadow-3: 0 16px 40px rgba(0,8,74,0.48), 0 6px 16px rgba(0,8,74,0.32);

  --header-h: 76px;
  --container-w: 1200px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: var(--body);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  tabular-nums: normal;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; color: var(--text-primary); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }

h1, .h1 { font: var(--h1); color: var(--text-strong); letter-spacing: -0.02em; }
h2, .h2 { font: var(--h2); color: var(--text-strong); letter-spacing: -0.01em; }
h3, .h3 { font: var(--h3); }
.body-lg { font: var(--body-lg); color: var(--text-secondary); }
.caption { font: var(--caption); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Browser-chrome theming */
::selection { background: var(--primary-100); color: var(--primary-dark); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gray-700); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 var(--sp-6); }

/* ==========================================================================
   Section rhythm — alternate surfaces so scroll boundaries read clearly
   ========================================================================== */
.section { padding: var(--sp-20) 0; }
.section-bg-base { background: var(--bg); }
.section-bg-surface { background: var(--surface); }
.section-bg-tint { background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.section-bg-solid {
  background:
    radial-gradient(900px 500px at 12% 15%, rgba(76,95,255,0.38), transparent 60%),
    radial-gradient(700px 420px at 88% 85%, rgba(1,151,112,0.32), transparent 55%),
    var(--primary-dark);
  position: relative;
}

/* ==========================================================================
   Final CTA (homepage only) — 40/60 split: support-agent photo left, content right
   ========================================================================== */
.cta-split { display: grid; grid-template-columns: 2fr 3fr; align-items: stretch; min-height: 460px; }
.cta-split__media {
  position: relative;
  background: url('https://images.unsplash.com/photo-1758691737605-69a0e78bd193?auto=format&fit=crop&w=1200&q=80') center 22%/cover no-repeat, var(--primary-dark);
}
.cta-split__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,8,74,0.12) 0%, rgba(0,8,74,0.5) 68%, var(--primary-dark) 100%);
}
.cta-split__content {
  display: flex; align-items: center; padding: var(--sp-16) var(--sp-12);
  background:
    radial-gradient(700px 400px at 95% 15%, rgba(1,151,112,0.30), transparent 60%),
    radial-gradient(600px 400px at 15% 95%, rgba(76,95,255,0.26), transparent 55%),
    var(--primary-dark);
}
@media (max-width: 860px) {
  .cta-split { grid-template-columns: 1fr; }
  .cta-split__media { display: none; }
  .cta-split__content { padding: var(--sp-12) var(--sp-6); justify-content: center; }
}
/* Shape dividers — soften the hard edge where a section-bg-light block meets dark neighbors */
.has-wave-dividers { position: relative; }
.has-wave-dividers > .container { position: relative; z-index: 1; }
.section-wave { position: absolute; left: 0; width: 100%; line-height: 0; z-index: 0; pointer-events: none; }
.section-wave svg { display: block; width: 100%; height: 64px; }
.section-wave--top { top: -1px; }
.section-wave--bottom { bottom: -1px; transform: rotate(180deg); }
@media (max-width: 640px) { .section-wave svg { height: 36px; } }

.section-bg-light {
  background: var(--gray-50);
  color: var(--gray-900);
}
.section-bg-light h2, .section-bg-light h3, .section-bg-light .h2, .section-bg-light .h3 { color: var(--primary-dark); }
.section-bg-light .body-lg { color: var(--gray-600); }
.section-bg-light .caption, .section-bg-light .section-header .caption { color: var(--accent-dark); }
.section-bg-light .card { background: #fff; border-color: var(--gray-200); box-shadow: var(--shadow-1); }
.section-bg-light .badge-accent { background: rgba(1,151,112,0.12); color: var(--accent-dark); }
.section-bg-light .avatar { background: var(--gray-100); border-color: var(--gray-200); color: var(--accent-dark); }
.section-bg-light .btn-outline { border-color: var(--gray-300); color: var(--gray-900); }
.section-bg-light .btn-outline:hover { border-color: var(--primary); background: var(--gray-100); color: var(--primary-dark); }
.section-bg-light .service-card__link { color: var(--accent-dark); }
.section-bg-light .case-card__metric span { color: var(--gray-500); }
.section-header { max-width: 640px; margin: 0 auto var(--sp-12); text-align: center; }
.section-header .caption { color: var(--accent); margin-bottom: var(--sp-3); display: block; }
.section-header h2 { text-wrap: balance; }
.section-header h2 + .body-lg { margin-top: var(--sp-4); }  /* cùng khoảng cách tiêu đề → mô tả như đầu các trang con */

/* Scroll-reveal (motivated motion: guides reading order, not decoration) */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease-out, transform 500ms ease-out; }
  .reveal.is-visible { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
/* Khối đã nằm trong màn hình lúc mở trang thì hiện ngay, không fade lại (global.js gắn .is-instant) */
.reveal.is-instant { transition: none; }

/* Chuyển trang mượt (cross-document View Transitions, Chrome / Edge / Safari 18.2+): giữ trang cũ cho tới khi
   trang mới vẽ xong rồi crossfade nhanh, không nháy trắng. Header đứng yên vì có view-transition-name riêng. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(*) { animation-duration: 140ms; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; animation-timing-function: ease-out; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Header (sticky, transparent -> solid on scroll) — Landing page nav surface
   ========================================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: background 240ms ease-out, border-color 240ms ease-out, box-shadow 240ms ease-out;
}
.site-header.is-scrolled,
.site-header.is-solid {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
  /* Signature moment: 2px gradient strip replicating the real 3-color KTP logo */
  border-image: linear-gradient(90deg, var(--primary-dark), var(--accent), var(--signature-red)) 1;
}
.site-header__inner { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); }
.site-header__logo { display: flex; align-items: center; gap: var(--sp-2); }
.site-header__logo img { height: 28px; width: auto; }
.site-header__nav { display: flex; align-items: center; gap: var(--sp-8); }
.site-header__nav a {
  font: var(--caption); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14.5px;
  color: var(--text-secondary); transition: color 160ms ease-out; position: relative; padding: var(--sp-2) 0;
}
.site-header__nav a:hover, .site-header__nav a.is-active { color: var(--text-strong); }
.site-header__nav a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--accent); border-radius: 2px;
}
.site-header__actions { display: flex; align-items: center; gap: var(--sp-4); }
.lang-toggle {
  display: flex; border: 1px solid var(--border-light); border-radius: var(--radius-full); padding: 2px; gap: 2px;
}
.lang-toggle button {
  border: none; background: transparent; color: var(--text-muted); font: var(--caption); text-transform: none;
  padding: 4px 10px; border-radius: var(--radius-full); transition: background 160ms, color 160ms;
}
.lang-toggle button.is-active { background: var(--surface-3); color: var(--text-strong); }
.site-header__burger { display: none; }

/* ==========================================================================
   Buttons — 4 defined roles, never reuse one style for every action
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font: 600 14.5px var(--font-sans); padding: 12px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; transition: transform 140ms ease-out, box-shadow 140ms ease-out, background 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-lg { padding: 15px 28px; font-size: 15.5px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: #5C6DFF; box-shadow: var(--shadow-2); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-1); }
.btn-accent:hover { background: #01AD82; box-shadow: var(--shadow-2); }
.btn-outline { background: transparent; border-color: var(--border-light); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--primary); color: var(--text-strong); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-strong); background: var(--surface-2); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-6); box-shadow: var(--shadow-1);
  transition: transform 200ms ease-out, box-shadow 200ms ease-out, border-color 200ms ease-out;
}
@media (prefers-reduced-motion: no-preference) {
  .card.is-hoverable:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); border-color: var(--border-light); }
}

/* Stat / KPI card with a colored accent strip */
.stat-card {
  position: relative; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--sp-6); overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--stat-accent, var(--primary));
}
.stat-card--accent { --stat-accent: var(--accent); }
.stat-card--success { --stat-accent: var(--success); }
.stat-card--warning { --stat-accent: var(--warning); }
.stat-card__value { font: 800 40px/1.1 var(--font-sans); color: var(--text-strong); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card__label { font: var(--caption); color: var(--text-muted); margin-top: var(--sp-2); }

/* Badge / status pill */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: var(--radius-full); font: 600 12.5px var(--font-sans);
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-info { background: var(--primary-100); color: var(--primary-dark); }
.badge-domain { display: inline-flex; align-items: center; gap: 6px; }
.badge-domain .domain-icon { width: 14px; height: 14px; flex: none; }
.badge-accent { background: rgba(1,151,112,0.16); color: var(--accent); }

/* Forms */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font: 600 13.5px var(--font-sans); color: var(--text-primary); margin-bottom: var(--sp-2); }
.field .hint { font: var(--caption); text-transform: none; color: var(--text-muted); margin-top: 6px; display: block; }
.input, .textarea, .select {
  width: 100%; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text-primary); font: var(--body); transition: border-color 140ms, box-shadow 140ms;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(76,95,255,0.2); outline: none; }
.textarea { resize: vertical; min-height: 120px; }
.field.has-error .input, .field.has-error .textarea { border-color: var(--error); }
.field__error { display: none; font: 600 12.5px var(--font-sans); color: var(--error); margin-top: 6px; }
.field.has-error .field__error { display: block; }

/* Accordion (FAQ) */
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  background: transparent; border: none; text-align: left; padding: var(--sp-6) 0; color: var(--text-strong);
  font: 600 16px var(--font-sans);
}
.accordion-trigger svg { flex-shrink: 0; transition: transform 220ms ease-out; color: var(--accent); }
.accordion-item.is-open .accordion-trigger svg { transform: rotate(180deg); }
.accordion-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms ease-out; }
.accordion-item.is-open .accordion-panel { grid-template-rows: 1fr; }
.accordion-panel__inner { overflow: hidden; }
.accordion-panel p { padding-bottom: var(--sp-6); color: var(--text-secondary); }

/* Tabs (used on service detail pages) */
.tabs { display: flex; gap: var(--sp-2); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-6); }
.tab {
  padding: var(--sp-3) var(--sp-4); background: transparent; border: none; color: var(--text-muted);
  font: 600 14px var(--font-sans); border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 160ms, border-color 160ms;
}
.tab.is-active { color: var(--text-strong); border-color: var(--accent); }

/* Avatar */
.avatar {
  width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--surface-3);
  display: flex; align-items: center; justify-content: center; font: 700 16px var(--font-sans); color: var(--accent);
  border: 1px solid var(--border-light); flex-shrink: 0;
}

/* Empty state */
.empty-state { text-align: center; padding: var(--sp-16) var(--sp-6); color: var(--text-muted); }
.empty-state svg { margin: 0 auto var(--sp-4); color: var(--gray-600); }

/* Toast */
.toast {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6); z-index: 300;
  background: var(--surface-3); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-6); box-shadow: var(--shadow-3); display: flex; align-items: center; gap: var(--sp-3);
  transform: translateY(20px); opacity: 0; transition: transform 260ms ease-out, opacity 260ms ease-out;
  max-width: 360px;
}
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast svg { color: var(--success); flex-shrink: 0; }

/* Modal (used for demo-reset / delete confirm if needed) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5,7,16,0.72); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 220ms ease-out;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  padding: var(--sp-8); max-width: 440px; width: 90%; box-shadow: var(--shadow-3);
  transform: translateY(12px) scale(0.98); transition: transform 220ms ease-out;
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); }

/* Breadcrumb (used on blog/portfolio detail pages) */
.breadcrumb { display: flex; align-items: center; gap: var(--sp-2); font: var(--caption); text-transform: none; margin-bottom: var(--sp-6); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--gray-700); }

/* ==========================================================================
   Signature moment: 3-color KTP logo gradient (use ONLY in these 2 places)
   ========================================================================== */
.signature-strip {
  height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--accent) 50%, var(--signature-red) 100%);
}
.signature-glow-bg {
  position: relative;
}
.signature-glow-bg::before {
  content: ''; position: absolute; inset: -1px; z-index: 0; border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, var(--primary-dark), var(--accent), var(--signature-red));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0.55;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding: calc(var(--header-h) + var(--sp-16)) 0 var(--sp-20);
  background:
    linear-gradient(100deg, rgba(var(--hero-scrim),0.96) 0%, rgba(var(--hero-scrim),0.88) 40%, rgba(var(--hero-scrim),0.62) 75%, rgba(var(--hero-scrim),0.45) 100%),
    radial-gradient(1200px 600px at 15% -10%, rgba(76,95,255,0.32), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(1,151,112,0.26), transparent 55%),
    url('https://images.unsplash.com/photo-1745015446589-7ee6f702d8c1?auto=format&fit=crop&w=2400&q=80') center/cover no-repeat,
    var(--bg);
  position: relative; overflow: hidden;
}
.hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--sp-16); align-items: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: 6px 14px;
  background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius-full);
  font: var(--caption); color: var(--accent); margin-bottom: var(--sp-6);
}

/* Hero terminal-style typewriter line — technical/branded rotating tagline */
.hero__terminal {
  display: inline-flex; align-items: center; gap: 2px; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 13.5px; color: var(--accent); background: rgba(1,151,112,0.12); border: 1px solid rgba(1,151,112,0.32);
  padding: 9px 16px; border-radius: var(--radius-sm); margin-bottom: var(--sp-6);
}
.hero__terminal-prompt { color: var(--text-muted); }
.hero__terminal-text { color: var(--accent); font-weight: 600; }
.hero__terminal-cursor { color: var(--accent); margin-left: 1px; }
@media (prefers-reduced-motion: no-preference) {
  .hero__terminal-cursor { animation: cursorBlink 1s step-end infinite; }
}
@keyframes cursorBlink { 50% { opacity: 0; } }

.hero h1 { margin-bottom: var(--sp-6); }
.hero .body-lg { max-width: 480px; margin-bottom: var(--sp-8); }
.hero__ctas { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* Hero trust row — icon các lĩnh vực + số dự án có playground (đếm từ DATA_DU_AN, script.js renderHeroTrust) */
.hero__trust { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-8); }
.hero__trust-avatars { display: flex; }
.hero__trust-avatars .avatar {
  width: 34px; height: 34px; font-size: 12px; border: 2px solid var(--bg); margin-left: -10px; flex-shrink: 0;
}
.hero__trust-avatars .avatar:first-child { margin-left: 0; }
.hero__trust-avatars .avatar .domain-icon { width: 16px; height: 16px; }
.hero__trust-rating { display: flex; flex-direction: column; gap: 3px; }
.hero__trust-rating strong { font: 600 14px/1.3 var(--font-sans); color: var(--text-strong); }
.hero__trust-rating span { font: var(--caption); text-transform: none; color: var(--text-secondary); font-size: 12.5px; }
.hero__visual-stack { position: relative; }
.hero__visual {
  position: relative; z-index: 2; border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border-light); box-shadow: var(--shadow-3); background: var(--surface);
}
.browser-chrome { background: var(--surface-3); padding: 10px 14px; display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.browser-chrome span { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-600); }
.hero__visual-body { padding: var(--sp-6); }

/* ==========================================================================
   Hero showcase carousel — xoay các prototype thật (ảnh bìa trong showcase/assets/covers, dữ liệu DATA_DU_AN):
   lĩnh vực, tên dự án, phân hệ, một giá trị kinh doanh bằng chữ, nút bấm thử playground.
   ========================================================================== */
.hero-showcase { position: relative; height: 290px; overflow: hidden; background: var(--surface-3); }
.hero-showcase__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block;
}
.hero-showcase__try {
  position: absolute; top: 14px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-full); background: var(--primary); color: #fff;
  font: 600 12.5px var(--font-sans); box-shadow: var(--shadow-2); transition: background 160ms ease-out, transform 160ms ease-out;
}
.hero-showcase__try:hover { background: #5B6CFF; transform: translateY(-1px); }
.hero-showcase__overlay {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--sp-6);
  background: linear-gradient(180deg, rgba(8,10,20,0) 0%, rgba(8,10,20,0.2) 14%, rgba(8,10,20,0.9) 40%, rgba(6,8,15,0.97) 100%);
}
.hero-showcase__tag {
  display: inline-flex; align-items: center; gap: 7px; font: 700 11px var(--font-sans); letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: var(--sp-3);
}
.hero-case__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  .hero-case__dot::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--accent);
    animation: statusPulse 1.8s ease-out infinite;
  }
}
.hero-showcase__tag .domain-icon { width: 13px; height: 13px; flex: none; }
.hero-showcase__project { font: 700 16px var(--font-sans); color: #fff; margin-bottom: 5px; }
.hero-showcase__project a { color: inherit; }
.hero-showcase__project a:hover { color: var(--accent); }
.hero-showcase__desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: var(--sp-4); max-width: 92%; }
.hero-showcase__metric { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); }
.hero-showcase__metric-value { font: 800 20px/1.2 var(--font-sans); color: var(--accent); letter-spacing: -0.01em; }
.hero-showcase__metric-label { font-size: 11.5px; color: var(--text-secondary); line-height: 1.4; max-width: 220px; }
.hero-showcase__bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.14); overflow: hidden; }
.hero-showcase__bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--primary)); width: 0%; }
@media (prefers-reduced-motion: no-preference) {
  .hero-showcase__bar-fill.is-filling { animation: heroBarFill 6000ms linear forwards; }
  .hero-showcase__project, .hero-showcase__desc, .hero-showcase__metric {
    animation: tabFadeIn 420ms ease-out;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-showcase__bar-fill.is-filling { width: 100%; }
}
@keyframes heroBarFill { from { width: 0%; } to { width: 100%; } }

.hero-showcase__dots { display: flex; justify-content: center; gap: 6px; padding: var(--sp-3) 0; background: var(--surface); }
.hero-showcase__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--border-light); border: none; padding: 0; cursor: pointer; transition: width 220ms ease-out, background 220ms ease-out; }
.hero-showcase__dot.is-active { width: 20px; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .hero__float { animation: float 6s ease-in-out infinite; }
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Secondary floating panels behind the main hero mockup — staggered depth effect */
.hero__visual-panel {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2); padding: 12px 16px; max-width: 200px;
  font: var(--caption); text-transform: none; color: var(--text-secondary); line-height: 1.35;
}
.hero__visual-panel strong { color: var(--text-strong); font-size: 13px; }
.hero__visual-panel svg { flex-shrink: 0; color: var(--accent); }
.hero__visual-panel--a { top: -26px; left: -28px; --rot: -6deg; transform: rotate(var(--rot)); }
.hero__visual-panel--b { bottom: -22px; right: -22px; --rot: 5deg; transform: rotate(var(--rot)); }
@media (prefers-reduced-motion: no-preference) {
  .hero__visual-panel--a { animation: floatPanel 5.5s ease-in-out infinite; animation-delay: .3s; }
  .hero__visual-panel--b { animation: floatPanel 7s ease-in-out infinite; animation-delay: 1s; }
}
@keyframes floatPanel {
  0%, 100% { transform: translateY(0) rotate(var(--rot)); }
  50% { transform: translateY(-9px) rotate(var(--rot)); }
}
@media (max-width: 960px) {
  .hero__visual-panel { display: none; }
}

/* ==========================================================================
   Mobile nav drawer
   ========================================================================== */
.mobile-nav {
  position: fixed; inset: 0; z-index: 150; background: var(--bg);
  transform: translateX(100%); transition: transform 280ms ease-out;
  padding: var(--sp-20) var(--sp-6) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-2);
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav a { font: 600 20px var(--font-sans); color: var(--text-primary); padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.mobile-nav__close { position: absolute; top: var(--sp-6); right: var(--sp-6); background: transparent; border: none; color: var(--text-strong); }
.mobile-nav__ctas { margin-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }

/* ==========================================================================
   Grid utilities
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Service card (value-props / dịch vụ section) */
.service-card { display: flex; flex-direction: column; gap: var(--sp-4); height: 100%; }
.service-card__icon {
  width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  background: var(--icon-bg, rgba(76,95,255,0.14)); color: var(--icon-color, var(--primary));
}
.service-card--featured { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: var(--sp-8); background: var(--surface-2); }
.service-card--featured .service-card__icon { width: 64px; height: 64px; }
@media (max-width: 860px) { .service-card--featured { flex-direction: column; } }
.service-card__link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font: 600 14px var(--font-sans); margin-top: auto; }
.service-card__link svg { width: 14px; height: 14px; transition: transform 160ms ease-out; }
.service-card__link:hover svg { transform: translateX(3px); }

/* Service tabs — click a tab to fade the content panel to that service */
.service-tabs { display: grid; grid-template-columns: 380px 1fr; gap: var(--sp-8); align-items: stretch; }
.service-tabs__nav { display: flex; flex-direction: column; gap: var(--sp-2); }
.service-tab-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: var(--sp-4); text-align: left; padding: var(--sp-4);
  border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; cursor: pointer;
  transition: background 160ms ease-out, border-color 160ms ease-out;
}
.service-tab-btn:hover { background: var(--surface-2); }
.service-tab-btn.is-active { background: var(--surface-2); border-color: var(--border-light); box-shadow: var(--shadow-1); }
.service-tab-btn__icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  background: var(--icon-bg, rgba(76,95,255,0.14)); color: var(--icon-color, var(--primary)); flex-shrink: 0;
}
.service-tab-btn__icon svg { width: 20px; height: 20px; }
.service-tab-btn__text strong { display: block; font-size: 15px; color: var(--text-strong); margin-bottom: 2px; transition: color 160ms ease-out; }
.service-tab-btn__text span { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.service-tab-btn.is-active .service-tab-btn__text strong { color: var(--accent); }

/* Auto-advance progress indicator — fills over the autoplay interval, resets on manual click */
.service-tab-btn__progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 0%; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .service-tab-btn__progress.is-animating { animation: serviceTabProgress 5500ms linear forwards; }
  .service-tabs__nav:hover .service-tab-btn__progress.is-animating { animation-play-state: paused; }
}
@keyframes serviceTabProgress {
  from { width: 0%; }
  to { width: 100%; }
}

.service-tabs__panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-8); overflow: hidden; }

.service-tab-content__media {
  position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 16/9;
  background: var(--surface-3);
}
.service-tab-content__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.service-tab-content__media-icon {
  position: absolute; left: var(--sp-4); top: var(--sp-4); width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; background: var(--icon-bg, rgba(76,95,255,0.16));
  color: var(--icon-color, var(--primary)); box-shadow: var(--shadow-2); z-index: 2;
}
.service-tab-content__media-icon svg { width: 22px; height: 22px; }
.service-tab-content__media-hint {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--sp-4);
  background: rgba(10,13,26,0.45); color: #fff; font: 600 13px var(--font-sans); opacity: 0; transition: opacity 200ms ease-out;
}

/* Overlay pinned to the bottom of the image — dark scrim behind the benefits text for readability over any photo */
.service-tab-content__overlay {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--sp-5); opacity: 1;
  background: linear-gradient(180deg, rgba(8,10,20,0) 0%, rgba(8,10,20,0.62) 45%, rgba(6,8,15,0.95) 100%);
}
.service-tab-content__benefits { display: flex; flex-direction: column; gap: 8px; padding-left: var(--sp-4); padding-right: var(--sp-4); padding-bottom: var(--sp-4); }
.service-tab-content__benefit {
  display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; color: #fff;
}
.service-tab-content__benefit svg { color: var(--success); flex-shrink: 0; margin-top: 2px; }

/* Hover the image to fade the overlay + benefits in, staggered — only on devices with real hover (skip touch) */
@media (hover: hover) and (pointer: fine) {
  .service-tab-content__media-hint { opacity: 1; }
  .service-tab-content__overlay { opacity: 0; transition: opacity 560ms ease-out; }
  .service-tab-content__media:hover .service-tab-content__media-hint { opacity: 0; }
  .service-tab-content__media:hover .service-tab-content__overlay { opacity: 1; }

  .service-tab-content__benefit {
    opacity: 0; transform: translateY(10px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
  }
  .service-tab-content__media:hover .service-tab-content__overlay .service-tab-content__benefit {
    opacity: 1; transform: translateY(0);
  }
  .service-tab-content__media:hover .service-tab-content__overlay .service-tab-content__benefit:nth-child(1) { transition-delay: 120ms; }
  .service-tab-content__media:hover .service-tab-content__overlay .service-tab-content__benefit:nth-child(2) { transition-delay: 280ms; }
  .service-tab-content__media:hover .service-tab-content__overlay .service-tab-content__benefit:nth-child(3) { transition-delay: 440ms; }
  .service-tab-content__media:hover .service-tab-content__overlay .service-tab-content__benefit:nth-child(4) { transition-delay: 600ms; }
}
@media (prefers-reduced-motion: reduce) {
  .service-tab-content__overlay { opacity: 1 !important; }
  .service-tab-content__benefit { opacity: 1 !important; transform: none !important; }
  .service-tab-content__media-hint { display: none; }
}

/* Màn hẹp / cảm ứng: không có hover, ảnh 16:9 quá thấp để phủ chữ lên → danh sách lợi ích nằm dưới ảnh */
@media (max-width: 860px), (hover: none) {
  .service-tabs__panel { padding: var(--sp-6) var(--sp-4); }
  .service-tab-content__media { aspect-ratio: auto; overflow: visible; background: none; border-radius: 0; }
  .service-tab-content__media img { aspect-ratio: 16/9; height: auto; border-radius: var(--radius-md); }
  .service-tab-content__media-icon { display: none; }  /* icon đã có ở danh sách tab phía trên, không đè lên ảnh */
  .service-tab-content__media-hint { display: none; }
  :root .service-tab-content__overlay {
    position: static; opacity: 1; padding: 0; margin-top: var(--sp-4); background: none;
    color: var(--text-primary); --text-secondary: inherit;
  }
  .service-tab-content__benefits { padding: 0; gap: 10px; }
  .service-tab-content .service-tab-content__benefit { opacity: 1; transform: none; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
}
@media (prefers-reduced-motion: no-preference) {
  .service-tab-content.is-active { animation: tabFadeIn 320ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  .service-tab-btn { transition: none; }
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 860px) {
  .service-tabs { grid-template-columns: 1fr; }
}

/* Process steps (Quy trình làm việc — real ordered sequence) */
.process-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); counter-reset: step; align-items: start; }
@media (min-width: 861px) {
  .process-steps { grid-template-columns: repeat(4, 1fr) 30px; }
}
@media (max-width: 860px) { .process-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  /* Mobile: timeline dọc gọn — số bên trái, nội dung bên phải, đường nối giữa các số */
  .process-steps { grid-template-columns: 1fr; gap: 0; }
  .process-step { display: grid; grid-template-columns: 36px 1fr; column-gap: var(--sp-4); padding: 0 0 var(--sp-6); }
  .process-step:nth-child(4) { padding-bottom: 0; }
  .process-step__num { grid-row: 1 / span 2; margin-bottom: 0; }
  .process-step h3 { align-self: center; margin: 0 0 var(--sp-1); line-height: 36px; }
  .process-step p { grid-column: 2; }
  .process-step:nth-child(-n+3)::before {
    content: ''; position: absolute; left: 17.5px; top: 40px; bottom: 4px; width: 1px; background: var(--border-light);
  }
}
.process-step { position: relative; padding-top: var(--sp-8); }
.process-step h3 { margin-bottom: var(--sp-2); }  /* tiêu đề bước → mô tả: không dính sát */
.process-step__num {
  position: relative; z-index: 1;
  font: 800 15px var(--font-sans); color: var(--accent); background: var(--surface-2); border: 1px solid var(--border-light);
  width: 36px; height: 36px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-4);
}
.process-step__connector {
  display: none;
}

/* Pipeline end-cap: success/go-live marker the connector line runs into after step 4 */
.process-pipeline-end {
  display: none;
}
@media (min-width: 861px) {
  .process-pipeline-end {
    position: relative;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 50%; margin-top: calc(var(--sp-8) + 18px - 17px);
    background: var(--success-bg); color: var(--success); border: 1px solid var(--success);
  }
  /* Continuous "impact" shockwave once the dart has landed — keeps the end-cap feeling alive */
  .process-pipeline-end::after {
    content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1.5px solid var(--success);
    opacity: 0;
  }

  /* Connector — anchored to the circle's real edges (36px wide, flush left), not a % guess that
     drifted out of sync with the number circle at different viewport widths. */
  .process-step::after {
    content: ''; position: absolute; z-index: 0; top: calc(var(--sp-8) + 18px); left: 36px; right: calc(-1 * var(--sp-6));
    height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left;
  }

  @media (prefers-reduced-motion: no-preference) {
    /* Sequenced like a pipeline: each line draws into the next node, which is what reveals that
       step's number + copy — nothing after step 1 is visible until its line reaches it.
       Khung .process-steps phải có class reveal (global.js gắn is-visible), không thì các bước ẩn mãi. */
    .process-step > * { opacity: 0; transform: translateY(10px); }
    .process-steps.is-visible .process-step > * {
      animation: stepContentPop 380ms ease-out forwards;
    }
    .process-steps.is-visible .process-step:nth-child(1) > * { animation-delay: 0ms; }
    .process-steps.is-visible .process-step:nth-child(2) > * { animation-delay: 850ms; }
    .process-steps.is-visible .process-step:nth-child(3) > * { animation-delay: 1500ms; }
    .process-steps.is-visible .process-step:nth-child(4) > * { animation-delay: 2150ms; }

    .process-steps.is-visible .process-step::after {
      animation: drawConnectorLine 650ms ease-out forwards;
    }
    .process-steps.is-visible .process-step:nth-child(1)::after { animation-delay: 200ms; }
    .process-steps.is-visible .process-step:nth-child(2)::after { animation-delay: 850ms; }
    .process-steps.is-visible .process-step:nth-child(3)::after { animation-delay: 1500ms; }
    .process-steps.is-visible .process-step:nth-child(4)::after { animation-delay: 2150ms; }

    .process-pipeline-end { opacity: 0; transform: scale(0.4); }
    .process-steps.is-visible .process-pipeline-end {
      animation: pipelineEndPop 420ms cubic-bezier(.34,1.56,.64,1) forwards;
      animation-delay: 2650ms;
    }
    .process-steps.is-visible .process-pipeline-end::after {
      animation: pipelineEndPulse 1.8s ease-out infinite;
      animation-delay: 3070ms;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .process-step::after { transform: scaleX(1); }
  }
}
@keyframes drawConnectorLine { to { transform: scaleX(1); } }
@keyframes stepContentPop { to { opacity: 1; transform: translateY(0); } }
@keyframes pipelineEndPop { to { opacity: 1; transform: scale(1); } }
@keyframes pipelineEndPulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ==========================================================================
   Testimonial marquee — 2 rows scrolling continuously in opposite directions
   ========================================================================== */
.testimonial-marquee {
  max-width: var(--container-w); margin: 0 auto; padding: 0 var(--sp-6);
  display: flex; flex-direction: column; gap: var(--sp-8);
}
.marquee-row {
  overflow: hidden; padding: var(--sp-2) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex; gap: var(--sp-6); width: max-content;
  animation: marqueeScroll 42s linear infinite;
}
.marquee-row--reverse .marquee-track { animation-direction: reverse; }
@media (prefers-reduced-motion: no-preference) {
  .marquee-row:hover .marquee-track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; }
  .marquee-row { overflow: visible; -webkit-mask-image: none; mask-image: none; }
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-card {
  flex: 0 0 auto; width: 420px; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: var(--sp-6); box-shadow: var(--shadow-1);
  text-align: left;
}
.marquee-card__quote { font: 400 14.5px/1.55 var(--font-sans); color: var(--gray-800); margin-bottom: var(--sp-4); min-height: 68px; }
.marquee-card__meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding-top: var(--sp-3); border-top: 1px solid var(--gray-100);
}
.marquee-card__author { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.marquee-card__author .avatar { width: 36px; height: 36px; font-size: 13px; background: var(--gray-100); border-color: var(--gray-200); color: var(--accent-dark); flex-shrink: 0; }
.marquee-card__author-info { min-width: 0; }
.marquee-card__author-info strong { display: block; font-size: 13px; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marquee-card__author-info span { font-size: 11.5px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.marquee-card__rating { text-align: right; flex-shrink: 0; }
.marquee-card__rating .stars { display: flex; gap: 1px; justify-content: flex-end; margin-bottom: 3px; }
.marquee-card__rating .stars svg { width: 12px; height: 12px; }
.marquee-card__rating .stars svg.is-filled { color: var(--warning); }
.marquee-card__rating .stars svg.is-empty { color: var(--gray-200); }
.marquee-card__rating span { font-size: 10.5px; color: var(--gray-400); white-space: nowrap; }

@media (max-width: 640px) {
  .marquee-card { width: 300px; }
}

.case-card__tag { margin-bottom: var(--sp-3); }
.case-card__metric { display: flex; align-items: baseline; gap: 6px; margin-top: var(--sp-4); }
.case-card__metric strong { font: 800 24px var(--font-sans); color: var(--accent); }
/* Thẻ dự án có nút (Xem chi tiết / Playground bản mẫu): nút dồn xuống đáy thẻ */
.portfolio-card.has-acts { display: flex; flex-direction: column; }
.portfolio-card.has-acts .portfolio-card__body { flex: 1; display: flex; flex-direction: column; }
.portfolio-card.has-acts .portfolio-card__img img { object-position: top left; }
.portfolio-card__title a:hover { color: var(--primary); }
.case-card__acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-6); }
.portfolio-card.has-acts .case-card__metric { flex-direction: column; align-items: flex-start; gap: 2px; }
.portfolio-card.has-acts .case-card__metric strong { font-size: 20px; line-height: 1.25; }
.case-card__acts .btn { flex: 1 1 auto; padding: 10px 14px; font-size: 13.5px; }
.case-card__metric span { color: var(--text-muted); font-size: 13px; }

/* ==========================================================================
   CR-01 — Case study: badge quốc gia / trạng thái, nhãn "Cần xác nhận", hành trình phạm vi
   ========================================================================== */
.case-card__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.badge-market { background: rgba(76,95,255,0.16); color: #AEB8FF; }
.badge-market svg { flex-shrink: 0; }
.badge-ongoing { background: var(--warning-bg); color: var(--warning); }
.badge-ongoing__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  .badge-ongoing__dot { animation: ongoingPulse 1.8s ease-in-out infinite; }
}
@keyframes ongoingPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.section-bg-light .badge-market { background: rgba(76,95,255,0.10); color: #3442C9; }
.section-bg-light .badge-ongoing { background: #FFF3DC; color: #8A5300; }

/* CR-02 — Nút demo (Live demo / Request for demo) + hàng nút trên card case study */
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-demo svg { width: 15px; height: 15px; }
.case-card__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); }
.case-card__actions .service-card__link { margin-top: 0; }
.case-card__title-link { color: inherit; }
.case-card__title-link:hover { color: var(--accent); }
.section-bg-light .case-card__title-link:hover { color: var(--accent-dark); }
a.portfolio-card__img { display: block; }

/* CR-02 — Chip business domain của dự án (E-commerce, CRM, Inventory…) */
.domain-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--radius-full);
  border: 1px solid var(--border-light); background: rgba(255,255,255,0.03);
  font: 600 12px/1.4 var(--font-sans); color: var(--gray-200); white-space: nowrap;
}
.domain-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.section-bg-light .domain-chip { border-color: var(--gray-200); background: #fff; color: var(--gray-700); }

/* Nội dung chưa được KTP xác nhận — cố ý nổi bật để không bị bỏ sót trước go-live */
.tbc-flag {
  display: inline; padding: 1px 8px; border: 1px dashed var(--warning); border-radius: 6px;
  background: rgba(245,165,36,0.10); color: var(--warning); font-size: 0.82em; font-weight: 600; line-height: 1.9;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.case-confidential { font-size: 13px; font-style: italic; color: var(--text-muted); margin-bottom: var(--sp-8); }

.scope-journey {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--stages, 3), 1fr); gap: var(--sp-8);
}
.scope-stage { position: relative; display: flex; flex-direction: column; gap: var(--sp-3); }
.scope-stage__head {
  display: flex; align-items: center; gap: 10px; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border-light);
  font: 700 13px var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}
.scope-stage__num {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border-light); color: var(--text-strong); font-size: 12px; letter-spacing: 0;
}
.scope-stage:not(:last-child)::after {
  content: '→'; position: absolute; top: 2px; right: calc(var(--sp-8) / -2 - 8px);
  color: var(--accent); font: 700 18px var(--font-sans);
}
.scope-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4); }
/* Trạng thái chặng: Đang triển khai (vàng cam, chấm nhấp nháy) · Chuẩn bị bắt đầu (xám, thẻ viền đứt) */
.scope-stage.is-active .scope-stage__head { color: var(--warning); }
.scope-stage.is-active .scope-stage__num { border-color: var(--warning); color: var(--warning); }
.scope-stage.is-active .scope-stage__head::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--warning); margin-left: 2px; }
@media (prefers-reduced-motion: no-preference) { .scope-stage.is-active .scope-stage__head::after { animation: ongoingPulse 1.6s ease-in-out infinite; } }
.scope-stage.is-upcoming .scope-stage__head { color: var(--text-muted); }
.scope-stage.is-upcoming .scope-item { background: transparent; border-style: dashed; }
.scope-item strong { display: block; color: var(--text-strong); font-size: 15px; margin-bottom: 4px; }
.scope-item p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); }
@media (max-width: 860px) {
  .scope-journey { grid-template-columns: 1fr; gap: var(--sp-10, 40px); }
  .scope-stage:not(:last-child)::after { content: '↓'; top: auto; right: auto; bottom: -32px; left: 7px; }
}

/* ==========================================================================
   CR-01 — Trang chủ: "Đồng hành chuyển đổi số" (vòng 4 bước, thay section Quy trình 4 bước)
   ========================================================================== */
.dx-loop__steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6);
}
.dx-step {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-6);
}
.dx-step__num {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 800 15px var(--font-sans); color: var(--accent); background: var(--bg); border: 1px solid var(--accent);
  margin-bottom: var(--sp-4);
}
.dx-step h3 { font: var(--h3); font-size: 17px; color: var(--text-strong); margin-bottom: var(--sp-2); }
.dx-step p { font-size: 14px; line-height: 1.6; color: var(--text-secondary); }
.dx-step__out {
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px dashed var(--border-light);
  font-size: 12.5px; color: var(--text-muted);
}
.dx-step p + .dx-step__out { margin-top: var(--sp-4); }
.dx-step__out strong { color: var(--accent); font-weight: 600; }
/* CR-03 — dòng "✦ AI" trong mỗi bước + chip AI dùng chung (trang chủ, trang dịch vụ) */
.dx-ai-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; padding: 1px 8px 1px 6px; border-radius: var(--radius-full);
  background: rgba(1,151,112,0.18); color: var(--accent); font: 700 11px/1.6 var(--font-sans); letter-spacing: 0.05em; vertical-align: 1px;
  transition: background 300ms ease-out, color 300ms ease-out;
}
.dx-ai-tag svg { width: 10px; height: 10px; }
.dx-step .dx-step__ai {
  margin-top: var(--sp-3); padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; color: var(--gray-200);
  background: rgba(1,151,112,0.07); border: 1px solid rgba(1,151,112,0.22);
  transition: background 300ms ease-out, border-color 300ms ease-out;
}
.dx-step__ai + .dx-step__out { margin-top: var(--sp-4); }
.dx-loop .dx-step.is-active .dx-step__ai { background: rgba(245,165,36,0.08); border-color: rgba(245,165,36,0.35); }
.dx-loop .dx-step.is-active .dx-ai-tag { background: rgba(245,165,36,0.2); color: var(--warning); }
/* Mũi tên nối giữa các bước (desktop) */
.dx-step:not(:last-child)::after {
  content: ''; position: absolute; top: 42px; right: calc(-1 * var(--sp-6)); width: var(--sp-6); height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='14' viewBox='0 0 24 14' fill='none' stroke='%23019770' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='7' x2='20' y2='7'/%3E%3Cpolyline points='15 2 20 7 15 12'/%3E%3C/svg%3E") center / 24px 14px no-repeat;
}
/* Đường quay lại bước ① — nối tâm cột 1 với tâm cột 4: inset = w/2 = 12.5% − 3·gap/8 */
.dx-loop__return {
  position: relative; height: 52px; margin: 0 calc(12.5% - 9px);
  border: 2px dashed rgba(1,151,112,0.55); border-top: none; border-radius: 0 0 28px 28px;
}
.dx-loop__return::before {
  content: ''; position: absolute; left: -7px; top: -2px;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--accent);
}
.dx-loop__return-label {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 18px; border-radius: var(--radius-full); background: var(--bg); border: 1px solid var(--accent);
  font: 600 13.5px var(--font-sans); color: var(--text-strong);
}
.dx-loop__return-label svg { color: var(--accent); flex-shrink: 0; }
.dx-loop__return-label span { color: var(--text-secondary); font-weight: 500; }

.dx-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); margin-top: var(--sp-16); }
.dx-stat {
  display: flex; align-items: flex-start; gap: var(--sp-6);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-6);
}
.dx-stat__value { font: 800 32px/1.1 var(--font-sans); color: var(--text-strong); letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dx-stat__value em { font-style: normal; color: var(--warning); }
.dx-stat p { font-size: 14.5px; line-height: 1.55; color: var(--text-secondary); }
.dx-stat__src { display: block; margin-top: var(--sp-2); font-size: 12px; color: var(--text-muted); }
.dx-stat__src a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dx-stat__src a:hover { color: var(--text-secondary); }
.dx-loop__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-4); margin-top: var(--sp-12); }

@media (prefers-reduced-motion: no-preference) {
  .dx-loop .dx-step, .dx-loop .dx-loop__return { opacity: 0; transform: translateY(12px); transition: opacity 450ms ease-out, transform 450ms ease-out; }
  .dx-loop.is-visible .dx-step, .dx-loop.is-visible .dx-loop__return { opacity: 1; transform: none; }
  .dx-loop.is-visible .dx-step:nth-child(2) { transition-delay: 150ms; }
  .dx-loop.is-visible .dx-step:nth-child(3) { transition-delay: 300ms; }
  .dx-loop.is-visible .dx-step:nth-child(4) { transition-delay: 450ms; }
  .dx-loop.is-visible .dx-loop__return { transition-delay: 700ms; }
}

/* ---- Vòng chạy tự động (JS: initDxLoop) — chỉ khi không bật reduced-motion ----
   Màu nổi bật của vòng chạy = vàng cam --warning (#F5A524) để tách khỏi teal của trạng thái tĩnh.
   Không dùng đỏ: crimson là màu signature, đỏ --error mang nghĩa lỗi. */
.dx-loop { --dx-hl: var(--warning); --dx-hl-rgb: 245,165,36; }
.dx-loop__round { display: none; }
.dx-step__trace { display: none; }
.dx-golive { display: none; }
.dx-loop__dot { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .dx-loop--running .dx-loop__round {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--sp-4);
    font: 600 12.5px var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted);
  }
  .dx-loop__round b { color: var(--dx-hl); font-variant-numeric: tabular-nums; display: inline-block; }
  .dx-loop__round b.is-bump { animation: dxRoundBump 520ms cubic-bezier(.34,1.56,.64,1); }
  .dx-loop__round-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dx-hl); animation: ongoingPulse 1.6s ease-in-out infinite; }

  /* bỏ delay của reveal khi vòng chạy đã bắt đầu, để các trạng thái chuyển tức thời */
  .dx-loop--running .dx-step, .dx-loop--running .dx-loop__return { transition-delay: 0s !important; }
  .dx-loop .dx-step { transition: opacity 450ms ease-out, transform 400ms ease-out, border-color 400ms ease-out, box-shadow 400ms ease-out, background 400ms ease-out; }
  .dx-loop .dx-step__num { transition: background 300ms ease-out, color 300ms ease-out, box-shadow 300ms ease-out, border-color 300ms ease-out; }

  /* Bước đang chạy: nhấc lên, quầng sáng vàng cam, số tô đặc; viền giữ dịu để nét "progress" chạy quanh viền nổi rõ */
  .dx-loop .dx-step.is-active {
    border-color: rgba(var(--dx-hl-rgb),0.22); background: var(--surface-2); transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(var(--dx-hl-rgb),0.14), 0 0 28px rgba(var(--dx-hl-rgb),0.08);
  }
  .dx-loop .dx-step.is-active .dx-step__num { background: var(--dx-hl); border-color: var(--dx-hl); color: var(--bg); box-shadow: 0 0 0 6px rgba(var(--dx-hl-rgb),0.2); }
  .dx-loop .dx-step.is-active h3 { color: var(--text-strong); }
  .dx-loop .dx-step.is-active .dx-step__out strong { color: var(--dx-hl); }
  .dx-loop .dx-step.is-done .dx-step__num { background: rgba(var(--dx-hl-rgb),0.14); border-color: rgba(var(--dx-hl-rgb),0.6); color: var(--dx-hl); }

  /* Progress chạy vòng quanh viền card (SVG rect do JS chèn, pathLength=100 → dashoffset 100 → 0) */
  .dx-loop--running .dx-step__trace {
    display: block; position: absolute; left: -1px; top: -1px; width: calc(100% + 2px); height: calc(100% + 2px);
    overflow: visible; pointer-events: none;
  }
  .dx-step__trace rect {
    fill: none; stroke: var(--dx-hl); stroke-width: 2.5; stroke-linecap: round;
    stroke-dasharray: 100 100; stroke-dashoffset: 100;
    filter: drop-shadow(0 0 4px rgba(var(--dx-hl-rgb),0.7));
  }
  .dx-step.is-active .dx-step__trace rect { animation: dxTrace var(--dx-step-ms, 2200ms) linear forwards; }
  .dx-step.is-done .dx-step__trace rect { stroke-dashoffset: 0; opacity: 0.28; filter: none; transition: opacity 400ms ease-out; }
  .dx-loop.is-paused .dx-step__trace rect { animation-play-state: paused; }

  /* Mũi tên "chảy" sang bước kế tiếp — đổi sang vàng cam trong lúc chảy */
  .dx-step.is-flow::after {
    animation: dxArrowFlow 650ms ease-out;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='14' viewBox='0 0 24 14' fill='none' stroke='%23F5A524' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='7' x2='20' y2='7'/%3E%3Cpolyline points='15 2 20 7 15 12'/%3E%3C/svg%3E");
  }

  /* Badge Go-live bật lên ở bước 3 khi thử nghiệm xong */
  .dx-loop--running .dx-golive {
    display: inline-flex; align-items: center; gap: 5px; position: absolute; top: 18px; right: 18px;
    padding: 4px 10px; border-radius: var(--radius-full); background: var(--success-bg); color: var(--success);
    border: 1px solid rgba(34,197,94,0.4); font: 700 11.5px var(--font-sans); letter-spacing: 0.02em;
    opacity: 0; transform: scale(0.5);
    transition: opacity 260ms ease-out, transform 420ms cubic-bezier(.34,1.56,.64,1);
  }
  .dx-loop.is-golive .dx-golive { opacity: 1; transform: scale(1); }

  /* Pha quay lại: đường nét đứt sáng lên + chấm sáng chạy từ bước 4 về bước 1 */
  .dx-loop__return { transition: border-color 300ms ease-out; }
  .dx-loop__return.is-active { border-color: var(--dx-hl); border-style: none solid solid solid; } /* giữ không có cạnh trên như trạng thái thường */
  .dx-loop__return.is-active::before { border-bottom-color: var(--dx-hl); animation: dxArrowHead var(--dx-return-ms, 1800ms) ease-in-out; }
  .dx-loop--running .dx-loop__dot {
    display: block; position: absolute; left: 100%; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
    background: var(--dx-hl); box-shadow: 0 0 0 4px rgba(var(--dx-hl-rgb),0.25), 0 0 18px 4px rgba(var(--dx-hl-rgb),0.55); opacity: 0;
  }
  .dx-loop__return.is-active .dx-loop__dot { animation: dxReturnTravel var(--dx-return-ms, 1800ms) ease-in-out forwards; }
  .dx-loop__return-label { transition: background 300ms ease-out, box-shadow 300ms ease-out, border-color 300ms ease-out; }
  .dx-loop__return.is-active .dx-loop__return-label { background: var(--warning-bg); border-color: var(--dx-hl); box-shadow: 0 0 0 4px rgba(var(--dx-hl-rgb),0.15); }
  .dx-loop__return.is-active .dx-loop__return-label svg { color: var(--dx-hl); animation: dxSpinBack var(--dx-return-ms, 1800ms) ease-in-out; }
}
@keyframes dxTrace { to { stroke-dashoffset: 0; } }
@keyframes dxArrowFlow {
  0% { opacity: 0.25; transform: translateX(-8px); }
  60% { opacity: 1; transform: translateX(3px); filter: drop-shadow(0 0 6px rgba(245,165,36,0.9)); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes dxArrowFlowDown {
  0% { opacity: 0.25; transform: rotate(90deg) translateX(-8px); }
  60% { opacity: 1; transform: rotate(90deg) translateX(3px); filter: drop-shadow(0 0 6px rgba(245,165,36,0.9)); }
  100% { opacity: 1; transform: rotate(90deg) translateX(0); }
}
@keyframes dxRoundBump { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(1); } }
@keyframes dxSpinBack { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }
@keyframes dxArrowHead { 0%, 85% { transform: scale(1); } 93% { transform: scale(1.6); } 100% { transform: scale(1); } }
/* Đi theo khung chữ U: phải-trên → phải-dưới → trái-dưới → trái-trên (có bo góc xấp xỉ) — dùng % nên đúng ở mọi độ rộng */
@keyframes dxReturnTravel {
  0%   { left: 100%; top: 0; opacity: 0; }
  6%   { opacity: 1; }
  22%  { left: 100%; top: 50%; }
  30%  { left: calc(100% - 10px); top: calc(100% - 6px); }
  36%  { left: calc(100% - 28px); top: 100%; }
  64%  { left: 28px; top: 100%; }
  70%  { left: 10px; top: calc(100% - 6px); }
  78%  { left: 0; top: 50%; }
  95%  { left: 0; top: 0; opacity: 1; }
  100% { left: 0; top: 0; opacity: 0; }
}

@media (max-width: 860px) {
  .dx-loop__steps { grid-template-columns: 1fr; gap: var(--sp-8); }
  .dx-step:not(:last-child)::after { top: auto; right: auto; bottom: calc(-1 * var(--sp-8)); left: 28px; width: 24px; height: var(--sp-8); transform: rotate(90deg); transform-origin: center; }
  .dx-loop__return { height: auto; margin: var(--sp-8) 0 0; border: none; display: flex; justify-content: center; }
  .dx-loop__return::before { display: none; }
  .dx-loop__dot { display: none !important; }
  .dx-step.is-flow::after { animation-name: dxArrowFlowDown; }
  .dx-loop__return-label { position: static; transform: none; white-space: normal; flex-wrap: wrap; justify-content: center; text-align: center; border-radius: var(--radius-lg); }
  .dx-loop__return-label span { flex-basis: 100%; }
  .dx-stats { grid-template-columns: 1fr; margin-top: var(--sp-12); }
}
@media (max-width: 480px) {
  .dx-stat { flex-direction: column; gap: var(--sp-3); }
}

/* Blog card */
.blog-card { padding: 0; overflow: hidden; }
.blog-card__img { aspect-ratio: 16/10; overflow: hidden; background: var(--surface-3); }
.blog-card__img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card__body { padding: var(--sp-6); }
.blog-card__meta { display: flex; align-items: center; gap: var(--sp-2); font: var(--caption); text-transform: none; margin-top: var(--sp-4); }
.blog-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gray-600); }

/* Portfolio card */
.portfolio-card { padding: 0; overflow: hidden; }
.portfolio-card__img { aspect-ratio: 4/3; background: var(--surface-3); overflow: hidden; }
.portfolio-card__img img { width: 100%; height: 100%; object-fit: cover; }
.portfolio-card__body { padding: var(--sp-6); }

/* FAQ list wrapper */
.faq-list { max-width: 760px; margin: 0 auto; }

/* CTA band (final CTA) */
.cta-band { text-align: left; max-width: 480px; }
.cta-band h2 { color: var(--text-strong); margin-bottom: var(--sp-4); }
.cta-band .body-lg { color: rgba(255,255,255,0.72); margin-bottom: var(--sp-8); }
@media (max-width: 860px) {
  .cta-band { text-align: center; max-width: 520px; margin: 0 auto; }
  .cta-band .body-lg { margin-left: auto; margin-right: auto; }
}
.section-bg-solid .body-lg { color: rgba(255,255,255,0.72); }

/* "We're online" status badge with a pulsing dot — invites contact, ties to the support-agent background photo */
.cta-band__status {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 16px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius-full);
  font: var(--caption); text-transform: none; color: rgba(255,255,255,0.85); margin-bottom: var(--sp-6);
}
.cta-band__status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  .cta-band__status-dot::after {
    content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--success);
    animation: statusPulse 1.8s ease-out infinite;
  }
}
@keyframes statusPulse {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* Pulsing ring around the primary CTA button — motivated: invites the click */
@media (prefers-reduced-motion: no-preference) {
  .btn-pulse { animation: btnPulseRing 2.4s ease-out infinite; }
}
@keyframes btnPulseRing {
  0% { box-shadow: 0 0 0 0 rgba(1,151,112,0.55); }
  70% { box-shadow: 0 0 0 16px rgba(1,151,112,0); }
  100% { box-shadow: 0 0 0 0 rgba(1,151,112,0); }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--gray-900); border-top: 1px solid var(--border); padding: var(--sp-16) 0 var(--sp-8); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-8); margin-bottom: var(--sp-12); }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer__brand img { height: 26px; margin-bottom: var(--sp-4); }
.site-footer__brand p { color: var(--text-muted); font-size: 14px; max-width: 280px; }
.site-footer h4 { font: 600 14px var(--font-sans); color: var(--text-strong); margin-bottom: var(--sp-4); }
.site-footer ul li { margin-bottom: var(--sp-3); }
.footer-contact-item { display: flex; align-items: center; gap: var(--sp-2); }
.footer-contact-item svg { flex-shrink: 0; color: var(--accent); }
.footer-contact-item span, .footer-contact-item a { color: var(--text-muted); }
.site-footer a { color: var(--text-muted); font-size: 14px; transition: color 160ms; }
.site-footer a:hover { color: var(--accent); }
.site-footer__social { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); }
.site-footer__social a {
  width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.site-footer__bottom {
  border-top: 1px solid var(--border); padding-top: var(--sp-6); display: flex; justify-content: space-between;
  color: var(--text-muted); font-size: 13px; flex-wrap: wrap; gap: var(--sp-3);
}

/* Thank-you page */
.thankyou { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--sp-20) 0; }
.thankyou__icon {
  width: 84px; height: 84px; border-radius: 50%; background: var(--success-bg); color: var(--success);
  display: flex; align-items: center; justify-content: center; margin: 0 auto var(--sp-6);
}

/* Reset-demo link (contact page only) */
.demo-reset { position: fixed; bottom: var(--sp-4); left: var(--sp-4); font: var(--caption); color: var(--gray-600); z-index: 50; }
.demo-reset:hover { color: var(--text-secondary); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
}
@media (max-width: 860px) {
  .site-header__nav { display: none; }
  .site-header__actions .btn { display: none; }
  .site-header__burger { display: flex; }
  .container { padding: 0 var(--sp-4); }
  .section { padding: var(--sp-12) 0; }
}

/* ==========================================================================
   Light theme — bật bằng <html data-theme="light"> (nút đổi theme ở header, lưu localStorage "ktp_theme").
   Mặc định là dark. Chỉ ghi đè token; các khối luôn nền tối (footer, CTA navy, chữ trên ảnh)
   khai báo lại token dark tại chỗ để chữ vẫn sáng.
   ========================================================================== */
:root[data-theme="light"] {
  color-scheme: light;
  --accent: #016B52;            /* teal đậm hơn để chữ teal trên nền trắng đạt AA */
  --accent-dark: #01533F;

  --success: #15803D;  --success-bg: #E8F6EE;
  --warning: #B45309;  --warning-bg: #FDF3E1;
  --error: #C8322A;    --error-bg: #FDECEB;

  --bg: #FFFFFF;
  --surface: #F6F7FB;
  --surface-2: #EEF0F7;
  --surface-3: #E3E6F1;
  --border: #E1E4EF;
  --border-light: #CBCFE0;

  --text-primary: #12142A;
  --text-secondary: #434765;
  --text-muted: #5C6180;
  --text-strong: #00084A;

  --shadow-1: 0 1px 2px rgba(0,8,74,0.06), 0 1px 3px rgba(0,8,74,0.08);
  --shadow-2: 0 4px 12px rgba(0,8,74,0.10), 0 2px 4px rgba(0,8,74,0.06);
  --shadow-3: 0 16px 40px rgba(0,8,74,0.14), 0 6px 16px rgba(0,8,74,0.08);

  --header-bg: rgba(255, 255, 255, 0.92);
  --hero-scrim: 255,255,255;
}
:root { color-scheme: dark; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: var(--gray-200); }
:root[data-theme="light"] .breadcrumb .sep,
:root[data-theme="light"] .empty-state svg { color: var(--gray-300); }
:root[data-theme="light"] .blog-card__meta .dot { background: var(--gray-300); }
:root[data-theme="light"] .section-bg-light { background: var(--surface); }
:root[data-theme="light"] .modal-overlay { background: rgba(0,8,74,0.4); }
:root[data-theme="light"] .hero-showcase__dots { background: var(--surface-2); }
:root[data-theme="light"] .badge-market { background: rgba(76,95,255,0.10); color: #3442C9; }
:root[data-theme="light"] .domain-chip { border-color: var(--gray-200); background: #fff; color: var(--gray-700); }

/* Khối luôn nền tối: giữ token dark để chữ / viền vẫn đúng ở light theme */
:root[data-theme="light"] .site-footer,
:root[data-theme="light"] .section-bg-solid,
:root[data-theme="light"] .cta-split,
:root[data-theme="light"] .hero-showcase__overlay,
:root[data-theme="light"] .service-tab-content__overlay {
  --accent: #019770;
  --success: #22C55E;
  --surface: #111528; --surface-2: #171B33; --surface-3: #1E2340;
  --border: #262B4D; --border-light: #333962;
  --text-primary: #F5F6FA; --text-secondary: #A7ACC7; --text-muted: #7D82A3; --text-strong: #fff;
  color: var(--text-primary);
}
:root[data-theme="light"] .section-bg-solid .btn-outline,
:root[data-theme="light"] .cta-split .btn-outline { color: #fff; border-color: rgba(255,255,255,0.32); }

/* Nút đổi theme (global.js chèn vào .site-header__actions) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0;
  border: 1px solid var(--border-light); border-radius: var(--radius-full); background: transparent;
  color: var(--text-secondary); transition: color 160ms, border-color 160ms, background 160ms;
}
.theme-toggle:hover { color: var(--text-strong); border-color: var(--primary); background: var(--surface-2); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (max-width: 860px) { .site-header__burger { color: var(--text-strong); background: transparent; border: none; } }
