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

:root {
    --bg: #050508;
    --bg-card: #0d0d12;
    --bg-card-hover: #14141c;
    --accent: #D4AF37;
    --accent-glow: rgba(212, 175, 55, 0.3);
    --accent2: #a78bfa;
    --text: #f0f0f5;
    --text-muted: #6b6b80;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.hidden { display: none !important; }
section { padding: 100px 0; }
.section-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section-title {
    font-size: 2.4rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.section-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ============ NAVBAR ============ */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 8, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.logo-icon { font-size: 1.1rem; }
.logo-accent { color: var(--accent); }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-cta:hover { box-shadow: 0 0 20px var(--accent-glow); transform: translateY(-1px); }

@media (max-width: 640px) {
    .nav-links { display: none; }
}

/* ============ HERO ============ */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}
.hero-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.4;
}
.hero-content { position: relative; z-index: 2; max-width: 700px; padding: 0 24px; }
.hero-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}
#hero h1 {
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #f5d060 50%, var(--accent2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 50px; flex-wrap: wrap; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #c9a030);
    color: #000;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}
.btn-primary:hover { box-shadow: 0 8px 30px var(--accent-glow); transform: translateY(-2px); }
.btn-primary.btn-small { padding: 10px 24px; font-size: 0.9rem; border-radius: 10px; }
.btn-ghost {
    color: var(--text-muted);
    text-decoration: none;
    padding: 14px 24px;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
}
.btn-ghost:hover { color: var(--text); }
.hero-stats { display: flex; gap: 0; justify-content: center; align-items: center; }
.stat {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0 20px;
}
.stat-num { color: var(--accent); font-weight: 700; }
.stat-sep { width: 1px; height: 20px; background: var(--border); }

@media (max-width: 640px) {
    #hero h1 { font-size: 2.4rem; }
    .hero-sub { font-size: 1rem; }
}

/* ============ FEATURES ============ */
#features { background: var(--bg); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    text-align: center;
    transition: all 0.3s;
}
.feature-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}
.feature-icon { font-size: 2.5rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

@media (max-width: 768px) {
    .features-grid { grid-template-columns: 1fr; }
}

/* ============ TRY-ON APP ============ */
.tryon-app {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 460px;
    overflow: hidden;
    position: relative;
}
.tryon-step {
    display: none;
    flex-direction: column;
    padding: 32px;
    animation: fadeStep 0.35s ease;
}
.tryon-step.active { display: flex; }
@keyframes fadeStep { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.step-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 24px;
}
.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}
.step-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
}
.step-back:hover { color: var(--text); }

/* Category Cards */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}
.cat-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.cat-card:hover {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.cat-emoji { font-size: 2rem; }
.cat-name { font-weight: 600; font-size: 0.9rem; }

/* Ring Grid */
.ring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.ring-grid .grid-item {
    aspect-ratio: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ring-grid .grid-item img { width: 100%; height: 100%; object-fit: cover; }
.ring-grid .grid-item.active {
    border: 2px solid var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.ring-grid .grid-item:hover { border-color: var(--border-hover); }

/* Import Row */
.import-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.import-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}
.import-btn:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.import-btn.danger { color: #ff5555; }

/* Params */
.param-group { display: flex; flex-direction: column; gap: 10px; }
.param-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 500;
}
.param-item:hover { border-color: var(--accent); background: rgba(212, 175, 55, 0.04); }
.param-item span { font-size: 1.3rem; }

/* Capture */
.capture-zone {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.capture-zone video { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 140px; height: 140px;
    border: 2px dashed var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.75);
}
.capture-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.btn-shutter {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-shutter:hover { transform: scale(1.08); box-shadow: 0 0 20px rgba(255,255,255,0.2); }

/* Loading */
.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    gap: 12px;
}
.spinner {
    width: 44px; height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track {
    width: 200px; height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.4s ease;
}

/* Result */
.result-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 16px;
}
.result-img {
    max-width: 100%;
    max-height: 50vh;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.result-tag {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.result-actions { display: flex; gap: 10px; }

/* ============ AR BETA SECTION ============ */
#ar-beta { padding: 60px 0; }
.ar-beta-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}
.ar-beta-card::after {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.15;
    pointer-events: none;
}
.beta-badge {
    background: var(--accent);
    color: #000;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.ar-beta-content h3 { font-size: 1.3rem; margin-bottom: 8px; }
.ar-beta-content p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

/* ============ AR OVERLAY ============ */
.ar-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
    background: #000;
}
.ar-video-bg {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}
.ar-canvas-overlay {
    position: absolute;
    width: 100%; height: 100%;
    pointer-events: none;
}
.ar-top-bar {
    position: absolute;
    top: 0; width: 100%;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.4);
    z-index: 30;
}
.ar-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ar-controls {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 12px 16px 28px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 60%, transparent);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 30;
}
.ar-finger-selector { display: flex; justify-content: center; gap: 10px; }
.ar-finger-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ar-finger-btn.active {
    border-color: var(--accent);
    background: rgba(212,175,55,0.2);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: scale(1.1);
}
.ar-style-row { display: flex; justify-content: center; align-items: center; gap: 20px; }
.ar-color-selector { display: flex; gap: 8px; }
.ar-color-btn {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.ar-color-btn.active {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
    transform: scale(1.15);
}
.ar-thickness-ctrl { display: flex; align-items: center; gap: 8px; }
.ar-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.ar-thickness-ctrl input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    outline: none;
}
.ar-thickness-ctrl input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
.ar-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.ar-badge.online {
    background: rgba(0,200,80,0.15);
    color: #00e050;
    border: 1px solid rgba(0,200,80,0.3);
}
.ar-badge.offline {
    background: rgba(255,60,60,0.15);
    color: #ff5555;
    border: 1px solid rgba(255,60,60,0.3);
}

/* ============ API SECTION ============ */
#api-section { background: var(--bg); }
.api-demo {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 32px;
    align-items: start;
}
.code-block {
    background: #0c0c14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.code-header {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }
.code-filename { margin-left: 12px; font-size: 0.75rem; color: var(--text-muted); }
.code-block pre {
    padding: 20px;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.8;
}
.code-block code { font-family: 'SF Mono', 'Fira Code', monospace; }
.code-comment { color: #6b7280; }
.code-tag { color: #f472b6; }
.code-attr { color: #a78bfa; }
.code-str { color: #34d399; }

.api-info h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.api-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.api-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}
.api-features li { font-size: 0.9rem; color: var(--text-muted); }

.api-guide {
    margin-top: 60px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
}
.api-guide h3 { font-size: 1.4rem; margin-bottom: 8px; }
.guide-subtitle { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 30px; }

.visual-guide {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}
.vg-code-editor {
    background: #0c0c14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.vg-body {
    padding: 24px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    color: #e0e0e0;
}
.vg-line { display: flex; align-items: center; flex-wrap: wrap; }
.vg-line.indent-1 { padding-left: 20px; }
.vg-line.indent-2 { padding-left: 40px; }
.vg-line.indent-3 { padding-left: 60px; }
.vg-tag { color: #f472b6; }
.text-content { color: #f0f0f5; }

.vg-highlight-box {
    margin: 16px 0;
    padding: 16px 0;
    position: relative;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
}
.vg-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--accent);
    color: #000;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.mt-10 { margin-top: 24px; }
.mb-10 { margin-bottom: 24px; }

@media (max-width: 768px) {
    .api-demo {
        grid-template-columns: 1fr;
    }
    .ar-beta-card { flex-direction: column; }
    .vg-line.indent-1 { padding-left: 10px; }
    .vg-line.indent-2 { padding-left: 20px; }
    .vg-line.indent-3 { padding-left: 30px; }
}

/* ============ FOOTER ============ */
footer {
    padding: 50px 0 30px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.footer-brand { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
footer p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 6px; }
.footer-copy { font-size: 0.75rem; color: rgba(255,255,255,0.2); margin-top: 16px; }