/* Modern Resume Page - 2025 Design */

/* CSS Variables for theming */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #0891b2;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --card-glass-bg: rgba(255,255,255,0.85);
    --card-glass-bg-dark: rgba(31,41,55,0.85);
    --bg-grad-light: linear-gradient(180deg,#f6fbff 0%,#eef8ff 100%);
    --bg-grad-dark: linear-gradient(180deg,#07151a 0%,#08323b 100%);
    --page-bg: var(--bg-grad-light);
    --idmerge-filter-light: brightness(0);
    --idmerge-filter-dark: brightness(0) invert(1);
    --card-radius: 1.25rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3b82f6;
        --primary-dark: #2563eb;
        --text-primary: #e5e7eb;
        --text-secondary: #9ca3af;
        --bg-primary: #111827;
        --bg-card: #1f2937;
        --border-color: #374151;
        --card-glass-bg: rgba(31,41,55,0.85);
        --bg-grad-dark: linear-gradient(180deg,#07161a 0%,#042b30 100%);
        --page-bg: var(--bg-grad-dark);
    }
}

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

html {
    /* Responsive font size */
    font-size: clamp(100%, 0.875rem + 0.3125vw, 125%);
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Page background */
    background: var(--page-bg) no-repeat center/cover;
    background-color: var(--bg-primary);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-x: hidden;
    /* Ensure body background matches html */
    background: var(--page-bg) no-repeat center/cover;
    background-color: var(--bg-primary);
}

@media (prefers-color-scheme: dark) {
    /* html background uses the CSS variable set in the dark-mode :root above */
    html {
        background: var(--page-bg);
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    min-width: 0;
}

/* Main Card */
.card {
    background: rgba(255,255,255,0.95);
    border-radius: var(--card-radius);
    box-shadow: 0 24px 60px rgba(2,10,20,0.10);
    /* Responsive padding */
    padding: clamp(0.8rem, 2vw, 2rem) clamp(1rem, 4vw, 3.5rem);
    animation: fadeInUp 0.55s cubic-bezier(.4,0,.2,1);
    /* Responsive max-width */
    max-width: min(95vw, 65rem);
    margin: 0.5rem auto clamp(1rem, 5vh, 3.2rem);
    transition: box-shadow 0.3s, background 0.3s;
    box-sizing: border-box;
    width: 100%;
}

@media (prefers-color-scheme: dark) {
    .card {
        background: rgba(6,12,16,0.86);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Profile Section */
.profile-section {
    text-align: center;
    /* Responsive padding */
    padding-bottom: clamp(0.6rem, 1.5vh, 1rem);
    border-bottom: 1px solid var(--border-color);
}

.profile-image-container {
    /* Responsive circular container */
    width: clamp(8rem, 10vw + 6rem, 12rem);
    height: clamp(8rem, 10vw + 6rem, 12rem);
    padding: 0.25rem;
    margin: 0 auto 1.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    box-shadow: 0 4px 18px rgba(2,10,20,0.08);
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.profile-image-container:hover {
    transform: translateY(-2px) scale(1.02);
}

.profile-placeholder {
    width: 7.5rem; /* 120px */
    height: 7.5rem; /* 120px */
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    color: #fff;
    font-size: 3rem;
    margin: 0 auto;
}

.profile-placeholder svg {
    width: 4rem; /* 64px */
    height: 4rem; /* 64px */
    color: #fff;
    display: block;
}

.name {
    /* Responsive font size */
    font-size: clamp(2rem, 3vw + 1rem, 3.2rem);
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    position: relative;
    display: block;
    padding-bottom: 0.15rem;
}

.name::after {
    content: '';
    display: block;
    height: 0.1875rem;
    margin: 0.35rem 0 0 0;
    border-radius: 0.125rem;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    width: 100%;
}

.title {
    font-size: 1.15rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.bio {
    /* Responsive font size */
    font-size: clamp(0.95rem, 0.5vw + 0.85rem, 1.05rem);
    color: var(--text-secondary);
    max-width: 37.5rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* Contact Section */
.contact-section {
    /* Smooth padding scaling */
    padding: clamp(0.6rem, 1.5vh, 1rem) 0;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    /* Responsive font size */
    font-size: clamp(1.3rem, 1vw + 1rem, 1.5rem);
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.contact-buttons {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    max-width: 55rem;
    margin: 0 auto;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* Responsive padding */
    padding: clamp(0.6rem, 1.5vw, 1.3rem) clamp(1rem, 2vw, 1.6rem);
    background: var(--card-glass-bg);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    /* Responsive font size */
    font-size: clamp(1.05rem, 0.5vw + 0.95rem, 1.1rem);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
    box-shadow: 0 14px 40px rgba(2,10,20,0.06);
}

.contact-btn:nth-child(1) {
    animation-delay: 0.2s;
}

.contact-btn:nth-child(2) {
    animation-delay: 0.3s;
}
/* Stagger remaining buttons for consistent entrance animation */
.contact-btn:nth-child(3) { animation-delay: 0.4s; }
.contact-btn:nth-child(4) { animation-delay: 0.5s; }
.contact-btn:nth-child(5) { animation-delay: 0.55s; }
.contact-btn:nth-child(6) { animation-delay: 0.6s; }

.contact-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    opacity: 0.1;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.contact-btn:hover::before {
    width: 18.75rem;
    height: 18.75rem;
}

.contact-btn svg {
    width: 1.75rem;
    height: 1.75rem;
    transition: var(--transition);
}

.contact-btn img {
    width: 1.75rem;
    height: 1.75rem;
    transition: var(--transition);
}

/* Scale icons on hover */
.contact-btn:hover svg,
.contact-btn:hover img {
    transform: scale(1.15);
}

.contact-btn.idmerge img {
    filter: var(--idmerge-filter-light);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.contact-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(2,10,20,0.10);
    border-color: var(--primary-color);
}

.contact-btn:active {
    transform: translateY(-2px);
}

/* Ripple effect animation */
.contact-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.3;
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    from {
        transform: scale(0);
        opacity: 0.3;
    }
    to {
        transform: scale(2);
        opacity: 0;
    }
}

/* Specific button colors */
.contact-btn.linkedin:hover {
    color: #0077b5;
    border-color: #0077b5;
}

.contact-btn.linkedin:hover svg {
    transform: scale(1.15);
}

.contact-btn.github:hover {
    color: #333;
    border-color: #333;
}

@media (prefers-color-scheme: dark) {
    .contact-btn.github:hover {
        color: #fff;
        border-color: #fff;
    }
}

.contact-btn.github:hover svg {
    transform: scale(1.15) rotate(360deg);
}

.contact-btn.instagram:hover {
    color: #E4405F;
}

.contact-btn.instagram:hover svg {
    transform: scale(1.15);
}

.contact-btn.idmerge:hover {
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.contact-btn.idmerge:hover img {
    transform: scale(1.15);
    filter: none;
}

@media (prefers-color-scheme: dark) {
    .contact-btn.idmerge img {
        filter: var(--idmerge-filter-dark);
    }
}

.contact-btn.mail:hover {
    color: #007bff;
    border-color: #007bff;
}

.contact-btn.mail:hover svg {
    transform: scale(1.15);
}

/* Footer */
.footer {
    padding-top: 1.2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}


.sso-footer {
    font-size: 0.4rem;
    color: var(--text-secondary);
    opacity: 0.3;
    text-align: center;
    margin: 0.1rem;
    line-height: 1;
    user-select: none;
}

/* Responsive Design */

/* Mobile */
@media (max-width: 767px) {
    html {
        background-attachment: scroll;
    }

    body {
        padding: 0;
        background: var(--page-bg);
        background-attachment: scroll;
        overflow: auto;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: clamp(0.5rem, 3vh, 2rem);
        padding-bottom: clamp(0.5rem, 3vh, 2rem);
    }

    .card {
        min-height: auto;
        display: block;
        overflow-y: visible;
    }

    .profile-section {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.5rem clamp(1rem, 3vw, 1.75rem);
        align-items: center;
        text-align: left;
        padding-top: 0.4rem;
        padding-bottom: 0.6rem;
    }

    .profile-image-container {
        grid-row: 1;
        grid-column: 1;
        margin: 0;
        align-self: center;
    }



    .profile-image {
        width: 100%;
        height: 100%;
        margin-top: 0.25rem;
        box-shadow: 0 1.125rem 3rem rgba(3,20,30,0.16);
    }

    .profile-text-container {
        display: contents;
    }

    .name {
        grid-row: 1;
        grid-column: 2;
        margin: 0;
        white-space: normal;
        line-height: 1.1;
        word-break: break-word;
        text-align: left;
        max-width: none;
        align-self: center;
    }

    .name::after {
        width: 100%;
        margin: 0.35rem 0 0 0;
    }

    .title {
        grid-row: 2;
        grid-column: 1 / -1;
        margin: 0;
        text-align: left;
    }

    .bio {
        grid-row: 3;
        grid-column: 1 / -1;
        margin: 0;
        padding: 0;
        max-width: none;
        text-align: left;
    }
}

/* Small mobile: max-width 600px */
@media (max-width: 600px) {
    /* Keep contact section in normal flow on very small screens. This prevents
       large empty gaps by letting the card grow/shrink naturally. */
    .contact-section {
        display: block;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .contact-buttons {
        gap: 0.8rem;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        align-content: space-between; /* still useful if wrapping occurs */
        height: auto;
        flex: initial;
    }

    .contact-btn {
        width: 100%;
        flex-direction: row;
    }
}

/* Tablet/small desktop: 601px to 767px */
@media (min-width: 601px) and (max-width: 767px) {
    .contact-buttons {
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-start;
        max-width: 100%;
    }

    .contact-btn {
        flex: 0 1 calc(50% - 0.55rem);
        min-width: 10rem; /* 160px */
        max-width: calc(50% - 0.55rem);
    }
}

/* Medium: 481px to 899px */
@media (min-width: 768px) and (max-width: 899px) {
    body {
        justify-content: flex-end;
        padding-bottom: 15vh;
    }

    .card {
        /* pull the card up slightly on medium+ screens (not mobile) */
        position: relative;
        top: -3vh;
    }

    .profile-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: clamp(1rem, 3vw, 3rem);
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .profile-image-container {
        flex: 0 0 auto;
        margin: 0;
        width: clamp(8rem, 10vw + 6rem, 10rem);
        height: clamp(8rem, 10vw + 6rem, 10rem);
    }



    .profile-image {
        width: 100%;
        height: 100%;
        margin: 0;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }

    .profile-text-container {
        flex: 1 1 auto;
        padding-left: 0.5rem;
        text-align: left;
    }

    .name {
        margin: 0 0 0.3rem 0;
        text-align: left;
        white-space: normal;
        max-width: 100%;
        display: block;
        width: 100%;
        word-break: break-word;
        line-height: 1.1;
    }

    .name::after {
        width: 100%;
        margin: 0.5rem 0 0 0;
    }

    .bio {
        text-align: left;
        padding: 0;
        margin-top: 0.4rem;
    }
    /* ensure the bio block isn't horizontally centered on medium screens */
    .profile-text-container .bio {
        margin: 0;
    }

    .contact-buttons {
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-start;
        gap: 1rem;
        max-width: none;
    }

    .contact-btn {
        /* Ensure 2 buttons per row at tablet sizes */
        flex: 0 1 calc(50% - 0.5rem);
        min-width: 11rem;
        max-width: calc(50% - 0.5rem);
    }
}

/* Pull the card up slightly on desktop and larger screens as well */
@media (min-width: 900px) {
    .card {
        position: relative;
        top: -3.5vh;
    }
}

/* Desktop: min-width 900px */
@media (min-width: 900px) {
    body {
        justify-content: flex-end;
        padding-bottom: 12vh;
    }



    .profile-section {
        display: grid;
        /* Smooth grid column scaling */
        grid-template-columns: clamp(10rem, 15vw, 13.75rem) 1fr;
        /* Smooth gap scaling */
        gap: clamp(1rem, 3vw, 3rem);
        align-items: center;
        text-align: left;
    }



    .profile-image {
        width: 100%;
        height: 100%;
    }

    .profile-text-container {
        text-align: left;
        position: relative;
    }

    .name {
        display: block;
        text-align: left;
        margin-bottom: 0;
        padding-bottom: 0.1rem;
    }

    .name::after {
        position: static;
        width: 100%;
        margin: 0.35rem 0 0 0;
        height: 3px;
    }

    .title,
    .bio {
        text-align: left;
    }
    .profile-text-container .bio {
        margin: 0;
    }

    .contact-buttons {
        justify-content: center;
        width: auto;
        padding: 0;
        flex-wrap: wrap;
    }

    .contact-btn {
        /* Ensure buttons stay in single row on desktop with better sizing */
        flex: 1 1 auto;
        min-width: 13rem;
        max-width: 16rem;
    }
}

/* Large desktop: min-width 1300px */
@media (min-width: 1300px) {
    .card {
        box-shadow: 0 40px 90px rgba(2,10,20,0.14);
    }

    .profile-section {
        grid-template-columns: 13.75rem 1fr; /* 220px */
        gap: 3rem;
    }

    .bio {
        max-width: 70ch;
    }

    .contact-btn {
        box-shadow: 0 10px 30px rgba(2,10,20,0.12);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.contact-btn:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.contact-btn:focus:not(:focus-visible) {
    outline: none;
}

.contact-btn:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}