/* =========================================================
   Arcpoly AI Studio — Design System
   Dark theme · Accent #f54d2d
   ========================================================= */

:root {
    --bg-base:       #0a0a0b;
    --bg-elevated:   #131315;
    --bg-panel:      #1a1a1c;
    --bg-panel-2:    #222226;
    --bg-overlay:    rgba(14, 14, 14, 0.92);

    --accent:        #f54d2d;
    --accent-soft:   #ff6b4f;
    --accent-deep:   #c43a1f;
    --accent-glow:   rgba(245, 77, 45, 0.18);

    --success:       #10b981;
    --warning:       #f59e0b;
    --info:          #3b82f6;

    --text-primary:  #ffffff;
    --text-body:     #e5e7eb;
    --text-muted:    #a0a0a0;
    --text-faint:    #6b7280;

    --border:        #2a2a2e;
    --border-soft:   rgba(255,255,255,0.06);
    --border-strong: #3a3a3f;

    --radius-sm:  6px;
    --radius:     12px;
    --radius-lg:  20px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow:    0 8px 24px rgba(0,0,0,0.35);
    --shadow-lg: 0 24px 48px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --container: 1280px;
    --header-h:  72px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-base);
    color: var(--text-body);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a  { color: var(--accent); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-soft); }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5em;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.04em; }

p { margin: 0 0 1em; }

/* =================== Layout ==================== */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 920px; }
.container-wide   { max-width: 1480px; }

.section          { padding: 96px 0; }
.section-tight    { padding: 56px 0; }
.section-alt      { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.text-center { text-align: center; }
.text-accent { color: var(--accent) !important; }
.text-muted  { color: var(--text-muted) !important; }
.text-body   { color: var(--text-body) !important; }
.bg-panel    { background: var(--bg-panel); }
.lead { font-size: 1.15rem; color: var(--text-body); max-width: 740px; margin: 0 auto 32px; }

/* =================== Header ==================== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg-overlay);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    transition: all 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow); }
.site-header .inner {
    max-width: var(--container-wide, 1480px);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 40px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: white; letter-spacing: 0.5px; }
.brand img { height: 30px; }
.brand-text { font-size: 0.95rem; }

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    color: var(--text-body);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s var(--ease);
}
.nav a:hover, .nav a.active { color: white; background: rgba(255,255,255,0.05); }
.nav a.active { color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 12px; }
.lang-switch {
    display: inline-flex;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    font-size: 0.78rem;
    font-weight: 600;
}
.lang-switch button {
    border: 0; background: transparent; color: var(--text-muted);
    padding: 5px 12px; border-radius: 999px; cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: inherit;
}
.lang-switch button.active { background: var(--accent); color: white; }

.menu-toggle { display: none; background: none; border: 0; color: white; font-size: 1.5rem; cursor: pointer; }

/* Header CTA buttons — collapse text to icon-only on small screens */
@media (max-width: 640px) {
    .header-tools .lang-switch { display: none; }
}
@media (max-width: 480px) {
    .header-tools .btn-sm { font-size: 0; padding: 8px 10px; min-width: 36px; }
    .header-tools .btn-sm i { font-size: 0.95rem; margin: 0; }
}

/* =================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s var(--ease);
    line-height: 1;
}
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-deep); color: white; transform: translateY(-2px); box-shadow: var(--shadow-glow); }
.btn-ghost { background: transparent; color: white; border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: white; border-color: var(--accent); }
.btn-soft { background: var(--bg-panel); color: var(--text-body); border-color: var(--border); }
.btn-soft:hover { background: var(--bg-panel-2); color: white; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* =================== Hero ==================== */
.hero {
    position: relative;
    padding: calc(var(--header-h) + 80px) 0 96px;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(245,77,45,0.12), transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(245,77,45,0.08), transparent 50%),
        linear-gradient(180deg, rgba(14,14,14,0.85), rgba(14,14,14,0.97)),
        url('../img/background.jpg') center/cover no-repeat;
    z-index: -1;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 .accent-line { display: inline-block; color: var(--accent); position: relative; }
.hero p.lead { color: var(--text-body); font-size: 1.2rem; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-panel); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 16px;
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-body); margin-bottom: 24px;
}
.hero-badge i { color: var(--accent); }

.hero-stats {
    display: flex; gap: 48px;
    justify-content: center;
    margin-top: 48px;
    flex-wrap: wrap;
}
.hero-stat .num { font-size: 2.4rem; font-weight: 700; color: white; line-height: 1; }
.hero-stat .num span { color: var(--accent); }
.hero-stat .label { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }

/* =================== Section heading ==================== */
.section-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 56px;
}
.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* =================== Cards / Features ==================== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 992px) {
    .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }

.card-img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; border-bottom: 1px solid var(--border); }
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-tag {
    display: inline-block;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
    color: var(--accent); text-transform: uppercase;
    margin-bottom: 8px;
}
.card-title { font-size: 1.05rem; text-transform: uppercase; margin: 0 0 10px; }
.card-text { color: var(--text-body); font-size: 0.9rem; flex: 1; margin: 0 0 16px; line-height: 1.55; }
.card-link {
    color: var(--accent); font-size: 0.85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    align-self: flex-start;
}
.card-link:hover { gap: 10px; }
.card-link i { margin-left: 6px; transition: margin 0.2s var(--ease); }
.card-link:hover i { margin-left: 10px; }

.card.is-new::after {
    content: 'NEW';
    position: absolute;
    top: 12px; right: 12px;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 999px;
    letter-spacing: 0.1em;
}
.card { position: relative; }

/* =================== Pricing ==================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    align-items: stretch;
}
@media (max-width: 1100px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .pricing-grid { grid-template-columns: 1fr; } }

.price-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s var(--ease);
}
.price-card:hover { border-color: var(--border-strong); }
.price-card.popular {
    border: 2px solid var(--accent);
    box-shadow: var(--shadow-glow);
    transform: scale(1.04);
    z-index: 1;
}
.popular-badge {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: white;
    padding: 6px 16px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
}
.price-old { text-decoration: line-through; color: var(--text-faint); font-size: 1rem; }
.price-now { font-size: 2.4rem; font-weight: 800; color: white; margin: 8px 0 16px; }
.price-now small { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.price-features { list-style: none; padding: 0; margin: 0 0 28px; text-align: left; }
.price-features li {
    color: var(--text-body); font-size: 0.9rem;
    padding: 6px 0;
    display: flex; align-items: flex-start; gap: 10px;
}
.price-features i { color: var(--success); margin-top: 4px; }
@media (max-width: 1100px) { .price-card.popular { transform: none; } }

/* =================== Tables ==================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.table {
    width: 100%; border-collapse: collapse; background: var(--bg-panel);
    font-size: 0.92rem;
}
table.table th, table.table td { padding: 16px 20px; text-align: center; border-bottom: 1px solid var(--border); }
table.table th { background: var(--bg-panel-2); color: white; font-weight: 600; }
table.table tr:last-child td { border-bottom: 0; }
table.table tr:hover td { background: rgba(255,255,255,0.03); }
table.table td:first-child, table.table th:first-child { text-align: left; color: white; font-weight: 600; }

/* =================== Steps / Timeline ==================== */
.steps { display: grid; gap: 24px; }
.step {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    align-items: start;
}
.step .num {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800;
    box-shadow: var(--shadow-glow);
}
.step h3 { margin-top: 0; }
.step .meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }

/* =================== Accordion ==================== */
.acc-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; background: var(--bg-panel); overflow: hidden; }
.acc-head {
    width: 100%; text-align: left;
    background: transparent;
    border: 0; color: white;
    padding: 18px 24px;
    font-size: 1rem; font-weight: 600;
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-family: inherit;
}
.acc-head .icon { transition: transform 0.3s var(--ease); color: var(--accent); }
.acc-item.open .acc-head .icon { transform: rotate(45deg); }
.acc-body { padding: 0 24px 24px; color: var(--text-body); display: none; line-height: 1.7; }
.acc-item.open .acc-body { display: block; }

/* =================== Blog ==================== */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 992px) { .blog-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 580px) { .blog-grid { grid-template-columns: 1fr; } }

.post-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s var(--ease);
}
.post-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.post-thumb { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-body { padding: 24px; }
.post-meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 0.8rem; margin-bottom: 12px; }
.post-cat { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.post-title { font-size: 1.2rem; line-height: 1.35; margin: 0 0 12px; }
.post-title a { color: white; }
.post-title a:hover { color: var(--accent); }
.post-excerpt { color: var(--text-body); font-size: 0.92rem; margin: 0 0 16px; }

/* =================== Course =================== */
.course-card {
    background: linear-gradient(160deg, var(--bg-panel), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.course-card .badge { align-self: flex-start; background: var(--accent-glow); color: var(--accent); padding: 4px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; }
.course-card ul { padding-left: 20px; color: var(--text-body); }
.course-card li { margin: 6px 0; }

/* =================== Forms ==================== */
.form-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.field { margin-bottom: 18px; }
.field label { display: block; color: var(--text-body); margin-bottom: 6px; font-size: 0.88rem; font-weight: 500; }
.field input, .field textarea, .field select {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border);
    color: white;
    padding: 12px 14px;
    border-radius: 8px;
    font-family: inherit; font-size: 0.95rem;
    transition: border-color 0.2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 120px; resize: vertical; }

/* =================== Breadcrumbs =================== */
.breadcrumbs { padding: calc(var(--header-h) + 32px) 0 0; color: var(--text-muted); font-size: 0.85rem; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 8px; color: var(--text-faint); }

/* =================== Footer =================== */
.site-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 64px 0 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h5 { color: white; font-size: 0.95rem; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.08em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 8px 0; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; }
.social { display: flex; gap: 10px; }
.social a {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-body);
}
.social a:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* =================== Utility =================== */
.fade-in { opacity: 0; transform: translateY(20px); transition: all 0.7s var(--ease); }
.fade-in.in { opacity: 1; transform: translateY(0); }

.divider { height: 1px; background: var(--border); margin: 48px 0; }

.kbd {
    display: inline-block;
    background: var(--bg-panel-2); border: 1px solid var(--border);
    border-bottom-width: 2px;
    color: white;
    padding: 1px 8px;
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.85em;
}

.callout {
    background: rgba(245,77,45,0.08);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 16px 20px;
    color: var(--text-body);
    margin: 20px 0;
}
.callout-info { background: rgba(59,130,246,0.08); border-color: var(--info); }
.callout-warn { background: rgba(245,158,11,0.08); border-color: var(--warning); }

.video-frame {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }

/* =================== Responsive nav =================== */
@media (max-width: 992px) {
    .nav { position: fixed; top: var(--header-h); left: 0; right: 0;
        flex-direction: column;
        background: var(--bg-elevated);
        padding: 16px;
        gap: 4px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-200%);
        transition: transform 0.3s var(--ease);
    }
    .nav.open { transform: translateY(0); }
    .nav a { padding: 12px 16px; }
    .menu-toggle { display: block; }
}

/* =================== Lang visibility =================== */
[data-lang] { display: none; }
html[lang="vi"] [data-lang="vi"],
html[lang="en"] [data-lang="en"] { display: revert; }
