/* =========================================================================
   AppTactical — dark retro arcade game-tech theme
   Sections: tokens · base · layout · buttons · header · hero · sections ·
             games · services · analytics · process · about · contact ·
             footer · error pages · responsive
   ========================================================================= */

:root {
    --bg:           #0A0A12;
    --bg-2:         #0D0F1A;
    --surface:      #11131F;
    --surface-2:    #161A2B;
    --border:       rgba(255, 255, 255, 0.09);
    --border-2:     rgba(255, 255, 255, 0.16);

    --text:         #E6E9F2;
    --muted:        #8A90A6;

    --cyan:         #19E3FF;
    --magenta:      #FF2E88;
    --green:        #3DFF9E;

    --radius:       8px;
    --radius-sm:    5px;
    --container:    1180px;
    --gap:          clamp(1rem, 2vw, 1.5rem);

    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
    --font-head:    'Space Grotesk', 'Inter', sans-serif;
    --font-pixel:   'Press Start 2P', 'Space Grotesk', monospace;

    --shadow:       0 18px 50px rgba(0, 0, 0, 0.45);
    --ring-cyan:    0 0 0 1px rgba(25, 227, 255, 0.4), 0 0 28px rgba(25, 227, 255, 0.22);
}

/* ----------------------------- base ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(1100px 600px at 80% -10%, rgba(25, 227, 255, 0.10), transparent 60%),
        radial-gradient(900px 600px at 0% 10%, rgba(255, 46, 136, 0.10), transparent 55%),
        var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.12;
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; }

::selection { background: var(--magenta); color: #fff; }

/* CRT scanlines overlay */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.018) 0px,
        rgba(255, 255, 255, 0.018) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
    opacity: 0.5;
}

/* ----------------------------- layout ----------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 clamp(1.1rem, 4vw, 2rem);
}

.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }

.section-head { max-width: 640px; margin: 0 0 clamp(1.8rem, 4vw, 3rem); }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

.section-label {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 0.62rem;
    color: var(--cyan);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    text-shadow: 0 0 14px rgba(25, 227, 255, 0.5);
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--magenta);
    letter-spacing: 0.04em;
    margin-bottom: 1.4rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid rgba(255, 46, 136, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(255, 46, 136, 0.06);
}

.grad {
    background: linear-gradient(100deg, var(--cyan), var(--magenta) 55%, var(--green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ----------------------------- buttons ----------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.98rem;
    padding: 0.8rem 1.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
    color: #03060c;
    background: linear-gradient(100deg, var(--cyan), var(--green));
    box-shadow: 0 0 24px rgba(25, 227, 255, 0.28);
}
.btn-primary:hover { box-shadow: 0 0 34px rgba(25, 227, 255, 0.45); }

.btn-ghost {
    color: var(--text);
    border-color: var(--border-2);
    background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-nav {
    color: #03060c;
    background: var(--magenta);
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
    box-shadow: 0 0 18px rgba(255, 46, 136, 0.3);
}
.btn-nav:hover { background: #ff4c9c; }

.btn-block { width: 100%; }

/* ----------------------------- header ----------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 18, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 1rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark { color: var(--cyan); display: inline-flex; filter: drop-shadow(0 0 8px rgba(25, 227, 255, 0.5)); }
.brand-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.18rem;
    letter-spacing: -0.01em;
}
.brand-accent { color: var(--cyan); }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a {
    font-size: 0.94rem;
    color: var(--muted);
    transition: color 0.18s ease;
    position: relative;
}
.site-nav > a:not(.btn-nav):hover { color: var(--text); }
.site-nav > a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    left: 0; bottom: -6px;
    width: 0; height: 2px;
    background: var(--cyan);
    transition: width 0.2s ease;
}
.site-nav > a:not(.btn-nav):hover::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    width: 24px; height: 2px;
    background: var(--text);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ----------------------------- hero ----------------------------- */
.hero { position: relative; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem); overflow: hidden; }
.hero-glow {
    position: absolute;
    width: 620px; height: 620px;
    right: -8%; top: -12%;
    background: radial-gradient(circle, rgba(25, 227, 255, 0.18), transparent 62%);
    filter: blur(20px);
    pointer-events: none;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
    position: relative;
    z-index: 2;
}
.hero-title { font-size: clamp(2.4rem, 6.2vw, 4.3rem); margin-bottom: 1.1rem; }
.hero-lead { color: var(--muted); font-size: 1.12rem; max-width: 36ch; margin-bottom: 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2rem; }

.hero-pills {
    display: flex; flex-wrap: wrap; gap: 0.6rem;
    list-style: none; margin: 0; padding: 0;
}
.hero-pills li {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.85rem; color: var(--text);
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.hero-pills i { color: var(--cyan); font-size: 1rem; }

.hero-visual { position: relative; }
.hero-frame {
    position: relative;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow), var(--ring-cyan);
    aspect-ratio: 1 / 1;
}
.hero-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ----------------------------- games ----------------------------- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
}
.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}
.game-card:hover { transform: translateY(-5px); border-color: var(--border-2); box-shadow: var(--shadow); }
.game-art { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg-2); }
.game-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.game-card:hover .game-art img { transform: scale(1.05); }
.game-genre {
    position: absolute;
    left: 10px; top: 10px;
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    background: rgba(5, 8, 16, 0.78);
    border: 1px solid var(--border-2);
    color: var(--text);
}
.game-body { padding: 1rem 1.1rem 1.3rem; }
.game-body h3 { font-size: 1.18rem; margin-bottom: 0.35rem; }
.game-body p { color: var(--muted); font-size: 0.9rem; margin: 0; }

.accent-cyan:hover    { box-shadow: 0 16px 40px rgba(25, 227, 255, 0.16); }
.accent-magenta:hover { box-shadow: 0 16px 40px rgba(255, 46, 136, 0.16); }
.accent-green:hover   { box-shadow: 0 16px 40px rgba(61, 255, 158, 0.16); }
.accent-cyan .game-genre    { border-color: rgba(25, 227, 255, 0.5);  color: var(--cyan); }
.accent-magenta .game-genre { border-color: rgba(255, 46, 136, 0.5);  color: var(--magenta); }
.accent-green .game-genre   { border-color: rgba(61, 255, 158, 0.5);  color: var(--green); }

/* ----------------------------- services ----------------------------- */
.services { background: linear-gradient(180deg, transparent, rgba(13, 15, 26, 0.6)); }
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}
.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.7rem;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.service-card:hover { transform: translateY(-4px); border-color: var(--cyan); }
.service-icon {
    display: inline-flex;
    width: 52px; height: 52px;
    align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(25, 227, 255, 0.08);
    border: 1px solid rgba(25, 227, 255, 0.25);
    color: var(--cyan);
    font-size: 1.6rem;
    margin-bottom: 1.1rem;
}
.service-card h3 { font-size: 1.28rem; }
.service-card p { color: var(--muted); margin: 0; }

/* ----------------------------- analytics / stats ----------------------------- */
.analytics-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
.analytics-copy h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.analytics-copy p { color: var(--muted); }
.analytics-list { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.analytics-list li { display: flex; align-items: center; gap: 0.7rem; font-size: 0.98rem; }
.analytics-list i { color: var(--green); font-size: 1.2rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}
.stat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
    text-align: center;
}
.stat-value {
    display: block;
    font-family: var(--font-pixel);
    font-size: clamp(1.2rem, 3.5vw, 1.7rem);
    color: var(--cyan);
    text-shadow: 0 0 18px rgba(25, 227, 255, 0.4);
    margin-bottom: 0.7rem;
}
.stat:nth-child(2) .stat-value { color: var(--magenta); text-shadow: 0 0 18px rgba(255, 46, 136, 0.4); }
.stat:nth-child(3) .stat-value { color: var(--green);   text-shadow: 0 0 18px rgba(61, 255, 158, 0.4); }
.stat-label { color: var(--muted); font-size: 0.85rem; }

/* ----------------------------- process ----------------------------- */
.process-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    counter-reset: step;
}
.process-step {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
}
.process-step::before {
    content: '';
    position: absolute;
    left: 1.4rem; right: 1.4rem; top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    border-radius: 0 0 3px 3px;
}
.process-no {
    font-family: var(--font-pixel);
    font-size: 0.95rem;
    color: var(--magenta);
}
.process-step h3 { font-size: 1.2rem; margin: 0.8rem 0 0.4rem; }
.process-step p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ----------------------------- about ----------------------------- */
.about-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
.about-copy h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.about-copy p { color: var(--muted); }
.about-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem;
}
.about-card h3 {
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--green);
    margin-bottom: 1.4rem;
}
.about-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.about-facts li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.about-facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.about-facts span { color: var(--muted); }
.about-facts strong { text-align: right; }

/* ----------------------------- contact ----------------------------- */
.contact { background: linear-gradient(180deg, rgba(13, 15, 26, 0.6), transparent); }
.contact-inner {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}
.contact-copy h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
.contact-copy p { color: var(--muted); }
.contact-meta { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 1rem; }
.contact-meta li { display: flex; align-items: center; gap: 0.8rem; }
.contact-meta i {
    color: var(--cyan);
    font-size: 1.3rem;
    width: 26px; flex-shrink: 0;
}
.contact-meta a:hover { color: var(--cyan); }

.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.4rem, 3vw, 2rem);
    box-shadow: var(--shadow);
}
.form-row { margin-bottom: 1rem; }
.form-row label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--muted);
}
.form-row .opt { color: var(--border-2); }
.form-row input,
.form-row textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.98rem;
    color: var(--text);
    background: var(--bg-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(25, 227, 255, 0.15);
}
.form-row textarea { resize: vertical; min-height: 120px; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-fineprint { font-size: 0.82rem; color: var(--muted); margin: 0.9rem 0 0; text-align: center; }
.form-fineprint a { color: var(--cyan); }

.form-alert {
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
    margin: 0 0 1.2rem;
    border: 1px solid var(--border-2);
}
.form-ok   { background: rgba(61, 255, 158, 0.1);  border-color: rgba(61, 255, 158, 0.4); color: var(--green); }
.form-warn { background: rgba(25, 227, 255, 0.08); border-color: rgba(25, 227, 255, 0.4); color: var(--cyan); }
.form-err  { background: rgba(255, 46, 136, 0.1);  border-color: rgba(255, 46, 136, 0.4); color: var(--magenta); }
.form-alert a { text-decoration: underline; }

/* ----------------------------- footer ----------------------------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.6rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1fr;
    gap: clamp(1.6rem, 4vw, 3rem);
    margin-bottom: 2rem;
}
.footer-tag { color: var(--muted); max-width: 30ch; margin: 0.9rem 0 0; font-size: 0.92rem; }
.footer-col h4 { font-size: 0.95rem; margin-bottom: 1rem; }
.footer-col a { display: block; color: var(--muted); font-size: 0.92rem; margin-bottom: 0.55rem; transition: color 0.18s ease; }
.footer-col a:hover { color: var(--cyan); }
.footer-col address { color: var(--muted); font-style: normal; font-size: 0.92rem; line-height: 1.7; }
.footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.84rem;
}
.footer-bottom p { margin: 0; }

/* ----------------------------- error pages ----------------------------- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.error-shell { width: 100%; padding: 2rem 1.2rem; }
.error-card {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(2rem, 5vw, 3rem);
    box-shadow: var(--shadow);
}
.error-mascot { width: 200px; height: auto; margin: 0 auto 1.2rem; image-rendering: pixelated; }
.error-code {
    display: block;
    font-family: var(--font-pixel);
    font-size: clamp(2.4rem, 9vw, 3.6rem);
    color: var(--cyan);
    text-shadow: 0 0 22px rgba(25, 227, 255, 0.5);
    margin-bottom: 1rem;
}
.error-code-warn { color: var(--magenta); text-shadow: 0 0 22px rgba(255, 46, 136, 0.5); }
.error-title { font-size: clamp(1.3rem, 4vw, 1.8rem); margin-bottom: 0.7rem; }
.error-text { color: var(--muted); margin-bottom: 1.6rem; }
.error-brand {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    color: var(--muted);
    margin: 1.6rem 0 0;
    letter-spacing: 0.05em;
}

/* ----------------------------- responsive ----------------------------- */
@media (max-width: 980px) {
    .games-grid { grid-template-columns: repeat(2, 1fr); }
    .process-track { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { order: -1; max-width: 420px; }
    .analytics-inner,
    .about-inner,
    .contact-inner { grid-template-columns: 1fr; }
    .about-card { order: -1; }
}

@media (max-width: 760px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: fixed;
        inset: 70px 0 auto 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: rgba(10, 10, 18, 0.97);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 1.2rem 1.2rem;
        transform: translateY(-130%);
        transition: transform 0.28s ease;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .site-nav.open { transform: translateY(0); }
    .site-nav a { width: 100%; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
    .site-nav .btn-nav { margin-top: 0.8rem; border-bottom: 0; text-align: center; }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 560px) {
    .games-grid,
    .services-grid,
    .stats-grid,
    .process-track { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-cta .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}
