/* Portfolio — static layout, neutral + blue accent (v2) */

:root {
    --bg: #f6f7f9;
    --bg-alt: #eef1f5;
    --surface: #ffffff;
    --text: #1a1d23;
    --text-muted: #5c6370;
    --accent: #1e5a8c;
    --accent-hover: #164a73;
    --accent-soft: rgba(30, 90, 140, 0.08);
    --border: #e2e6ed;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(24, 32, 48, 0.06);
    --shadow-hover: 0 8px 24px rgba(24, 32, 48, 0.1);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max: 1080px;
    --narrow: 720px;
    --space-section: clamp(3rem, 8vw, 5rem);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}

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

/* Card / hero images set their own height (global height:auto breaks object-fit layouts) */

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

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.container--narrow {
    max-width: var(--narrow);
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(246, 247, 249, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.25rem;
}

.site-header__brand {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

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

/* Sections */

.section {
    padding-block: var(--space-section);
}

.section--alt {
    background: var(--bg-alt);
}

.section__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.section__lead {
    margin: 0 0 2rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 52ch;
}

.section__lead--muted {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Hero */

.hero {
    padding-top: clamp(2rem, 5vw, 3.5rem);
}

.hero__grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 800px) {
    .hero__grid {
        grid-template-columns: 1fr minmax(220px, 280px);
        gap: 3rem;
    }
}

.hero__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.hero__title {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 4.5vw, 2.65rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
}

.hero__headline {
    margin: 0 0 1rem;
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.5;
}

.hero__summary {
    margin: 0 0 1.75rem;
    color: var(--text);
    max-width: 62ch;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.hero__photo-wrap {
    justify-self: center;
}

@media (min-width: 800px) {
    .hero__photo-wrap {
        justify-self: end;
    }
}

.hero__photo {
    width: min(280px, 70vw);
    height: auto;
    max-height: none;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: var(--shadow-hover);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn__icon {
    flex-shrink: 0;
}

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

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

.btn--secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

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

.btn--outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn--outline:hover {
    background: var(--accent-soft);
}

.btn--lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Prose */

.prose p {
    margin: 0 0 1rem;
    color: var(--text);
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose--center {
    text-align: center;
}

/* Featured cards */

.featured-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card--featured {
    display: grid;
    gap: 0;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 768px) {
    .card--featured {
        grid-template-columns: minmax(200px, 320px) 1fr;
    }
}

.card--featured:hover {
    box-shadow: var(--shadow-hover);
    border-color: #d0d8e4;
}

.card__media {
    position: relative;
    display: grid;
    place-items: stretch;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-alt);
    aspect-ratio: 16 / 10;
}

@media (min-width: 768px) {
    .card--featured .card__media {
        aspect-ratio: unset;
        min-height: 220px;
        height: 100%;
        align-self: stretch;
    }
}

/* Featured media: fill frame consistently (avoids huge intrinsic image sizes when CSS loads late) */
.card__image {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    display: block;
    box-sizing: border-box;
}

.card__image img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.card__media > img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    place-self: stretch;
}

.card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    background: linear-gradient(145deg, var(--bg-alt) 0%, #e4e9f0 100%);
    border: 1px dashed var(--border);
    box-sizing: border-box;
}

.card__body {
    padding: 1.35rem 1.5rem 1.5rem;
}

.card__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.card__subtitle {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.4;
}

.card__desc {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.card__highlights {
    margin: 0;
    padding-left: 1.15rem;
    color: var(--text);
    font-size: 0.9rem;
}

.card__highlights li {
    margin-bottom: 0.4rem;
}

.card__highlights li:last-child {
    margin-bottom: 0;
}

.card__links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card__demo-line {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
}

.card__demo-label {
    font-weight: 600;
    color: var(--text);
}

.card__note {
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.card__note strong {
    color: var(--text);
    font-weight: 600;
}

.link-pill--url {
    word-break: break-all;
    max-width: 100%;
    line-height: 1.35;
}

.link-pill {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    transition: background 0.15s ease, color 0.15s ease;
}

.link-pill:hover {
    background: var(--accent);
    color: #fff;
}

/* Earlier projects — compact grid */

.earlier-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 560px) {
    .earlier-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .earlier-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card--compact {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card--compact:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card--compact__media {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    background: var(--bg-alt);
    overflow: hidden;
    padding: 0.35rem;
    box-sizing: border-box;
}

.card__thumb {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.card__placeholder--sm {
    width: 100%;
    height: 100%;
    min-height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: none;
    background: var(--bg-alt);
}

/* Fill compact media cell (grid centers thumbs but stretches placeholders) */
.card--compact__media .card__placeholder--sm {
    place-self: stretch;
    width: auto;
    height: auto;
}

.card--compact__body {
    padding: 1rem 1.1rem 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card__title--sm {
    font-size: 1rem;
}

.card__desc--sm {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
    flex: 1;
}

.card__links--compact {
    margin-top: auto;
}

/* Resume */

.resume-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Contact */

.section--contact {
    padding-bottom: calc(var(--space-section) + 1rem);
}

.contact-list {
    list-style: none;
    margin: 2rem auto 0;
    padding: 0;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
}

.contact-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.contact-link {
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    word-break: break-word;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Footer */

.site-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
