/* ===== RESET AND BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F9FAFD;
    color: #1a2947;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    display: flex;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: center;
    flex-direction: column;
}

/* ===== HEADER SECTION ===== */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0 0;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.header-content {
    width: 100%;
    display: flex;
    text-align: center;
    justify-content: space-between;
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.2px;
}

.company-name {
    color: #5d667a;
    letter-spacing: 0.12px;
}

.social-handle {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #5d667a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-handle:hover {
    color: #1a2947;
}

.at-symbol {
    width: 16px;
    height: 16px;
}

.logo {
    display: flex;
    margin-top: 24px;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ===== HERO SECTION ===== */
.hero {
    margin: 120px 0 80px;
    max-width: 720px;
}

.hero-content-greeting {
    position: relative;
    width: fit-content;
}

.greeting {
    display: flex;
    width: fit-content;
    font-size: 16px;
    font-weight: 400;
    color: #1a2947;
    margin-bottom: 24px;
    letter-spacing: 0.16px;
}

.waving-hand {
    position: absolute;
    top: -28px;
    right: -80px;
    display: flex;
    background: #85B6FF;
    box-sizing: border-box;
    border-radius: 18px 18px 18px 4px;
    padding: 8px 48px 8px 8px;
    border: 1.5px solid #ffffff;
}

.waving-hand:hover .hand-icon {
    animation: wave 0.6s ease-in-out;
}

.hand-icon {
    width: 16px;
    height: 16px;
    transform-origin: 70% 70%;
}

.description {
    font-size: 16px;
    line-height: 24px;
    color: #1a2947;
    margin-bottom: 24px;
    letter-spacing: 0.16px;
}

/* CTA Section */
.cta-section {
    /* margin-bottom: 24px; */
}

.cta-text {
    font-size: 16px;
    color: #1a2947;
    margin-bottom: 16px;
    letter-spacing: 0.16px;
}

.cta-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.cta-container:hover .mail-capsule {
    background: #f0c4f8;
}

.cta-container:hover .cta-link {
    color: #5d667a;
}

.cta-container:hover .mail-icon {
    transform: translateX(-28px);
}

.mail-capsule {
    background: #f6d5fe;
    padding: 8px 8px 8px 40px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cta-link {
    color: #1a2947;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mail-icon {
    width: 16px;
    height: 16px;
    transition: transform 1s ease;
}

.copy-instruction {
    font-size: 16px;
    color: #5d667a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    background: #e1e6f0;
    border: none;
    border-radius: 8px;
    padding: 3px 10px;
    font-size: 16px;
    font-weight: 500;
    color: #1a2947;
    cursor: pointer;
    border-bottom: 1.5px solid #afb7c7;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #d0d8e8;
    transform: translateY(-1px);
}

/* ===== WORK SECTION ===== */
.work-section {
    width: 720px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 40px;
}

.section-title {
    font-size: 16px;
    font-weight: 400;
    color: #afb7c7;
    margin-bottom: 16px;
    letter-spacing: 0.16px;
}

.section-subtitle {
    font-size: 16px;
    color: #5d667a;
    letter-spacing: 0.16px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Project Card Links */
.projects-grid a {
    text-decoration: none;
    color: inherit;
}

/* Project Cards */
.project-card {
    border-radius: 24px;
    padding: 36px 28px 28px;
    position: relative;
    overflow: hidden;
    border: 4px solid #ffffff;
    box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideInLeft 0.6s ease-out;
}


.project-card:nth-child(even) {
    animation: scaleIn 0.6s ease-out;
}

/* Specific Project Cards */
.somno-card {
    background: #fff8eb;
    grid-row: span 2;
    height: 618px;

}

.somno-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.12);
}

.remixicon-wrapper {
    position: relative;
    grid-column: span 1;
}

.remixicon-wrapper:hover .shadow-svg {
    /* box-shadow: 0px 16px 24px rgba(0, 0, 0, 0.2); */
    filter: drop-shadow(0px 16px 24px rgba(0, 0, 0, 0.2));
}

.remixicon-wrapper:hover .remixicon-card {
    transform: perspective(2000px) rotateX(1.25deg);
    transform-origin: top center;
    transition: transform 0.3s ease-out;
}

.remixicon-card {
    background: #d6ecff;
    height: 618px;
    position: relative;
    overflow: visible;
    z-index: 2;
    transition: transform 0.3s ease-out;
    transform-origin: top center;
}

.tape-sticker {
    position: absolute;
    top: -50px;
    right: 0;
    width: 88px;
    z-index: 5;
    pointer-events: none;
}

.shadow-svg {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 348px;
    height: auto;
    z-index: 1;
    transition: all 0.3s ease;
    pointer-events: none;
}

.launchos-wrapper {
    position: relative;
    grid-column: span 2;
    z-index: 1;
}

.launchos-card {
    background: #f0f4f8;
    margin-top: -24px;
    height: 512px;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.launchos-wrapper:hover .launchos-card {
    transform: translateY(-4px);
    box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.12);
}

.project-icon {
    display: flex;
    margin-bottom: 12px;
}

.icon-img {
    width: 36px;
    height: 36px;
}

.project-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #1a2947;
    margin-bottom: 12px;
    line-height: 30px;
}

.project-tags {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    line-height: 14px;
    color: rgba(13, 15, 20, 0.8);
    margin-bottom: 12px;
    height: 24px;
}

.tag-separator {
    color: rgba(0, 0, 0, 0.2);
}

/* Badge base styles */
.open-source-badge,
.star-badge {
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    line-height: 14px;
    font-weight: 500;
    mix-blend-mode: plus-darker;
}

.open-source-badge {
    background: rgba(49, 115, 246, 0.08);
    padding: 4px 8px;
}

.star-badge {
    background: rgba(26, 41, 71, 0.08);
    padding: 5px 3px 5px 6px;
    gap: 4px;
    color: #1a2947;
}

.badge-text {
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    color: #1d5ef5;
    font-weight: 500;
}

/* Project Previews */
.project-preview {
    text-align: center;
    position: relative;
}

.somno-card .preview-img {
    box-sizing: content-box;
    max-width: 208px;
    height: auto;
    border-radius: 32px;
    border: 6.5px solid rgba(0, 0, 0, 0.8);
    display: block;
    margin: 0 auto;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 36px;

}

.remixicon-preview {
    position: absolute;
    bottom: 28px;
    left: 32px;
    right: 32px;
}

.remixicon-preview-img {
    width: 100%;
    height: auto;
}

/* LaunchOS Card Preview */
.launchos-card .project-preview {
    position: absolute;
    bottom: -10px;
    right: -106px;
}

.launchos-card .preview-img {
    max-width: 612px;
    height: auto;
}

/* ===== MAC ICONS CONTAINER & ANIMATIONS ===== */
.mac-icons-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 720px;
    height: 512px;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

.mac-icon {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* Initial positions - scattered around the center */
.mac-icon.icon-1 {
    top: 20%;
    left: 15%;
    transform: rotate(0deg);
}

.mac-icon.icon-2 {
    top: 15%;
    left: 45%;
    transform: rotate(0deg);
}

.mac-icon.icon-3 {
    top: 25%;
    left: 75%;
    transform: rotate(0deg);
}

.mac-icon.icon-4 {
    top: 45%;
    left: 10%;
    transform: rotate(0deg);
}

.mac-icon.icon-5 {
    top: 40%;
    left: 40%;
    transform: rotate(0deg);
}

.mac-icon.icon-6 {
    top: 50%;
    left: 70%;
    transform: rotate(0deg);
}

.mac-icon.icon-7 {
    top: 65%;
    left: 20%;
    transform: rotate(0deg);
}

.mac-icon.icon-8 {
    top: 70%;
    left: 50%;
    transform: rotate(0deg);
}

.mac-icon.icon-9 {
    top: 60%;
    left: 80%;
    transform: rotate(0deg);
}

.mac-icon.icon-10 {
    top: 55%;
    left: 35%;
    transform: rotate(0deg);
}

/* Hover state - icons move to container edges */
.launchos-wrapper:hover .mac-icon.icon-1 {
    top: 64%;
    left: -35%;
    transform: rotate(-25deg);
}

.launchos-wrapper:hover .mac-icon.icon-2 {
    top: 12%;
    left: 124%;
    transform: rotate(20deg);
}

.launchos-wrapper:hover .mac-icon.icon-3 {
    top: 72%;
    left: 120%;
    transform: rotate(15deg);
}

.launchos-wrapper:hover .mac-icon.icon-4 {
    top: 48%;
    left: 126%;
    transform: rotate(25deg);
}

.launchos-wrapper:hover .mac-icon.icon-5 {
    top: 10%;
    left: -20%;
    transform: rotate(-18deg);
}

.launchos-wrapper:hover .mac-icon.icon-6 {
    top: 54%;
    left: 98%;
    transform: rotate(-12deg);
}

.launchos-wrapper:hover .mac-icon.icon-7 {
    top: 30%;
    left: 108%;
    transform: rotate(30deg);
}

.launchos-wrapper:hover .mac-icon.icon-8 {
    top: 40%;
    left: -8%;
    transform: rotate(20deg);
}

.launchos-wrapper:hover .mac-icon.icon-9 {
    top: 36%;
    left: -32%;
    transform: rotate(15deg);
}

.launchos-wrapper:hover .mac-icon.icon-10 {
    top: 75%;
    left: -15%;
    transform: rotate(-30deg);
}

/* Sogou Card */
.sogou-wrapper {
    position: relative;
    grid-column: span 2;
    z-index: 1;
}

.sogou-card {
    background: #f3f7fe;
    background-image: url('Images/sogou_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 720px;
    height: 320px;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.sogou-wrapper:hover .sogou-card {
    transform: translateY(-4px);
    box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.12);
}

/* Project badges container */
.project-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* macOS tag */
.project-tags .tag {
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 24px;
    padding: 5px 0;
    display: flex;
    align-items: center;
}

/* Sogou Open Source badge */
.sogou-open-source {
    background: rgba(33, 163, 93, 0.12);
    padding: 5px 8px;
}

.sogou-open-source .badge-text {
    color: #21A35D;
}

/* Star badge - removed duplicate styles, now inherits from base */

.github-icon {
    width: 14px;
    height: 14px;
}

.star-text {
    color: #5D667A;
}

.star-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 50px;
    color: #1a2947;
    font-weight: 600;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
    width: 720px;
    margin: 0 auto;
    margin-top: 80px;
}

.contact-grid {
    display: flex;
    flex-direction: column;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(26, 41, 71, 0.04);
    animation: fadeInUp 0.5s ease-out;
    min-height: 64px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.contact-item:hover {
    transform: translateY(-1px);
}

.contact-item:hover .arrow-icon {
    transform: translateX(4px);
}

.contact-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.contact-icon.rednote {
    width: auto;
    height: 24px;
}

.contact-label {
    font-size: 18px;
    font-weight: 400;
    color: #5D667A;
    flex-shrink: 0;
}

.contact-value {
    font-size: 16px;
    color: #1A2947;
    font-family: 'Geist Mono', monospace;
    flex: 1;
    text-align: right;
    margin-right: 12px;
}

.arrow-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item:nth-child(2) {
    animation-delay: 0.1s;
}

.contact-item:nth-child(3) {
    animation-delay: 0.2s;
}

.copy-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.copy-icon:hover {
    background: #f0f4f8;
}

.copy-img {
    width: 18px;
    height: 18px;
}

/* ===== FOOTER ===== */
.footer {
    padding: 40px 0;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.footer-text {
    font-size: 14px;
    color: #5d667a;
    font-family: 'Geist Mono', monospace;
}

/* ===== ANIMATIONS ===== */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-15deg) scale(1.1);
    }
    75% {
        transform: rotate(15deg) scale(1.1);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation Classes for JavaScript */
.animate-initial {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* ===== SCROLLBAR CUSTOMIZATION ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header {
        text-align: center;
    }

    .logo {
        position: static;
        transform: none;
        margin: 24px auto 0;
    }

    .hero {
        padding: 40px 0;
        margin: 40px 0 0;
    }

    /* Work Section - Adaptive width for title area */
    .work-section {
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
        padding: 0 16px;
    }

    .section-header {
        width: 100%;
        text-align: left;
        margin-bottom: 24px;
    }

    /* Projects Grid - Vertical layout for mobile */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Remove hover effects on mobile */
    .project-card:hover,
    .somno-card:hover,
    .remixicon-wrapper:hover .remixicon-card,
    .launchos-wrapper:hover .launchos-card,
    .sogou-wrapper:hover .sogou-card {
        transform: none !important;
        box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.08) !important;
    }

    .remixicon-wrapper:hover .shadow-svg {
        filter: drop-shadow(0px 0px 0px rgba(0, 0, 0, 0));
    }

    .launchos-wrapper:hover .mac-icon {
        display: none;
    }

    /* RemixIcon Card - Top align preview image with 24px spacing */
    .remixicon-wrapper {
        height: auto;
    }

    .remixicon-card {
        height: auto;
        min-height: 350px;
        display: flex;
        flex-direction: column;
        padding-bottom: 24px;
    }

    .remixicon-card .card-content {
        padding: 24px;
        flex-shrink: 0;
    }

    .remixicon-preview {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        margin-top: 24px;
        padding: 0 24px;
        overflow: hidden;
        border-radius: 0 0 20px 20px;
    }

    .remixicon-preview-img {
        width: 100%;
        height: auto;
        max-height: 200px;
        object-fit: cover;
        object-position: center;
    }

    /* LaunchOS Card - Center preview image and increase height */
    .launchos-wrapper {
        grid-column: span 1;
        height: auto;
    }

    .launchos-card {
        height: 400px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-top: 0;
    }

    .launchos-card .card-content {
        padding: 24px;
    }

    .launchos-card .project-preview {
        position: relative;
        bottom: auto;
        right: auto;
        text-align: center;
        margin-top: 24px;
        padding: 0 24px 24px;
    }

    .launchos-card .preview-img {
        max-width: 100%;
        height: auto;
        position: relative;
        left: auto;
        top: auto;
        transform: none;
    }

    /* Hide mac icons on mobile */
    .mac-icons-container {
        display: none;
    }

    /* Sogou Card - Mobile styles */
    .sogou-wrapper {
        grid-column: span 1;
        height: auto;
    }

    .sogou-card {
        background-image: url('Images/sogou_bg_mobile.png');
        width: 100%;
        height: 320px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .sogou-card .card-content {
        padding: 24px;
    }

    /* Sogou Card - Mobile layout for tags */
    .sogou-card .project-tags {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sogou-card .project-badges {
        margin-top: 0;
    }

    /* Contact Section - Adaptive width */
    .contact-section {
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
        padding: 80px 16px 0;
    }

    .contact-section .section-header {
        width: 100%;
        text-align: left;
        margin-bottom: 24px;
    }

    /* Contact items - Fix flexible area */
    .contact-item {
        padding: 16px 0;
        min-height: 56px;
    }

    .contact-value {
        flex: 1;
        text-align: right;
        margin-right: 8px;
        word-break: break-all;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .contact-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .contact-value {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .description {
        font-size: 14px;
        line-height: 22px;
    }

    .project-card {
        padding: 24px;
        height: auto;
        min-height: 300px;
    }

    .somno-card,
    .remixicon-card {
        height: auto;
        min-height: 350px;
    }

    .launchos-card {
        height: auto;
        min-height: 400px;
    }

    .sogou-card {
        height: 328px;
    }

    .project-title {
        font-size: 18px;
    }

    .contact-value {
        font-size: 14px;
    }

    .contact-label {
        font-size: 16px;
    }
}