/* ==============================================
   Taku Theme - Main Stylesheet
   ============================================== */

/* --- CSS Variables --- */
:root {
    --color-primary: #1a3a5c;
    --color-accent: #4a90d9;
    --color-dark: #0d1b2a;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-border: #e0e0e0;
    --font-body: 'Noto Sans JP', sans-serif;
    --font-heading: 'Cormorant Garamond', serif;
    --container-width: 1200px;
    --header-height: 80px;
    --transition: 0.3s ease;
}

/* ==============================================
   Loading Screen
   ============================================== */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-inner {
    text-align: center;
}

.loader-logo {
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    animation: loaderFadeUp 0.8s 0.2s ease forwards;
}

.loader-logo img {
    max-height: 60px;
    width: auto;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.loader-site-name {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.1em;
}

.loader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin: 0 auto 16px;
    overflow: hidden;
    opacity: 0;
    animation: loaderFadeUp 0.6s 0.5s ease forwards;
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #ffffff);
    border-radius: 2px;
    animation: loaderProgress 1.8s 0.6s ease-in-out forwards;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2em;
    opacity: 0;
    animation: loaderFadeUp 0.6s 0.5s ease forwards;
}

@keyframes loaderFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loaderProgress {
    0% { width: 0%; }
    30% { width: 40%; }
    60% { width: 70%; }
    100% { width: 100%; }
}

/* Prevent scroll while loading */
body.loading {
    overflow: hidden;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary);
}

/* --- Container --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Section Common --- */
.section {
    padding: 120px 0;
}

.section-label {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 400;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.section-subtitle {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 60px;
    letter-spacing: 0.1em;
}

/* ==============================================
   Header
   ============================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: background var(--transition), box-shadow var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo a,
.site-title-link {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.site-logo img {
    max-height: 50px;
    width: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 4px;
    transition: color var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 30px;
    height: 2px;
    background: var(--color-primary);
    transition: all var(--transition);
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ==============================================
   Hero Section
   ============================================== */
.section-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-color: var(--color-dark);
    padding: 0;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(13, 27, 42, 0.6) 0%,
        rgba(26, 58, 92, 0.7) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 24px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 400;
    color: #ffffff;
    letter-spacing: 0.08em;
    margin-bottom: 24px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    letter-spacing: 0.15em;
}

.hero-description {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 2;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.scroll-text {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.15em;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% { top: -100%; }
    100% { top: 100%; }
}

/* ==============================================
   About Section
   ============================================== */
.section-about {
    background-color: var(--color-bg);
}

.about-philosophy {
    text-align: center;
    margin-bottom: 80px;
}

.philosophy-label {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    color: var(--color-accent);
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 16px;
}

.philosophy-title {
    font-size: 4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 24px;
    letter-spacing: 0.1em;
}

.philosophy-text {
    font-size: 1rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 2;
}

.about-ourway {
    background-color: var(--color-bg-alt);
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.about-ourway::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(26, 58, 92, 0.85);
    opacity: 0;
    transition: opacity var(--transition);
}

.about-ourway[style*="background-image"]::before {
    opacity: 1;
}

.ourway-content {
    position: relative;
    z-index: 1;
    padding: 80px 60px;
    text-align: center;
}

.about-ourway[style*="background-image"] .ourway-content {
    color: #ffffff;
}

.ourway-label {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    color: var(--color-accent);
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 16px;
}

.ourway-title {
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--color-primary);
}

.about-ourway[style*="background-image"] .ourway-title {
    color: #ffffff;
}

.ourway-text {
    font-size: 1rem;
    line-height: 2;
    max-width: 600px;
    margin: 0 auto;
    color: var(--color-text-light);
}

.about-ourway[style*="background-image"] .ourway-text {
    color: rgba(255, 255, 255, 0.85);
}

/* ==============================================
   Service Section
   ============================================== */
.section-service {
    background-color: var(--color-bg-alt);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.service-card {
    background: var(--color-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.service-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.service-card:hover .service-card-image img {
    transform: scale(1.05);
}

.service-card-body {
    padding: 32px;
}

.service-card-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.service-card-catchphrase {
    font-size: 0.9375rem;
    color: var(--color-accent);
    margin-bottom: 16px;
    font-style: italic;
}

.service-card-description {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.9;
    margin-bottom: 20px;
}

.service-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-text-light);
    transition: color var(--transition);
}

.service-card-link:hover {
    color: var(--color-accent);
}

/* ==============================================
   Members Section
   ============================================== */
.section-members {
    background-color: var(--color-bg);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.member-card {
    text-align: center;
}

.member-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 24px;
    border: 3px solid var(--color-bg-alt);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.member-role {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.member-flower {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: 20px;
    padding: 2px 12px;
    margin-bottom: 16px;
}

.member-description {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    line-height: 1.8;
}

/* ==============================================
   Gallery Section
   ============================================== */
.section-gallery {
    background-color: var(--color-bg-alt);
}

.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: 1px solid var(--color-border);
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-item.hidden {
    display: none;
}

.gallery-item-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-item-image img {
    transform: scale(1.08);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 58, 92, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
}

.gallery-empty {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
}

/* ==============================================
   Contact Section
   ============================================== */
.section-contact {
    background-color: var(--color-bg);
}

.contact-wrapper {
    max-width: 640px;
    margin: 0 auto;
}

.contact-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    font-size: 1rem;
    color: var(--color-text-light);
}

.contact-email a {
    color: var(--color-accent);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    margin-bottom: 20px;
    transition: border-color var(--transition);
    background: var(--color-bg);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.contact-form textarea {
    min-height: 160px;
    resize: vertical;
}

.contact-form input[type="submit"],
.btn-primary {
    display: inline-block;
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    padding: 14px 48px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.contact-form input[type="submit"]:hover,
.btn-primary:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

.contact-note {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.875rem;
    padding: 40px 0;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
}

/* ==============================================
   Footer
   ============================================== */
.site-footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.6);
    padding: 60px 0 40px;
    text-align: center;
}

.footer-nav {
    margin-bottom: 24px;
}

.footer-nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-nav-list a {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color var(--transition);
}

.footer-nav-list a:hover {
    color: #ffffff;
}

.copyright {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Page Top Button */
.page-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

.page-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.page-top-btn:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
}

/* ==============================================
   404 Page
   ============================================== */
.error-404 {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px;
}

.error-404 h1 {
    font-family: var(--font-heading);
    font-size: 8rem;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 16px;
}

.error-404 p {
    color: var(--color-text-light);
    margin-bottom: 32px;
}

/* ==============================================
   Fade-in Animation
   ============================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.fade-delay-1 { transition-delay: 0.2s; }
.fade-delay-2 { transition-delay: 0.4s; }

/* ==============================================
   Responsive
   ============================================== */

/* Tablet */
@media (max-width: 1024px) {
    .members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ourway-content {
        padding: 60px 40px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .section {
        padding: 80px 0;
    }

    .section-label {
        font-size: 2.25rem;
    }

    /* Header Mobile */
    .menu-toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease;
        z-index: 1000;
    }

    .site-nav.open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 28px;
        text-align: center;
    }

    .nav-link {
        font-size: 1.125rem;
    }

    /* Hero Mobile */
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* About Mobile */
    .philosophy-title {
        font-size: 3rem;
    }

    .ourway-content {
        padding: 48px 24px;
    }

    /* Service Mobile */
    .service-grid {
        grid-template-columns: 1fr;
    }

    /* Members Mobile */
    .members-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .member-photo {
        width: 160px;
        height: 160px;
    }

    /* Gallery Mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* Footer Mobile */
    .footer-nav-list {
        flex-direction: column;
        gap: 16px;
    }

    .page-top-btn {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .section-label {
        font-size: 1.875rem;
    }

    .filter-btn {
        padding: 6px 16px;
        font-size: 0.8125rem;
    }
}
