/* Base: tokens, document defaults, navigation, and shared layout
   Generated from the original stylesheet and kept in cascade order. */

/* ====================
   全域與基礎設定
   ==================== */
html {
    scroll-behavior: smooth;
}

:root {
    --bg: #111111;
    --surface: #1b1b1b;
    --surface-raised: #242424;
    --surface-soft: #2c2b29;
    --line: #343434;
    --text: #e6e2dc;
    --muted: #aaa39a;
    --gold: #c4a484;
    --gold-light: #e5d3b3;
    --teal: #7fb7ad;
    --wine: #a76f73;
    --radius: 8px;
}

/* ====================
   專屬質感捲軸 (Scrollbar)
   ==================== */
::-webkit-scrollbar {
    width: 8px; /* 讓捲軸變細緻一點 */
}

::-webkit-scrollbar-track {
    background: #121212; /* 軌道顏色跟背景一樣 */
}

::-webkit-scrollbar-thumb {
    background: #333; /* 捲軸本體的顏色 */
    border-radius: 10px; /* 圓角設計 */
}

::-webkit-scrollbar-thumb:hover {
    background: #c4a484; /* 滑鼠移過去時亮起你的品牌金色 */
}

body {
    background: linear-gradient(135deg, #101010 0%, #15120f 52%, #101817 100%);
    color: var(--text);
    font-family: 'Noto Sans TC', sans-serif;
    margin: 0;
    padding: 0;
}

h1 {
    font-family: 'Noto Serif TC', serif;
    font-size: clamp(38px, 5vw, 56px);
    color: var(--gold);
    margin-bottom: 10px;
    margin-top: 0;
    line-height: 1.05;
}

#home,
#tracks,
#about {
    scroll-margin-top: 100px;
}


/* ====================
   導覽列 (Navbar)
   ==================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 改為 80% 透明度的深色背景 */
    background-color: rgba(20, 20, 20, 0.84); 
    /* 新增：毛玻璃模糊特效 */
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); /* 支援 Safari */
    padding: 15px 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(196, 164, 132, 0.16);
}

.logo {
    font-family: 'Noto Serif TC', serif;
    font-size: 24px;
    color: #c4a484;
    font-weight: bold;
    text-decoration: none;
}

.logo:hover {
    color: #e5d3b3;
}


.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-menu-button {
    position: relative;
    display: none;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 9px;
    color: var(--text);
    background: rgba(27, 27, 27, 0.82);
    border: 1px solid rgba(196, 164, 132, 0.24);
    border-radius: 7px;
    cursor: pointer;
}

.nav-menu-button span {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.22s ease, opacity 0.16s ease;
}

.nav-menu-button span:nth-child(1) {
    transform: translate(-50%, -7px);
}

.nav-menu-button span:nth-child(2) {
    transform: translate(-50%, -50%);
}

.nav-menu-button span:nth-child(3) {
    transform: translate(-50%, 5px);
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 1000;
    padding: 9px 13px;
    color: #111;
    background: var(--gold-light);
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.18s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.nav-links a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown details {
    position: relative;
}

.nav-dropdown summary {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text, #e0e0e0);
    font-size: 16px;
    font-weight: bold;
    list-style: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    order: 2;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
}

.nav-dropdown details[open] > summary::before {
    transform: rotate(225deg) translate(-2px, -1px);
}

.nav-submenu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    z-index: 120;
    display: grid;
    min-width: 205px;
    margin: 0;
    padding: 7px;
    list-style: none;
    background: var(--panel-background);
    border: 1px solid var(--border-soft);
    border-radius: 7px;
    box-shadow: 0 16px 34px var(--shadow-color);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-submenu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 13px;
}

.nav-dropdown details[open] > .nav-submenu,
.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.nav-submenu a {
    display: block;
    padding: 10px 11px;
    border-radius: 5px;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #c4a484;
}

/* 新增：當前所在頁面的專屬高亮顏色 */
.nav-links a.active {
    color: #c4a484;
}

.nav-links a:focus-visible,
.nav-dropdown summary:focus-visible,
.nav-menu-button:focus-visible,
.theme-toggle:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.result-mode-button:focus-visible,
.favorite-track-button:focus-visible,
.progression-play-button:focus-visible,
.progression-save-button:focus-visible,
.progression-export-button:focus-visible,
.transpose-controls button:focus-visible,
.track-link:focus-visible,
.footer .social-links a:focus-visible,
#backToTopBtn:focus-visible {
    outline: 3px solid #e5d3b3;
    outline-offset: 4px;
}

/* ====================
   Premium motion layer
   ==================== */
:root {
    --motion-lift-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
    --motion-wash: rgba(229, 211, 179, 0.16);
}

html[data-theme="light"] {
    --motion-lift-shadow: 0 20px 48px rgba(99, 75, 55, 0.16);
    --motion-wash: rgba(154, 107, 68, 0.13);
}

.navbar,
.footer,
.track-card,
.start-card,
.home-release-card,
.audio-player-card,
.key-finder-panel,
.key-finder-result,
.dictionary-browser,
.dictionary-detail,
.chord-shape-card,
.progression-card,
.trainer-card,
.theme-toggle,
.primary-button,
.secondary-button {
    transition:
        color 0.32s ease,
        background-color 0.32s ease,
        border-color 0.32s ease,
        box-shadow 0.32s ease,
        transform 0.22s ease;
}

.start-card,
.home-release-card,
.track-card,
.chord-shape-card,
.dictionary-browser,
.dictionary-detail,
.progression-card,
.trainer-card,
.key-finder-panel,
.key-finder-result {
    position: relative;
    overflow: hidden;
}

.start-card::before,
.home-release-card::before,
.track-card::before,
.chord-shape-card::before,
.dictionary-browser::before,
.dictionary-detail::before,
.progression-card::before,
.trainer-card::before,
.key-finder-panel::before,
.key-finder-result::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, transparent 0%, var(--motion-wash) 42%, transparent 72%);
    opacity: 0;
    transform: translateX(-44%);
    transition: opacity 0.36s ease, transform 0.56s ease;
}

.start-card:hover,
.home-release-card:hover,
.track-card:hover,
.chord-shape-card:hover,
.dictionary-browser:hover,
.dictionary-detail:hover,
.progression-card:hover,
.trainer-card:hover {
    box-shadow: var(--motion-lift-shadow);
}

.start-card:hover::before,
.home-release-card:hover::before,
.track-card:hover::before,
.chord-shape-card:hover::before,
.dictionary-browser:hover::before,
.dictionary-detail:hover::before,
.progression-card:hover::before,
.trainer-card:hover::before,
.key-finder-panel:hover::before,
.key-finder-result:hover::before {
    opacity: 1;
    transform: translateX(44%);
}

.theme-transition-wash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 18%, rgba(229, 211, 179, 0.16), transparent 38%),
        rgba(255, 250, 242, 0.08);
}

html[data-theme="light"] .theme-transition-wash {
    background:
        radial-gradient(circle at 50% 18%, rgba(127, 183, 173, 0.14), transparent 38%),
        rgba(40, 33, 27, 0.045);
}

.theme-transition-wash.is-css-fallback {
    animation: themeWashFallback 0.46s ease forwards;
}

@keyframes themeWashFallback {
    0% {
        opacity: 0;
    }
    38% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.motion-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) var(--motion-delay, 0ms),
        transform 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) var(--motion-delay, 0ms);
}

.motion-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

html.motion-reduced *,
html.motion-reduced *::before,
html.motion-reduced *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
}


/* ====================
   進場淡入動畫 (Animation)
   ==================== */
@keyframes fadeInSlideUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================
   版面大架構 (Flexbox)
   ==================== */
.content-container {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 40px; 
}

.left-column {
    flex: 1;
    animation: fadeInSlideUp 1s ease-out forwards;
}

.right-column {
    flex: 1;
    animation: fadeInSlideUp 1s ease-out 0.4s forwards;
    opacity: 0; 
}

/* ====================
   區塊標題與文字
   ==================== */
.section-title {
    color: #c4a484;
    font-size: 24px;
}

.section-title-spaced {
    margin-top: 40px;
}

.section-title-link {
    color: inherit;
    text-decoration: none;
}

.section-title-link:hover {
    color: #e5d3b3;
}

.section-divider {
    border-color: #333;
    margin: 30px 0;
}

.about-text {
    line-height: 1.8;
}

.track-list {
    list-style-position: inside;
    padding: 0;
}
