:root {
    --blue: #1e9fd8;
    --blue-dark: #137bb0;
    --red: #e8412c;
    --ink: #0f1c2e;
    --text: #3b4a5c;
    --muted: #6b7a8c;
    --line: #e3e9f0;
    --bg: #ffffff;
    --bg-alt: #f5f8fb;
    --radius: 14px;
    --shadow: 0 10px 30px -12px rgba(15, 28, 46, .18);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue-dark); text-decoration: none; }
a:hover { color: var(--red); }

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* Buttons */
.btn {
    display: inline-block;
    padding: .8em 1.4em;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--blue);
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--ink); border-color: var(--line); }
.btn-small { padding: .45em 1em; font-size: .92rem; }
.btn-block { width: 100%; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand img { height: 32px; width: auto; }
.nav nav { display: flex; align-items: center; gap: 28px; }
.nav nav a:not(.btn) { color: var(--text); font-weight: 500; font-size: .95rem; }
.nav nav a:not(.btn):hover { color: var(--blue-dark); }

/* Hero */
.hero {
    position: relative;
    padding: 96px 0 104px;
    overflow: hidden;
    background:
        radial-gradient(600px 400px at 90% 10%, rgba(30, 159, 216, .12), transparent 70%),
        radial-gradient(500px 360px at 0% 100%, rgba(232, 65, 44, .08), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center; }
.eyebrow {
    font-family: var(--mono);
    font-size: .82rem;
    letter-spacing: .04em;
    color: var(--red);
    margin: 0 0 18px;
}
.hero h1 { font-size: clamp(2.1rem, 4.2vw, 3.2rem); font-weight: 700; letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: var(--text); max-width: 34em; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }

.terminal {
    background: #0f1c2e;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -20px rgba(15, 28, 46, .45);
    overflow: hidden;
}
.terminal-bar { display: flex; gap: 7px; padding: 14px 16px; background: #16273d; }
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #34475f; }
.terminal-bar span:first-child { background: var(--red); }
.terminal-bar span:nth-child(2) { background: #f2b33d; }
.terminal-bar span:nth-child(3) { background: #3fc47a; }
.terminal pre {
    margin: 0;
    padding: 22px 24px 26px;
    font-family: var(--mono);
    font-size: .86rem;
    line-height: 1.8;
    color: #d6e2ef;
    white-space: pre-wrap;
}
.t-prompt { color: var(--blue); }
.t-ok { color: #3fc47a; }
.t-dim { color: #7f93aa; }
.cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -3px; background: #d6e2ef; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Sections */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -.015em; }
.section-title::after {
    content: "";
    display: block;
    width: 44px;
    height: 4px;
    margin-top: 14px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--blue), var(--red));
}
.section-lead { color: var(--muted); font-size: 1.08rem; margin-bottom: 44px; }

/* Service cards */
/* Flex so an odd number of cards centers the last row. */
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.cards .card { flex: 0 1 calc((100% - 44px) / 3); }
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card h3 { font-size: 1.1rem; margin-top: 18px; }
.card p { font-size: .95rem; margin: 0; color: var(--muted); }
.card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(30, 159, 216, .1);
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--blue-dark); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.project {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project-media { display: block; aspect-ratio: 1200 / 630; overflow: hidden; background: #0e2e1c; }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
/* Two phone screenshots side by side, cropped to the same frame as the website image. */
.project-media-app { display: flex; justify-content: center; gap: 18px; padding: 22px 22px 0; background: #1c4d30; }
.project-media-app img { width: auto; height: 100%; object-fit: cover; object-position: top; border-radius: 12px 12px 0 0; }
.project-body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.project-kind { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--red); margin: 0 0 6px; }
.project h3 { font-size: 1.3rem; }
.project-body > p:not(.project-kind) { color: var(--muted); font-size: .96rem; margin: 0 0 18px; }
.tags { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .8rem; font-weight: 500; color: var(--blue-dark); background: rgba(30, 159, 216, .1); padding: 4px 10px; border-radius: 999px; }
.project-link { margin-top: auto; font-weight: 600; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: center; }
.about-links { display: flex; gap: 22px; font-weight: 600; margin-top: 24px; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.stats li {
    display: flex;
    align-items: baseline;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 10px;
    padding: 18px 22px;
}
.stats li:nth-child(2) { border-left-color: var(--red); }
.stats strong { font-size: 1.6rem; color: var(--ink); letter-spacing: -.02em; }
.stats span { color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: start; }

.form-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    padding: .7em .85em;
    border: 1px solid #cfd8e3;
    border-radius: 9px;
    background: #fbfcfe;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(30, 159, 216, .15);
    background: #fff;
}
.field small { display: block; color: var(--red); font-size: .85rem; margin-top: 5px; }
.has-error input, .has-error textarea { border-color: var(--red); }

.alert { border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; font-size: .95rem; }
.alert-success { background: #eaf8f0; color: #1d6b42; border: 1px solid #bfe8d0; }
.alert-error { background: #fdeeec; color: #a3291a; border: 1px solid #f5c6bf; }

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

/* Footer */
.site-footer { background: var(--ink); color: #9fb0c4; padding: 28px 0; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.site-footer a { color: #d6e2ef; }
.site-footer a:hover { color: var(--blue); }

/* Responsive */
@media (max-width: 980px) {
    .cards .card { flex-basis: calc((100% - 22px) / 2); }
    .projects { grid-template-columns: 1fr; }
    .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero { padding: 64px 0 72px; }
}
@media (max-width: 640px) {
    body { font-size: 16px; }
    .nav nav a:not(.btn) { display: none; }
    .brand img { height: 24px; }
    .field-row { grid-template-columns: 1fr; }
    .cards .card { flex-basis: 100%; }
    .section { padding: 64px 0; }
    .form-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cursor { animation: none; }
    .card, .btn, .project { transition: none; }
}
