:root {
    --red: #C21807;
    --red-dark: #8C1104;
    --amber: #F59E0B;
    --green: #059669;
    --blue: #2563EB;
}

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f8fafc;
}
::-webkit-scrollbar-thumb {
    background: var(--red);
    border-radius: 3px;
}

html {
    scroll-behavior: smooth;
}
body {
    font-family: 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── TOPBAR ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    height: 50px;
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.topbar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red-dark), var(--red), var(--amber));
}
.topbar-logo {
    width: 182px;
    height: 22px;
    background: url(https://cdn.baohatinh.vn/assets/web/styles/img/logo.svg) no-repeat 0 0;
    text-indent: -999em;
    display: block;
}
.topbar-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #333;
    text-decoration: none;
}
.topbar-label:hover {
    color: var(--red);
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: #1877f2;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    text-decoration: none;
    transition: opacity .2s;
}
.share-btn:hover {
    opacity: .85;
}

/* ── HERO ── */
.hero {
    background: #0f172a;
    position: relative;
    overflow: hidden;
    padding: 64px 0 56px;
}
.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(194,24,7,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(194,24,7,.07) 1px, transparent 1px);
    background-size: 40px 40px;
}
.hero-glow-1 {
    position: absolute;
    top: -80px;
    left: -80px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(194,24,7,.25) 0%, transparent 70%);
}
.hero-glow-2 {
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(245,158,11,.18) 0%, transparent 70%);
}
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(194,24,7,.18);
    border: 1px solid rgba(194,24,7,.4);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.hero-title {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
}
.hero-title span {
    color: #fca5a5;
}
.hero-sub {
    font-size: clamp(14px, 2vw, 18px);
    color: #94a3b8;
    font-weight: 400;
    line-height: 1.7;
}

/* big counter */
.big-num {
    font-size: clamp(56px, 10vw, 100px);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* ── NAV PILLS ── */
.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .25s;
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.nav-pill-active {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 14px rgba(194,24,7,.35);
}
.nav-pill-outline {
    background: rgba(255,255,255,.08);
    color: #cbd5e1;
    border-color: rgba(255,255,255,.12);
}
.nav-pill-outline:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
    border-color: rgba(255,255,255,.25);
}

/* ── SECTION WRAPPERS ── */
.sec-white {
    background: #fff;
}
.sec-slate {
    background: #f8fafc;
}
.sec-dark  {
    background: #0f172a;
}
.sec-tint  {
    background: #fff5f5;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 72px 20px;
}

/* ── SECTION HEADING ── */
.sec-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 40px;
}
.sec-num {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    background: var(--red);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .05em;
    margin-top: 4px;
}
.sec-title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 900;
    color: #0f172a;
    line-height: 1.3;
    text-transform: uppercase;
}
.sec-title-dark {
    color: #f1f5f9;
}

/* ── CARDS ── */
.card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.card-dark {
    background: #1e293b;
    border-color: #334155;
}

/* top-accent stripe */
.card-red    {
    border-top: 3px solid var(--red);
}
.card-amber  {
    border-top: 3px solid var(--amber);
}
.card-green  {
    border-top: 3px solid var(--green);
}
.card-blue   {
    border-top: 3px solid var(--blue);
}

/* ── STAT STRIP ── */
.stat-strip {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.stat-val {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.stat-unit {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

/* ── FUNNEL / TRANSFORM ── */
.funnel-block {
    position: relative;
    padding: 28px 24px;
    border-radius: 16px;
}
.funnel-before {
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
}
.funnel-after {
    background: linear-gradient(135deg, #fef2f2, #fff5f5);
    border: 1.5px solid rgba(194,24,7,.2);
}
.funnel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

/* ── BAR ── */
@keyframes bar-grow {
    from {
        width: 0;
    }
}
.bar-anim {
    animation: bar-grow 1s cubic-bezier(.22,1,.36,1) .3s both;
}

/* ── PRINCIPLE CARD ── */
.principle-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px 24px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: box-shadow .25s;
}
.principle-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.principle-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* ── TIMELINE ── */
.tl-wrap {
    position: relative;
    padding-left: 28px;
}
.tl-wrap::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: linear-gradient(to bottom, var(--red), #e2e8f0);
    border-radius: 2px;
}
.tl-dot {
    position: absolute;
    left: 0;
    top: 14px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--red);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(194,24,7,.2);
}
.tl-item {
    position: relative;
    margin-bottom: 32px;
}
.tl-item:last-child {
    margin-bottom: 0;
}
.tl-item:last-child .tl-dot {
    background: #e2e8f0;
    box-shadow: none;
}

/* ── DOT GRID VISUALIZATION ── */
.dot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 420px;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-active {
    background: var(--red);
}
.dot-removed {
    background: #e2e8f0;
}

/* ── DIVIDER ── */
.divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0 30%, #e2e8f0 70%, transparent);
    margin: 0;
}

/* ── FOOTER ── */
.footer {
    background: #0f172a;
    color: #64748b;
    padding: 40px 20px 60px;
    position: relative;
    overflow: hidden;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red-dark), var(--red), var(--amber));
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* scrollreveal helper */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to   {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-up {
    animation: fade-up .65s ease both;
}
.delay-1 {
    animation-delay: .1s;
}
.delay-2 {
    animation-delay: .2s;
}
.delay-3 {
    animation-delay: .3s;
}
.delay-4 {
    animation-delay: .4s;
}

/* responsive helper classes */
.md-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 640px) {
    .md-grid-2,.mbgrid {
        grid-template-columns: 1fr!important;
    }
}

@media (max-width: 640px) {
    .section-inner {
        padding: 48px 16px;
    }
}
@media (max-width: 768px) {
    #principle-grid-3,.mbgrid {
        grid-template-columns: 1fr !important;
    }
    #lotinh-steps {
        grid-template-columns: 1fr !important;
    }
    #lotinh-steps > div {
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,.07);
    }
    #lotinh-steps > div:last-child {
        border-bottom: none;
    }
    #merge-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #merge-grid > div {
        border-right: none !important;
        border-bottom: 1px solid #f1f5f9;
    }
    #result-grid {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 480px) {
    #merge-grid,.mbgrid {
        grid-template-columns: 1fr !important;
    }
}