/* ============================================================
   WT Studio official website — design system (base.css)
   Visual source of truth: 10 reference frames (dark cyber + neon lime)
   ============================================================ */

:root {
    --bg-0: #020609;
    --bg-1: #03090d;
    --bg-2: #061015;
    --surface: rgba(7, 16, 21, 0.86);
    --surface-hover: rgba(10, 24, 29, 0.94);
    --lime: #bfff00;
    --lime-bright: #cfff20;
    --green: #73ff35;
    --emerald: #00e69a;
    --cyan: #22dfff;
    --blue: #5bc7ff;
    --text-primary: #f6f8f9;
    --text-secondary: #a8b1b6;
    --text-muted: #68747a;
    --border: rgba(130, 255, 80, 0.15);
    --border-active: rgba(190, 255, 0, 0.75);
    --glow-sm: 0 0 12px rgba(190, 255, 0, 0.2), 0 0 34px rgba(120, 255, 0, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
    --header-h: 72px;
    --font: "Be Vietnam Pro", "Inter", "Segoe UI", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background: var(--bg-0);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

::selection {
    background: rgba(191, 255, 0, 0.28);
}

/* ---------- cyber background layers ---------- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(130, 255, 80, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(130, 255, 80, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.4) 60%, transparent 96%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(circle at 82% 8%, rgba(34, 223, 255, 0.07), transparent 30%),
        radial-gradient(circle at 12% 38%, rgba(191, 255, 0, 0.05), transparent 26%),
        radial-gradient(circle at 60% 90%, rgba(115, 255, 53, 0.04), transparent 30%),
        linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 52%, var(--bg-0) 100%);
}

.circuit-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.circuit-deco::before,
.circuit-deco::after {
    content: "";
    position: absolute;
    width: 420px;
    height: 420px;
    opacity: 0.07;
    background:
        linear-gradient(90deg, transparent 49.6%, var(--lime) 49.6%, var(--lime) 50.4%, transparent 50.4%) 0 0 / 84px 84px,
        linear-gradient(transparent 49.6%, var(--lime) 49.6%, var(--lime) 50.4%, transparent 50.4%) 0 0 / 84px 84px;
    mask-image: radial-gradient(circle at 30% 30%, #000, transparent 70%);
}

.circuit-deco::before {
    left: -140px;
    top: 120px;
    transform: rotate(8deg);
}

.circuit-deco::after {
    right: -160px;
    top: 40%;
    transform: rotate(-6deg);
}

/* ---------- layout ---------- */
.container {
    width: min(1440px, 100% - 96px);
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .container {
        width: min(1440px, 100% - 48px);
    }
}

@media (max-width: 640px) {
    .container {
        width: calc(100% - 40px);
    }
}

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 10px;
    z-index: 60;
    margin: 12px auto 0;
    width: min(1440px, 100% - 48px);
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    border: 1px solid rgba(130, 255, 80, 0.12);
    border-radius: 18px;
    background: rgba(2, 8, 10, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    margin-right: auto;
}

.brand img {
    width: 30px;
    height: 30px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.main-nav a {
    position: relative;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    padding: 24px 2px;
    transition: color 0.16s ease;
}

.main-nav a:hover {
    color: var(--text-primary);
}

.main-nav a.is-active {
    color: var(--lime);
}

.main-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    height: 2px;
    background: var(--lime);
    box-shadow: 0 0 10px rgba(191, 255, 0, 0.7);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.lang-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(130, 255, 80, 0.18);
    border-radius: 10px;
    background: rgba(10, 24, 29, 0.6);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease;
}

.lang-btn:hover {
    border-color: var(--border-active);
    color: var(--lime);
}

.menu-toggle {
    display: none;
}

.mobile-menu {
    display: none;
    position: fixed;
    z-index: 70;
    top: 92px;
    left: 24px;
    right: 24px;
    padding: 18px 22px 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(2, 8, 10, 0.97);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.mobile-menu.is-open {
    display: grid;
    gap: 4px;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 12px 6px;
    border-bottom: 1px solid rgba(130, 255, 80, 0.08);
}

.mobile-menu a:last-child {
    border-bottom: 0;
}

.mobile-menu a.is-active {
    color: var(--lime);
}

@media (max-width: 1024px) {
    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: rgba(10, 24, 29, 0.6);
        color: var(--text-primary);
        cursor: pointer;
    }
}

/* ---------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 26px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.14s ease, filter 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(115deg, var(--lime-bright), var(--lime) 55%, #a8e600);
    color: #06100a;
    box-shadow: var(--glow-sm);
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: rgba(130, 255, 80, 0.45);
}

.btn-secondary:hover {
    border-color: var(--border-active);
    transform: translateY(-1px);
    box-shadow: var(--glow-sm);
}

.btn-ghost {
    background: rgba(10, 24, 29, 0.7);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--border-active);
}

.btn-sm {
    min-height: 42px;
    padding: 0 18px;
    font-size: 14px;
    border-radius: 10px;
}

.btn .ic {
    width: 18px;
    height: 18px;
}

/* ---------- badges / labels ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: 1px solid rgba(190, 255, 0, 0.4);
    border-radius: 999px;
    color: var(--lime);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(191, 255, 0, 0.05);
}

.section-label {
    color: var(--lime);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* ---------- typography ---------- */
.h-hero {
    margin: 0;
    font-size: clamp(40px, 4.6vw, 68px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.h-page {
    margin: 0;
    font-size: clamp(38px, 4.2vw, 60px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.h-section {
    margin: 0;
    font-size: clamp(30px, 3vw, 44px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hl {
    color: var(--lime);
}

.lead {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.7;
    max-width: 640px;
}

/* ---------- cards ---------- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(150deg, rgba(10, 22, 27, 0.9), rgba(4, 10, 14, 0.92));
    padding: 24px;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(190, 255, 0, 0.35);
}

.icon-tile {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(190, 255, 0, 0.5);
    border-radius: 12px;
    color: var(--lime);
    background: rgba(191, 255, 0, 0.06);
    box-shadow: inset 0 0 18px rgba(191, 255, 0, 0.07);
}

.icon-tile svg {
    width: 26px;
    height: 26px;
}

/* ---------- benefit mini row ---------- */
.benefit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 28px;
    border-left: 1px solid rgba(130, 255, 80, 0.14);
}

.benefit-item:first-child {
    border-left: 0;
    padding-left: 0;
}

.benefit-item .ic {
    width: 26px;
    height: 26px;
    color: var(--lime);
    flex: none;
}

.benefit-item b {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.benefit-item span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 768px) {
    .benefit-row {
        gap: 14px;
    }

    .benefit-item {
        border-left: 0;
        padding: 4px 0;
        width: 100%;
    }
}

/* ---------- reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ---------- section spacing ---------- */
.section {
    padding: 84px 0;
}

.section-tight {
    padding: 56px 0;
}

/* ---------- footer ---------- */
.site-footer {
    border-top: 1px solid rgba(130, 255, 80, 0.1);
    background: rgba(2, 6, 9, 0.9);
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding: 56px 0 40px;
}

.footer-grid h4 {
    margin: 0 0 14px;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lime);
}

.footer-grid a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 5px 0;
}

.footer-grid a:hover {
    color: var(--lime);
}

.footer-grid p {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    border-top: 1px solid rgba(130, 255, 80, 0.08);
    padding: 18px 0 22px;
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    background: rgba(1, 4, 6, 0.88);
    backdrop-filter: blur(8px);
}

.lightbox.is-open {
    display: flex;
}

.lightbox figure {
    margin: 0;
    max-width: min(1200px, 92vw);
    position: relative;
}

.lightbox img {
    max-height: 78vh;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #05090c;
    transition: transform 0.25s ease;
    cursor: zoom-in;
}

.lightbox img.is-zoomed {
    transform: scale(1.6);
    cursor: zoom-out;
}

.lightbox figcaption {
    margin-top: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.lightbox-btn {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: rgba(6, 14, 18, 0.85);
    color: var(--text-primary);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.lightbox-btn:hover {
    border-color: var(--border-active);
    color: var(--lime);
}

.lightbox-close {
    top: -56px;
    right: 0;
}

.lightbox-prev {
    left: -64px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: -64px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 1200px) {
    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }
}

/* ---------- toast ---------- */
.toast-zone {
    position: fixed;
    z-index: 100;
    bottom: 24px;
    right: 24px;
    display: grid;
    gap: 10px;
}

.toast {
    min-width: 260px;
    max-width: 380px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--lime);
    border-radius: 12px;
    background: rgba(6, 14, 18, 0.95);
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    animation: toast-in 0.25s ease;
}

.toast.is-error {
    border-left-color: #ff7e8a;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- accordion ---------- */
.acc-item {
    border-bottom: 1px solid rgba(130, 255, 80, 0.1);
}

.acc-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: none;
    border: 0;
    color: var(--text-primary);
    padding: 16px 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.acc-head:hover {
    color: var(--lime);
}

.acc-head .chev {
    transition: transform 0.2s ease;
    color: var(--lime);
    flex: none;
}

.acc-item.is-open .acc-head .chev {
    transform: rotate(90deg);
}

.acc-body {
    display: none;
    padding: 0 4px 18px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.acc-item.is-open .acc-body {
    display: block;
}

/* ---------- forms ---------- */
.field {
    width: 100%;
    min-height: 50px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(6, 14, 18, 0.8);
    color: var(--text-primary);
    font: inherit;
    font-size: 15px;
}

.field:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(191, 255, 0, 0.12);
}

select.field {
    appearance: none;
}

/* ---------- code block ---------- */
.codebox {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(190, 255, 0, 0.3);
    border-radius: 12px;
    background: rgba(4, 12, 10, 0.9);
    padding: 14px 18px;
    font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
    color: var(--lime);
    font-size: 13.5px;
    overflow-x: auto;
    white-space: nowrap;
}

.codebox code {
    flex: 1;
}

@media (max-width: 1024px) {
    .codebox {
        white-space: normal;
        align-items: flex-start;
        flex-direction: column;
    }

    .codebox code {
        word-break: break-all;
        margin-bottom: 10px;
    }
}

/* ---------- misc ---------- */
.divider {
    height: 1px;
    background: rgba(130, 255, 80, 0.1);
    border: 0;
}

.muted {
    color: var(--text-muted);
}

.secondary {
    color: var(--text-secondary);
}

.mono {
    font-family: "Cascadia Code", Consolas, monospace;
}

:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001s !important;
        transition-duration: 0.001s !important;
    }
}

/* ===== WebThreads — nền ambient cho hero (vanilla WebGL2, xem web-threads.js) ===== */
.web-threads {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 98%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 98%);
}

.web-threads canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.home-hero > .container,
.page-hero > .container {
    position: relative;
    z-index: 1;
}