/* --- Global Variables & Design System --- */
:root {
    --primary: #6366f1;
    --primary-bright: #818cf8;
    --secondary: #2dd4bf;
    --accent: #a855f7;
    --bg-deep: #020617;
    --bg-card: rgba(15, 23, 42, 0.65);
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-lg: 24px;
    --radius-md: 14px;
    --easing: cubic-bezier(0.16, 1, 0.3, 1);
    --primary-glow: rgba(99, 102, 241, 0.4);
}

/* --- Base Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
body { background: var(--bg-deep); color: var(--text-main); font-family: var(--font-sans); line-height: 1.6; overflow-x: hidden; }
.container { max-width: 1366px; margin: 0 auto; padding: 0 32px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
section { padding: 100px 0; }

.bg-glow {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15), transparent 45%),
                radial-gradient(circle at 20% 80%, rgba(45, 212, 191, 0.1), transparent 45%);
    z-index: -1; pointer-events: none;
}

.glass { background: var(--bg-card); backdrop-filter: blur(20px); border: 1px solid var(--border); }
.text-gradient { background: linear-gradient(135deg, #818cf8, #2dd4bf); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- Navigation --- */
.main-nav { position: fixed; top: 0; width: 100%; z-index: 1000; height: 80px; background: rgba(2, 6, 23, 0.8); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.25rem; cursor: pointer; flex-shrink: 0; }
.logo-text { display: flex; align-items: center; gap: 6px; }
.logo-text .dim { color: var(--text-dim); font-weight: 400; margin-left: 2px; opacity: .7; font-size: 80%;}
.nav-links { display: flex; list-style: none; gap: 32px; }
.nav-links a { color: var(--text-dim); font-size: 0.9rem; font-weight: 600; }
.nav-links a:hover { color: var(--text-main); }

.lang-selector { position: relative; flex-shrink: 0; }
.lang-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: white; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.lang-dropdown { position: absolute; top: calc(100% + 10px); right: 0; background: #0f172a; border: 1px solid var(--border); border-radius: 14px; padding: 8px; width: 140px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.3s var(--easing); }
.lang-selector:hover .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-dropdown a { display: block; padding: 10px 16px; border-radius: 8px; font-size: 0.85rem; color: var(--text-dim); font-weight: 600; }
.lang-dropdown a.active { color: var(--primary-bright); background: rgba(99, 102, 241, 0.1); }

/* --- Hero --- */
.hero { padding: 200px 0 100px; text-align: center; }
.badge { display: inline-flex; align-items: center; gap: 10px; background: rgba(99, 102, 241, 0.1); color: var(--primary-bright); padding: 8px 24px; border-radius: 40px; font-size: 0.7rem; font-weight: 800; border: 1px solid rgba(99, 102, 241, 0.2); margin-bottom: 32px; letter-spacing: 1px; }
.pulse { width: 8px; height: 8px; background: var(--primary-bright); border-radius: 50%; animation: pulseAnim 2s infinite; }
@keyframes pulseAnim { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.5; } }
.hero-title { font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 800; line-height: 1.1; margin-bottom: 32px; letter-spacing: -3px; }
.hero-subtitle { color: var(--text-dim); max-width: 650px; margin: 0 auto 48px; font-size: 1.2rem; }
.hero-btns { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }

.btn-primary { background: var(--primary); color: white; border: none; padding: 16px 40px; border-radius: 14px; font-weight: 700; cursor: pointer; transition: 0.3s; box-shadow: 0 10px 20px var(--primary-glow); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 30px var(--primary-glow); }
.btn-outline { background: transparent; color: white; border: 1px solid var(--border); padding: 16px 40px; border-radius: 14px; font-weight: 700; cursor: pointer; transition: 0.3s; }
.btn-outline:hover { background: rgba(255,255,255,0.05); transform: translateY(-3px); }
.btn-outline.sm { padding: 8px 16px;font-size: 0.8rem; }

/* --- Evolution Section --- */
.section-head { text-align: center; margin-bottom: 60px; }
.section-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 16px; }
.section-desc { color: var(--text-dim); font-size: 1.1rem; }

.evolution-wrapper { display: grid; grid-template-columns: 320px 1fr; border-radius: var(--radius-lg); overflow: hidden; margin-top: 50px; }
.evo-nav { background: rgba(0, 0, 0, 0.3); padding: 40px 24px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.evo-item { padding: 24px; border-radius: 20px; background: transparent; border: 1px solid transparent; text-align: left; cursor: pointer; transition: 0.4s var(--easing); display: flex; flex-direction: column; gap: 8px; color: var(--text-dim); }
.evo-item.active { background: rgba(99, 102, 241, 0.1); border-color: rgba(99, 102, 241, 0.3); color: var(--text-main); transform: translateX(10px); }
.evo-num { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 800; color: var(--primary-bright); }
.evo-label { font-size: 1.3rem; font-weight: 800; }

.evo-content-container { padding: 60px; background: rgba(0, 0, 0, 0.1); }
.evo-detail { display: none; animation: fadeIn 0.5s var(--easing); }
.evo-detail.active { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Visual Diagrams (Keep for functionality) */
.evo-visual-box { background: #000; border-radius: var(--radius-lg); height: 400px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; border: 1px solid var(--border); }
.evo-overlay-label { position: absolute; bottom: 20px; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); background: rgba(0,0,0,0.8); padding: 8px 18px; border-radius: 20px; z-index: 10; }

/* Web 1.0 Diagram */
.diagram-1-broadcast { display: flex; flex-direction: column; align-items: center; width: 100%; }
.server-unit { width: 100px; height: 120px; background: #1e293b; border: 2px solid var(--primary-bright); border-radius: 8px; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 0 30px var(--primary-glow); color: var(--primary-bright); font-weight: 800; font-size: 0.7rem; }
.server-glow { position: absolute; top: -10px; width: 40px; height: 4px; background: #fff; box-shadow: 0 0 20px #fff; animation: blink 1.5s infinite; }
.flow-lines { height: 100px; display: flex; gap: 30px; margin: 15px 0; }
.f-line { width: 2px; height: 100%; background: linear-gradient(180deg, var(--primary-bright), transparent); position: relative; }
.f-line::after { content: ''; position: absolute; top: -10px; left: -2px; width: 6px; height: 6px; background: #fff; border-radius: 50%; animation: flowDown 2.5s infinite linear; }
.client-row { display: flex; gap: 20px; }
.client-unit { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.65rem; color: var(--text-dim); background: rgba(255,255,255,0.02); }

@keyframes flowDown { from { top: 0; opacity: 1; } to { top: 100%; opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* Web 2.0 Diagram */
.diagram-2-orbit { position: relative; width: 300px; height: 300px; display: flex; align-items: center; justify-content: center; }
.platform-core { width: 100px; height: 100px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 5; font-weight: 900; font-size: 0.7rem; box-shadow: 0 0 50px var(--primary-glow); color: #fff; }
.orbit-path { position: absolute; border: 1px dashed rgba(255,255,255,0.1); border-radius: 50%; }
.path-1 { width: 200px; height: 200px; }
.path-2 { width: 280px; height: 280px; }
.user-node { position: absolute; padding: 5px 12px; background: #0f172a; border: 1px solid var(--border); border-radius: 20px; font-size: 0.6rem; font-weight: 700; color: var(--secondary); }
.node-a { animation: orbitRotate 10s infinite linear; }
.node-b { animation: orbitRotate 15s infinite linear reverse; }
.node-c { animation: orbitRotate 20s infinite linear; }
@keyframes orbitRotate { from { transform: rotate(0deg) translate(120px) rotate(0deg); } to { transform: rotate(360deg) translate(120px) rotate(-360deg); } }

/* Web 3.0 Diagram */
.diagram-3-mesh { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.mesh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; z-index: 2; }
.m-node { width: 60px; height: 60px; background: rgba(45, 212, 191, 0.1); border: 1px solid var(--secondary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; animation: pulseNode 3s infinite ease-in-out; }
.mesh-lines { position: absolute; width: 240px; height: 240px; background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 85px 85px; opacity: 0.3; }
@keyframes pulseNode { 0%, 100% { transform: scale(1); box-shadow: 0 0 0px var(--secondary); } 50% { transform: scale(1.1); box-shadow: 0 0 20px var(--secondary); } }

/* --- Pillars Card Grid --- */
/* FIXED: Responsive min-width for mobile */
.concepts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 40px; }
.concept-card-v2 { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px; transition: 0.4s; }
.concept-card-v2:hover { border-color: var(--primary-bright); transform: translateY(-5px); }
.concept-icon-box { width: 56px; height: 56px; background: rgba(99, 102, 241, 0.1); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--primary-bright); border: 1px solid var(--primary-glow); margin-bottom: 24px; }

/* --- Glossary --- */
.glossary-container { display: grid; grid-template-columns: 320px 1fr; border-radius: var(--radius-lg); overflow: hidden; margin-top: 40px; }
.glossary-sidebar { background: rgba(0,0,0,0.3); border-right: 1px solid var(--border); padding: 24px; overflow-y: auto; }
.glossary-tab { width: 100%; padding: 14px 20px; border: none; border-radius: 12px; background: transparent; color: var(--text-dim); text-align: left; cursor: pointer; font-weight: 600; margin-bottom: 8px; transition: 0.2s; }
.glossary-tab.active { background: var(--primary); color: white; }
.glossary-item { padding: 60px; display: none; overflow-y: auto; height: 100%; }
.glossary-item.active { display: block; animation: fadeIn 0.4s; }
.glossary-title { font-size: 2.5rem; font-weight: 800; color: var(--primary-bright); margin-bottom: 24px; }
.glossary-body { font-size: 1.15rem; line-height: 1.8; color: var(--text-main); }
.glossary-example { padding: 20px; background: rgba(99, 102, 241, 0.05); border-radius: 12px; font-style: italic; color: var(--primary-bright); margin-top: 30px; font-size: 0.95rem; border: 1px dashed var(--border); }

/* --- Navigator & Filters --- */
.blog-filters { display: flex; justify-content: center; gap: 12px; margin-bottom: 40px; overflow-x: auto; padding: 0 10px 10px; scrollbar-width: none; -ms-overflow-style: none; }
.blog-filters::-webkit-scrollbar { display: none; }
.filter-btn { padding: 10px 24px; border-radius: 30px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: var(--text-dim); font-weight: 700; cursor: pointer; transition: 0.3s; white-space: nowrap; font-size: 0.85rem; }
.filter-btn:hover { border-color: var(--primary); color: var(--text-main); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 0 20px var(--primary-glow); }

/* FIXED: Safer min-width for mobile */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 20px; }
.blog-card { padding: 40px; cursor: pointer; border-radius: var(--radius-lg); transition: 0.4s; position: relative; overflow: hidden; animation: cardEntry 0.5s var(--easing); }
.blog-card:hover { border-color: var(--primary-bright); transform: translateY(-8px); }
.card-tag { position: absolute; top: 20px; right: 24px; font-size: 0.65rem; font-weight: 800; background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 6px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }
@keyframes cardEntry { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* --- Hash Lab (Input & Output Areas) --- */
.lab-card-v2 { padding: 48px; border-radius: var(--radius-lg); margin-top: 40px; }
.lab-v2-header { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.lab-v2-icon { width: 52px; height: 52px; background: var(--primary); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: white; }
.lab-v2-body { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.lab-v2-input-area, .lab-v2-output-area { display: flex; flex-direction: column; gap: 12px; }
.lab-v2-input-area label, .lab-v2-output-area label { 
    font-family: var(--font-mono); 
    font-size: 0.65rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    color: var(--text-dim); 
    letter-spacing: 1px;
}

textarea#hash-input { width: 100%; height: 220px; background: rgba(0,0,0,0.4); border: 1px solid var(--border); border-radius: 16px; padding: 24px; color: white; font-family: var(--font-mono); resize: none; font-size: 1rem; transition: 0.3s; }
textarea#hash-input:focus { border-color: var(--primary-bright); background: rgba(0,0,0,0.6); }
.hash-display { background: #000; padding: 24px; border-radius: 16px; color: var(--secondary); font-family: var(--font-mono); word-break: break-all; min-height: 220px; display: flex; align-items: center; border: 1px solid var(--border); line-height: 1.4; }

/* --- Quiz Section --- */
.quiz-card { padding: 80px 60px; text-align: center; border-radius: var(--radius-lg); margin-top: 40px; }
.quiz-badge { font-family: var(--font-mono); font-size: 0.7rem; color: var(--primary-bright); letter-spacing: 2px; margin-bottom: 20px; }

.quiz-body { 
    margin-top: 40px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    max-width: 700px; 
    margin-left: auto; 
    margin-right: auto;
    transition: all 0.3s ease;
}
.quiz-opt { width: 100%; padding: 18px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 12px; color: white; text-align: left; margin-bottom: 12px; cursor: pointer; transition: 0.2s; font-weight: 600; font-size: 1rem; }
.quiz-opt:hover { background: rgba(255,255,255,0.08); border-color: var(--primary); transform: translateX(5px); }

/* --- Security Phishing Simulator --- */
.security-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; margin-top: 40px; }
.scam-mockup { border-radius: var(--radius-lg); overflow: hidden; background: #0f172a; border: 1px solid var(--border); }
.browser-bar { background: #1e293b; padding: 12px 20px; display: flex; align-items: center; }
.browser-url { background: #0f172a; padding: 8px 16px; border-radius: 8px; font-size: 0.75rem; flex: 1; color: var(--text-dim); }
.wallet-popup-v2 { width: 280px; margin: 40px auto; background: #1e293b; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 30px 60px rgba(0,0,0,0.5); overflow: hidden; }
.wallet-v2-header { padding: 15px 20px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 0.85rem; }
.wallet-v2-body { padding: 24px; text-align: center; }
.danger-indicator { color: #f87171; font-weight: 800; margin-bottom: 15px; }
.wallet-v2-footer { display: flex; gap: 10px; padding: 20px; background: rgba(0,0,0,0.2); }
.btn-v2-cancel, .btn-v2-confirm { flex: 1; padding: 12px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-v2-cancel { background: transparent; color: white; border: 1px solid var(--border); }
.btn-v2-confirm { background: var(--primary); border: none; color: #fff; }
.security-status-card { padding: 48px; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; }

/* --- Footer --- */
.footer-v2 { padding: 80px 0; background: rgba(2, 6, 23, 0.9); border-top: 1px solid var(--border); margin-top: 100px; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; }
.footer-brand { }
.footer-brand p { color: var(--text-dim); margin-top: 20px; font-size: 0.95rem; }

/** ---- wallet ---- **/
.wallet-list { display: grid; gap: 24px; margin-top: 40px; }
.wallet-item { display: grid; grid-template-columns: 80px 1fr 180px; gap: 32px; padding: 32px; align-items: center; }
.wallet-icon { width: 64px; height: 64px; background: rgba(255,255,255,0.05); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--primary-bright); }
.wallet-icon svg { width: calc(100% - 12px); height: calc(100% - 12px); }
.wallet-meta h3 { margin-bottom: 8px; font-size: 1.5rem; }
.wallet-tags { display: flex; gap: 8px; margin-bottom: 12px; }
.tag-sec { font-size: 0.7rem; padding: 2px 10px; border-radius: 4px; background: rgba(99, 102, 241, 0.1); color: var(--primary-bright); border: 1px solid rgba(99, 102, 241, 0.2); }
.wallet-features { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; }
@media (max-width: 900px) {
    .wallet-item { grid-template-columns: 1fr; gap: 20px; text-align: center; }
    .wallet-icon { margin: 0 auto; }
    .wallet-tags { justify-content: center; }
}

/** ---- exchange ---- **/
.exchange-table-container { margin-top: 60px; overflow-x: auto; }
.exchange-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.exchange-table th, .exchange-table td { padding: 24px; text-align: left; border-bottom: 1px solid var(--border); }
.exchange-table th { background: rgba(255,255,255,0.03); color: var(--primary-bright); font-weight: 800; text-transform: uppercase; font-size: 0.8rem; }
.rank-badge { width: 32px; height: 32px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.exchange-name { font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5em; }
.exchange-name img { width: 2em; height: 2em; }
.tech-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.tech-tag { padding: 2px 10px; border-radius: 4px; background: rgba(45, 212, 191, 0.1); color: var(--secondary); border: 1px solid rgba(45, 212, 191, 0.2); font-size: 0.7rem; }
.score-pill { display: inline-block; padding: 4px 12px; border-radius: 20px; background: rgba(99, 102, 241, 0.1); color: var(--primary-bright); font-family: var(--font-mono); font-weight: 800; font-size: 0.85rem; }
tr:hover { background: rgba(255,255,255,0.02); }

/* --- Responsive Adaptations --- */
@media (max-width: 1024px) {
    .container { padding: 0 20px; }
    
    .main-nav { height: auto; padding: 10px 0; }
    .nav-container { flex-direction: column; gap: 15px; }
    .nav-links { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .nav-links a { font-size: 0.8rem; }
    
    .hero { padding: 150px 0 60px; }
    .hero-title { font-size: 3rem; }
    .hero-btns { flex-direction: column; align-items: stretch; max-width: 400px; margin: 0 auto; }
    .btn-primary, .btn-outline { width: 100%; text-align: center; }

    .evolution-wrapper, .glossary-container, .lab-v2-body, .security-layout { grid-template-columns: 1fr; height: auto; }
    .evo-nav, .glossary-sidebar { flex-direction: row; overflow-x: auto; padding: 15px; border-right: none; border-bottom: 1px solid var(--border); scrollbar-width: none; }
    .evo-nav::-webkit-scrollbar, .glossary-sidebar::-webkit-scrollbar { display: none; }
    .evo-item, .glossary-tab { min-width: 160px; text-align: center; padding: 15px; }
    .evo-item.active { transform: none; }
    
    .evo-content-container { padding: 30px 20px; }
    .evo-detail.active { grid-template-columns: 1fr; gap: 40px; }
    .evo-visual-box { height: 300px; }
    
    .glossary-item { padding: 40px 20px; }
    .glossary-title { font-size: 1.8rem; }
    
    .concepts-grid { grid-template-columns: 1fr; }
    .concept-card-v2 { padding: 30px; }
    
    .lab-card-v2 { padding: 30px 20px; }
    .quiz-card { padding: 60px 20px; }
    
    .security-status-card { padding: 30px 20px; }
    .footer-grid { flex-direction: column; gap: 40px; text-align: center; }
    .footer-brand { max-width: 100%; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .section-title { font-size: 1.8rem; }
    .logo-text { font-size: 1rem; }
}

@media (max-width: 768px) {
    .glossary-sidebar { display: flex }
    .blog-filters { justify-content: flex-start; }
    section { padding: 30px 0; }
    .evo-visual-box { height: auto; padding: 12px;}
}