/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Varela', sans-serif;
    font-size: 20px;
    line-height: 1.6;
    color: #1d1d1f;
    background-color: #f5f5f7;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Back link for sub-pages */
.back-link {
    position: absolute;
    top: 2rem;
    left: 3rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #6e6e73;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 400;
    transition: color 0.3s ease;
}

.back-link svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    transition: stroke 0.3s ease;
}

.back-link:hover {
    color: #1d1d1f;
}

/* Main content area */
main {
    max-width: 700px;
    margin: 0 auto;
    padding: 8rem 3rem 4rem;
}

/* Home page styles */
.home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    max-width: 1100px;
    padding: 4rem;
    gap: 2.5rem;
}

.profile-container {
    display: flex;
    flex-direction: row;
    gap: 4rem;
    align-items: flex-start;
    width: 100%;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease;
    flex-shrink: 0;
    position: relative;
}

.profile-sidebar::after {
    content: '';
    position: absolute;
    right: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 90%;
    background: linear-gradient(to bottom, transparent, #e0e0e2 10%, #e0e0e2 90%, transparent);
}

.profile-sidebar h1 {
    font-size: 2.2rem;
    font-weight: 400;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    margin: 0;
}

.name-armenian {
    font-size: 1.1rem;
    font-weight: 300;
    color: #6e6e73;
    margin: 0;
    margin-top: -0.1rem;
    letter-spacing: 0.02em;
}

.profile-image {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e0e0e2;
    transition: transform 0.4s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.profile-image:hover {
    transform: scale(1.02);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-content {
    animation: fadeInUp 0.8s ease 0.15s both;
    flex: 1;
    padding-left: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bio,
.interests {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #4a4a4c;
    font-weight: 300;
    letter-spacing: 0.01em;
}

.bio a {
    color: #6e6e73;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.bio a:hover {
    color: #1d1d1f;
    text-decoration-color: #1d1d1f;
}

/* Page links with icons */
.page-links {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.5rem;
}

.page-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #6e6e73;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
}

.page-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #1d1d1f;
    transition: width 0.3s ease;
}

.page-link:hover::after {
    width: 100%;
}

.page-link svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    transition: stroke 0.3s ease;
}

.page-link:hover {
    color: #1d1d1f;
}

.page-link:hover svg {
    stroke: #1d1d1f;
}

.interests {
    margin-top: 2rem;
}

/* Blockquote/motto */
.motto {
    font-size: 1.2rem;
    font-style: italic;
    font-weight: 300;
    color: #5b7a99;
    margin-bottom: 0;
    margin-top: -2rem;
    min-height: 1.8rem;
    padding-left: 1.5rem;
    border-left: 3px solid #5b7a99;
}

.motto cite {
    display: block;
    font-size: 0.9rem;
    font-style: normal;
    color: #86868b;
    margin-top: 0.75rem;
    letter-spacing: 0.02em;
}

.motto-separator {
    border: none;
    border-top: 1px solid #e0e0e2;
    margin: 2.5rem 0;
}

/* Contact links */
.home .links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.3s both;
    width: 100%;
    max-width: 700px;
}

.links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.links a {
    color: #6e6e73;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    position: relative;
    transition: color 0.3s ease;
}

.links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #1d1d1f;
    transition: width 0.3s ease;
}

.links a:hover::after {
    width: 100%;
}

.links a:hover {
    color: #1d1d1f;
}

/* Content pages */
h1 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 4rem;
    color: #1d1d1f;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease;
}

h2 {
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    color: #1d1d1f;
    letter-spacing: 0.02em;
}

h3 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #1d1d1f;
    letter-spacing: -0.01em;
}

.content-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e0e0e2;
    animation: fadeInUp 0.8s ease 0.15s both;
}

.content-section:nth-child(2) {
    animation-delay: 0.25s;
}

.content-section:nth-child(3) {
    animation-delay: 0.35s;
}

.content-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.item {
    margin-bottom: 3.5rem;
    transition: transform 0.3s ease;
}

.item:hover {
    transform: translateX(2px);
}

.item:last-child {
    margin-bottom: 0;
}

/* Expandable items */
.item.expandable h3::after {
    content: ' →';
    color: #a1a1a6;
    font-size: 0.9em;
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
}

.item.expandable:hover h3::after,
.item.expandable.expanded h3::after {
    transform: rotate(90deg);
    color: #1d1d1f;
}

.item.expandable .item-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
    margin-top: 0;
    pointer-events: none;
}

.item.expandable:hover .item-details,
.item.expandable.expanded .item-details {
    max-height: 300px;
    opacity: 1;
    margin-top: 0.5rem;
    pointer-events: auto;
}

.meta,
.item p.meta {
    font-size: 0.8rem;
    color: #86868b;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    font-style: normal;
}

.item p {
    color: #3a3a3c;
    line-height: 1.8;
    margin-bottom: 0.5rem;
    font-weight: 300;
    font-style: italic;
    font-size: 1.0rem;
}

.item p.authors {
    font-size: 0.85rem;
    color: #a1a1a6;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 300;
    line-height: 1.6;
    font-style: normal;
}

.content-section a {
    color: #6e6e73;
    text-decoration: none;
    font-size: inherit;
    font-weight: inherit;
    position: relative;
    transition: color 0.3s ease;
}

.content-section a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #1d1d1f;
    transition: width 0.3s ease;
}

.content-section a:hover::after {
    width: 100%;
}

.content-section a:hover {
    color: #1d1d1f;
}

/* Links inside h3 - use text-decoration for multi-line support */
.content-section h3 a::after {
    display: none;
}

.content-section h3 a {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.3s ease, color 0.3s ease;
}

.content-section h3 a:hover {
    text-decoration-color: #1d1d1f;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Back link */
    .back-link {
        top: 1.5rem;
        left: 1.5rem;
        font-size: 1rem;
    }

    .back-link svg {
        width: 22px;
        height: 22px;
    }

    /* Main content */
    main {
        padding: 5rem 1.5rem 3rem;
    }

    /* Home page */
    .home {
        padding: 3rem 1.5rem;
        gap: 2rem;
    }

    .profile-container {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
        text-align: center;
    }

    .profile-sidebar::after {
        display: none;
    }

    .profile-content {
        padding-left: 0;
        padding-top: 2rem;
        border-top: 1px solid #e0e0e2;
        align-items: center;
    }

    .profile-image {
        width: 140px;
        height: 140px;
    }

    .profile-sidebar h1 {
        font-size: 1.8rem;
    }

    .name-armenian {
        font-size: 1rem;
    }

    .bio {
        font-size: 1rem;
        text-align: center;
    }

    .page-links {
        justify-content: center;
        gap: 2rem;
        margin-top: 2rem;
    }

    .page-link {
        font-size: 1.1rem;
    }

    .page-link svg {
        width: 22px;
        height: 22px;
    }

    .interests {
        font-size: 1rem;
        text-align: center;
    }

    .home .links {
        gap: 1.5rem;
    }

    /* Content pages */
    h1 {
        font-size: 1.75rem;
        margin-bottom: 3rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    h3 {
        font-size: 1.05rem;
    }

    .motto {
        font-size: 1rem;
        margin-top: -1.5rem;
        padding-left: 1rem;
    }

    .motto cite {
        font-size: 0.8rem;
    }

    .motto-separator {
        margin: 2rem 0;
    }

    .content-section {
        margin-bottom: 2rem;
        padding-bottom: 2rem;
    }

    .item {
        margin-bottom: 2.5rem;
    }

    .item p {
        font-size: 0.95rem;
    }

    .item p.authors {
        font-size: 0.8rem;
    }

    .meta {
        font-size: 0.75rem;
    }

    /* Make expandable items tap-friendly on mobile */
    .item.expandable {
        cursor: pointer;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .home {
        padding: 2rem 1rem;
    }

    main {
        padding: 4.5rem 1rem 2rem;
    }

    .back-link {
        top: 1rem;
        left: 1rem;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .profile-sidebar h1 {
        font-size: 1.6rem;
    }

    .page-links {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    h1 {
        font-size: 1.5rem;
    }

    .links a {
        font-size: 0.9rem;
    }
}
