/* Base Reset & Variables - Phase 1.5 */
:root {
    --bg-color: #FFFFFF;
    --text-main: #1A365D; /* Ocean Deep Navy */
    --text-muted: #5b6f8a;
    --accent-light: #F0F8FF;
    --accent-color: #3182CE;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Noto Sans JP', sans-serif;
    --font-logo: 'Playfair Display', serif; /* New elegant font for logo */
    --spacing-unit: 1rem;
    --transition-speed: 0.4s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; }
a { color: var(--text-main); text-decoration: none; transition: color var(--transition-speed); }
a:hover { color: var(--accent-color); }

.cormorant-text {
    font-family: 'Cormorant Garamond', 'Noto Serif JP', 'Yu Mincho', serif;
    letter-spacing: 0.05em;
    line-height: 2;
}
.cormorant-text-en {
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.05em;
}

/* Layout Classes */
.container { max-width: 1100px; margin: 0 auto; padding: 0 40px; }
.section { padding: 120px 0; scroll-margin-top: 100px; }
.section.contact { background-color: #fafbfc; } /* Match PROFILE background and default padding */
.section-title {
    font-size: 2.2rem; text-align: center; margin-bottom: 4rem;
    letter-spacing: 0.15em; text-transform: uppercase; position: relative; color: var(--text-main);
}
.section-title::after {
    content: ''; display: block; width: 30px; height: 1px;
    background-color: var(--text-main); margin: 1.5rem auto 0;
}

/* Header & Nav */
.header {
    position: fixed; top: 0; left: 0; width: 100%; padding: 25px 50px;
    display: flex; justify-content: space-between; align-items: center;
    background-color: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px);
    z-index: 1000; transition: padding 0.3s ease;
}
.header.scrolled { padding: 15px 50px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }

/* Logo Image */
.logo a {
    display: flex;
    align-items: center;
}
.header-logo {
    height: 40px; /* Adjust height as needed */
    width: auto;
    filter: invert(1); /* If the image is white text on transparent, this makes it black for standard mode */
}
/* Logo specific styling if needed */
.header-logo {
    transition: filter 0.3s;
}

/* Nav */
.nav-list { display: flex; list-style: none; gap: 40px; }
.nav-list a {
    font-family: var(--font-heading); font-size: 1.1rem;
    letter-spacing: 0.1em; text-transform: uppercase; position: relative;
}
.nav-list a::after {
    content: ''; position: absolute; bottom: -5px; left: 0;
    width: 0; height: 1px; background-color: var(--text-main); transition: width var(--transition-speed);
}
.nav-list a:hover::after { width: 100%; }

/* Mobile menu hidden for this iteration */
.mobile-menu-btn { display: none; }

/* Subpage Hero (Unified) */
.subpage-hero {
    padding: 140px 0 30px;
    text-align: center;
    background-color: #fafbfc;
}
.subpage-hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    letter-spacing: 0.15em;
    color: var(--text-main);
}
.subpage-hero p {
    font-family: 'Cormorant Garamond', 'Noto Serif JP', 'Yu Mincho', serif;
    color: var(--text-muted);
    margin-top: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

/* Hero Section */
.hero {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative; overflow: hidden;
    background-color: #050a15;
}
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('Image/Hero/hero_bg.JPG');
    background-size: cover; background-position: left center;
    opacity: 0.8; z-index: 0; filter: none;
}
.hero-content {
    position: relative; z-index: 1;
}
.hero-title {
    font-size: 5rem; margin-bottom: 1rem; letter-spacing: 0.2em;
    color: #ffffff; text-shadow: 0 4px 20px rgba(0,0,0,0.6);
    animation: fadeUp 1s ease 0.2s both;
}
.hero-subtitle {
    font-family: var(--font-body); font-size: 1.1rem; 
    color: rgba(255,255,255,0.9); text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    letter-spacing: 0.2em; animation: fadeUp 1s ease 0.4s both;
}

.scroll-indicator {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; animation: fadeUpScroll 1s ease 0.6s both;
}
.scroll-indicator span { font-family: var(--font-heading); font-size: 0.8rem; letter-spacing: 0.2em; margin-bottom: 10px; }
.scroll-indicator .line { width: 1px; height: 60px; background-color: var(--text-main); position: relative; overflow: hidden; }
.scroll-indicator .line::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 100%;
    background-color: white; animation: scrollLine 2s infinite cubic-bezier(0.65, 0.05, 0.36, 1);
}
@keyframes scrollLine { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUpScroll { 
    from { opacity: 0; transform: translateX(-50%) translateY(20px); } 
    to { opacity: 1; transform: translateX(-50%) translateY(0); } 
}

/* About Section */
.about { background-color: #fafbfc; }
.about-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 60px; align-items: center; }
.about-image img { width: 100%; border-radius: 4px; box-shadow: 0 10px 30px rgba(26,54,93,0.05); }
.about-text h3 { font-size: 1.8rem; margin-bottom: 5px; letter-spacing: 0.1em; }
.about-role { font-family: var(--font-heading); color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; font-style: italic; }
.about-text p { margin-bottom: 1.5rem; color: #4a5568; }

/* Buttons */
.more-btn-container { margin-top: 2rem; }
.more-btn-container.center { text-align: center; margin-top: 4rem; }

.more-btn {
    display: inline-block;
    font-family: var(--font-heading);
    letter-spacing: 0.15em;
    font-size: 0.9rem;
    padding: 10px 0;
    position: relative;
    border-bottom: 1px solid var(--text-main);
}
.more-btn.outline {
    border: 1px solid var(--text-main);
    padding: 15px 40px;
    background: transparent;
    transition: all 0.3s ease;
}
.more-btn.outline:hover { background: var(--text-main); color: white; }
.more-btn.text-only { border: none; font-size: 0.85rem; }

.more-btn span { transition: transform 0.3s ease; display: inline-block; }
.more-btn:hover span { transform: translateX(5px); }

/* Portfolio Gallery */
.portfolio-desc { text-align: center; margin-bottom: 3rem; color: var(--text-muted); font-size: 0.95rem; }
.portfolio { padding-left: 0; padding-right: 0; }
.portfolio .container { max-width: 100%; padding: 0 0; }
.portfolio .section-title, .portfolio .portfolio-desc { padding: 0 40px; }
.portfolio .more-btn-container { padding: 0 40px; }
.gallery-grid {
    display: flex;
    gap: 6px;
    margin: 0 40px; /* 40px side margin */
    align-items: flex-start;
}
.masonry-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* Gallery item */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #eee;
    width: 100%;
}
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-overlay {
    display: none;
}

/* Journal/News List (Top View) */
.news-list { max-width: 800px; margin: 0 auto; border-top: 1px solid #e2e8f0; }
.news-item {
    display: flex; gap: 30px; padding: 25px 10px; border-bottom: 1px solid #e2e8f0;
    align-items: center; transition: background-color 0.3s;
}
.news-item:hover { background-color: white; }
.news-item time {
    font-family: var(--font-heading); font-size: 1.1rem;
    color: var(--text-muted); min-width: 100px;
}
.news-item a { flex: 1; font-size: 0.95rem; line-height: 1.6; }


/* Lightbox Modal - Modified for FULLSCREEN */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(10, 15, 25, 0.98); /* Much darker background to pop the photo */
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.lightbox.active { opacity: 1; pointer-events: auto; }

/* The image fills up to 95% of screen.
   width/height are explicitly set so object-fit:contain works correctly
   for BOTH landscape and portrait images - no cropping ever occurs. */
.lightbox img {
    width: 90vw;
    height: 90vh;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}
.lightbox.active img { transform: scale(1); }

/* Close button - Make it white and clearly visible over dark BG */
.lightbox-close {
    position: absolute; top: 20px; right: 30px;
    font-size: 3rem; font-weight: 300; cursor: pointer;
    color: rgba(255,255,255,0.7);
    transition: transform var(--transition-speed), color 0.3s;
    z-index: 2001; /* Ensure its above the image */
}
.lightbox-close:hover { transform: rotate(90deg); color: white; }


/* Contact Entry Section */
.contact-card {
    background: transparent; /* No background */
    padding: 10px 20px 60px; text-align: center;
    max-width: 800px; margin: 0 auto;
    /* Removed box-shadow and border */
    border: none;
    box-shadow: none;
}
/* Utility Classes */
.ib { display: inline-block; }

/* Contact Section */
.contact-section { padding: 10px 0 80px; background-color: white; }
.contact-intro { font-size: 1rem; color: #4a5568; margin-bottom: 40px; line-height: 1.8; }
.primary-btn {
    display: inline-block; background-color: var(--text-main); color: white;
    padding: 16px 50px; font-family: var(--font-heading); font-size: 1.1rem;
    letter-spacing: 0.15em; border-radius: 2px; transition: background-color 0.3s;
}
.primary-btn:hover { background-color: #0f1f38; color: white;}

/* Footer Updates */
.footer { padding: 60px 0 40px; text-align: center; background-color: #fafbfc; border-top: 1px solid #eee; }
@media (max-width: 768px) {
    .footer { padding: 30px 0 20px !important; }
    .pc-only { display: none !important; }
}
.footer-inline-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
/* Footer link with icon + text */
.social-link-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-main); /* Same color as nav */
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 0.08em;
    transition: color 0.3s, transform 0.3s;
}
.social-link-label:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}
.social-link-label svg { flex-shrink: 0; }

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: color 0.3s, transform 0.3s;
}
.social-icon:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}
.text-link { font-size: 1rem; color: var(--text-main); letter-spacing: 0.08em; font-family: var(--font-heading);}
.text-link:hover { color: var(--accent-color); }

.copyright { font-family: var(--font-heading); font-size: 0.9rem; letter-spacing: 0.1em; color: var(--text-muted); margin-top: 10px;}

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

/* ==== Mobile Responsive Adjustments ==== */
@media (max-width: 768px) {
    /* Header layout */
    .header { padding: 15px 25px; }
    .header.scrolled { padding: 10px 25px; }

    /* Mobile Menu Toggle Button (Hamburger) */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        cursor: pointer;
        z-index: 1001;
    }
    .mobile-menu-btn span {
        display: block; width: 100%; height: 2px;
        background-color: var(--text-main);
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .mobile-menu-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* Nav Overlay */
    .nav {
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        width: 100%; height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        display: flex; align-items: center; justify-content: center;
        opacity: 0; visibility: hidden; pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1000;
    }
    .nav.active { opacity: 1; visibility: visible; pointer-events: auto; }
    
    .nav-list { flex-direction: column; align-items: center; gap: 35px; }
    .nav-list a { font-size: 1.6rem; }

    /* Fix excess gray padding on subpage titles (Hero) */
    .subpage-hero { 
        padding: 100px 0 30px !important; 
    }
    .subpage-hero h1 { 
        font-size: 1.6rem !important; 
        letter-spacing: 0.1em;
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    /* Footer mobile wrap control (2-column neat grid) */
    .footer-inline-links {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Exact 2 columns */
        gap: 20px 10px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto 30px;
        justify-items: center; /* ALIGN TO CENTER FOR EACH ITEM */
    }

    /* General layout spacing for mobile */
    .section { padding: 60px 0; }
    .container { padding: 0 20px; }
    
    /* Top Page Hero Margin & Typography Fixes */
    .hero-content { padding: 0 20px; width: 100%; }
    .hero-title { font-size: 2.5rem; letter-spacing: 0.15em; word-break: keep-all; }
    .hero-subtitle { font-size: 1rem; line-height: 1.8; }
    
    .section-title { font-size: 1.8rem; margin-bottom: 2rem; }

    /* Profile page heading break fix */
    .about-text h2 { 
        font-size: 1.6rem !important; 
        word-break: keep-all; 
        overflow-wrap: break-word; 
    }
    
    /* Hero Section for Mobile */
    .hero-bg {
        background-image: url('Image/Hero/hero_bg_sp.JPG'); /* Smartphone vertical crop */
        background-size: cover;
        background-position: center;
    }

    /* Top page elements to stack */
    .about-grid { grid-template-columns: 1fr; gap: 30px; }
    
    /* Gallery mobile layout (1 column to prevent overlap & tiny size) */
    .gallery-grid { grid-template-columns: 1fr; margin: 0 20px; gap: 10px; }
    .gallery-item { min-height: auto; } /* Overrides 250px so it resizes naturally */
    
    .contact-card { padding: 30px 20px 40px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.2rem; }
    .section-title { font-size: 1.5rem; }
    /* Gallery stays 1 column */
    .gallery-grid { grid-template-columns: 1fr; }
    .footer-inline-links { gap: 15px; }
    .subpage-hero { padding: 90px 0 25px !important; }
}
