/* Global Reset & Typography */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Noto+Sans+JP:wght@300;400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', 'Noto Sans JP', sans-serif;
    line-height: 1.8;
    letter-spacing: 0.05em;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

ul {
    list-style: none;
}

/* Page Specific Themes */
body.dark-theme {
    background-color: #111;
    color: #fff;
}

body.light-theme {
    background-color: #fff;
    color: #333;
}

/* Navigation - Minimalist Top Right */
header {
    position: absolute;
    /* Transparent overlay */
    top: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    padding: 3rem 4rem;
    /* Generous padding */
}

nav {
    display: flex;
    justify-content: flex-end;
    /* Align to right */
    align-items: center;
}

/* Mobile Nav Toggle */
.burger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.burger div {
    width: 25px;
    height: 2px;
    /* Thinner lines */
    margin: 6px;
    transition: all 0.3s ease;
}

body.dark-theme .burger div {
    background-color: #fff;
}

body.light-theme .burger div {
    background-color: #000;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
}

body.dark-theme .nav-links a {
    color: #fff;
}

body.light-theme .nav-links a {
    color: #000;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
}

/* Home Page */
.home-container {
    height: 100vh;
    /* Base Layer: The Background Image */
    background: url('img/background.jpeg') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 10%;
    overflow: hidden;
}

/* Middle Layer: The Face (tominaga_top.jpg) */
/* Masked to fade out towards bottom right, revealing the background */
.home-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/tominaga_top.jpg') no-repeat center 20%/cover;
    /* Mask: Solid at top-left, Transparent at bottom-right */
    -webkit-mask-image: linear-gradient(135deg, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 90%);
    mask-image: linear-gradient(135deg, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 90%);
    z-index: 1;
    /* Optional: Blend mode if needed, but Normal with mask usually looks cleanest for "dissolving" */
    mix-blend-mode: normal;
}

/* Top Layer: Noise and Color Gradient Atmosphere */
.home-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    /* Let clicks pass through */

    background-image:
        /* Noise */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.4'/%3E%3C/svg%3E"),
        /* Diagonal Gradient */
        linear-gradient(120deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.8) 100%);

    background-size: 150px 150px, cover;
    background-repeat: repeat, no-repeat;
    background-blend-mode: overlay, normal;
}

/* Content needs to be above the layers */
.home-content {
    position: relative;
    z-index: 3;
}

.home-content h1 {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.home-content p {
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    margin-left: 5px;
}

/* Container for Subpages */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 150px 2rem 5rem;
    /* Top padding clears nav */
}

.page-title {
    font-size: 1.2rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 4rem;
    text-align: center;
    opacity: 0.8;
}

/* Profile Page (Light Theme) */
.profile-layout {
    display: flex;
    flex-direction: row-reverse;
    /* Text Left, Image Right */
    gap: 4rem;
    align-items: flex-start;
    /* Align top */
    justify-content: space-between;
}

.profile-img {
    flex: 1;
    /* Smaller portion */
    max-width: 400px;
    height: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Stronger shadow for dark theme */
}

.profile-text {
    flex: 1.5;
    /* Wider text */
    max-width: none;
    text-align: left;
    font-weight: 300;
    color: #eee;
    /* Light text for dark theme */
}

.profile-text h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.profile-text p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Schedule Page (Dark Theme) */
.schedule-container {
    max-width: 800px;
    margin: 0 auto;
}

.schedule-item {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    transition: background-color 0.3s;
}

.schedule-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.schedule-date {
    font-weight: 700;
    margin-right: 2rem;
    min-width: 120px;
    color: #fff;
}

.schedule-info {
    flex: 1;
}

.schedule-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #fff;
}

.schedule-details {
    font-size: 0.9rem;
    color: #aaa;
    display: block;
}

/* Past Shows Table */
.past-shows {
    margin-top: 5rem;
    background: transparent;
    /* Remove white box */
    padding: 0;
    border-radius: 0;
    color: #eee;
}

.past-shows h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
    color: #fff;
    font-weight: 300;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.year-heading {
    color: #fff;
    /* White year */
    font-size: 3rem;
    font-weight: 100;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.past-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: #ccc;
}

.past-table th,
.past-table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* Thin dividers */
    text-align: left;
}

.past-table tr:nth-child(even) {
    background-color: transparent;
    /* No stripe */
}

.past-table tr:nth-child(odd) {
    background-color: transparent;
}

.past-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
    /* Subtle hover */
}

/* Movie Page (Dark Theme) */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Contact Page (Light/Dark - Choosing Clean Dark to match home vibe for contact) */
.contact-wrapper {
    text-align: center;
    padding-top: 5rem;
}

.contact-text {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    color: #ccc;
}

.contact-email {
    font-size: 1.8rem;
    font-weight: 300;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

.contact-email:hover {
    color: #fff;
    border-color: #fff;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    font-size: 0.7rem;
    opacity: 0.4;
    letter-spacing: 0.1em;
}

/* Subpage Backgrounds (Schedule/Movie/Contact) */
body.artistic-bg {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('img/tominaga06.jpg') no-repeat center center/cover;
    background-attachment: fixed;
}

@media screen and (max-width: 768px) {
    body.artistic-bg {
        background-attachment: scroll;
        /* Fix zoom issue on mobile */
        background-position: center top;
    }
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
}

.video-wrapper-item {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.video-wrapper-item iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media screen and (max-width: 768px) {
    header {
        padding: 2rem;
    }

    .profile-layout {
        flex-direction: column-reverse;
        /* Image Top (since row-reverse swaps order, column-reverse puts last item (image) first? No wait. 
        HTML is [Image, Text]. 
        Row-reverse -> Text, Image. 
        Column-reverse -> Text, Image. 
        I want Image TOP on mobile. 
        Existing HTML: Image, Text.
        Original CSS: flex-direction: column -> Image, Text.
        New CSS Desktop: row-reverse -> Text, Image.
        New CSS Mobile: flex-direction: column -> Image, Text. 
        */
        flex-direction: column;
    }

    .profile-img {
        max-width: 80%;
        /* Don't fill screen */
        width: auto;
        /* Maintain aspect ratio */
        max-height: 400px;
        margin: 0 auto;
        /* Center */
    }

    .burger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        background-color: inherit;
        /* Inherit from body theme */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.5s ease-in-out;
        z-index: 1000;
    }

    /* Ensure nav links background matches explicit theme if needed */
    body.dark-theme .nav-links {
        background-color: #111;
    }

    body.light-theme .nav-links {
        background-color: #fff;
    }

    .nav-active {
        transform: translateX(0%);
    }

    .home-content h1 {
        font-size: 2.5rem;
    }

    .schedule-item {
        flex-direction: column;
    }

    .schedule-date {
        margin-bottom: 0.5rem;
    }
}