/* ===== MageTec Design System ===== */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&family=Syne:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0d0f14;
    --bg2: #131720;
    --bg3: #1a2030;
    --surface: #1e2535;
    --border: #2a3348;
    --accent: #4f8ef7;
    --accent2: #38d9a9;
    --accent3: #f7884f;
    --accent4: #c678dd;
    --text: #e2e8f4;
    --text-muted: #7a8aaa;
    --text-dim: #4a5878;
    --nav-h: 64px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Syne', sans-serif;
    overflow-x: hidden;
    cursor: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Cursor ---- */
.cursor {
    position: fixed; width: 10px; height: 10px;
    background: var(--accent); border-radius: 50%;
    pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .2s, height .2s, background .2s;
}
.cursor-ring {
    position: fixed; width: 36px; height: 36px;
    border: 1px solid rgba(79,142,247,.4); border-radius: 50%;
    pointer-events: none; z-index: 9998;
    transform: translate(-50%, -50%);
}

/* ---- Navbar ---- */
nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100; padding: 0 48px; height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(13,15,20,.9); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo-mark {
    width: 32px; height: 32px; background: var(--accent);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; color: #fff;
}
.nav-logo-text { font-size: 17px; font-weight: 700; letter-spacing: .01em; color: var(--text); }

.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
    text-decoration: none; color: var(--text-muted);
    font-size: 13px; font-weight: 500;
    font-family: 'DM Mono', monospace; letter-spacing: .05em;
    padding: 7px 14px; border-radius: 6px;
    transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--accent); background: rgba(79,142,247,.08); }
.nav-links a.nav-cta {
    color: #fff !important; background: var(--accent);
    margin-left: 8px;
}
.nav-links a.nav-cta:hover { background: #3a7de8; }

/* ---- Page wrapper ---- */
main { flex: 1; margin-top: var(--nav-h); }

/* ---- Section base ---- */
.section { padding: 90px 48px; }
.section-label {
    font-family: 'DM Mono', monospace; font-size: 11px;
    color: var(--accent); letter-spacing: .14em;
    text-transform: uppercase; margin-bottom: 14px;
}
h1, h2 {
    font-weight: 800; line-height: 1.05; letter-spacing: -.025em;
}
h1 { font-size: clamp(44px, 7vw, 86px); margin-bottom: 28px; }
h2 { font-size: clamp(30px, 4.5vw, 50px); margin-bottom: 20px; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 12px; }

.lead {
    font-family: 'DM Mono', monospace; font-weight: 300;
    font-size: 14px; color: var(--text-muted); line-height: 1.9;
    max-width: 600px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: 8px;
    font-size: 14px; font-weight: 600; text-decoration: none;
    letter-spacing: .02em; transition: all .2s; cursor: pointer; border: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3a7de8; transform: translateY(-1px); box-shadow: 0 8px 32px rgba(79,142,247,.3); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Cards ---- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 36px;
    transition: border-color .3s, transform .3s;
}
.card:hover { border-color: rgba(79,142,247,.4); transform: translateY(-2px); }

/* ---- Grid ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

/* ---- Tag ---- */
.tag {
    font-family: 'DM Mono', monospace; font-size: 10px;
    letter-spacing: .08em; color: var(--text-dim);
    border: 1px solid var(--border); border-radius: 100px;
    padding: 4px 10px; display: inline-block;
}

/* ---- Divider ---- */
.divider {
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ---- Page hero (inner pages) ---- */
.page-hero {
    padding: 72px 48px 60px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: relative; overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(79,142,247,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,142,247,.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 100% 100% at 0% 50%, black 30%, transparent 80%);
}
.page-hero > * { position: relative; z-index: 1; }
.page-hero h1 { margin-bottom: 16px; }

/* ---- Footer ---- */
footer {
    background: var(--bg2); border-top: 1px solid var(--border);
    padding: 28px 48px;
    display: flex; align-items: center; justify-content: space-between;
}
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-mark {
    width: 28px; height: 28px; background: var(--accent);
    border-radius: 5px; display: flex; align-items: center; justify-content: center;
    font-family: 'DM Mono', monospace; font-size: 12px; color: #fff;
}
.footer-name { font-weight: 700; font-size: 15px; }
.footer-copy { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-dim); letter-spacing: .06em; }
.footer-links { display: flex; gap: 24px; list-style: none; }
.footer-links a { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-dim); text-decoration: none; letter-spacing: .08em; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }

/* ---- Reveal anim ---- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---- Code block ---- */
.code-block {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 12px; padding: 28px;
    font-family: 'DM Mono', monospace; font-size: 13px; line-height: 1.9;
    position: relative; overflow: hidden;
}
.code-block::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
}
.code-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.code-dot:nth-child(1){background:#ff5f57;} .code-dot:nth-child(2){background:#febc2e;} .code-dot:nth-child(3){background:#28c840;}
.c-comment{color:var(--text-dim);} .c-key{color:var(--accent);} .c-str{color:var(--accent2);}
.c-val{color:var(--accent3);} .c-fn{color:var(--accent4);} .c-text{color:var(--text-muted);}
.typing-cursor { display:inline-block; width:2px; height:14px; background:var(--accent); margin-left:2px; vertical-align:middle; animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ---- Form ---- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; background: var(--bg2); border: 1px solid var(--border);
    border-radius: 8px; padding: 11px 15px; color: var(--text);
    font-family: 'DM Mono', monospace; font-size: 13px; outline: none;
    transition: border-color .2s; resize: vertical;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent); }
.form-group textarea { min-height: 120px; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-dim); }
.form-group select option { background: var(--bg2); }

/* ---- Glow bg element ---- */
.glow { position: absolute; border-radius: 50%; pointer-events: none; }
.glow-blue { background: radial-gradient(circle, rgba(79,142,247,.12) 0%, transparent 70%); }
.glow-green { background: radial-gradient(circle, rgba(56,217,169,.08) 0%, transparent 70%); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    nav { padding: 0 20px; }
    .nav-links a span { display: none; }
    .section, .page-hero { padding: 56px 20px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    footer { flex-direction: column; gap: 16px; text-align: center; }
    .footer-links { display: none; }
}
