/**
 * H. Rose Kim - Academic Portfolio Styles
 * Redesigned for a modern, professional, and clean aesthetic.
 */

:root {
    /* Colors */
    --primary-color: #1a2a3a;      /* Deep Navy */
    --secondary-color: #6c757d;    /* Muted Slate */
    --accent-color: #cbb26a;       /* Muted Gold/Bronze for highlights */
    --text-color: #2c3e50;         /* Dark Charcoal */
    --text-light: #5a6b7c;         /* Light Gray Text */
    --bg-color: #ffffff;           /* Pure White */
    --bg-alt: #f8f9fa;             /* Very subtle gray */
    
    /* Typography */
    --font-heading: 'Crimson Pro', serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing */
    --nav-height: 80px;
    --section-spacing: 4rem;
}

/* ==========================================================================
   1. Base & Reset
   ========================================================================== */

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--nav-height); /* Offset for fixed navbar */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
}

p {
    margin-bottom: 1.5rem;
    font-weight: 300;
    color: var(--text-color);
}

strong {
    font-weight: 600;
    color: var(--primary-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   2. Navigation
   ========================================================================== */

.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: var(--nav-height);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color) !important;
    letter-spacing: -0.01em;
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--text-light) !important;
    padding: 0.5rem 0 !important;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Active State indicator */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 500;
    border: none; /* Override old border */
}

.nav-link.active::after {
    width: 100%;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ==========================================================================
   3. Layout & Content Animation
   ========================================================================== */

main.container {
    max-width: 1000px; /* Constrain width for better readability */
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* ==========================================================================
   4. Home Section
   ========================================================================== */

/* Profile Image */
.profile-image {
    max-height: 500px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.15);
    filter: grayscale(20%); /* Artistic touch */
    transition: filter 0.5s ease, transform 0.5s ease;
}

.profile-image:hover {
    filter: grayscale(0%);
    transform: scale(1.01);
}

/* Education List */
dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

dt {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

dd {
    margin-left: 0;
    margin-bottom: 0;
    color: var(--text-light);
    font-size: 0.95rem;
    border-left: 2px solid var(--accent-color);
    padding-left: 1rem;
}

/* ==========================================================================
   5. CV Section
   ========================================================================== */

.cv-container {
    position: relative;
    min-height: 800px;
    background: var(--bg-alt);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 1rem;
}

.cv-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-light);
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.cv-embed {
    width: 100%;
    min-height: 800px;
    border: none;
    border-radius: 4px;
    background-color: white;
}

/* ==========================================================================
   6. Contact Section
   ========================================================================== */

#contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-photo {
    border-radius: 50%;
    max-width: 250px;
    height: 250px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    margin-bottom: 2rem;
    border: 4px solid white;
}

.contact-links {
    margin-top: 2rem;
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 8px;
    display: inline-block;
    width: 100%;
}

.contact-links p {
    margin-bottom: 1rem;
}

.contact-links a {
    color: var(--text-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: background-color 0.2s ease;
}

.contact-links a:hover {
    background-color: rgba(0,0,0,0.05);
    text-decoration: none;
}

.contact-links svg {
    margin-right: 10px;
    color: var(--primary-color);
}

/* ==========================================================================
   7. Responsive Design
   ========================================================================== */

@media (max-width: 991.98px) {
    .profile-image {
        max-height: 400px;
        margin-bottom: 2rem;
        width: auto;
        max-width: 100%;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }
    
    .nav-link {
        margin-left: 0;
        padding: 0.75rem 0 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .nav-link::after {
        display: none; /* Disable underline animation on mobile */
    }
}

@media (max-width: 575.98px) {
    h1 {
        font-size: 2rem;
    }
    
    .profile-image {
        max-height: none;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    .contact-photo {
        max-width: 180px;
        height: 180px;
    }
    
    .cv-embed, .cv-container {
        min-height: 500px;
    }
    
    main.container {
        padding-top: 1rem;
    }
}
