:root {
    --primary-color: #0f1c3f;
    /* Deeper, more intelligent Navy */
    --accent-color: #6a9c78;
    /* Gentle, calming Green */
    --text-color: #333;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --font-main: 'Zen Maru Gothic', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    /* Increased slightly for better Japanese readability */
    overflow-x: hidden;

    /* Japanese Typography Rules (Strict & Beautiful) */
    word-break: keep-all;
    /* Prevent breaking words (e.g. 認知症) in mid-word */
    overflow-wrap: anywhere;
    /* Break only if necessary to prevent overflow */
    line-break: strict;
    /* Strict prohibition of line-start punctuation */
    text-align: left;
    /* Avoid awkward line stretching and unexpected wraps */
    text-wrap: pretty;
    /* Prevent orphans (one character on last line) */
    -webkit-font-smoothing: antialiased;
    /* Crisp text */
}

/* Ensure headings look balanced */
h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
    /* Balance lines for headings */
    word-break: keep-all;
    line-break: strict;
}

/* Explicitly apply to specific elements to ensure inheritance/override */
p,
li,
.btn,
.tagline,
.sub-copy,
.caption {
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-break: strict;
    text-wrap: pretty;
}

.nowrap-line {
    white-space: nowrap;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography Helpers removed to stick to global body rules */

/* Animations */
@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(5px, -10px) rotate(2deg);
        /* Gentle breathing movement */
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    font-size: 4rem;
    /* Uniform size */
    font-family: 'Zen Maru Gothic', sans-serif;
    /* Ensure font matches */
    font-weight: bold;
    color: #5c6bc0;
    opacity: 0.06;
    /* Very subtle (0.05-0.08) */
    animation: float 15s ease-in-out infinite;
    /* Very slow breathing */
}

/* Staggered "Brick" Layout with Random Jitter */
/* Rows approx at: 10%, 25%, 40%, 55%, 70% */
/* Row 1 (y ~ 5-10%) */
.shape-1 {
    top: 8%;
    left: 8%;
    animation-delay: 0s;
}

.shape-2 {
    top: 6%;
    left: 28%;
    animation-delay: 2s;
}

.shape-3 {
    top: 9%;
    left: 48%;
    animation-delay: 4s;
}

.shape-4 {
    top: 7%;
    left: 68%;
    animation-delay: 6s;
}

.shape-5 {
    top: 8%;
    left: 88%;
    animation-delay: 1s;
}

/* Row 2 (y ~ 20-25%) - Staggered */
.shape-6 {
    top: 23%;
    left: 18%;
    animation-delay: 3s;
}

.shape-7 {
    top: 21%;
    left: 38%;
    animation-delay: 5s;
}

.shape-8 {
    top: 24%;
    left: 58%;
    animation-delay: 7s;
}

.shape-9 {
    top: 22%;
    left: 78%;
    animation-delay: 2.5s;
}

.shape-10 {
    top: 23%;
    left: 95%;
    animation-delay: 0.5s;
}

/* Row 3 (y ~ 35-40%) */
.shape-11 {
    top: 38%;
    left: 5%;
    animation-delay: 4.5s;
}

.shape-12 {
    top: 36%;
    left: 25%;
    animation-delay: 1.5s;
}

.shape-13 {
    top: 39%;
    left: 45%;
    animation-delay: 3.5s;
}

.shape-14 {
    top: 37%;
    left: 65%;
    animation-delay: 5.5s;
}

.shape-15 {
    top: 38%;
    left: 85%;
    animation-delay: 2.8s;
}

/* Row 4 (y ~ 50-55%) - Staggered */
.shape-16 {
    top: 53%;
    left: 15%;
    animation-delay: 6.5s;
}

.shape-17 {
    top: 51%;
    left: 35%;
    animation-delay: 1.2s;
}

.shape-18 {
    top: 54%;
    left: 55%;
    animation-delay: 3.2s;
}

.shape-19 {
    top: 52%;
    left: 75%;
    animation-delay: 5.2s;
}

.shape-20 {
    top: 53%;
    left: 92%;
    animation-delay: 0.8s;
}

/* Row 5 (y ~ 65-70%) */
.shape-21 {
    top: 68%;
    left: 10%;
    animation-delay: 4.2s;
}

.shape-22 {
    top: 66%;
    left: 30%;
    animation-delay: 2.2s;
}

.shape-23 {
    top: 69%;
    left: 50%;
    animation-delay: 6.2s;
}

.shape-24 {
    top: 67%;
    left: 70%;
    animation-delay: 1.8s;
}

.shape-25 {
    top: 68%;
    left: 90%;
    animation-delay: 3.8s;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #1a2a50);
    color: white;
    padding: 80px 0 100px;
    position: relative;
    border-radius: 0 0 50px 50px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* Ensure content doesn't spill out */
}

/* Flex container for the header content */
.hero-container {
    display: flex;
    flex-direction: row;
    /* Default to row for desktop */
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    text-align: left;
    /* Left align text for desktop */
}

.hero-text {
    flex: 1;
    max-width: 600px;
    /* Limit text width for readability */
    z-index: 2;
    /* Ensure text is above background elements */
}

.hero .logo {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
    margin-left: 2px;
    /* Slight adjustment */
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.language-switch a {
    color: #d6f5db;
    text-decoration: none;
    opacity: 0.85;
}

.language-switch a:hover {
    opacity: 1;
    text-decoration: underline;
}

.language-switch a.active {
    font-weight: 700;
    opacity: 1;
}

.hero .app-title {
    font-size: 4rem;
    margin: 10px 0 20px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.1;
}

.hero .tagline {
    font-size: 1.5rem;
    font-weight: bold;
    color: #c8e6c9;
    margin-bottom: 10px;
    display: inline-block;
}

.hero .sub-copy {
    font-size: 1.1rem;
    margin-bottom: 40px;
    opacity: 0.95;
    line-height: 1.8;
    word-break: normal;
    overflow-wrap: normal;
    line-break: auto;
}

.hero-image-container {
    flex: 1;
    display: flex;
    /* Ensure container is flex */
    justify-content: flex-end;
    /* Align image to the right */
    position: relative;
    z-index: 2;
    min-width: 0;
    /* Flexbox trick to prevent overflow */
}

.hero-gallery-scroll {
    width: 100%;
}

/* Hero Gallery Grid Styles - ENFORCE DESKTOP ROW */
.hero-gallery-grid {
    display: flex !important;
    /* Force flex */
    flex-direction: row !important;
    /* Force row on desktop */
    flex-wrap: nowrap !important;
    /* No wrapping */
    justify-content: flex-end;
    /* Align right */
    gap: 15px;
    width: 100%;
    max-width: 600px;
    /* Limit width */
}

.hero-gallery-grid .gallery-item {
    text-align: center;
    flex: 1 1 0;
    /* Grow/Shrink equally */
    min-width: 0;
    /* Prevent overflow */
    max-width: 180px;
    /* Max width per item */
}

.hero-gallery-grid .gallery-image {
    width: 100%;
    height: auto;
    /* Maintain aspect ratio */
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    display: block;
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.hero-gallery-grid .gallery-item:hover .gallery-image {
    transform: translateY(-5px);
}

.btn-primary {
    display: inline-block;
    padding: 18px 50px;
    /* Larger button */
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25);
    background-color: #558b6e;
}

/* Responsive Styles */
@media (max-width: 1023px) {
    .hero-container {
        flex-direction: column;
        /* Stack vertically on smaller screens */
        text-align: center;
        /* Center text on mobile */
    }

    .hero-text {
        order: 1;
        /* Image below text? Requirement says: Image is under text "スマホでは縦並び（画像はテキスト下）" -> So text is 1, image is 2. */
        margin-bottom: 40px;
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .hero-image-container {
        order: 2;
        justify-content: center;
        /* Center image on mobile */
        width: 100%;
    }

    .hero .logo {
        align-self: center;
    }

    .language-switch {
        align-self: center;
    }

    .hero-img {
        max-width: 90%;
        /* Slight margin on mobile */
        max-height: 400px;
    }

    .hero .app-title {
        font-size: 3rem;
    }
}

/* Features Section */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h4 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

/* Gallery Section */
.gallery {
    padding: 80px 0;
    background-color: #ffffff;
    /* Clean white background */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.gallery-item {
    text-align: center;
}

.screen-placeholder {
    width: 100%;
    max-width: 280px;
    /* Max width for a phone size */
    aspect-ratio: 9 / 19;
    /* Modern phone aspect ratio */
    background-color: #e0e0e0;
    margin: 0 auto 20px;
    border-radius: 20px;
    border: 4px solid var(--primary-color);
    /* Navy border for chic look */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Add a subtle shine effect to placeholders */
.screen-placeholder::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.0) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 60%);
    transform: rotate(30deg);
    pointer-events: none;
}

.gallery-item .caption {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: bold;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Target Section */
.target {
    background-color: #e8eaf6;
    /* Light Indigo */
    padding: 80px 0;
}

.target-list {
    list-style: none;
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
}

.target-list li {
    background: white;
    margin-bottom: 15px;
    padding: 20px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.target-list li::before {
    content: '✅';
    margin-right: 15px;
    color: var(--accent-color);
}

/* Footer & Privacy */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 60px 0 20px;
    text-align: center;
}

.footer a {
    color: #a5d6a7;
    text-decoration: none;
}

.privacy-policy {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.8;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.privacy-policy h4 {
    margin-bottom: 10px;
}

.copyright {
    margin-top: 40px;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-gallery-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 10px;
    }

    .hero-gallery-grid {
        width: max-content;
        max-width: none;
        margin: 0;
        justify-content: flex-start;
        flex-direction: row !important;
        padding: 0 12px;
        gap: 12px;
    }

    .hero-gallery-grid .gallery-item {
        flex: 0 0 auto;
        width: 180px;
        max-width: none;
        margin: 0;
    }



    .hero .app-title {
        font-size: 2.5rem;
    }

    .hero .sub-copy {
        font-size: 1rem;
        line-height: 1.7;
    }

    .target-title-ja {
        font-size: 1.75rem;
        letter-spacing: -0.02em;
        white-space: nowrap;
        max-width: 100%;
    }

    .shape {
        font-size: 3rem;
    }
}
