/* ─── Variables ─────────────────────────────────────────────── */
:root {
    --bg:          #08090f;
    --bg-2:        #0d0f1a;
    --bg-card:     rgba(255, 255, 255, 0.028);
    --border:      rgba(255, 255, 255, 0.08);
    --border-h:    rgba(99, 149, 255, 0.35);
    --blue:        #4d7cfe;
    --blue-dim:    rgba(77, 124, 254, 0.12);
    --cyan:        #00d4c8;
    --text:        #e8ecf4;
    --text-muted:  #6b7280;
    --text-dim:    #9ca3af;
    --green:       #34d399;
    --radius:      12px;
    --radius-sm:   8px;
    --nav-h:       68px;
    --font-mono:   'JetBrains Mono', monospace;
    --font:        'Inter', system-ui, sans-serif;
    --transition:  0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ─── Container ──────────────────────────────────────────────── */
.container {
    max-width: 1160px;
    margin-inline: auto;
    padding-inline: 24px;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.btn--primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 0 24px rgba(77, 124, 254, 0.3);
}
.btn--primary:hover {
    background: #5d8cff;
    box-shadow: 0 0 36px rgba(77, 124, 254, 0.5);
    transform: translateY(-1px);
}
.btn--ghost {
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn--ghost:hover {
    border-color: var(--border-h);
    color: var(--text);
    background: var(--blue-dim);
}
.btn--nav {
    padding: 8px 18px;
    border: 1px solid var(--border-h);
    color: var(--blue);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}
.btn--nav:hover {
    background: var(--blue-dim);
}
.btn--full { width: 100%; justify-content: center; }

/* ─── Gradient text ──────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(110deg, var(--blue) 0%, var(--cyan) 45%, #8baeff 70%, var(--blue) 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 6s linear infinite;
}
@keyframes shimmer {
    to { background-position: -220% center; }
}

/* ─── Section shared ─────────────────────────────────────────── */
.section-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--blue);
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}
.section-header {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 56px;
}
.section-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.25;
}
.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ─── Navigation ─────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    transition: background var(--transition), border-color var(--transition);
}
.nav.scrolled {
    background: rgba(8, 9, 15, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav__inner {
    width: 100%;
    max-width: 1160px;
    margin-inline: auto;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav__logo {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.logo-bracket { color: var(--blue); }
.nav__links {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav__links a {
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: color var(--transition);
}
.nav__links a:hover { color: var(--text); }
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}
.nav__toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-h);
    overflow: hidden;
}
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
#gridCanvas {
    width: 100%; height: 100%;
    opacity: 0.35;
}
.hero .container { position: relative; z-index: 1; width: 100%; }
.hero__layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    padding-block: 80px;
}
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: var(--green);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 24px;
}
.badge-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}
.hero__title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}
.hero__sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 460px;
    margin-bottom: 36px;
}
.hero__actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
.hero__stats {
    display: flex;
    align-items: center;
    gap: 24px;
}
.stat__num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-mono);
}
.stat__label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.stat__divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* ─── Terminal ───────────────────────────────────────────────── */
.terminal {
    background: #0d0f1a;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(77,124,254,0.08);
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.terminal__bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border);
}
.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
}
.dot--red    { background: #ff5f56; }
.dot--yellow { background: #ffbd2e; }
.dot--green  { background: #27c93f; }
.terminal__title {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.terminal__body {
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 220px;
}
.terminal__line {
    line-height: 1.7;
    color: var(--text);
}
.t-output { color: var(--text-dim); padding-left: 2px; }
.t-prompt  { color: var(--blue); margin-right: 8px; }
.t-cmd     { color: #c4cde8; }
.t-arg     { color: var(--cyan); }
.t-green   { color: var(--green); }
.t-cursor  {
    color: var(--blue);
    animation: blink 1.1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ─── Services ───────────────────────────────────────────────── */
.services {
    padding: 96px 0;
    background: var(--bg);
}
.services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 26px;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
    opacity: 0;
    transform: translateY(24px);
}
.service-card.revealed {
    opacity: 1;
    transform: none;
    transition: border-color var(--transition), background var(--transition), transform var(--transition),
                opacity 0.5s ease, transform 0.5s ease;
}
.service-card:hover {
    border-color: var(--border-h);
    background: rgba(77, 124, 254, 0.05);
    transform: translateY(-2px);
}
.service-card__icon {
    width: 44px; height: 44px;
    color: var(--blue);
    margin-bottom: 18px;
    background: var(--blue-dim);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.service-card__icon svg { width: 100%; height: 100%; }
.service-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.service-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 18px;
}
.service-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.service-card__tags li {
    background: rgba(77, 124, 254, 0.08);
    border: 1px solid rgba(77, 124, 254, 0.18);
    color: #8baeff;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
}

/* ─── About ──────────────────────────────────────────────────── */
.about {
    padding: 96px 0;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.about__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
}
.about__content h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}
.about__content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 14px;
}
.about__highlights {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}
.highlight {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.highlight__icon {
    color: var(--green);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.stack-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
    transition: border-color var(--transition), color var(--transition);
}
.stack-item:hover {
    border-color: var(--border-h);
    color: var(--text);
}

/* ─── Contact ────────────────────────────────────────────────── */
.contact {
    padding: 96px 0;
    background: var(--bg);
}
.contact__inner {
    max-width: 640px;
    margin: 0 auto;
}
.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
}
.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color var(--transition), background var(--transition);
    outline: none;
    resize: none;
    -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='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-h);
    background: rgba(77, 124, 254, 0.05);
}
.form-group select option { background: #0d0f1a; }
/* Honeypot — visuell und für Screenreader versteckt, aber im DOM */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.form-status {
    font-size: 0.875rem;
    text-align: center;
    margin-top: 2px;
    min-height: 1.2em;
    transition: color var(--transition);
}
.form-status.is-success { color: var(--green); }
.form-status.is-error   { color: #ff6b6b; }
.form-status.is-loading { color: var(--text-dim); }
.contact__alt {
    text-align: center;
    margin-top: 28px;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.contact__alt p { margin-bottom: 8px; }
.contact__email {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--blue);
    transition: color var(--transition);
}
.contact__email:hover { color: var(--cyan); }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0 32px;
    background: var(--bg-2);
}
.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.footer__brand .nav__logo {
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: 6px;
    display: block;
}
.footer__brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer__links,
.footer__legal {
    display: flex;
    gap: 24px;
}
.footer__links a,
.footer__legal a {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color var(--transition);
}
.footer__links a:hover,
.footer__legal a:hover { color: var(--text); }
.footer__bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer__bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Reveal animation ───────────────────────────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed {
    opacity: 1;
    transform: none;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
    .hero__layout { grid-template-columns: 1fr; gap: 48px; padding-block: 60px; }
    .hero__visual { order: -1; }
    .services__grid { grid-template-columns: repeat(2, 1fr); }
    .about__inner { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 640px) {
    .nav__links { display: none; flex-direction: column; gap: 0; }
    .nav__links.open {
        display: flex;
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0;
        background: rgba(8, 9, 15, 0.97);
        backdrop-filter: blur(16px);
        padding: 16px 24px 24px;
        border-bottom: 1px solid var(--border);
        gap: 4px;
    }
    .nav__links.open li { width: 100%; }
    .nav__links.open a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }
    .nav__links.open .btn--nav {
        display: inline-flex;
        margin-top: 12px;
        border: none;
        background: none;
        color: var(--blue);
        padding: 12px 0;
    }
    .nav__toggle { display: flex; }
    .services__grid { grid-template-columns: 1fr; }
    .hero__stats { gap: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .contact-form { padding: 24px; }
    .footer__inner { flex-direction: column; align-items: flex-start; gap: 20px; }
    .stack-grid { grid-template-columns: repeat(2, 1fr); }
    .hero__title { font-size: 2rem; }
}

@media (max-width: 400px) {
    .hero__actions { flex-direction: column; }
    .hero__actions .btn { width: 100%; justify-content: center; }
}

/* ─── Scroll progress bar ────────────────────────────────────── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 0;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    z-index: 200;
    box-shadow: 0 0 12px rgba(77, 124, 254, 0.6);
    will-change: transform;
}

/* ─── Hero glow orbs ─────────────────────────────────────────── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
    will-change: transform;
}
.orb--1 {
    width: 460px; height: 460px;
    top: -120px; right: -80px;
    background: radial-gradient(circle, rgba(77,124,254,0.5), transparent 70%);
    animation: orbFloat 18s ease-in-out infinite;
}
.orb--2 {
    width: 380px; height: 380px;
    bottom: -140px; left: -60px;
    background: radial-gradient(circle, rgba(0,212,200,0.35), transparent 70%);
    animation: orbFloat 22s ease-in-out infinite reverse;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(40px, 30px) scale(1.12); }
}

/* ─── Hero entrance ──────────────────────────────────────────── */
.hero__content > * {
    opacity: 0;
    transform: translateY(18px);
    animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero__content > *:nth-child(1) { animation-delay: 0.05s; }
.hero__content > *:nth-child(2) { animation-delay: 0.15s; }
.hero__content > *:nth-child(3) { animation-delay: 0.25s; }
.hero__content > *:nth-child(4) { animation-delay: 0.35s; }
.hero__content > *:nth-child(5) { animation-delay: 0.45s; }
.hero__visual {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    animation: heroIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}
@keyframes heroIn {
    to { opacity: 1; transform: none; }
}

/* ─── Terminal glow + line reveal ────────────────────────────── */
.terminal {
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
}
.terminal:hover {
    transform: translateY(-3px);
    box-shadow: 0 32px 90px rgba(0,0,0,0.7), 0 0 0 1px rgba(77,124,254,0.2), 0 0 40px rgba(77,124,254,0.12);
}
.terminal__line {
    opacity: 0;
    animation: termLine 0.35s ease forwards;
}
@keyframes termLine {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: none; }
}

/* ─── Service card spotlight ─────────────────────────────────── */
.service-card { position: relative; overflow: hidden; }
.service-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition);
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
                rgba(77, 124, 254, 0.12), transparent 45%);
    pointer-events: none;
}
.service-card:hover::before { opacity: 1; }
.service-card > * { position: relative; z-index: 1; }
.service-card__icon {
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.service-card:hover .service-card__icon {
    transform: translateY(-2px) scale(1.06);
    background: rgba(77, 124, 254, 0.18);
    box-shadow: 0 0 24px rgba(77, 124, 254, 0.25);
}

/* ─── Stack item glow ────────────────────────────────────────── */
.stack-item {
    position: relative;
    transition: border-color var(--transition), color var(--transition),
                background var(--transition), transform var(--transition);
}
.stack-item:hover {
    background: rgba(77, 124, 254, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* ─── Button sheen ───────────────────────────────────────────── */
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(110deg, transparent, rgba(255,255,255,0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}
.btn--primary:hover::after { left: 130%; }

/* ─── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .gradient-text,
    .orb,
    .hero__content > *,
    .hero__visual,
    .terminal__line,
    .badge-dot,
    .t-cursor {
        animation: none !important;
    }
    .hero__content > *,
    .hero__visual,
    .terminal__line { opacity: 1; transform: none; }
}
