@charset "utf-8";

body{
	margin:0;
	padding:0;
}

header{
	position:sticky;
	top:0;
	width:100%;
	height: 50px;
	z-index:8000;
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
	overflow: hidden;
}



#top{
	display: flex;
	width: 100%;
	flex-direction: row;
	align-items: center;
	background: var(--white80);
	justify-content: space-between;;
}


#topHome{
	display: flex;
	width: 100%;
	flex-direction: row;
	align-items: center;
	background: none;
	justify-content: flex-end;
}

#topHome .menu-text a {
    color: var(--white80);
}

#topHome .menu-text a:hover {
    color: var(--colorcontrastbright);
}

/*nav left name*/
.title{
	justify-content: flex-start;
}

.title h1 a{
	font-size: 2.2em;
	color:var(--colormid);
	text-decoration:none;
	font-family: var(--titlefont);
	font-weight: 400;
	font-style: normal;
	margin: 0;
	white-space: nowrap;
	padding-left:20px;
}

/*nav right menu*/
.menu-text{
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding-right:20px;
	white-space: nowrap;
	overflow: hidden; 
	height: 100%;
	margin-left: auto;
}

.menu-text>a{
	padding:10px;
	color:var(--colormid);
	text-decoration:none;
	font-family:var(--titlefont);
	font-weight: 400;
	font-style: normal;
	font-size: 0.8em;
}

.menu-text>a:hover{
	color:var(--whitetheme);
	font-weight: 500;
}

.menu-burger{
	display: none;
}

footer{
	width: 100%;
	clear:both;
	text-align:center;
	font-family:var(--titlefont);
	color:var(--colorcontrast2);
	margin:40px auto;
	font-size:0.8em;
}


#lang-switch, #lang-switch-mobile {
    color: var(--colorcontrast2);
    display: inline-flex;
    align-items: center;
    line-height: 1; /* Prevents extra line space from shifting characters */
}


#lang-switch:hover, #lang-switch-mobile:hover {
    color: var(--white50);
}





/* CURSOR START */

:root {
    --cursor-main-opacity: 0.7;
    --cursor-trail-opacity: 0.4;
}

*, *:before, *:after {
    cursor: none !important;
}


.cursor-main, .cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 80000;
    visibility: hidden; /* Prevents the browser from painting it on load */
    opacity: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 1, 1), 
                height 0.3s cubic-bezier(0.4, 0, 1, 1), 
                opacity 0.2s ease,
                visibility 0.2s ease;
}

/* Revealed instantly on the first mouse movement */
.cursor-main.is-visible {
    visibility: visible;
    opacity: var(--cursor-main-opacity);
}

.cursor-trail.is-visible {
    visibility: visible;
    opacity: var(--cursor-trail-opacity);
}

.cursor-main {
    width: 15px;
    height: 15px;
    background-color: var(--colorcontrastbright);
    opacity: 0.7;
    /* Change ease-out to ease-in, ease-in-out, or a custom cubic-bezier */
    transition: width 0.3s cubic-bezier(0.4, 0, 1, 1), height 0.3s cubic-bezier(0.4, 0, 1, 1);
    z-index: 90000;

}

.cursor-trail {
    width: 40px;
    height: 40px;
    background-color: var(--whitetheme);
    opacity: var(--cursor-trail-opacity);
    transition: width 0.3s cubic-bezier(0.4, 0, 1, 1), height 0.3s cubic-bezier(0.4, 0, 1, 1);
}

.cursor-main,
.cursor-trail {
    will-change: transform;
}

/* Hover growth state for main (30px * 1.8 = 54px) */
.cursor-main.is-hovering {
    width: 40px;
    height: 40px;
	mix-blend-mode: multiply; 
	/* normal, multiply, screen, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, hue, saturation, color, luminosity, plus-darker, plus-lighter */
}

/* Hover growth state for trail (matches main's hovered size of 54px) */
.cursor-trail.is-hovering {
    width: 0px;
    height: 0px;
	opacity: 0;
	border: solid 3px var(--colorcontrastbright);
	blend-mode: multiply; /* overlay | multiply | screen | color | soft-light */
}

/* Text hover state (Transforms circles into a vertical line) */
.cursor-main.is-text {
    width: 2px;
    height: 18px;
    border-radius: 2px;
}

.cursor-trail.is-text {
    width: 0px;
    height: 0px;
    opacity: 0;
}

.home-page .cursor-main.is-text {
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.home-page .cursor-trail.is-text {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

/* Cursor disappears outside viewport */
.cursor-main, .cursor-trail {
    /* ... existing styles ... */
    opacity: var(--cursor-main-opacity);
    transition: width 0.3s cubic-bezier(0.4, 0, 1, 1), 
                height 0.3s cubic-bezier(0.4, 0, 1, 1), 
                opacity 0.2s ease; /* added opacity transition */
}

.cursor-main.is-hidden, .cursor-trail.is-hidden {
    opacity: 0;
}

.cursor-main, .cursor-trail {
    pointer-events: none; /* 絕對不能漏掉這行 */
}

/* CURSOR END */


/* PAGE TRANSITION */

#page-transition {
	position: fixed;
	inset: 0;
	background: var(--colormid);
	z-index: 99999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

#page-transition.is-visible {
	opacity: 1;
	pointer-events: all;
}


@media only screen and (max-width: 768px) {

	#topHome{
	position: absolute; /* 或 fixed 視滑動需求而定 */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999; /* 確保層級高於圖片 */
    background: transparent; /* 若需要穿透背景可設為透明，或保留半透明 */
	}

	#main-header{
		position: sticky;
		height: 42px;
		top:0px;
	}



	#top{
		padding-top: 20px;
        align-items: center;
	}



	.title h1 a{
		color:var(--colormid);
		font-size: 9.5vw;
		padding-left:0px;
	}

	.menu-burger{
		display: flex; 
		position:absolute;
		right:12px;
		top:10px;
		font-size:30px;
		gap:12px;

	}

	.menu-burger svg {
	    fill: var(--colorcontrast);

	}

	.menu:hover{
		cursor:pointer;
	}
	.menu-text{
		display: none;
	}

	#lang-switch-mobile {
			font-size: 0.9rem;
			color: var(--lightgray);
			text-decoration: none; /* Removes underline */
			display: inline-flex;
			align-items: center;
			line-height: 1;
			position: relative;
			top: -2px; /* Micro-adjustment to lift it into exact optical alignment with the icons */
			font-weight: 600; /* Ensures consistent weight with the rest of the menu */
			padding: 10px 2px; /* Adds a bit of horizontal padding for better touch targets */
	}
	#lang-switch-mobile .zh {
		font-weight: 300; /* Thinner weight for Chinese characters */
	}

	#lang-switch, #lang-switch-mobile,
	#lang-switch:visited, #lang-switch-mobile:visited,
	#lang-switch:active, #lang-switch-mobile:active,
	#lang-switch:focus, #lang-switch-mobile:focus {
    color: var(--lightgray);
    text-decoration: none;
	}

	#lang-switch:hover, #lang-switch-mobile:hover {
		color: var(--lightgray);
	}


	*, *::before, *::after {
        cursor: auto !important;
    }

    .cursor-main,
    .cursor-trail {
        display: none !important;
    }

	footer{
	font-size:0.6em;
}
}