/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #0a0a0f;
    --color-surface: #12121a;
    --color-surface-alt: #1a1a26;
    --color-accent: #00ff88;
    --color-accent-dim: #00cc6a;
    --color-accent-glow: rgba(0, 255, 136, 0.15);
    --color-text: #c8c8d0;
    --color-text-bright: #e8e8f0;
    --color-text-dim: #6a6a7a;
    --color-border: #2a2a3a;
    --color-red: #ff3366;
    --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", monospace;
    --font-sans: "Inter", -apple-system, sans-serif;
    --radius: 4px;
    --shadow-glow: 0 0 20px rgba(0, 255, 136, 0.1);
    --max-width: 1100px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
    color: var(--color-accent);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

::selection {
    background: var(--color-accent);
    color: var(--color-bg);
}

/* === Matrix Canvas === */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

/* === Scanline overlay === */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* === Header === */
header {
    background: rgba(18, 18, 26, 0.92);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-mark {
    width: 2rem;
    height: 2rem;
    display: block;
    flex-shrink: 0;
    transition: filter 0.2s;
}

.logo-text {
    transform: translateY(1px);
}

.logo:hover {
    color: var(--color-accent);
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.55);
}

.logo:hover .logo-mark {
    filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.5));
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: var(--color-text-dim);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
    text-transform: lowercase;
}

nav a::before {
    content: "./";
    color: var(--color-text-dim);
    opacity: 0.5;
}

nav a:hover,
nav a.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

/* === Home: single viewport (no scroll) === */
body:has(.home-screen) {
    height: 100dvh;
    overflow: hidden;
}

body:has(.home-screen) footer {
    padding: 0.65rem 0;
}

.home-screen {
    position: relative;
    height: calc(100dvh - 7rem);
    max-height: calc(100dvh - 7rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    overflow: hidden;
    padding: 0.5rem 0 0.75rem;
}

.home-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.18;
    z-index: 0;
    pointer-events: none;
}

.home-screen > .hero--fit,
.home-screen > .features--fit {
    position: relative;
    z-index: 1;
}

.hero--fit {
    padding: 1.25rem 0 0.5rem;
    flex-shrink: 0;
    /* kill section-only bg image leftovers */
    background: transparent;
}

.hero--fit .hero-bg {
    display: none;
}

.hero-brand {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.35);
}

.hero--fit h1 {
    font-size: clamp(1.35rem, 3.5vw, 2.1rem);
    margin-bottom: 0.65rem;
}

.hero--fit .hero-subtitle {
    font-size: 0.9rem;
    margin: 0 auto 1.25rem;
    max-width: 520px;
    line-height: 1.45;
}

.hero--fit .btn {
    padding: 0.55rem 1.25rem;
    font-size: 0.8rem;
}

.features--fit {
    padding: 0.5rem 0 0;
    flex-shrink: 1;
    min-height: 0;
}

.features--fit h2 {
    display: none;
}

.grid--fit {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.card--fit {
    padding: 1rem 1.1rem;
}

.card--fit h3 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.card--fit p {
    font-size: 0.78rem;
    line-height: 1.4;
    margin: 0;
}

@media (max-width: 768px) {
    .home-screen {
        height: calc(100dvh - 8.5rem);
        max-height: calc(100dvh - 8.5rem);
        gap: 0.85rem;
        justify-content: flex-start;
        padding-top: 0.75rem;
    }

    .grid--fit {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .card--fit {
        padding: 0.75rem 0.9rem;
    }

    .hero--fit .hero-subtitle {
        margin-bottom: 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .home-screen {
        height: calc(100dvh - 9.5rem);
        max-height: calc(100dvh - 9.5rem);
    }

    .hero-brand {
        margin-bottom: 0.4rem;
    }
}

/* === Hero === */
.hero {
    position: relative;
    padding: 6rem 0;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--color-accent);
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
    font-family: var(--font-mono);
}

.hero h1::before {
    display: none;
}

.hero-prefix {
    color: var(--color-text-dim);
    font-weight: 400;
}

#typed-title {
    color: var(--color-accent);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--color-text);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    font-family: var(--font-mono);
}

/* === Typing cursor effect === */
.cursor-blink {
    color: var(--color-accent);
    animation: blink 1s step-end infinite;
}

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

/* === Buttons === */
.btn {
    display: inline-block;
    background: transparent;
    color: var(--color-accent);
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--color-accent);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background: var(--color-accent);
    color: var(--color-bg);
    box-shadow: var(--shadow-glow), 0 0 30px rgba(0, 255, 136, 0.2);
    text-shadow: none;
}

.btn:active {
    transform: scale(0.98);
}

/* === Sections === */
.page-header {
    background: rgba(18, 18, 26, 0.85);
    border-bottom: 1px solid var(--color-border);
    padding: 4rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--color-accent);
    font-family: var(--font-mono);
}

.page-header h1::before {
    content: "# ";
    color: var(--color-text-dim);
}

.page-header p {
    color: var(--color-text-dim);
    font-size: 0.95rem;
}

.features,
.services-list {
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    color: var(--color-text-bright);
    font-family: var(--font-mono);
}

.features h2::before {
    content: "## ";
    color: var(--color-accent);
}

/* === Grid === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* === Cards === */
.card {
    background: rgba(18, 18, 26, 0.9);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--color-accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.card:hover::before {
    opacity: 1;
}

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    border: 1px solid var(--color-border);
    opacity: 0.85;
    transition: opacity 0.3s;
}

.card:hover .card-img {
    opacity: 1;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-accent);
    font-family: var(--font-mono);
}

.card h3::before {
    content: "> ";
    color: var(--color-text-dim);
}

.card p {
    color: var(--color-text-dim);
    font-size: 0.85rem;
}

/* === Contact === */
.contact-section {
    padding: 4rem 0;
}

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

.contact-form {
    background: rgba(18, 18, 26, 0.9);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(4px);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group label::before {
    content: "→ ";
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    background: rgba(10, 10, 15, 0.8);
    color: var(--color-text-bright);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.15);
}

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

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

.form-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.form-status[data-kind="ok"] {
    color: var(--color-accent);
}

.form-status[data-kind="error"] {
    color: #ff6b6b;
}

.form-status[data-kind="pending"] {
    color: var(--color-text-dim);
}

.contact-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.contact-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contact-info {
    padding: 1rem 0;
}

.contact-info h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--color-accent);
    font-family: var(--font-mono);
}

.contact-info p {
    margin-bottom: 1.25rem;
    color: var(--color-text-dim);
    line-height: 1.8;
    font-size: 0.85rem;
}

.contact-info strong {
    color: var(--color-text-bright);
}

/* === Footer === */
footer {
    background: rgba(18, 18, 26, 0.92);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-dim);
    padding: 1.5rem 0;
    margin-top: auto;
    backdrop-filter: blur(8px);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-inner p {
    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--color-text-dim);
    font-size: 0.75rem;
}

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

/* === Glitch effect for hero title (subtle) === */
@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(1px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
}

.hero h1:hover {
    animation: glitch 0.3s ease;
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header-inner {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero h1 {
        font-size: 1.3rem;
    }

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

/* === Pricing === */
.pricing-section {
    padding: 4rem 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.pricing-card {
    background: rgba(18, 18, 26, 0.9);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(4px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.pricing-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.pricing-card--featured {
    border-color: var(--color-accent);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.08);
}

.pricing-card--featured .pricing-badge {
    background: var(--color-accent);
    color: var(--color-bg);
}

.pricing-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    margin-bottom: 1rem;
    width: fit-content;
}

.pricing-card h3 {
    font-size: 1.1rem;
    color: var(--color-text-bright);
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
}

.pricing-price {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.pricing-desc {
    color: var(--color-text-dim);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
    flex: 1;
}

.pricing-features li {
    padding: 0.4rem 0;
    font-size: 0.82rem;
    color: var(--color-text);
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.pricing-features li::before {
    content: "✓ ";
    color: var(--color-accent);
}

.pricing-card .btn {
    width: 100%;
    text-align: center;
    margin-top: auto;
}

.pricing-custom {
    text-align: center;
    padding: 2rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
}

.pricing-custom h3 {
    color: var(--color-accent);
    font-family: var(--font-mono);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.pricing-custom p {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* === Legal === */
.legal-section {
    padding: 4rem 0;
}

.legal-content {
    max-width: 800px;
}

.legal-content h2 {
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.legal-content h2::before {
    content: "## ";
    color: var(--color-text-dim);
}

.legal-content h3 {
    color: var(--color-text-bright);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.legal-content p {
    color: var(--color-text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.legal-content strong {
    color: var(--color-text-bright);
}
