/* ============================================================
   Portfolio stylesheet.
   Colors and fonts live in the :root variables below — change
   them there and the whole site follows.
   ============================================================ */

:root {
    color-scheme: dark;           /* makes browser-drawn parts (scrollbars, form widgets) dark too */
    --color-bg: #12161c;
    --color-surface: #1b222b;
    --color-text: #e6ebf1;
    --color-muted: #9aa8b8;
    --color-accent: #4e9d73;      /* buttons, links, highlights — muted dark green */
    --color-accent-dark: #71bd94; /* hover shade — lighter, since the page is dark */
    --color-border: #2c3540;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius: 10px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-dark); }

h1, h2, h3 { line-height: 1.25; }

code {
    background: var(--color-border);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---------- Header & navigation ---------- */

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    flex-wrap: wrap;
}

.brand { text-decoration: none; color: var(--color-text); }
.brand-name { display: block; font-weight: 700; font-size: 1.15rem; }
.brand-tagline { display: block; font-size: 0.78rem; color: var(--color-muted); }

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
}

.site-nav a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: var(--color-accent); }
.site-nav a.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1.3rem;
    padding: 0.15rem 0.55rem;
    cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}

.hero h1 { font-size: 2.4rem; margin: 0 0 1rem; }

.hero-lead {
    max-width: 640px;
    margin: 0 auto 1.75rem;
    color: var(--color-muted);
    font-size: 1.1rem;
}

.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--color-accent);
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); color: #fff; }

.btn-secondary { background: transparent; color: var(--color-accent); }
.btn-secondary:hover { background: var(--color-accent); color: #fff; }

/* ---------- Sections & project cards ---------- */

.section { padding: 2.5rem 0; }
.page-lead { color: var(--color-muted); max-width: 640px; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.project-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: var(--color-border);
}

.project-body { padding: 1rem 1.25rem 1.25rem; }
.project-body h3 { margin: 0 0 0.5rem; }
.project-tools, .project-skills { font-size: 0.85rem; color: var(--color-muted); }

/* ---------- Services ---------- */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 2rem;
}

.service {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}

.service h3 { margin-top: 0; }

/* ---------- About ---------- */

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

.about-photo img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.skills-list { padding-left: 1.2rem; }
.skills-list li { margin-bottom: 0.4rem; }

/* ---------- Contact form ---------- */

.contact-form {
    max-width: 560px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.contact-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; }

.contact-form input,
.contact-form textarea {
    font: inherit;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--color-accent);
    border-color: var(--color-accent);
}

.contact-form button { align-self: flex-start; }

/* Honeypot field: moved off-screen so visitors never see it */
.hp-field { position: absolute; left: -9999px; }

.form-success {
    background: #14291c;
    border: 1px solid #2f6b45;
    color: #8fd8a8;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
}

.form-error {
    background: #331a1a;
    border: 1px solid #7a3535;
    color: #f2a0a0;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    margin-top: 3rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 1rem;
    padding-bottom: 1rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
    .nav-toggle { display: block; }

    .site-nav {
        display: none;
        width: 100%;
    }

    .site-nav.open { display: block; }

    .site-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
    }

    .site-nav a { display: block; padding: 0.6rem 0; }

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

    .about-grid { grid-template-columns: 1fr; }
    .about-photo { order: -1; max-width: 280px; }
}
