/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Kanata's representative colors */
    --kanata-blue: #2894FF;
    --kanata-blue-light: #5AAFFF;
    --kanata-blue-dark: #1A6FCC;
    --white: #FFFFFF;
    --gold: #FFD700;
    --gold-light: #FFE44D;

    /* Supporting colors */
    --light-blue: #87CEEB;
    --sky-gradient-start: #E8F4FF;
    --sky-gradient-end: #B8DCFF;
    --text-dark: #333333;
    --text-light: #666666;

    /* Legacy aliases for compatibility */
    --primary-blue: #2894FF;
    --dark-blue: #1A6FCC;
    --light-gray: #F5F5F5;
    --cream-white: #F8FBFF;
}

/* Language-specific fonts */
html[lang="ja"] {
    font-family: 'Noto Sans JP', 'Hiragino Sans', sans-serif;
}

html[lang="zh-TW"] {
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

html[lang="en"] {
    font-family: 'Roboto', 'Arial', sans-serif;
}

/* Zen Maru Gothic for headings - warm, rounded feel */
h1, h2, .forever-kanata, .counter-number {
    font-family: 'Zen Maru Gothic', 'Noto Sans JP', 'Noto Sans TC', sans-serif;
}

body {
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--cream-white);
    min-height: 100vh;
}

/* ==================== */
/* Language Selector    */
/* ==================== */
.language-selector {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 8px 12px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 148, 255, 0.2);
}

.lang-btn.active {
    background: var(--kanata-blue);
    color: white;
}

/* ==================== */
/* Main Header          */
/* ==================== */
.main-header {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../images/kanata-header.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
    z-index: -1;
}

/* Golden glow layer for emotional warmth */
.header-bg::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(
        circle,
        rgba(255, 215, 0, 0.12) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

/* Gradient overlay for emotional depth */
.header-bg::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        180deg,
        rgba(40, 148, 255, 0.1) 0%,
        rgba(26, 111, 204, 0.25) 100%
    );
}

.header-content {
    text-align: center;
    color: white;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Title fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content h1 {
    font-size: 2.8em;
    margin-bottom: 25px;
    font-weight: 700;
    animation: fadeInUp 1.2s ease-out;
    letter-spacing: 0.02em;
}

/* Counter with gentle pulse (breathing light) */
@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(40, 148, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 35px rgba(40, 148, 255, 0.6);
    }
}

.counter-container {
    background: linear-gradient(135deg, rgba(40, 148, 255, 0.9) 0%, rgba(26, 111, 204, 0.9) 100%);
    padding: 25px 50px;
    border-radius: 15px;
    display: inline-block;
    animation: fadeInUp 1.2s ease-out 0.3s both, gentlePulse 4s ease-in-out infinite 1.5s;
}

/* Counter prefix - small text */
.counter-prefix {
    font-size: 0.95em;
    opacity: 0.9;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
    font-weight: 300;
}

/* Counter number - large emphasis */
.counter-number {
    font-size: 3.5em;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1.1;
}

/* Ethereal glow - soft luminous effect */
#day-counter-number {
    color: white;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(40, 148, 255, 0.3);
}

.counter-unit {
    font-size: 0.4em;
    opacity: 0.95;
    margin-left: 0.15em;
    vertical-align: middle;
    -webkit-text-fill-color: white;
}

/* ==================== */
/* Navigation           */
/* ==================== */
.main-nav {
    background: linear-gradient(90deg, var(--kanata-blue) 0%, var(--kanata-blue-dark) 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 15px rgba(40, 148, 255, 0.3);
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 15px 25px;
    color: white;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ==================== */
/* Content Sections     */
/* ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section {
    padding: 80px 0;
}

.content-section h2 {
    font-size: 2em;
    margin-bottom: 30px;
    color: var(--dark-blue);
    text-align: center;
}

/* ==================== */
/* Intro Section        */
/* ==================== */
.intro-section {
    background: linear-gradient(180deg, var(--cream-white) 0%, var(--sky-gradient-start) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Large decorative quote */
.intro-section::before {
    content: '"';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 150px;
    color: rgba(40, 148, 255, 0.12);
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
    pointer-events: none;
}

/* Infinity symbol - eternity decoration */
.intro-section::after {
    content: '∞';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 50px;
    color: rgba(40, 148, 255, 0.08);
    pointer-events: none;
}

.intro-section h2 {
    font-size: 2.2em;
    color: var(--kanata-blue);
    font-weight: 300;
    letter-spacing: 0.08em;
    margin-bottom: 35px;
}

.intro-section p {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.15em;
    line-height: 2.2;
    color: #555;
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* ==================== */
/* Messages Section     */
/* ==================== */
.messages-container {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.message-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(40, 148, 255, 0.1);
    border-left: 4px solid var(--kanata-blue);
}

.message-author {
    font-weight: bold;
    color: var(--kanata-blue);
    margin-bottom: 10px;
}

.message-content {
    line-height: 1.8;
    margin-bottom: 10px;
}

.message-date {
    font-size: 0.9em;
    color: #666;
    text-align: right;
}

/* ==================== */
/* Contribute Notice    */
/* ==================== */
.contribute-notice {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--kanata-blue) 0%, var(--kanata-blue-dark) 100%);
    border-radius: 10px;
    color: white;
}

.github-link {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 35px;
    background: white;
    color: var(--kanata-blue);
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.github-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(40, 148, 255, 0.3);
    background: var(--gold-light);
    color: var(--kanata-blue-dark);
}

/* ==================== */
/* Footer               */
/* ==================== */
footer {
    background: linear-gradient(180deg, #2d2d44 0%, #1a1a2e 100%);
    color: white;
    padding: 50px 0;
    margin-top: 0;
    position: relative;
}

.forever-kanata {
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 35px;
    font-weight: 500;
    letter-spacing: 0.15em;
    padding: 20px 0;
    position: relative;
    background: linear-gradient(90deg, var(--kanata-blue-light), var(--gold), var(--kanata-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Golden glow behind footer text */
.forever-kanata::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 250%;
    background: radial-gradient(
        ellipse,
        rgba(255, 215, 0, 0.08) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: -1;
}

.credits {
    text-align: center;
    font-size: 0.9em;
    opacity: 0.8;
}

.credits ul {
    list-style: none;
    margin-top: 10px;
}

.credits li {
    margin: 5px 0;
}

.credits a {
    color: var(--kanata-blue-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.credits a:hover {
    color: var(--gold);
    text-decoration: underline;
}

.footer-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-links a {
    color: var(--kanata-blue-light);
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-links span {
    color: rgba(255, 255, 255, 0.3);
}

/* ==================== */
/* Scroll Reveal        */
/* ==================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered entrance animations for rhythm */
.reveal-on-scroll.revealed h2 {
    animation: fadeInUp 0.8s ease-out both;
}

.reveal-on-scroll.revealed p {
    animation: fadeInUp 0.8s ease-out 0.12s both;
}

.reveal-on-scroll.revealed .github-link,
.reveal-on-scroll.revealed .gallery-contribute,
.reveal-on-scroll.revealed .danmaku-contribute {
    animation: fadeInUp 0.8s ease-out 0.24s both;
}

/* Gallery items staggered entrance */
.gallery-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out both;
}

.gallery-item:nth-child(1) { animation-delay: 0s; }
.gallery-item:nth-child(2) { animation-delay: 0.08s; }
.gallery-item:nth-child(3) { animation-delay: 0.16s; }
.gallery-item:nth-child(4) { animation-delay: 0.24s; }
.gallery-item:nth-child(5) { animation-delay: 0.32s; }
.gallery-item:nth-child(6) { animation-delay: 0.40s; }

/* ==================== */
/* Feather Effects      */
/* ==================== */
.feather-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* White feather SVG for mouse trail - Feather Icons style */
.feather {
    position: absolute;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.24 12.24a6 6 0 0 0-8.49-8.49L5 10.5V19h8.5z'/%3E%3Cline x1='16' y1='8' x2='2' y2='22'/%3E%3Cline x1='17.5' y1='15' x2='9' y2='15'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    will-change: transform, opacity;
}

/* Mouse trail feather - only effect */
.feather.trail {
    animation: featherTrail 1.5s ease-out forwards;
}

@keyframes featherTrail {
    0% {
        opacity: 0.85;
        transform: scale(0.4) rotate(0deg);
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: scale(1.2) rotate(90deg) translateY(50px);
    }
}

/* ==================== */
/* Responsive Design    */
/* ==================== */
@media (max-width: 768px) {
    .main-header {
        height: 60vh;
        min-height: 400px;
    }

    .header-content h1 {
        font-size: 1.8em;
        padding: 0 15px;
    }

    .counter-container {
        padding: 20px 30px;
    }

    .counter-number {
        font-size: 2.5em;
    }

    .counter-prefix {
        font-size: 0.9em;
    }

    .language-selector {
        top: 10px;
        right: 10px;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .main-nav ul {
        flex-direction: column;
    }

    .main-nav a {
        text-align: center;
        padding: 12px 20px;
    }

    .intro-section::before {
        font-size: 100px;
        top: 20px;
    }

    .intro-section h2 {
        font-size: 1.6em;
    }

    .intro-section p {
        font-size: 1em;
        padding: 0 15px;
        line-height: 2;
    }

    .content-section {
        padding: 50px 0;
    }

    .feather {
        width: 16px;
        height: 16px;
    }

    .forever-kanata {
        font-size: 2em;
    }

    /* Header glow responsive */
    .header-bg::before {
        width: 300px;
        height: 300px;
    }

    /* Intro infinity symbol responsive */
    .intro-section::after {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .main-header {
        height: 50vh;
        min-height: 350px;
    }

    .header-content h1 {
        font-size: 1.5em;
    }

    .counter-container {
        padding: 15px 25px;
    }

    .counter-number {
        font-size: 2em;
    }

    .counter-prefix {
        font-size: 0.85em;
    }

    .intro-section::before {
        font-size: 70px;
    }

    .feather {
        width: 14px;
        height: 14px;
    }

    /* Header glow - smaller on mobile */
    .header-bg::before {
        width: 200px;
        height: 200px;
    }

    /* Infinity symbol - smaller */
    .intro-section::after {
        font-size: 30px;
        bottom: 15px;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal-on-scroll {
        opacity: 1;
        transform: none;
    }

    .feather-container {
        display: none;
    }
}
