@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0d0f14;
  --bg-secondary: #13161e;
  --bg-card: #1a1e28;
  --bg-card-hover: #1f2435;
  --accent: #4f8ef7;
  --accent-hover: #6ba3ff;
  --accent-glow: rgba(79, 142, 247, 0.15);
  --success: #4ade80;
  --danger: #f87171;
  --text-primary: #e8eaf0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;
  --border: #232839;
  --border-light: #2d3448;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 40px rgba(79,142,247,0.12);
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-display); background: var(--bg-primary); color: var(--text-primary); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* NAVBAR */
.navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(13,15,20,0.92); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 0 5%; height: 70px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.35rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.nav-brand span { color: var(--accent); }
.nav-logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent), #7c3aed); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); background: var(--bg-card); }
.nav-cta { background: var(--accent) !important; color: #fff !important; font-weight: 600 !important; }
.nav-cta:hover { background: var(--accent-hover) !important; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; background: none; border: none; }
.hamburger span { width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; display: block; transition: var(--transition); }

/* HERO */
.hero { padding: 140px 5% 80px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -50%; left: 50%; transform: translateX(-50%); width: 800px; height: 800px; background: radial-gradient(circle, rgba(79,142,247,0.07) 0%, transparent 70%); pointer-events: none; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-glow); border: 1px solid rgba(79,142,247,0.3); color: var(--accent); font-size: 0.78rem; font-weight: 700; padding: 6px 14px; border-radius: 100px; margin-bottom: 24px; letter-spacing: 1px; text-transform: uppercase; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.15; letter-spacing: -1.5px; margin-bottom: 20px; max-width: 800px; margin-left: auto; margin-right: auto; }
.hero h1 .highlight { color: var(--accent); }
.hero p { font-size: 1.05rem; color: var(--text-secondary); max-width: 560px; margin: 0 auto; line-height: 1.7; }

/* TEST */
.test-container { max-width: 920px; margin: 0 auto; padding: 0 5% 80px; }
.test-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow), var(--shadow-glow); position: relative; overflow: hidden; }
.test-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), #7c3aed, var(--accent)); }

/* SETTINGS */
.test-settings { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.setting-group { display: flex; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.setting-btn { background: none; border: none; color: var(--text-secondary); font-family: var(--font-display); font-size: 0.84rem; font-weight: 600; padding: 8px 16px; cursor: pointer; transition: var(--transition); }
.setting-btn.active { background: var(--accent); color: #fff; }
.setting-btn:hover:not(.active) { color: var(--text-primary); background: var(--bg-card-hover); }
.setting-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 2px; }

/* STATS */
.stats-bar { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 24px; }
.stat-item { text-align: center; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 10px; }
.stat-value { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.stat-value.active { color: var(--accent); }
.stat-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* TIMER */
.timer-bar { width: 100%; height: 4px; background: var(--bg-secondary); border-radius: 2px; margin-bottom: 24px; overflow: hidden; }
.timer-progress { height: 100%; background: linear-gradient(90deg, var(--accent), #7c3aed); border-radius: 2px; transition: width 1s linear; width: 100%; }

/* TYPING AREA */
.typing-area { position: relative; margin-bottom: 24px; }
.text-display { font-family: var(--font-mono); font-size: 1.05rem; line-height: 2; color: var(--text-muted); background: var(--bg-secondary); border: 2px solid var(--border); border-radius: var(--radius); padding: 24px; min-height: 150px; max-height: 230px; overflow-y: auto; cursor: text; transition: border-color var(--transition); user-select: none; letter-spacing: 0.3px; word-wrap: break-word; white-space: pre-wrap; }
.text-display.focused { border-color: var(--accent); }
.text-display::-webkit-scrollbar { width: 4px; }
.text-display::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }
.char { transition: color 0.08s; }
.char.correct { color: var(--success); }
.char.incorrect { color: var(--danger); background: rgba(248,113,113,0.1); border-radius: 2px; }
.char.current { color: var(--text-primary); background: var(--accent); border-radius: 2px; animation: blink 1s ease infinite; }
.hidden-input { position: absolute; opacity: 0; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }

/* CONTROLS */
.test-controls { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 26px; border-radius: 10px; font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: all var(--transition); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79,142,247,0.35); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-hint { background: none; border: 1px solid var(--border); color: var(--text-muted); font-family: var(--font-display); font-size: 0.82rem; padding: 11px 18px; border-radius: 10px; cursor: default; }

/* RESULTS */
.results-overlay { display: none; position: absolute; inset: 0; background: var(--bg-card); border-radius: var(--radius-lg); padding: 40px; flex-direction: column; align-items: center; justify-content: center; z-index: 10; }
.results-overlay.show { display: flex; animation: fadeIn 0.4s ease; }
.results-title { font-size: 0.9rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 24px; }
.results-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; width: 100%; margin-bottom: 28px; }
.result-item { text-align: center; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 12px; }
.result-value { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.result-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.performance-msg { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 28px; text-align: center; line-height: 1.5; }
.performance-msg span { color: var(--accent); }

/* SECTIONS */
.section { padding: 80px 5%; }
.section-header { text-align: center; margin-bottom: 52px; }
.section-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.section-header h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.section-header p { font-size: 1rem; color: var(--text-secondary); max-width: 520px; margin: 0 auto; }

/* FEATURES */
.features-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; max-width: 1000px; margin: 0 auto; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 26px; transition: all 0.3s; }
.feature-card:hover { border-color: rgba(79,142,247,0.35); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.feature-icon { width: 50px; height: 50px; background: var(--accent-glow); border: 1px solid rgba(79,142,247,0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 18px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.65; }

/* FAQ */
.faq-container { max-width: 720px; margin: 0 auto; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq-item:hover { border-color: var(--border-light); }
.faq-question { width: 100%; background: none; border: none; color: var(--text-primary); font-family: var(--font-display); font-size: 0.93rem; font-weight: 600; text-align: left; padding: 18px 22px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; transition: var(--transition); }
.faq-question:hover { color: var(--accent); }
.faq-icon { font-size: 1.2rem; color: var(--text-muted); transition: transform 0.3s; flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); color: var(--accent); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-answer-inner { padding: 0 22px 18px; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.75; }
.faq-item.open .faq-answer { max-height: 200px; }

/* BLOG */
.blog-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; max-width: 1000px; margin: 0 auto; }
.blog-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: all 0.3s; text-decoration: none; display: block; }
.blog-card:hover { border-color: rgba(79,142,247,0.3); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.blog-card-thumb { height: 150px; background: linear-gradient(135deg,#1a1e28,#232839); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; border-bottom: 1px solid var(--border); }
.blog-card-body { padding: 22px; }
.blog-tag { font-size: 0.68rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: block; }
.blog-card h3 { font-size: 0.97rem; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; line-height: 1.4; }
.blog-card p { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; }
.blog-meta { font-size: 0.74rem; color: var(--text-muted); }

/* FOOTER */
footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 60px 5% 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.footer-brand p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; max-width: 260px; margin-top: 14px; }
.footer-heading { font-size: 0.76rem; font-weight: 700; color: var(--text-primary); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 16px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 0.875rem; color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { font-size: 0.82rem; color: var(--text-muted); }
.footer-bottom a { color: var(--accent); text-decoration: none; }

/* INNER PAGES */
.page-hero { padding: 120px 5% 56px; text-align: center; border-bottom: 1px solid var(--border); }
.page-hero h1 { font-size: clamp(2rem,4vw,3rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.page-hero p { font-size: 0.97rem; color: var(--text-secondary); max-width: 520px; margin: 0 auto; }
.content-wrapper { max-width: 780px; margin: 0 auto; padding: 56px 5%; }
.content-wrapper h2 { font-size: 1.35rem; font-weight: 700; margin: 36px 0 14px; letter-spacing: -0.5px; }
.content-wrapper h3 { font-size: 1.05rem; font-weight: 600; margin: 24px 0 10px; }
.content-wrapper p { font-size: 0.94rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; }
.content-wrapper ul, .content-wrapper ol { margin: 14px 0 14px 24px; color: var(--text-secondary); font-size: 0.94rem; line-height: 1.8; }
.content-wrapper li { margin-bottom: 8px; }
.content-wrapper a { color: var(--accent); }
.highlight-box { background: var(--accent-glow); border: 1px solid rgba(79,142,247,0.25); border-radius: var(--radius); padding: 18px 22px; margin: 24px 0; }
.highlight-box p { color: var(--text-primary) !important; margin: 0 !important; }

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 48px; max-width: 900px; margin: 0 auto; padding: 56px 5%; }
.contact-info h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; }
.contact-info p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; }
.contact-detail { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.contact-detail-icon { width: 38px; height: 38px; background: var(--accent-glow); border: 1px solid rgba(79,142,247,0.2); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.contact-detail-text { color: var(--text-secondary); font-size: 0.875rem; }
.contact-detail-text strong { display: block; color: var(--text-primary); font-size: 0.78rem; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.form-control { width: 100%; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-family: var(--font-display); font-size: 0.9rem; padding: 12px 16px; outline: none; transition: var(--transition); }
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 130px; }
.form-success { display: none; background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.3); border-radius: var(--radius); padding: 14px 18px; font-size: 0.88rem; color: var(--success); margin-top: 14px; }

/* UTILS */
.text-accent { color: var(--accent); }
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ANIMATIONS */
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
@keyframes shake { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-5px); } 75% { transform:translateX(5px); } }
.animate-in { animation: fadeIn 0.5s ease forwards; opacity: 0; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; right: 0; background: var(--bg-primary); border-bottom: 1px solid var(--border); padding: 16px; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .features-grid, .blog-grid { grid-template-columns: 1fr; }
  .results-grid, .stats-bar { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .test-card { padding: 22px 18px; }
  .hero { padding: 110px 5% 50px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: repeat(2,1fr); }
}
