/* Variables */
:root {
    --background-color: #f8f8f8;
    --text-color: #2d2d2d;
    --accent-color: #2c5f8a;
    --muted-color: #666;
    --highlight-bg: #2d2d2d;
    --highlight-text: #f8f8f8;

    /* Spacing scale — one source of truth for every margin/padding/gap. */
    --space-3xs: 0.25rem;
    --space-2xs: 0.5rem;
    --space-xs: 0.75rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;

    /* Semantic aliases */
    --content-width: 640px;
    --section-gap: var(--space-lg);        /* between major sections */
    --page-margin-block: var(--space-xl);  /* symmetric breathing room top/bottom */
}

@media (min-width: 1080px) {
    :root {
        --page-margin-block: var(--space-2xl);
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --text-color: #e6e6e6;
        --accent-color: #7fb0dd;
        --muted-color: #999;
        --highlight-bg: #e6e6e6;
        --highlight-text: #1a1a1a;
    }
}

/* General */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    width: 100%;
    min-height: 100vh;
    font-weight: 400;
}

strong {
    font-weight: 600;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

/* Content: a single centered text column. The photo sits in the left margin
   on wide screens (see .sidebar below), so the text gets the full column width. */
.content {
    width: 90%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding-block: var(--page-margin-block) 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Layout Sections */
.main-column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.header-section {
    text-align: left;
    margin-bottom: 0;
}

.role-line {
    margin-top: var(--space-2xs);
    font-size: 1.05rem;
}

@media (min-width: 768px) {
    .role-line {
        font-size: 1.15rem;
    }
}

.location-line {
    margin-top: var(--space-2xs);
    font-size: 0.9rem;
    color: var(--muted-color);
}

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--muted-color);
    opacity: 0.3;
    margin-block: var(--space-md);
}

.text-section {
    margin-bottom: 0;
}

.text-section p {
    margin-bottom: var(--space-sm);
    line-height: 1.7;
}

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

/* Photo: stacked above the text by default; moves into the left margin on
   wide screens so the text column stays centered on the page. */
.sidebar {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.sidebar img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

@media (min-width: 1080px) {
    /* Photo footprint, shared between .sidebar width and the .content shift below. */
    :root {
        --photo-width: 190px;
    }

    /* Center the photo + text as one unit: nudge the centered text column right by
       half the photo footprint (photo width + gap), so the combined block is balanced
       on the page instead of leaving a large empty right margin. */
    .content {
        transform: translateX(calc((var(--photo-width) + var(--space-lg)) / 2));
    }

    .sidebar {
        position: absolute;
        right: 100%;
        top: calc(var(--page-margin-block) + 6px);
        width: var(--photo-width);
        max-width: none;
        margin: 0 var(--space-lg) 0 0;
    }

    .sidebar img {
        height: 270px;
        object-fit: cover;
        object-position: center top;
        filter: grayscale(20%);
        transition: filter 0.3s ease;
    }

    .sidebar img:hover {
        filter: grayscale(0%);
    }
}

/* Typography scale */
.big {
    font-size: 1.8rem;
    line-height: 1.3;
    font-weight: 300;
    margin: 0;
}

@media (min-width: 768px) {
    .big {
        font-size: 2.2rem;
    }
}

.medium {
    font-size: 1.1rem;
    line-height: 1.7;
}

@media (min-width: 768px) {
    .medium {
        font-size: 1.25rem;
    }
}

.body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
}

@media (min-width: 768px) {
    .body {
        font-size: 1.05rem;
    }
}

/* Typing Animation */
.cursor {
    opacity: 1;
    animation: blink 1s infinite;
    font-weight: 300;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Role Highlight */
.role-highlight {
    font-weight: 600;
    position: relative;
    color: var(--text-color);
}

.role-highlight::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    opacity: 0.35;
    z-index: -1;
}

/* Content blocks (What I do / Selected work / About) */
.block {
    margin-top: var(--section-gap);
}

.block-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-color);
    margin-bottom: var(--space-sm);
}

/* Skills list */
.skills-list {
    list-style: none;
}

.skills-list li {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3xs) var(--space-sm);
    margin-bottom: var(--space-xs);
    line-height: 1.5;
}

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

.skill-label {
    flex: 0 0 130px;
    font-weight: 600;
    color: var(--text-color);
}

.skill-value {
    flex: 1;
    min-width: 200px;
    color: var(--muted-color);
}

/* Selected work */
.work-list {
    list-style: none;
}

.work-list li {
    border-left: 2px solid var(--accent-color);
    padding-left: var(--space-xs);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

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

.work-title {
    display: block;
    margin-bottom: var(--space-3xs);
    font-weight: 600;
    color: var(--text-color);
}

.work-desc {
    color: var(--muted-color);
}

/* Contact Section */
.footer-section {
    margin-top: var(--section-gap);
}

.contact-section {
    padding-top: var(--space-md);
    position: relative;
    font-size: 0.95rem;
    color: var(--muted-color);
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--muted-color);
    opacity: 0.3;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

.contact-icon {
    width: 2rem;
    margin-right: var(--space-xs);
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.6;
    font-weight: 600;
    font-family: monospace;
}

.contact-text {
    flex: 1;
}

.contact-text strong {
    color: var(--text-color);
    font-weight: 500;
}

.email {
    color: var(--text-color);
}

.contact-note {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--muted-color);
    opacity: 0.85;
}

/* Copyright (in normal flow at page end) */
.copyright {
    text-align: center;
    padding-block: var(--space-xl) var(--page-margin-block);
    padding-inline: var(--space-sm);
    font-size: 0.75rem;
    color: var(--muted-color);
    opacity: 0.7;
}

.copyright a {
    color: var(--muted-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Mobile */
@media (max-width: 767px) {
    .header-section .big {
        margin: 0;
        line-height: 1.2;
        font-size: 1.6rem;
    }

    .skill-label {
        flex-basis: 100%;
    }

    .medium {
        font-size: 1.05rem;
    }
}
