/* The public page. Follows the system's light or dark setting. */

:root {
    --bg: #ffffff;
    --surface: #f9fafb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --text-2: #4b5563;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
    --shadow-hover: 0 8px 24px rgb(0 0 0 / 0.10);
    --gh-0: #ebedf0;
    --gh-1: #9be9a8;
    --gh-2: #40c463;
    --gh-3: #30a14e;
    --gh-4: #216e39;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111827;
        --surface: #1f2937;
        --card: #1f2937;
        --border: #374151;
        --text: #f9fafb;
        --text-2: #d1d5db;
        --muted: #9ca3af;
        --accent: #60a5fa;
        --accent-hover: #93c5fd;
        --shadow: 0 1px 3px rgb(0 0 0 / 0.4);
        --shadow-hover: 0 10px 28px rgb(0 0 0 / 0.45);
        --gh-0: #263040;
        --gh-1: #0e4429;
        --gh-2: #006d32;
        --gh-3: #26a641;
        --gh-4: #39d353;
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, p { margin: 0; }

.icon { width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); }

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: background-color .15s, border-color .15s;
}
.button:hover { background: var(--surface); color: var(--text); border-color: var(--muted); }

/* ---------- Top: profile on the left, details on the right ---------- */

.intro {
    display: grid;
    grid-template-columns: 1fr;
}
/* Lets the activity grid scroll inside its column instead of widening the page. */
.intro > * { min-width: 0; }

.profile {
    padding: 56px 24px 32px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.profile-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 340px;
    margin: 0 auto;
}

.avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--border);
    margin-bottom: 12px;
}

.name { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.headline { font-size: 18px; color: var(--muted); }
.rule { width: 64px; height: 1px; background: var(--border); margin: 8px 0; }
.summary { font-size: 15px; color: var(--text-2); }

.contact {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--text-2);
}
.contact li { display: flex; align-items: center; justify-content: center; gap: 8px; }
.contact a { color: var(--text-2); }
.contact a:hover { color: var(--text); }

.socials { display: flex; gap: 4px; }
.socials a {
    display: inline-flex;
    padding: 8px;
    border-radius: 8px;
    color: var(--muted);
    transition: color .15s, background-color .15s;
}
.socials a:hover { color: var(--text); background: var(--surface); }
.socials .icon { width: 20px; height: 20px; }

.details { padding: 8px 0 16px; }

.block {
    max-width: 672px;
    margin: 0 auto;
    padding: 24px;
}

.block h2,
.projects h2 {
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

/* ---------- Skills ---------- */

.skills {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.skill-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 8px;
}

.chips {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chips li {
    padding: 3px 10px;
    font-size: 14px;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.chips.small li { font-size: 12px; padding: 2px 8px; }

/* ---------- Experience ---------- */

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.timeline li {
    position: relative;
    padding-left: 18px;
    border-left: 2px solid var(--border);
}
.timeline li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 3px var(--bg);
}
.job-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 2px 12px;
}
.job-head h3 { font-size: 16px; font-weight: 600; }
.period { font-size: 14px; color: var(--muted); white-space: nowrap; }
.company { font-size: 14px; font-weight: 500; color: var(--text-2); margin: 2px 0 6px; }
.company a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.company a:hover { color: var(--text); }

.prose { color: var(--text-2); }
.prose.small { font-size: 14px; line-height: 1.6; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 8px; }
.prose ul { margin: 0; padding-left: 18px; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- GitHub activity ---------- */

.activity-scroll { overflow-x: auto; padding-bottom: 4px; }

.activity {
    --cell: minmax(9px, 1fr);
    min-width: calc(var(--weeks) * 12px);
}
.activity-months,
.activity-grid {
    display: grid;
    grid-template-columns: repeat(var(--weeks), var(--cell));
    gap: 3px;
}
.activity-months {
    height: 16px;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
}
.activity-months span { white-space: nowrap; }
.activity-grid {
    grid-template-rows: repeat(7, auto);
    grid-auto-flow: column;
}
.activity-grid i {
    aspect-ratio: 1;
    border-radius: 2px;
    background: var(--gh-0);
}
.activity-grid i.empty { background: transparent; }
.activity-grid i.l1 { background: var(--gh-1); }
.activity-grid i.l2 { background: var(--gh-2); }
.activity-grid i.l3 { background: var(--gh-3); }
.activity-grid i.l4 { background: var(--gh-4); }
.activity-total { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ---------- Projects ---------- */

.projects {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 16px 24px;
}
.projects h2 { text-align: center; border-bottom: 0; font-size: 24px; margin-bottom: 24px; }

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.card-media {
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: grid;
    place-items: center;
    overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-initial { font-size: 48px; font-weight: 700; color: var(--border); }

.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    flex: 1;
}
.card-body h3 { font-size: 17px; font-weight: 600; }
.card-foot { margin-top: auto; padding-top: 4px; font-size: 14px; }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.card-link .icon { width: 14px; height: 14px; }
.closed { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-style: italic; }
.closed .icon { width: 14px; height: 14px; }

.footer {
    text-align: center;
    padding: 32px 16px 40px;
    font-size: 13px;
    color: var(--muted);
}

.message-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
}
.message-page h1 { font-size: 24px; }

/* ---------- Wider screens ---------- */

@media (min-width: 640px) {
    .skills { grid-template-columns: 1fr 1fr; }
    .project-grid { grid-template-columns: 1fr 1fr; }
    .projects { padding-left: 24px; padding-right: 24px; }
}

@media (min-width: 900px) {
    /* Fills a normal screen, but a very tall one does not leave a void around the content. */
    .intro { grid-template-columns: 2fr 3fr; min-height: min(100vh, 960px); }
    .profile {
        border-bottom: 0;
        border-right: 1px solid var(--border);
        padding: 48px 24px;
    }
    /* The profile stays in view while the details scroll past it. */
    .profile-inner { position: sticky; top: 48px; }
    .avatar { width: 160px; height: 160px; }
    .name { font-size: 30px; }
    .details { padding: 40px 16px; display: flex; flex-direction: column; justify-content: center; }
    .block { width: 100%; }
    .project-grid { grid-template-columns: repeat(3, 1fr); }
}
