@import url('https://fonts.googleapis.com/css2?family=Merriweather&family=Noto+Sans+TC:wght@100&family=Pacifico&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import "https://unpkg.com/open-props/easings.min.css";

/* Variables */
:root {
    --primary-color: #5e4e3e;
    --primary-light: #6b5642;
    --accent-color: wheat;
    --text-light: #ffffff;
    --text-dark: #222222;
    --bg-dark: #222222;
    --bg-darker: #1a1a1a;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.05);
    --section-padding: 60px 0;
    --content-max-width: 1200px;
    --transition-slow: 0.4s;
    --transition-medium: 0.3s;
    --transition-fast: 0.2s;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Global styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-dark);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 6px;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    margin: 0;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    position: relative;
    color: var(--text-light);
    overflow-x: hidden;
}

main {
    min-height: 300vh;
}

.container {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Section common styles */
.section {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--section-padding);
}

.section-inner {
    width: 100%;
    max-width: var(--content-max-width);
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent-color);
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

.section-content {
    width: 100%;
}

/* Navigation */
.left-side-nav {
    left: 0;
    top: 30vh;
    position: fixed;
    display: flex;
    font-family: "Pacifico", serif;
    font-size: 20px;
    z-index: 100;
}

.left-side-nav ul {
    list-style: disc;
    --arc: 5deg;
    color: var(--primary-color); /* Ensure bullet points are visible */
    padding-left: 20px; /* Add padding for bullet points */
}

@media (hover) and (prefers-reduced-motion: no-preference) {
    .left-side-nav ul:has(li:nth-child(1):hover) {--target: 1}
    .left-side-nav ul:has(li:nth-child(2):hover) {--target: 2}
    .left-side-nav ul:has(li:nth-child(3):hover) {--target: 3}
    .left-side-nav ul:has(li:nth-child(4):hover) {--target: 4}

    .left-side-nav ul > li {
        transform-origin: -200% 50%;
        transition: transform 2s var(--ease-spring-5), opacity 0.3s var(--ease-3);
    }

    .left-side-nav ul:hover > li:not(:hover) {
        --distance-from-target: abs(var(--sibling-index) - var(--target));
        --distance-multiplier: var(--distance-from-target) * 15%;
        --gradual-fadeout: calc(100% - var(--distance-multiplier));
        opacity: var(--gradual-fadeout);

        --angle: calc((var(--sibling-index) - var(--target)) * var(--arc));
        transform: rotateZ(var(--angle));
    }
}

.left-side-nav li {
    padding-top: 30px;
}

.left-side-nav li::marker {
    color: var(--primary-color);
}

.left-side-nav a {
    background-color: var(--primary-color);
    padding: 10px;  
    border-radius: 15px;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-medium) ease, box-shadow var(--transition-medium) ease;
}

.left-side-nav a:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.left-side-nav a img {
    width: 1em;
    margin-left: 5px;
    margin-right: 10px;
    filter: invert(100%) sepia(99%) saturate(2%) hue-rotate(75deg) brightness(110%) contrast(100%);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: rgba(34, 34, 34, 0.9);
    z-index: 100;
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(245, 222, 179, 0.2);
}

.mobile-nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 0.75rem;
    font-family: "Poppins", sans-serif;
    transition: transform var(--transition-fast) ease;
}

.mobile-nav a:active {
    transform: scale(0.95);
}

.mobile-nav img {
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
    filter: invert(100%) sepia(99%) saturate(2%) hue-rotate(75deg) brightness(110%) contrast(100%);
}

/* Home Section */
.home {
    background-image: url(../public/home.webp);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

.home .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.home .title {
    color: white;
    text-align: center;
    font-size: 2.8rem; /* Increased from 2.5rem */
    margin-bottom: 10px;
}

.home .subtitle {
    color: white;
    font-size: 1.25rem;
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
}

.home .slash {
    color: var(--primary-color);
    display: inline-block;
    padding: 0 5px;
}

.social-links {
    display: flex;
    justify-content: center;
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.social-links li {
    margin: 0 15px;
}

.social-links img {
    width: 3.6em;
    transition: transform var(--transition-fast);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scroll-indicator span {
    display: block;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(45deg);
    margin: -10px;
    animation: scrollAnim 2s infinite;
}

.scroll-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.scroll-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* About Me Section */
.aboutme {
    background-color: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.aboutme::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(94, 78, 62, 0.8) 0%, rgba(34, 34, 34, 0.9) 70%);
    top: 0;
    left: 0;
}

.aboutme .section-inner {
    position: relative;
    z-index: 1;
}

.about-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--card-border);
    width: 100%;
    display: flex;
    align-items: center;
}

.card-icon {
    min-width: 60px;
    min-height: 60px;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.card-content {
    flex: 1;
}

.web-icon::before {
    content: "🌐";
    font-size: 28px;
}

.game-icon::before {
    content: "🎮";
    font-size: 28px;
}

.casual-icon::before {
    content: "🎧";
    font-size: 28px;
}

.about-text {
    line-height: 1.6;
    text-align: left;
    position: relative;
    color: var(--accent-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    margin: 0;
    font-size: 1.05rem;
}

.highlight {
    font-weight: 600;
    color: var(--accent-color);
}

/* Portal Section */
.portal {
    position: relative;
    background: linear-gradient(to bottom, var(--bg-darker), #2d2d2d);
    overflow: hidden;
}

.portal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(94, 78, 62, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(94, 78, 62, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

.portal .section-inner {
    position: relative;
    z-index: 1;
}

.portal-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
}

.portal-card {
    height: 180px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;

}   

.portal-card a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.card-content {
    border-radius: 15px;
    padding: 10px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent 70%);
    z-index: 1;
}

.portal-card h3 {
    color: var(--accent-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1.4rem;
    text-align: center;
    margin: 0;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-medium) ease;
}

.portal-card:hover h3 {
    transform: scale(1.05);
}

.portal .bottom {
    padding: 30px 0;
    width: 100%;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    color: white;
    margin-top: 50px;
}

.portal .bottom p {
    margin-bottom: 5px;
}

.author-name {
    font-weight: bold;
    color: var(--accent-color);
}

.hosting-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    position: relative;
    border: 4px solid var(--accent-color);
    animation: loader 2s infinite ease;
}

.loader-inner {
    vertical-align: top;
    display: inline-block;
    width: 100%;
    background-color: var(--accent-color);
    animation: loader-inner 2s infinite ease-in;
}

.loading-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: var(--accent-color);
    letter-spacing: 2px;
}

/* Responsive styles */
@media screen and (max-width: 1024px) {
    .section-header h2 {
        font-size: 2.2rem;
    }
    
    .about-text {
        font-size: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .left-side-nav {
        display: none;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-inner {
        padding: 1.5rem;
    }
    
    .aboutme, .portal {
        align-items: flex-start;
    }
    
    .home {
        align-items: center;
        padding-top: 80px;
    }
    
    .home .container {
        padding: 0 20px;
    }
    
    .scroll-indicator {
        bottom: 60px;
    }
}

@media screen and (max-width: 480px) {
    .section {
        padding: 30px 0;
    }
    
    .about-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 15px;
    }
    
    .portal-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .about-text {
        text-align: center;
    }
    
    .home .title {
        font-size: 2rem;
    }
    
    .home .subtitle {
        font-size: 1rem;
    }
}