/* ==========================================================
   Ngosa Lwando Niza — portfolio
   Off-white paper, deep emerald accent, editorial type.
   ========================================================== */

:root {
    --paper: #f8f8f5;
    --paper-2: #edeee8;
    --ink: #16181a;
    --ink-2: #44484a;
    --muted: #7e8285;
    --line: #e0e1da;
    --line-strong: #c9cbc2;

    --accent: #16735a;
    --accent-deep: #0e5742;
    --accent-wash: #e5f0ec;

    --dark: #111412;
    --dark-2: #1b201d;

    /* Groundr brand, taken from its own stylesheet */
    --groundr-green: #4ade80;
    --groundr-blue: #60a5fa;

    --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

    --shell: 1120px;
    --gutter: 32px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--paper);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

/* Faint paper grain. Decorative only, never catches pointer events. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
    color: inherit;
}

/* height:auto is required — the width/height attributes on <img> act as
   presentational hints, so without it a CSS width stretches the image. */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ── Type ── */
h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 400;
    color: var(--ink);
    line-height: 1.05;
    letter-spacing: -0.015em;
}

h1 {
    font-size: clamp(2.6rem, 8vw, 5.75rem);
}

h2 {
    font-size: clamp(1.95rem, 5vw, 3.25rem);
}

em {
    font-style: italic;
    color: var(--accent);
}

.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 20px;
}

.eyebrow-light {
    color: rgba(255, 255, 255, 0.45);
}

/* ── Masthead ── */
.masthead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 248, 245, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.masthead.stuck {
    border-bottom-color: var(--line);
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
}

.mark {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-decoration: none;
    color: var(--ink);
    flex-shrink: 0;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav a {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--ink-2);
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* ── Hero ── */
.hero {
    padding: clamp(48px, 10vw, 120px) 0 clamp(52px, 8vw, 100px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}

.hero h1 {
    margin-bottom: 28px;
}

.hero-lead {
    font-size: 1.2rem;
    max-width: 46ch;
    color: var(--ink-2);
    margin-bottom: 40px;
}

.roles {
    display: flex;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    margin-bottom: 40px;
}

.role {
    flex: 1 1 180px;
    padding: 18px 20px 18px 0;
    border-bottom: 1px solid var(--line);
}

.role dt {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}

.role dd {
    font-size: 0.95rem;
    color: var(--ink);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn {
    display: inline-block;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 14px 26px;
    text-decoration: none;
    border-radius: 2px;
    border: 1px solid var(--ink);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-solid {
    background: var(--ink);
    color: var(--paper);
}

.btn-solid:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Portrait sits on an offset rule rather than a drop shadow */
.portrait {
    position: relative;
    max-width: 380px;
    margin-left: auto;
}

.portrait::after {
    content: '';
    position: absolute;
    inset: 18px -18px -18px 18px;
    border: 1px solid var(--accent);
    z-index: 0;
}

.portrait img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.04);
    transition: filter 0.5s ease;
}

.portrait:hover img {
    filter: grayscale(0%) contrast(1);
}

/* ── Shipped band ── */
.band {
    background: var(--paper-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 36px 0;
}

.band-label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 24px;
}

.band-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 48px;
    align-items: center;
}

.band-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink-2);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.78;
    transition: opacity 0.25s ease, color 0.25s ease;
}

.band-list a:hover {
    opacity: 1;
    color: var(--accent);
}

.band-logo {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 7px;
    flex-shrink: 0;
}

/* ── Sections ── */
.section {
    padding: clamp(60px, 9vw, 120px) 0;
}

.section-alt {
    background: var(--paper-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 62ch;
    margin-bottom: 56px;
}

.section-note {
    margin-top: 18px;
    color: var(--muted);
}

.sub-head {
    font-size: 1.45rem;
    margin: 72px 0 8px;
    padding-top: 36px;
    border-top: 1px solid var(--line-strong);
}

/* ── Featured work ── */
.featured {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

.card {
    background: var(--paper);
    border: 1px solid var(--line-strong);
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.section-alt .card {
    background: #fff;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.card-logo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid var(--line);
}

.card-title {
    font-family: var(--serif);
    font-size: 1.8rem;
    color: var(--ink);
    line-height: 1.1;
}

.card-role {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 5px;
}

.card p {
    font-size: 0.97rem;
    margin-bottom: 22px;
}

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
    margin-bottom: 20px;
}

.tags li {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--ink-2);
    background: var(--accent-wash);
    border: 1px solid var(--line);
    padding: 4px 9px;
}

.card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.card-links a {
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.card-links a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Groundr has no image mark — rebuild its CSS wordmark instead */
.groundr-mark {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #030305;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--sans);
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #fff;
}

.groundr-mark .g-o { color: var(--groundr-green); }
.groundr-mark .g-d { color: var(--groundr-blue); }

.groundr-mark .g-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--groundr-blue);
    margin-left: 2px;
    align-self: center;
    transform: translateY(5px);
}

/* Same mark, scaled down for the shipped band */
.band-list .groundr-mark {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    font-size: 0.55rem;
}

.band-list .groundr-mark .g-dot {
    width: 2.5px;
    height: 2.5px;
    transform: translateY(3px);
}

/* ── Archive list ── */
.archive {
    list-style: none;
}

.archive li {
    border-bottom: 1px solid var(--line);
}

.archive a,
.archive .row {
    display: grid;
    grid-template-columns: 1fr 1.6fr auto;
    gap: 24px;
    align-items: baseline;
    padding: 22px 0;
    text-decoration: none;
    color: var(--ink-2);
    transition: color 0.2s ease;
}

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

.archive-name {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
}

.archive a:hover .archive-name {
    color: var(--accent);
}

.archive-desc {
    font-size: 0.92rem;
    color: var(--muted);
}

.archive-meta {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}

/* ── About ── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: clamp(32px, 6vw, 80px);
}

.about-grid .section-head {
    margin-bottom: 0;
}

.prose p + p {
    margin-top: 20px;
}

.prose strong {
    color: var(--ink);
    font-weight: 600;
}

.facts {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    margin-top: 44px;
    background: var(--line);
    border: 1px solid var(--line);
}

.facts li {
    background: var(--paper-2);
    padding: 20px 18px;
}

.fact-k {
    display: block;
    font-family: var(--serif);
    font-size: 1.9rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 6px;
}

.fact-v {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

/* ── Stack ── */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.stack-col {
    background: var(--paper);
    padding: 32px 28px;
}

.stack-col h4 {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.stack-col p {
    font-size: 0.93rem;
    color: var(--ink-2);
}

/* ── Contact ── */
.section-dark {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.72);
}

.section-dark h2 {
    color: #fff;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(36px, 7vw, 90px);
    align-items: start;
}

.contact-head {
    margin-bottom: 22px;
}

.contact-note {
    max-width: 42ch;
    color: rgba(255, 255, 255, 0.62);
}

.contact-list {
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.contact-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.contact-list a {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 20px 4px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.contact-list a:hover {
    color: #fff;
    padding-left: 12px;
}

.contact-list i {
    font-size: 1.1rem;
    color: var(--accent);
}

.contact-list span {
    font-weight: 500;
}

.contact-list em {
    font-family: var(--mono);
    font-style: normal;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

/* ── Footer ── */
.footer {
    background: var(--dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 28px 0;
    color: rgba(255, 255, 255, 0.4);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 10px 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
}

/* ==========================================================
   Responsive
   ========================================================== */

/* Tablet — drop the featured grid to a single column */
@media (max-width: 1000px) {
    .featured {
        grid-template-columns: 1fr;
    }
}

/* Portrait tablet and large phones — stack every two-column block */
@media (max-width: 900px) {
    .hero-grid,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Photo leads on narrow screens, name follows */
    .portrait {
        order: -1;
        max-width: 220px;
        margin: 0 0 8px;
    }

    .archive a,
    .archive .row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 18px 0;
    }

    .archive-meta {
        text-align: left;
    }

    .sub-head {
        margin-top: 56px;
    }
}

/* Phones */
@media (max-width: 680px) {
    :root {
        --gutter: 20px;
    }

    body {
        font-size: 16px;
    }

    .masthead-inner {
        height: 60px;
    }

    .nav {
        gap: 18px;
    }

    .nav a {
        font-size: 0.82rem;
    }

    .hero-lead {
        font-size: 1.05rem;
        margin-bottom: 32px;
    }

    .roles {
        margin-bottom: 32px;
    }

    .role {
        flex: 1 1 100%;
        padding: 14px 0;
    }

    /* Full-width taps rather than two cramped buttons */
    .hero-actions {
        gap: 10px;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
        text-align: center;
        padding: 15px 20px;
    }

    .band {
        padding: 28px 0;
    }

    .band-list {
        gap: 14px 28px;
    }

    .band-list a {
        font-size: 0.88rem;
        gap: 10px;
    }

    .section-head {
        margin-bottom: 40px;
    }

    .card {
        padding: 24px 20px;
    }

    .card-top {
        gap: 14px;
        margin-bottom: 18px;
    }

    .card-logo,
    .groundr-mark {
        width: 52px;
        height: 52px;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .card-links {
        gap: 14px;
    }

    .facts {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 36px;
    }

    .fact-k {
        font-size: 1.6rem;
    }

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

    .stack-col {
        padding: 26px 22px;
    }

    /* Icon stays left, label and value stack beside it */
    .contact-list a {
        grid-template-columns: 24px 1fr;
        gap: 6px 14px;
        padding: 18px 2px;
    }

    .contact-list i {
        grid-row: span 2;
        align-self: start;
        margin-top: 3px;
    }

    .contact-list em {
        grid-column: 2;
        font-size: 0.75rem;
        word-break: break-word;
    }

    .contact-list a:hover {
        padding-left: 2px;
    }

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

/* Small phones */
@media (max-width: 400px) {
    .masthead-inner {
        gap: 10px;
    }

    .nav {
        gap: 13px;
    }

    .nav a {
        font-size: 0.76rem;
    }

    .mark {
        font-size: 0.78rem;
    }

    .portrait {
        max-width: 180px;
    }

    .band-list {
        gap: 12px 20px;
    }

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

/* Touch devices get no hover lift — it only ever fires as a sticky state */
@media (hover: none) {
    .card:hover {
        transform: none;
    }

    .portrait:hover img {
        filter: grayscale(100%) contrast(1.04);
    }

    .contact-list a:hover {
        padding-left: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }
}
