/* Reset & Basics */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden; /* No scrolling */
    background-color: #212121;
    color: #ffffff;
    font-family: 'Work Sans', sans-serif;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    margin: 0;
}

h1 {
    font-size: 4rem;
    margin-bottom: 0;
    color: #14ffec; /* Accent color from original */
}

.chinese-name {
    font-size: 1.5rem;
    font-family: 'Space Mono', monospace;
    color: #ffffff;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.subtitle {
    font-size: 2rem;
    margin-bottom: 3rem;
    color: #e0e0e0;
}

.highlight {
    color: #0d7377; /* Secondary accent */
    font-weight: bold;
}

/* Layout */
.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background: linear-gradient(-45deg, #121212, #1f2e3d, #0d7377, #212121);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.content {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    animation: fadeIn 1.5s ease-in-out;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 4px solid #14ffec;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    align-items: center; /* Center items */
}

/* Add a vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: #0d7377;
    z-index: 0;
    opacity: 0.5;
}

.timeline-item {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    z-index: 1;
    transition: transform 0.3s ease;
    border: 1px solid transparent;
    width: 100%;
    max-width: 500px; /* Limit width */
}

.timeline-item:hover {
    transform: scale(1.05);
    border-color: #14ffec;
}

.year {
    display: block;
    font-size: 0.9rem;
    color: #14ffec;
    margin-bottom: 0.5rem;
    font-family: 'Space Mono', monospace;
}

.school {
    font-size: 1.2rem;
    font-weight: 600;
    display: block;
}

.major {
    display: block;
    font-size: 1rem;
    color: #cccccc;
    margin-top: 0.25rem;
    font-weight: 300;
}

/* Links */
.links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 2px solid #0d7377;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

.links a:hover {
    color: #14ffec;
    border-color: #14ffec;
}

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

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .subtitle { font-size: 1.5rem; }
    .timeline::before { left: 20px; }
    .timeline-item { 
        text-align: left; 
        margin-left: 40px; 
        width: calc(100% - 40px);
    }
    .timeline {
        align-items: flex-start;
    }
}

/* Timeline Group for Hover Effect */
.timeline-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    align-items: center;
    position: relative;
}

.shared-info {
    position: absolute;
    right: -320px; /* Position to the right of the timeline items */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    width: 300px;
}

.timeline-group:hover .shared-info {
    opacity: 1;
    visibility: visible;
    right: -300px; /* Slight slide-in effect */
}

.bracket {
    width: 20px;
    height: 100%; /* Will match the height of the group? No, absolute positioning makes this tricky. */
    height: 150px; /* Fixed height approximation or needs JS/flex magic. Let's use a fixed height that covers most of the two items */
    border-right: 2px solid #14ffec;
    border-top: 2px solid #14ffec;
    border-bottom: 2px solid #14ffec;
    margin-right: 15px;
    flex-shrink: 0;
}

.info-box {
    background-color: rgba(13, 115, 119, 0.9); /* #0d7377 with opacity */
    padding: 1rem;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid #14ffec;
    text-align: left;
}

/* Responsive adjustment for the hover box */
@media (max-width: 1200px) {
    .shared-info {
        display: none; /* Hide on smaller screens where it won't fit */
    }
}

/* Language Toggle */
.language-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    font-family: 'Space Mono', monospace;
}

.lang-btn {
    background: none;
    border: 1px solid transparent;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: #fff;
}

.lang-btn.active {
    color: #14ffec;
    border: 1px solid #14ffec;
    border-radius: 4px;
}

/* Language Visibility Logic */
body:not(.zh-mode) .lang-zh {
    display: none !important;
}

body.zh-mode .lang-en {
    display: none !important;
}
