/* ===================
   DESIGN TOKENS
   =================== */
:root {
    --font-sans: "Inter", sans-serif;
    --font-mono:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;

    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    --border-color: var(--color-gray-200);
    --focus-ring: 0 0 0 2px var(--color-gray-300);

    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
}

/* ===================
   BASE
   =================== */
*,
::before,
::after {
    box-sizing: border-box;
    border-color: var(--border-color);
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
}

body {
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
address {
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-size: inherit;
    font-weight: inherit;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

address {
    font-style: normal;
}

a {
    color: inherit;
    text-decoration: inherit;
}

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

/* ===================
   LAYOUT COMPONENTS
   =================== */
.cv-container {
    max-width: 52rem;
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 3rem) 1rem 3rem;
    background: var(--color-white);
    color: var(--color-gray-800);
    font-family: var(--font-sans);
}

.cv-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
}

.cv-header-content {
    flex: 1 1 0%;
}

.cv-photo {
    width: 6.25rem;
    height: 6.25rem;
    border-radius: var(--radius-xl);
}

.section {
    margin-top: 2rem;
}

/* ===================
   TYPOGRAPHY
   =================== */
.cv-name {
    color: var(--color-gray-900);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 2.25rem;
}

.cv-tagline {
    margin-top: 0.5rem;
    padding-inline-end: 1rem;
    color: var(--color-gray-600);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.section-title {
    color: var(--color-gray-900);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.75rem;
}

.company-name {
    color: var(--color-gray-900);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.75rem;
}

.job-title {
    color: var(--color-gray-900);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
}

.body-text {
    color: var(--color-gray-600);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* ===================
   CONTACT & SOCIAL
   =================== */
.contact-info {
    margin-top: 0.5rem;
}

.contact-info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.contact-info-item-text {
    margin-inline-start: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.social-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.social {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
}

.social:hover {
    background: var(--color-gray-100);
}

.social-url {
    display: none;
    margin-inline-start: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1rem;
}

/* ===================
   ABOUT SECTION
   =================== */
.about-text {
    margin-top: 1rem;
    color: var(--color-gray-600);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* ===================
   EXPERIENCE SECTION
   =================== */
.experience-item {
    margin-top: 2rem;
}

.experience-item-compact {
    margin-top: 1rem;
}

.experience-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.date-range {
    color: var(--color-gray-500);
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.job-description {
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.125rem;
}

.achievement-list {
    margin-top: 0.5rem;
    padding-left: 1rem;
    list-style-position: outside;
    list-style-type: disc;
}

.achievement-list li + li {
    margin-top: 0.25rem;
}

/* ===================
   EDUCATION SECTION
   =================== */
.education-item {
    margin-top: 1rem;
}

.education-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.education-degree {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.education-description {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1rem;
}

/* ===================
   SKILLS SECTION
   =================== */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    list-style: none;
}

.skill-badge {
    border-radius: var(--radius-md);
    background: var(--color-gray-200);
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem;
}

/* ===================
   PRODUCTS SECTION
   =================== */
.products-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.product-item {
    position: relative;
    display: flex;
    height: 100%;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition:
        background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.product-item:hover {
    background: var(--color-gray-50);
}

.product-item:focus-within {
    box-shadow: var(--focus-ring);
}

.product-card-link {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
}

.product-card-link:focus {
    outline: none;
}

.product-content {
    pointer-events: none;
}

.product-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-xl);
}

.product-title {
    font-weight: 600;
    letter-spacing: -0.025em;
}

.product-description {
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1rem;
    text-wrap: pretty;
}

.product-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
    pointer-events: none;
}

.product-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.product-secondary-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    pointer-events: none;
}

.product-secondary-link {
    position: relative;
    z-index: 10;
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.25rem;
    border-bottom: 1px solid transparent;
    color: var(--color-gray-900);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem;
    pointer-events: auto;
    white-space: nowrap;
}

.product-secondary-link:hover {
    border-bottom-color: var(--color-gray-900);
}

.product-skill-badge {
    border-radius: var(--radius-md);
    background: var(--color-gray-200);
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1rem;
}

/* ===================
   PROJECTS SECTION
   =================== */
.projects-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.project-item {
    display: flex;
    height: 100%;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition:
        background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.project-item:hover {
    background: var(--color-gray-50);
}

.project-item:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

.project-title {
    font-weight: 600;
    letter-spacing: -0.025em;
}

.project-description {
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1rem;
    text-wrap: pretty;
}

.project-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    list-style: none;
}

.project-skill-badge {
    border-radius: var(--radius-md);
    background: var(--color-gray-200);
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1rem;
}

/* ===================
   RESPONSIVE STYLES
   =================== */
@media (max-width: 480px) {
    .cv-container {
        padding: 1rem 1rem 2rem;
    }

    .cv-header {
        gap: 1rem;
    }

    .cv-photo {
        width: 5rem;
        height: 5rem;
    }

    .cv-name {
        font-size: 1.5rem;
        line-height: 1.75rem;
    }

    .cv-tagline {
        padding-inline-end: 0;
    }
}

@media (min-width: 768px) {
    .cv-tagline {
        padding-inline-end: 4rem;
    }

    .projects-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .product-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .product-secondary-link {
        align-self: auto;
    }

    .product-secondary-links {
        justify-content: flex-end;
    }

    .projects-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ===================
   PRINT STYLES
   =================== */
@media print {
    @page {
        size: auto;
    }

    .cv-container {
        max-width: none;
        padding: 0;
    }

    .cv-photo {
        width: 5.5rem;
        height: 5.5rem;
    }

    .section {
        margin-top: 1.25rem;
    }

    .experience-item {
        margin-top: 1rem;
    }

    .experience-item-compact {
        margin-top: 0.75rem;
    }

    .job-description {
        font-size: 0.75rem;
        line-height: 1rem;
    }

    .achievement-list {
        margin-top: 0.4rem;
    }

    .achievement-list li + li {
        margin-top: 0.15rem;
    }

    #projects {
        display: none;
    }

    .contact-info-item {
        margin-top: 0.5rem;
    }

    .contact-info-item-text {
        font-size: 0.75rem;
        line-height: 1rem;
    }

    .social-container {
        flex-direction: column;
    }

    .social {
        width: auto;
        height: auto;
        justify-content: flex-start;
        border: 0;
        padding: 0;
    }

    .social:hover {
        background: transparent;
    }

    .social-url {
        display: inline;
    }

    .skill-badge {
        border: 1px solid var(--color-gray-400);
        background: transparent;
    }

    .product-description,
    .project-description {
        font-size: 10px;
    }

    .projects-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
