/* ── Fonts ── */
@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/hanken-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/hanken-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/playfair-normal-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/playfair-normal-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: italic;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/playfair-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Playfair Display';
    font-style: italic;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/playfair-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset & variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* VS Code "Light (Visual Studio)" palette */
    --bg:           #ffffff;
    --bg-card:      #f3f3f3;
    --bg-card-hover:#e8e8e8;
    --accent:       #007acc;
    --accent-dim:   rgba(0, 122, 204, 0.08);
    --available:        #2e7d32;
    --available-dim:    rgba(46, 125, 50, 0.08);
    --available-border: rgba(46, 125, 50, 0.3);
    --text-primary: #1e1e1e;
    --text-muted:   #6f6f6f;
    --border:       #d4d4d4;
    --serif:        'Playfair Display', Georgia, 'Times New Roman', serif;
    --mono:         'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    --sans:         'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--sans);
    line-height: 1.6;
    font-size: 16px;
}

/* Subtle dot-grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(0, 122, 204, 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ── Navigation ── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--serif);
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav ul a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

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

.lang-toggle {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.lang-toggle a {
    display: inline-block;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.lang-toggle a:first-child { border-left: none; }

.lang-toggle a:hover { color: var(--accent); background: var(--accent-dim); }

.lang-toggle a.active {
    color: var(--accent);
    background: var(--accent-dim);
    font-weight: 600;
    cursor: default;
}


/* ── Layout ── */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

section { padding: 6rem 0; }

section.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

section.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    section.reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.section-heading::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: var(--border);
}


/* ── Hero ── */
#intro {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
}

.intro-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.greeting {
    font-family: var(--mono);
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0.05em;
}

.intro-text h1 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 4.5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    white-space: nowrap;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.intro-text h2 {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    letter-spacing: 0.01em;
}

/* "Open to new assignments" pill, shown once no work entry is ongoing. */
.availability {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    padding: 0.4rem 0.9rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    color: var(--available);
    background: var(--available-dim);
    border: 1px solid var(--available-border);
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s;
}

.availability[hidden] {
    display: none;
}

.availability:hover {
    background: var(--available-border);
}

.availability-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--available);
    animation: availability-pulse 2s ease-out infinite;
}

@keyframes availability-pulse {
    0%   { box-shadow: 0 0 0 0 var(--available-border); }
    70%  { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .availability-dot {
        animation: none;
    }
}

.intro-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 500px;
    margin-bottom: 2rem;
}

.stats {
    display: flex;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.stat-num {
    display: block;
    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

.social-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    transition: all 0.2s;
    letter-spacing: 0.03em;
}

.btn-link:hover {
    background: var(--accent-dim);
    box-shadow: 0 0 16px rgba(0, 122, 204, 0.15);
}

.btn-link svg {
    width: 18px; height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ── Profile photo ── */
.photo-col {
    display: flex;
    justify-content: center;
}

.photo-frame {
    position: relative;
    width: 290px;
    height: 290px;
    flex-shrink: 0;
}

.photo-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent);
    border-radius: 8px;
    transform: translate(14px, 14px);
    transition: transform 0.25s;
    z-index: -1;
}

.photo-frame:hover::after { transform: translate(8px, 8px); }

.photo-frame img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 8px;
    filter: grayscale(15%);
    transition: filter 0.3s;
    display: block;
}

.photo-frame:hover img { filter: none; }

/* ── Cards ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.25rem;
}

/* ── Work timeline ── */
.timeline {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* vertical line sits in the gutter column, centered */
.timeline::before {
    content: '';
    position: absolute;
    left: calc(8rem + 1.25rem);
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 8rem 2.5rem 1fr;
    align-items: start;
    padding-bottom: 1.25rem;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 0.9rem;
    padding-top: 1.45rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* dot centered on the line */
.tl-item::before {
    content: '';
    position: absolute;
    left: calc(8rem + 1.25rem - 4px);
    top: 1.45rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
    z-index: 1;
}

.tl-item:hover::before {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.tl-item .project-card { grid-column: 3; }

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.co-logo {
    width: 44px; height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.co-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.co-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.co-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.card-title {
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.865rem;
    color: var(--text-muted);
    line-height: 1.55;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
}

.tag {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid rgba(0, 122, 204, 0.2);
    border-radius: 3px;
    padding: 0.18rem 0.5rem;
}

a.tag-link {
    text-decoration: none;
    transition: all 0.2s;
}

a.tag-link:hover,
a.tag-link:focus-visible {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.card-cta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--mono);
    text-align: right;
    margin-top: 0.25rem;
    transition: color 0.2s;
}

.project-card:hover .card-cta { color: var(--accent); }

/* ── Education card ── */
.edu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tl-item .edu-card { grid-column: 3; }

.edu-card {
    cursor: pointer;
    transition: all 0.25s;
}

.edu-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.edu-card:hover .card-cta { color: var(--accent); }

.edu-thesis {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
}

/* ── Modal ── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.overlay.open { display: flex; }

.modal {
    background: var(--bg);
    border: 1px solid rgba(0, 122, 204, 0.25);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 660px;
    width: 100%;
    max-height: 82vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.modal-close {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 0.25rem;
}

.modal-close:hover { color: var(--accent); }

.modal-co {
    font-family: var(--mono);
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.modal-date {
    font-family: var(--mono);
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 1rem;
}

.modal h3 {
    font-family: var(--serif);
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

.modal-body {
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.75;
}

.modal-body p { margin-bottom: 0.75rem; }

.modal-body ul {
    padding-left: 1.4rem;
    margin: 0.5rem 0 0.75rem;
}

.modal-body li { margin-bottom: 0.4rem; }

.modal-body h4 {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 1rem;
}

.modal-body h4:first-child { margin-top: 0; }

.modal-body strong { color: var(--text-primary); }

.modal-body a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.modal-body a:hover { text-decoration: underline; }

/* Brief highlight on a card scrolled to from a modal link. */
.flash { animation: flash 1.6s ease-out; }

@keyframes flash {
    0%, 30% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
    100% { box-shadow: 0 0 0 3px transparent; }
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ── OSS cards ── */
.oss-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.25s;
}

.oss-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.oss-card { cursor: pointer; }

.oss-card:hover .card-cta { color: var(--accent); }

.oss-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.oss-foot .card-cta { margin-top: 0; }

.modal-link { margin-top: 1.25rem; }

.oss-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.oss-project {
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.oss-desc {
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.55;
    flex: 1;
}

.oss-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.65rem;
    transition: all 0.2s;
    width: fit-content;
}

.oss-link:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.oss-link svg { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }

/* ── Skills ── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 1rem;
}

.skill-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    transition: all 0.25s;
}

.skill-tile:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.skill-tile[data-detail] { cursor: pointer; }

.skill-cta {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--mono);
    text-align: right;
    margin-top: 0.6rem;
    transition: color 0.2s;
}

.skill-tile:hover .skill-cta { color: var(--accent); }

.skill-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.skill-icon {
    width: 38px; height: 38px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.skill-icon svg { width: 38px; height: 38px; }

.skill-icon-logo { background: none; }

.skill-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.skill-level {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.bar-track {
    height: 3px;
    background: rgba(0, 122, 204, 0.12);
    border-radius: 2px;
}

.bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), #4db3e6);
    width: 0;
    transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Contact ── */
.contact-card {
    padding: 2rem;
}

.contact-intro {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 3rem 5rem;
}

.contact-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contact-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

/* Rendered as glyph-path SVGs at build time rather than plain text, so
   the values aren't sitting in the page source for scrapers to lift. */
.protected-value {
    color: var(--text-primary);
    display: inline-flex;
}

.protected-value svg { display: block; }

/* ── Footer ── */
footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

footer p {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

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

footer a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 820px) {
    nav { padding: 1rem 1.5rem; }
    nav ul { display: none; }

    .intro-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .photo-col { order: -1; }

    .photo-frame {
        width: 200px; height: 200px;
    }

    .stats { gap: 1.75rem; }

    .section-heading { font-size: 1.4rem; }

    .cards-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }

    .timeline::before { left: 7px; }
    .tl-item { grid-template-columns: 0 2rem 1fr; }
    .tl-date { display: none; }
    .tl-item::before { left: 2px; }
}
