/* ============================================================
   Machine Mischief Labs — Stylesheet
   ============================================================ */

:root {
    --bg:       #0a0a10;
    --bg2:      #111119;
    --bg3:      #18181f;
    --accent:   #00e5c8;
    --text:     #dde1e7;
    --dim:      #5a6270;
    --border:   rgba(255,255,255,0.07);
    --mono:     'Space Mono', monospace;
    --sans:     'Inter', sans-serif;
    --max:      1180px;
    --pad:      clamp(1.5rem, 5vw, 4rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, video { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; }
a { text-decoration: none; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Utility ── */
.accent { color: var(--accent); }
.hidden { display: none !important; }

/* ============================================================
   LOADER
   ============================================================ */
#loader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#loader.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-wrap {
    width: min(580px, 90vw);
}

.loader-terminal {
    background: rgba(0,229,200,0.03);
    border: 1px solid rgba(0,229,200,0.14);
    border-radius: 6px;
    overflow: hidden;
    font-family: var(--mono);
    font-size: clamp(11px, 2vw, 13px);
    color: var(--accent);
    min-height: 220px;
}

.loader-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(0,229,200,0.05);
    border-bottom: 1px solid rgba(0,229,200,0.1);
    font-size: 11px;
    color: var(--dim);
}

.lb-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

.lb-title {
    margin-left: 0.25rem;
    letter-spacing: 0.1em;
}

#loader-text {
    padding: 1.25rem 1.25rem 0;
    white-space: pre-wrap;
    line-height: 1.8;
}

.cursor {
    display: inline-block;
    padding: 0 1.25rem 1.25rem;
    animation: blink 0.75s step-end infinite;
    color: var(--accent);
    font-family: var(--mono);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

#skip-btn {
    display: block;
    margin-top: 0.875rem;
    background: none;
    border: none;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    padding: 0.25rem 0;
}

#skip-btn:hover { color: var(--text); }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
#main {
    opacity: 0;
    transition: opacity 0.5s ease 0.1s;
}

#main.visible,
#main.no-loader {
    opacity: 1;
}

/* ============================================================
   NAV
   ============================================================ */
#nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem var(--pad);
    background: rgba(10,10,16,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

#nav.scrolled {
    background: rgba(10,10,16,0.98);
}

.nav-logo {
    font-family: var(--mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.nav-active { color: var(--accent); }

/* Hamburger (mobile) */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 9rem var(--pad) 5rem;
    overflow: hidden;
}

/* Subtle grid background */
.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,229,200,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,229,200,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 60% 40%, black 20%, transparent 80%);
    pointer-events: none;
}

/* Glow orb */
.hero::after {
    content: '';
    position: absolute;
    top: 15%;
    right: 5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0,229,200,0.07) 0%, transparent 65%);
    pointer-events: none;
}

.hero-eyebrow {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.25em;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.hero h1 {
    font-size: clamp(3.25rem, 9vw, 7rem);
    font-weight: 600;
    line-height: 1.0;
    letter-spacing: -0.025em;
    margin-bottom: 1.75rem;
    position: relative;
    z-index: 1;
}

.hero-sub {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--dim);
    max-width: 480px;
    margin-bottom: 2.75rem;
    line-height: 1.75;
    position: relative;
    z-index: 1;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: #000;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 3px;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,229,200,0.22);
}

.btn-ghost {
    display: inline-block;
    padding: 0.875rem 2rem;
    border: 1px solid var(--border);
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    border-radius: 3px;
    transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
    border-color: rgba(255,255,255,0.18);
    color: var(--text);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
    padding: 6rem var(--pad);
    max-width: calc(var(--max) + var(--pad) * 2);
    margin: 0 auto;
}

.section-tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.2em;
    margin-bottom: 2.5rem;
    opacity: 0.7;
}

.section h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 3rem;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
    border-top: 1px solid var(--border);
}

.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 5rem;
    align-items: start;
}

.about-text h2 {
    margin-bottom: 1.5rem;
}

.about-text p {
    color: var(--dim);
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.stat:first-child { padding-top: 0; }
.stat:last-child { border-bottom: none; }

.stat-num {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--dim);
    letter-spacing: 0.04em;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
    border-top: 1px solid var(--border);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.card {
    padding: 2rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.25s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: rgba(0,229,200,0.18);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.card-icon {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
    font-family: monospace;
}

.card h3 {
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--dim);
    font-size: 0.9rem;
    line-height: 1.75;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-section { padding-top: 8rem; }

.contact-h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.contact-sub {
    color: var(--dim);
    font-size: 1.05rem;
    max-width: 540px;
    margin-bottom: 3.5rem;
    line-height: 1.75;
}

.contact-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 5rem;
    align-items: start;
}

/* Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--dim);
    text-transform: uppercase;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.875rem 1rem;
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a6270' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(0,229,200,0.4);
    box-shadow: 0 0 0 3px rgba(0,229,200,0.06);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--dim);
    opacity: 0.6;
}

.form-group textarea { resize: vertical; min-height: 140px; }

.btn-submit { width: fit-content; }

/* Honeypot */
.contact-form p.hidden { display: none; }

/* Contact info */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.contact-item:first-child { padding-top: 0; }

.ci-label {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    color: var(--dim);
}

.contact-item a,
.contact-item span {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.5;
}

.contact-item a:hover { color: var(--accent); }

.contact-note {
    padding-top: 1.5rem;
}

.contact-note p {
    color: var(--dim);
    font-size: 0.875rem;
    line-height: 1.75;
}

/* ============================================================
   THANKS PAGE
   ============================================================ */
.thanks-section {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 8rem;
}

.thanks-h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.thanks-sub {
    color: var(--dim);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    border-top: 1px solid var(--border);
    padding: 2.25rem var(--pad);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-logo {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--dim);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }
.footer-sep { color: var(--border); }

.footer-legal {
    width: 100%;
    text-align: right;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--dim);
    opacity: 0.5;
    letter-spacing: 0.04em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-stats { flex-direction: row; flex-wrap: wrap; gap: 0; }
    .stat { flex: 1 1 140px; }

    .services-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .footer-legal { text-align: left; }
}

/* Mobile nav open state */
#nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10,10,16,0.98);
    padding: 1.5rem var(--pad);
    border-bottom: 1px solid var(--border);
    gap: 1.25rem;
}
