@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
    --bg: #ffffff;
    --text: #050C06;
    --muted: #6b7280;
    --accent: #2DAC69;
    --border: #e5e7eb;
    --code-bg: #f3f4f6;
    --radius: 6px;
    --max-width: 760px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1c1f23;
        --text: #e6e8ea;
        --muted: #9aa1a8;
        --accent: #3FBF7C;
        --border: #2e3338;
        --code-bg: #25292e;
    }

    .post-body img,
    .screenshot-item img {
        opacity: 0.92;
    }

    .company-logo {
        background: #fff;
    }
}

html {
    scrollbar-gutter: stable;
}

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

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a[href^="http"]:not(:has(img.company-logo))::after {
    content: "↗";
    font-size: 0.75em;
    color: var(--muted);
    margin-left: 0.15em;
    display: inline-block;
    text-decoration: none;
}

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

/* ── Layout ── */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

main {
    flex: 1;
}

/* ── Header ── */

header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

.site-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.0em;
}

.site-name:hover {
    color: var(--accent);
    text-decoration: none;
}

.btn-reach-out {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-reach-out:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

/* ── Nav ── */

nav {
    border-bottom: 1px solid var(--border);
}

nav .container {
    display: flex;
    gap: 0.25rem;
}

nav a {
    display: inline-block;
    padding: 0.75rem 0.625rem;
    font-size: 0.9rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

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

/* ── Footer ── */

footer {
    margin-top: 5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

footer .container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

footer a {
    color: var(--muted);
    font-size: 0.875rem;
}

footer a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ── Home ── */

.home-content {
    padding: 4rem 0;
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.profile-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 100% 60%;
    transform: scale(1.20) translateX(8%);
    /*transform-origin: 100% 60%;*/
}

.home-text h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.375rem;
    line-height: 1.2;
}

.home-text .tagline {
    color: var(--muted);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.home-text p {
    margin-bottom: 1rem;
}

/* ── Blog list ── */

.page-heading {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 3rem 0 1.75rem;
}

.post-list {
    list-style: none;
}

.post-list li {
    border-top: 1px solid var(--border);
}

.post-list li:last-child {
    border-bottom: 1px solid var(--border);
}

.post-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    padding: 1.125rem 0;
    color: var(--text);
    text-decoration: none;
}

.post-list a:hover .post-title {
    color: var(--accent);
}

.post-title {
    font-size: 0.975rem;
    font-weight: 500;
}

.post-date {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ── Blog post ── */

.post-header {
    padding: 3rem 0 2rem;
}

.back-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.back-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.post-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.post-meta {
    font-size: 0.875rem;
    color: var(--muted);
}

.post-body {
    border-top: 1px solid var(--border);
    padding-top: 0rem;
    padding-bottom: 4rem;
}

.post-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 1.5rem 0 0.4rem;
}

.post-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.post-body p {
    margin-bottom: 1.25rem;
}

.post-body ul,
.post-body ol {
    margin: 0 0 1.25rem 1.5rem;
}

.post-body li {
    margin-bottom: 0.375rem;
}

.post-body img {
    margin: 1.5rem auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.caption {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.screenshot-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1.5rem 0;
}

.screenshot-item-portrait {
    flex: 1 1 200px;
    max-width: 260px;
}

.screenshot-item-landscape {
    flex: 1 1 400px;
    max-width: 800px;
}

.screenshot-item img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 0;
}

.screenshot-item .caption {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.signature {
    font-style: italic;
    font-size: 1rem;
    color: var(--muted);
    margin-top: 2rem;
}

/* ── Code ── */

code {
    font-family: 'SF Mono', ui-monospace, 'Cascadia Mono', 'Fira Mono', monospace;
    font-size: 0.84em;
    background: var(--code-bg);
    padding: 0.125em 0.4em;
    border-radius: 3px;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem 1.375rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text);
}

.code-snippet {
    margin: 0 0 1.25rem;
}

.code-snippet figcaption {
    font-family: 'SF Mono', ui-monospace, 'Cascadia Mono', 'Fira Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-bottom: none;
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    padding: 0.5rem 1.375rem;
}

.code-snippet pre {
    margin-bottom: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ── Quote ── */

blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.125rem 0 0.125rem 1rem;
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-style: italic;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* ── Tables ── */

.table-wrap {
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    text-align: left;
    padding: 0.625rem 1rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    white-space: nowrap;
}

tbody td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ── Resume ── */

.resume-content {
    padding-bottom: 4rem;
}

.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 600;
    margin: 3rem 0 1.5rem;
}

.exp-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.exp-item {
    display: grid;
    grid-template-columns: 48px 1fr;
    column-gap: 1.25rem;
}

.company-logo {
    background: var(--bg);
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    text-decoration: none;
}

.exp-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.125rem;
}

.company-name {
    font-weight: 600;
    font-size: 0.975rem;
}

a.company-name,
a.company-name:hover {
    color: var(--text);
    text-decoration: none;
}

.exp-duration {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

.exp-role {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.exp-bullets {
    margin: 0 0 0 1.25rem;
}

.exp-bullets li,
.exp-body {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

/* ── Responsive ── */

@media (max-width: 580px) {
    .home-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2.5rem 0;
        gap: 1.5rem;
    }

    .home-text h1 {
        font-size: 1.5rem;
    }

    .post-list a {
        flex-direction: column-reverse;
        gap: 0.25rem;
    }

    .post-header h1 {
        font-size: 1.5rem;
    }

    .exp-top {
        flex-direction: column;
    }

    .table-wrap {
        overflow-x: visible;
    }

    .table-wrap table,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap td {
        display: block;
        width: 100%;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tr {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.5rem 1rem;
        margin-bottom: 0.75rem;
    }

    .table-wrap tr:last-child {
        margin-bottom: 0;
    }

    .table-wrap tbody td {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
    }

    .table-wrap tbody tr td:last-child {
        border-bottom: none;
    }

    .table-wrap td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--muted);
        font-weight: 600;
        margin-bottom: 0.375rem;
    }
}
