/*
Theme Name: AIZIS Theme v1.2
Theme URI: https://aizis.co.jp
Author: AIZIS Co.,Ltd.
Author URI: https://aizis.co.jp
Description: 株式会社アイジス公式サイト用WordPressテーマ。View Transitions API、SEO最適化、レスポンシブ対応、ローカルフォント、JS最適化。
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: Proprietary
License URI:
Text Domain: aizis-theme
*/

/* =========================================
   Local Font - Noto Sans JP (Variable)
   ========================================= */
@font-face {
    font-family: "Noto Sans JP";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("./assets/fonts/NotoSansJP-Variable.woff2") format("woff2");
}

:root {
    /* Color Palette - Swiss Minimal */
    --color-bg: #ffffff;
    --color-text: #111111;
    --color-accent: #0033a0;
    /* Cobalt Blue - The only color */
    --color-gray: #e5e5e5;
    /* Light divider */

    /* Typography */
    --font-jp: "Noto Sans JP", sans-serif;
    --font-en: "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Spacing */
    --unit: 8px;
    /* Base unit */
    --container-width: 90%;
    /* Fluid */
    --header-height: 100px;
}

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

body {
    font-family: var(--font-en);
    /* English numbers/headings first */
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "palt";
    /* Tight Japanese spacing */
}

/* Typography Scale */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: var(--font-jp);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.jp-text {
    font-family: var(--font-jp);
    font-weight: 500;
}

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

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.text-accent {
    background: linear-gradient(
        90deg,
        #0ea5e9,
        #3b82f6,
        #6366f1,
        #8b5cf6,
        #3b82f6,
        #0ea5e9
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation:
        wave 8s ease infinite,
        hueShift 20s linear infinite;
}

@keyframes wave {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes hueShift {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(30deg);
    }
}

/* --- Liquid Glass Header --- */
.site-header {
    position: fixed;
    top: 30px;
    /* Floating from top */
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 0 40px;
    pointer-events: none;
    /* Let clicks pass through outside elements */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    pointer-events: auto;
    /* Re-enable clicks */
}

/* Logo */
.site-branding {
    flex-shrink: 0;
}

.logo-link img {
    height: 48px;
    /* Reduced by 20% (60px -> 48px) */
    width: auto;
    display: block;
}

/* Liquid Glass Nav Pill */
.main-navigation {
    /* Glassmorphism Container */
    background: rgba(223, 223, 223, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border-radius: 30px;
    padding: 5px 10px;
    display: flex;
    align-items: center;

    /* Optional: Border for glass feel */
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.main-navigation ul {
    display: flex;
    gap: 5px;
    /* Spacing between pill items */
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-navigation a {
    display: block;
    padding: 10px 25px;
    border-radius: 20px;

    /* Typography */
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-en);
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.02em;

    transition: all 0.3s ease;
}

.main-navigation a:hover {
    background: #ffffff;
    color: var(--color-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* --- Hero (Editorial) --- */
/* Base hero styles moved to 3D Depth Scroll section */

.hero-main-text {
    font-size: clamp(60px, 12vw, 180px);
    /* Massive */
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.04em;
    margin-bottom: 60px;
    font-family: var(--font-en);
}

.hero-sub {
    position: absolute;
    bottom: -60px;
    right: 5vw;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 60px;
}

.hero-desc {
    font-family: var(--font-jp);
    font-size: 24px;
    line-height: 1.8;
    max-width: 600px;
    font-weight: 500;
    text-align: right;
}

/* --- Services (List Layout) --- */
.section-services {
    padding: 100px 0;
}

.section-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 30px;
    margin-left: 5vw;
    margin-right: 5vw;
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 15px;
    position: relative;
}

.section-label::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-text);
}

.service-list {
    border-top: 2px solid var(--color-text);
    /* Bold top line */
}

.service-item {
    border-bottom: 1px solid var(--color-gray);
    padding: 40px 0;
    display: grid;
    grid-template-columns: 0.5fr 2fr 1fr;
    align-items: flex-start;
    transition:
        background 0.2s,
        color 0.2s;
}

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

.service-num {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-en);
}

.service-title {
    font-size: clamp(30px, 4vw, 60px);
    font-weight: 900;
    line-height: 1;
}

.service-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    color: var(--color-text);
    /* Darken on hover */
}

/* =========================================
   Apple Carousel Styles
   ========================================= */
.services-section {
    padding: 60px 0;
    overflow: hidden;
    /* Hide scrollbars outside */
}

/* =========================================
   Services Marquee - Infinite Scroll
   ========================================= */
.services-header {
    margin-bottom: 2rem;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    padding: 2rem 0 4rem 0;
    pointer-events: auto; /* Ensure container passes clicks to cards */
}

.marquee-track {
    display: flex;
    gap: 2rem;
    width: max-content;
    animation: marquee-scroll 40s linear infinite;
    will-change: transform;
    backface-visibility: hidden;
    pointer-events: auto; /* Ensure track passes clicks to cards */
}

.marquee-container:hover .marquee-track,
.marquee-container:focus-within .marquee-track {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Move exactly half (5 cards worth) for seamless loop */
        transform: translateX(calc(-50%));
    }
}

.marquee-card {
    flex: 0 0 320px;
    height: 450px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background: #f5f5f7;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    user-select: none;
    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
    text-decoration: none;
    display: block;
    color: inherit;
    cursor: pointer;
    pointer-events: auto; /* Ensure clickable even during animation */
}

a.marquee-card {
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto; /* Explicit for anchor tags */
}

@media (min-width: 768px) {
    .marquee-card {
        flex: 0 0 380px;
        height: 500px;
    }

    .marquee-track {
        gap: 2.5rem;
    }
}

@media (min-width: 1200px) {
    .marquee-card {
        flex: 0 0 420px;
        height: 540px;
    }
}

.marquee-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .marquee-track {
        animation: none;
    }
}

/* Legacy carousel styles (keep for backward compatibility) */
.apple-carousel-container {
    width: 100%;
    overflow: hidden;
    padding-left: 5vw;
    padding-right: 5vw;
}

.apple-carousel {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding: 2rem 0 4rem 0;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
}

.apple-carousel::-webkit-scrollbar {
    display: none;
}

.apple-carousel.active {
    cursor: grabbing;
    scroll-behavior: auto;
}

.apple-card {
    flex: 0 0 320px;
    height: 480px;
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    background: #f5f5f7;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    user-select: none;
}

@media (min-width: 768px) {
    .apple-card {
        flex: 0 0 400px;
        height: 550px;
    }
}

.apple-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
    pointer-events: none;
}

.apple-card:hover .card-bg,
.marquee-card:hover .card-bg {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    pointer-events: none;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    color: white;
    z-index: 2;
    pointer-events: none;
}

.card-category {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.card-title {
    font-family: "Noto Sans JP", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

/* Cards are visible by default */

/* --- Terminal Section --- */
.terminal-section {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.terminal_emulator {
    width: 800px;
    max-width: 90%;
    height: 500px;
    padding: 40px;
    font-size: 22px;
    line-height: 1.9;
    box-sizing: border-box;
    text-align: left;
    font-family: "Courier New", monospace;
    font-weight: 700;
    color: var(--color-accent);
    pointer-events: auto; /* Ensure terminal content is clickable when section is active */
    position: relative;
    z-index: 5;

    /* Liquid Glass Effect */
    background: rgba(223, 223, 223, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.terminal_emulator__field,
.terminal_emulator__command {
    position: relative;
    padding: 0 1.5em;
    margin: 0 0 9px 0;
}

.terminal_emulator__field::before,
.terminal_emulator__command::before {
    position: absolute;
    left: 0;
    top: 0;
    content: ">";
}

.terminal_emulator__response {
    padding: 0 0 9px 0;
    margin-left: 1.5em;
}

.terminal_emulator__command b {
    padding-bottom: 9px;
}

.terminal_emulator__field {
    display: inline-block;
    min-width: 1em;
    min-height: 1.5em;
    box-sizing: border-box;
}

.terminal_emulator__field::after {
    position: absolute;
    right: 0;
    bottom: 0.25em;
    content: "";
    width: 0.8em;
    height: 1.2em;
    background: var(--color-accent);
    animation: caretBlink 1s infinite;
}

.terminal_emulator__field.waiting {
    padding-left: 0;
    padding-right: 0;
}

.terminal_emulator__field.waiting::before {
    display: none;
}

.terminal_emulator__field.hidden {
    display: none;
}

@keyframes caretBlink {
    0%,
    50% {
        opacity: 0;
    }

    51%,
    100% {
        opacity: 1;
    }
}

/* Terminal Text Colors */
.terminal-prompt {
    color: #0077b8;
    font-weight: 700;
    font-size: 1.2em;
}

.terminal-text {
    color: #444444;
    max-height: 650px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Terminal Button */
.terminal-btn {
    display: inline-block;
    padding: 10px 30px;
    margin-top: 10px;
    background: transparent;
    border: 2px solid #0088cd;
    color: #0088cd;
    font-family: "Courier New", monospace;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto; /* Ensure clickable even when parent has pointer-events: none */
    position: relative;
    z-index: 10;
}

.terminal-btn:hover {
    background: #0088cd;
    color: var(--color-bg);
}

.terminal-btn-container {
    pointer-events: auto; /* Ensure container is clickable */
    position: relative;
    z-index: 10;
}

/* Carousel Navigation Buttons */
.carousel-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 2rem 5vw 0;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--color-gray);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-btn svg {
    width: 20px;
    height: 20px;
}

/* Footer & Other Adjustments */
footer.site-footer {
    background: #111;
    color: #fff;
    padding: 80px 0;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- News (Typographic Table) --- */
.section-news {
    padding: 60px 5vw 0 5vw; /* Remove bottom padding - CTA has its own padding */
    position: relative;
    z-index: 10; /* Above fixed sections (Services: 3, About: 5) */
    background: #fff; /* White background */
    max-width: 100%;
    box-sizing: border-box;
}

.section-news .section-label {
    margin-left: 0;
    margin-right: 0;
}

.news-row {
    display: flex;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-text);
    align-items: baseline;
}

.news-row:first-child {
    border-top: 1px solid var(--color-text);
}

.news-date {
    width: 150px;
    font-weight: 700;
}

.news-title {
    flex: 1;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* --- Footer --- */
.site-footer {
    background: var(--color-text);
    color: var(--color-bg);
    padding: 100px 0 40px;
    position: relative;
    z-index: 10; /* Above fixed sections */
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-logo {
    font-size: 80px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 20px;
    display: block;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 18px;
    font-weight: 700;
}

.copyright {
    margin-top: 80px;
    font-size: 12px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.copyright span {
    opacity: 0.5;
    text-align: center;
    grid-column: 2;
}

.copyright .privacy-link {
    color: var(--color-bg);
    text-decoration: none;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    text-align: right;
    grid-column: 3;
}

.copyright .privacy-link:hover {
    opacity: 1;
}

/* --- Typewriter Cursor --- */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--color-text);
    margin-left: 5px;
    animation: cursorBlink 1s infinite;
    vertical-align: text-bottom;
}

.typewriter-cursor.accent {
    background: var(--color-accent);
}

@keyframes cursorBlink {
    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header-container {
        padding: 0 20px;
    }

    .hero-main-text {
        font-size: clamp(54px, 14vw, 90px); /* 1.3x larger on mobile */
        line-height: 1.1;
        margin-bottom: 30px;
    }

    .hero-sub {
        position: absolute;
        bottom: 80px;
        right: 20px;
        left: 20px;
        flex-direction: column;
        gap: 20px;
    }

    .service-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .main-navigation {
        display: none;
    }
}

/* =========================================
   Company Page Styles
   ========================================= */

.company-page-main {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 120px;
}

.company-page-main .section-label {
    margin-left: 0;
    margin-right: 0;
}

/* Page Title (Huge & Clean) */
.page-title {
    font-size: clamp(60px, 10vw, 160px);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 0.9;
    margin-bottom: 100px;
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 40px;
}

/* Greeting Section */
.company-greeting {
    margin-bottom: 160px;
}

.greeting-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-top: 40px;
}

.greeting-title {
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.4;
}

.greeting-text p {
    margin-bottom: 2em;
    font-size: 16px;
    line-height: 2;
    /* Relaxed reading experience */
    text-align: justify;
}

.greeting-sign {
    margin-top: 60px;
    text-align: right;
    font-weight: 700;
}

.sign-name {
    font-size: 24px;
    display: block;
    margin-top: 10px;
}

/* Bento Grid (Company Info) - 2026 Trend */
.company-info {
    margin-bottom: 160px;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    /* Two rows */
    gap: 24px;
    margin-top: 40px;
}

.bento-item {
    background: #f9f9f9;
    /* Very subtle gray */
    padding: 40px;
    border-radius: 24px;
    /* Soft modern corners */
    transition:
        transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    /* Soft shadow on hover */
    background: #fff;
    border: 1px solid #eee;
    /* Outline on hover */
}

.bento-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: block;
}

.bento-value {
    font-size: 20px;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* Specific Bento Placements to make it asymmetrical/interesting */
.item-name {
    grid-column: 1 / 3;
    /* Spans 2 cols */
    background: var(--color-text);
    color: #fff;
    /* Dark mode card for contrast */
}

.item-name .bento-label {
    color: #888;
}

.item-name .bento-value {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700;
}

.en-name {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.7;
    font-family: var(--font-en);
    display: block;
    margin-top: 5px;
}

.item-location {
    grid-column: 3 / 4;
}

.item-rep {
    grid-column: 1 / 2;
}

.item-business {
    grid-column: 2 / 4;
    /* Spans 2 cols */
}

.business-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.business-list li {
    font-size: 14px;
    position: relative;
    padding-left: 15px;
}

.business-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

/* Partners Section */
.partners-list-container {
    max-width: 100%;
    margin-top: 40px;
    margin-left: 0;
    margin-right: 0;
}

.partners-title {
    font-size: 32px;
    margin-bottom: 40px;
}

.partners-list {
    border-top: 1px solid var(--color-text);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.partners-list li {
    padding: 20px 0;
    border-bottom: 1px solid var(--color-gray);
    font-size: 18px;
    font-weight: 500;
    transition:
        padding-left 0.3s ease,
        color 0.3s ease;
}

.partners-list li:nth-child(odd) {
    padding-right: 20px;
    border-right: 1px solid var(--color-gray);
}

.partners-list li:nth-child(even) {
    padding-left: 20px;
}

.partners-list li:hover {
    padding-left: 20px;
    color: var(--color-accent);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .greeting-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        /* Stack everything */
    }

    .item-name,
    .item-location,
    .item-rep,
    .item-business {
        grid-column: auto;
    }

    .business-list {
        grid-template-columns: 1fr;
    }

    .partners-list-container {
        margin-left: 0;
    }

    .partners-list {
        grid-template-columns: 1fr;
    }

    .partners-list li:nth-child(odd) {
        padding-right: 0;
        border-right: none;
    }

    .partners-list li:nth-child(even) {
        padding-left: 0;
    }
}
/* =========================================
   Services Page Styles
   ========================================= */

.services-page-main {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 120px;
}

.services-page-main .section-label {
    margin-left: 0;
    margin-right: 0;
}

/* Service Overview */
.services-overview {
    margin-bottom: 160px;
}

.overview-content {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
}

.overview-title {
    font-size: clamp(30px, 4vw, 50px);
    font-weight: 700;
    line-height: 1.2;
    font-family: var(--font-en);
}

.overview-text .overview-lead {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.6;
}

.overview-text p {
    font-size: 16px;
    line-height: 2;
    color: var(--color-text);
}

/* Service Details List */
.service-detail-list {
    border-top: 2px solid var(--color-text);
}

.service-detail-item {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Asymmetrical split */
    gap: 60px;
    padding: 80px 0;
    border-bottom: 1px solid var(--color-gray);
    transition: background 0.3s ease;
}

.service-detail-item:hover {
    background: #fafafa; /* Subtle highlight on hover */
}

/* Left Column: Number & Title */
.service-detail-head {
    position: relative;
}

.service-detail-num {
    display: block;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-en);
    margin-bottom: 20px;
    color: var(--color-accent);
}

.service-detail-title {
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 900;
    line-height: 1.1;
    font-family: var(--font-en);
}

/* Right Column: Description & Features */
.service-detail-body {
    padding-top: 40px; /* Align visually with title baseline roughly */
}

.service-detail-desc {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 40px;
    text-align: justify;
}

.text-highlight {
    background: linear-gradient(transparent 60%, rgba(0, 51, 160, 0.1) 60%);
    font-weight: 700;
}

.service-detail-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 40px;
    list-style: none;
    padding: 0;
}

.service-detail-features li {
    position: relative;
    padding-left: 20px;
    font-size: 15px;
    font-weight: 500;
}

.service-detail-features li::before {
    content: "/";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 700;
}

/* Responsive Services */
@media (max-width: 768px) {
    .overview-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .service-detail-item {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 60px 0;
    }

    .service-detail-body {
        padding-top: 0;
    }

    .service-detail-features {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   Recruit Page Styles
   ========================================= */

.recruit-page-main {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 120px;
}

.recruit-page-main .section-label {
    margin-left: 0;
    margin-right: 0;
}

/* Message Section */
.recruit-message {
    margin-bottom: 160px;
}

.message-content {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
}

.message-title {
    font-size: clamp(30px, 4vw, 50px);
    font-weight: 700;
    line-height: 1.1;
    font-family: var(--font-en);
}

.message-text p {
    font-size: 16px;
    line-height: 2.2;
    margin-bottom: 30px;
}

/* Mindset Section */
.recruit-mindset {
    margin-bottom: 160px;
}

.mindset-grid {
    margin-top: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

.mindset-head {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--color-text);
    padding-bottom: 15px;
}

.mindset-list {
    list-style: none;
    padding: 0;
}

.mindset-list li {
    position: relative;
    padding: 15px 0 15px 25px;
    border-bottom: 1px solid var(--color-gray);
    font-size: 16px;
    font-weight: 500;
}

.mindset-list li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-size: 12px;
    top: 18px;
}

/* Requirements Section */
.recruit-requirements {
    margin-bottom: 80px;
}

.requirements-container {
    margin-top: 60px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.req-group {
    margin-bottom: 100px;
}

.req-group.common {
    background: #f9f9f9;
    padding: 60px;
    border-radius: 8px;
}

.req-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    display: inline-block;
    background: var(--color-text);
    color: #fff;
    padding: 10px 30px;
}

.req-desc {
    margin-bottom: 40px;
    font-size: 15px;
    line-height: 1.8;
}

.req-sub-title {
    font-size: 18px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 10px;
    border-left: 4px solid var(--color-accent);
    padding-left: 15px;
}

.req-sub-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Requirement Definition List */
.req-list {
    border-top: 1px solid var(--color-text);
    display: grid;
    grid-template-columns: 1fr;
}

.req-list dt {
    font-weight: 700;
    padding-top: 25px;
    font-size: 15px;
}

.req-list dd {
    margin: 0;
    padding-bottom: 25px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.8;
}

/* Responsive Recruit */
@media (max-width: 768px) {
    .message-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .mindset-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .req-group {
        margin-bottom: 60px;
    }

    .req-group.common {
        padding: 30px;
    }
}

@media (min-width: 768px) {
    .req-list {
        grid-template-columns: 200px 1fr;
    }

    .req-list dt {
        padding: 25px 20px 25px 0;
        border-bottom: 1px solid #ddd;
    }

    .req-list dd {
        padding: 25px 0;
    }
}

/* =========================================
   News Page Styles
   ========================================= */

.news-page-main {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 120px;
}

.news-page-main .section-label {
    margin-left: 0;
    margin-right: 0;
}

.news-archive-section {
    margin-top: 60px;
}

/* Archive List - With Thumbnails for View Transitions */
.news-archive-list {
    border-top: 2px solid var(--color-text);
    margin-bottom: 80px;
}

.news-archive-item {
    border-bottom: 1px solid var(--color-gray);
    transition: background 0.3s ease;
}

.news-archive-item:hover {
    background: #fafafa;
}

.news-archive-link {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    padding: 25px 20px;
    color: var(--color-text);
    text-decoration: none;
    gap: 30px;
}

.news-archive-item:hover .news-title {
    color: var(--color-accent);
}

/* Thumbnail Styles */
.news-thumbnail-wrapper {
    width: 180px;
    height: 101px; /* 16:9 ratio */
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    contain: layout style;
}

.news-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-archive-item:hover .news-thumbnail {
    transform: scale(1.05);
}

.news-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-thumbnail-placeholder .placeholder-icon {
    font-size: 32px;
    opacity: 0.4;
}

/* Content Wrapper */
.news-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.news-date {
    font-family: var(--font-en);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.05em;
    color: #666;
}

.news-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--color-text);
    padding: 3px 8px;
    text-align: center;
    display: inline-block;
}

.news-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
    line-height: 1.5;
}

.news-excerpt {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

.nav-links {
    display: flex;
    gap: 20px;
    font-family: var(--font-en);
    font-weight: 700;
    font-size: 16px;
}

.pagination .page-numbers {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    color: var(--color-accent);
}

.pagination .prev,
.pagination .next {
    color: var(--color-text);
}

.pagination .prev:hover,
.pagination .next:hover {
    color: var(--color-accent);
}

/* Responsive News */
@media (max-width: 768px) {
    .news-archive-link {
        grid-template-columns: 120px 1fr;
        gap: 15px;
        padding: 20px 0;
    }

    .news-thumbnail-wrapper {
        width: 120px;
        height: 68px;
    }

    .news-title {
        font-size: 14px;
    }

    .news-excerpt {
        display: none;
    }

    .news-cat {
        display: inline-block;
        width: fit-content;
    }
}

/* =========================================
   News Detail (Single) Styles
   ========================================= */

.single-post-main {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 120px;
}

/* Featured Image Banner for View Transitions */
.post-banner-wrapper {
    width: 100%;
    max-width: 720px;
    margin: 0 auto 35px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    contain: layout style;
}

.post-banner {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .post-banner-wrapper {
        max-width: 480px;
        border-radius: 8px;
        margin-bottom: 25px;
    }

    .post-banner {
        max-height: 270px;
    }
}

.single-post-header {
    margin-bottom: 60px;
    border-bottom: 1px solid var(--color-gray);
    padding-bottom: 40px;
}

.post-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.post-date {
    font-family: var(--font-en);
    font-size: 16px;
    color: #666;
}

.post-cat {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid var(--color-text);
    padding: 2px 8px;
}

.post-title {
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.post-content {
    max-width: 800px; /* Optimal reading width */
    margin: 0 auto 100px 0; /* Align left but limit width */
    font-size: 16px;
    line-height: 2;
}

.post-content p {
    margin-bottom: 2em;
}

.post-content h2 {
    font-size: 24px;
    margin-top: 60px;
    margin-bottom: 30px;
    font-weight: 700;
}

/* Post Navigation */
.single-post-footer {
    border-top: 1px solid var(--color-text);
    padding-top: 60px;
}

.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-en);
    font-weight: 700;
}

.nav-prev a,
.nav-next a,
.nav-back a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-prev a:hover,
.nav-next a:hover,
.nav-back a:hover {
    color: var(--color-accent);
}

/* =========================================
   Contact Page Styles
   ========================================= */

.contact-page-main {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 120px;
}

.contact-page-main .section-label {
    margin-left: 0;
}

.form-intro {
    font-size: 16px;
    margin-bottom: 40px;
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
}

/* Contact Form 7 Styles */
.contact-form .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-form .wpcf7-form p {
    margin: 0;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label,
.contact-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
}

.form-control,
.contact-form .wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-acceptance) {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-size: 16px;
    background: #fff;
    transition: border-color 0.3s;
    appearance: none;
    box-sizing: border-box;
}

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

textarea.form-control,
.contact-form textarea.wpcf7-form-control {
    resize: vertical;
    min-height: 150px;
}

/* Privacy & Submit */
.privacy-group,
.contact-form .form-group.privacy-group {
    margin-top: 40px;
    text-align: left;
    border-top: 1px solid var(--color-gray);
    padding-top: 30px;
}

.contact-form .privacy-group .wpcf7-list-item {
    margin: 0;
}

/* Checkbox inline with label text */
.contact-form .privacy-group label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
}

.contact-form .privacy-group label br {
    display: none;
}

.contact-form .privacy-group input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
    flex-shrink: 0;
}

/* Form Submit Section */
.contact-form .form-submit {
    margin-top: 30px;
}

/* Submit Button */
.contact-form .wpcf7-submit {
    background: var(--color-text);
    color: #fff;
    border: none;
    padding: 20px 80px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-en);
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
    max-width: 300px;
}

.contact-form .wpcf7-submit:hover {
    background: var(--color-accent);
}

.privacy-link {
    margin-bottom: 20px;
}

.privacy-link a {
    color: var(--color-text);
    text-decoration: underline;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 10px;
    transform: scale(1.2);
}

.form-submit {
    margin-top: 60px;
}

.submit-button {
    background: var(--color-text);
    color: #fff;
    border: none;
    padding: 20px 80px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-en);
    cursor: pointer;
    transition: background 0.3s;
    width: 100%; /* Mobile friendly */
    max-width: 300px;
}

.submit-button:hover {
    background: var(--color-accent);
}

/* Responsive Contact */
@media (max-width: 768px) {
    .post-nav {
        flex-direction: column;
        gap: 20px;
    }
}

/* =========================================
   CTA Section (iOS 26 Liquid Glass Effect)
   ========================================= */
.cta-section {
    position: relative;
    padding: 96px 20px;
    text-align: center;
    background: #fff; /* White background */
    overflow: hidden;
    z-index: 10; /* Above fixed sections */
}

/* Liquid Glass Container */
.cta-glass-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
    padding: 60px 80px;
    border-radius: 40px;
}

.cta-glass-container::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: 40px;
    box-shadow:
        inset 2px 2px 0px -1px rgba(255, 255, 255, 0.8),
        inset 0 0 4px 2px rgba(255, 255, 255, 0.5),
        0 8px 32px rgba(0, 0, 0, 0.05);
}

.cta-glass-container::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.35);
    filter: url(#cta-container-glass);
    overflow: hidden;
    isolation: isolate;
}

.cta-text {
    position: relative;
    z-index: 1;
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 700;
    line-height: 1.6;
    color: #333;
    margin-bottom: 50px;
    letter-spacing: 0.02em;
    font-family: var(--font-jp);
}

/* Liquid Glass Button - Rectangle style like [y/y] */
.cta-glass-btn {
    position: relative;
    display: inline-block;
    padding: 16px 50px;
    background: transparent;
    border: 2px solid #0077b8;
    color: #0077b8;
    font-family: var(--font-jp);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

.cta-glass-btn:hover {
    background: #0077b8;
    color: #fff;
}

@media (max-width: 768px) {
    .cta-section {
        padding: 100px 20px;
    }

    .cta-glass-container {
        padding: 40px 30px;
        border-radius: 30px;
    }

    .cta-glass-container::before,
    .cta-glass-container::after {
        border-radius: 30px;
    }

    .cta-glass-btn {
        padding: 14px 40px;
        font-size: 16px;
    }
}

/* =========================================
   Scroll Snap System

   Requirements:
   - Hero → About → Services: SNAP (吸い付く)
   - Services → Latest/CTA/Footer: FREE SCROLL (スナップなし)
   ========================================= */

/* Body setup for scroll snap on html */
/* proximity: snaps when close to snap point, allows free scroll otherwise */
/* Only Hero and About have snap points - Services onwards is free scroll */
html.has-scroll-snap {
    scroll-snap-type: y proximity;
    scroll-padding-top: 0;
    scrollbar-gutter: stable;
}

body.has-scroll-snap {
    overflow-x: hidden;
}

/* Snap Container - now uses body scroll, not internal scroll */
.snap-container {
    /* Remove internal scrolling - use body scroll instead */
    overflow: visible;
    height: auto;
    min-height: auto;
}

/* No-snap sections (Latest, CTA, Footer) - no snapping */
.no-snap {
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
    height: auto !important;
    min-height: auto !important;
}

/* Snap Section - sections that SHOULD snap */
.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: normal; /* Allow smooth scrolling between sections */
    height: 100dvh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Snap Exit Zone - helps transition from snap to free scroll */
.snap-exit-zone {
    height: 1px;
    margin-bottom: -1px;
    scroll-snap-align: start;
    pointer-events: none;
}

/* Hero Section - Fixed, not affected by snap */
.hero-section.snap-section {
    /* Hero is fixed, see 3D Depth Scroll section */
    scroll-snap-align: none;
}

/* Services Section styling - now fixed, not in snap-container */
.services-section {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 80px;
    padding-left: 5vw;
    padding-right: 5vw;
    box-sizing: border-box;
    overflow: visible; /* Allow content to breathe */
}

/* Terminal/About Section - snap adjustment */
.terminal-section.snap-section {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
    /* Inherit height from .snap-section with dvh fallback */
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Force mandatory stop at About section */
    scroll-snap-stop: always;
}

/* Scroll lock during Hero/About animation */
html.scroll-locked {
    overflow: hidden !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
    scroll-snap-type: none !important;
}

html.scroll-locked body {
    overflow: hidden !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
}

/* News Section - snap adjustment */
.section-news.snap-section {
    padding: 80px 0;
    height: 100vh;
    min-height: 100vh;
    box-sizing: border-box;
}

/* CTA Section - snap adjustment */
.cta-section.snap-section {
    padding: 80px 20px;
    height: 100vh;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: visible; /* For Liquid Glass SVG filter */
}

/* =========================================
   Pagination Dots (iOS 26 Liquid Glass Effect)
   ========================================= */
.snap-pagination {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.snap-pagination ul {
    list-style: none;
    padding: 10px 7px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;

    /* Liquid Glass Container - Same as header nav */
    background: rgba(223, 223, 223, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.snap-dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;

    /* Default - Subtle dark dot */
    background: rgba(0, 0, 0, 0.2);
    border: none;
    box-shadow: none;

    transition:
        background 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

/* Larger touch target for accessibility (44x44px minimum) */
.snap-dot::before {
    content: "";
    position: absolute;
    top: -18px;
    left: -18px;
    right: -18px;
    bottom: -18px;
}

.snap-dot:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.2);
}

.snap-dot:focus {
    outline: none;
}

.snap-dot:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 3px;
}

.snap-dot.active {
    /* Active - Solid dark circle, same size */
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================
   3D Depth Scroll Animation System
   ========================================= */

/* Background Canvas - Always fixed behind everything */
#hero-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -10;
    width: 100%;
    height: 100vh;
    pointer-events: none;
}

/* Hero Section - Fixed position */
.hero-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: calc(var(--header-height) + 120px);
    padding-bottom: 120px;
    pointer-events: none;
}

.hero-content {
    pointer-events: auto;
    position: relative;
    height: 100%;
}

/* Hero Spacer - Takes up space for fixed hero in document flow */
.hero-spacer {
    height: 50vh;
    pointer-events: none;
    position: relative;
    z-index: -1; /* Below fixed sections */
}

.hero-spacer.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always; /* Force stop at Hero spacer */
}

/* About Spacer - Takes up space for fixed about section */
.about-spacer {
    height: 25vh; /* Short scroll distance from About to Services */
    pointer-events: none;
    position: relative;
    z-index: -1; /* Below fixed sections */
}

.about-spacer.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always; /* Ensure stop at About */
}

/* Services Spacer - Takes up space for fixed services section */
.services-spacer {
    height: 70vh; /* Height for Services section scroll */
    pointer-events: none;
    position: relative;
    z-index: -1; /* Below fixed sections */
}

.services-spacer.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always; /* Ensure stop at Services */
}

/* Hero Text Slide Animation */
.hero-main-text {
    transition:
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.6s ease;
    will-change: transform, opacity;
}

.hero-sub {
    transition:
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.6s ease;
    will-change: transform, opacity;
}

/* Hero text exit states - triggered by scroll */
.hero-text-exit .hero-main-text {
    transform: translateX(-100vw);
    opacity: 0;
}

.hero-text-exit .hero-sub {
    transform: translateX(100vw);
    opacity: 0;
}

/* =========================================
   3D Perspective Container
   ========================================= */

/* Main container gets perspective for 3D depth effect */
.snap-container {
    perspective: 1500px;
    perspective-origin: 50% 50%;
    position: relative;
    z-index: 10; /* Above fixed sections (Hero: 1, About: 5, Services: 3) */
    pointer-events: none; /* Let clicks pass through to fixed sections below */
}

/* Enable pointer events for scrollable content sections */
.snap-container .section-news,
.snap-container .cta-section,
.snap-container .no-snap {
    pointer-events: auto;
}

/* Sections that have 3D depth effect */
.terminal-section,
.services-section {
    transform-origin: center center;
    /* Longer transition for smoother About → Services animation */
    transition:
        transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 1s ease;
    will-change: transform, opacity;
}

/* 3D Depth States */

/* Far - Section is hidden, small scale in center */
.depth-far {
    transform: scale(0.3);
    opacity: 0;
}

/* Approaching - Section is growing from center */
.depth-approaching {
    transform: scale(0.7);
    opacity: 0.5;
}

/* Active - Section is fully visible */
.depth-active {
    transform: scale(1);
    opacity: 1;
}

/* Exiting - Section is scrolling past (not used for Services) */
.depth-exiting {
    transform: translateZ(200px) scale(1.05);
    opacity: 0.5;
}

/* Services section - active state (exiting is defined below with translateY) */
/* services-section.depth-active is defined below with full properties */

/* About/Terminal Section Specific - Fixed in center */
.terminal-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 5;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    /* Let depth classes control visibility */
    transition:
        transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.8s ease;
    will-change: transform, opacity;
}

/* Terminal: depth-far - completely hidden */
.terminal-section.depth-far {
    opacity: 0;
    transform: scale(0.3);
    visibility: hidden;
    pointer-events: none;
}

/* Terminal: depth-approaching - growing but still partially hidden */
.terminal-section.depth-approaching {
    opacity: 0.5;
    transform: scale(0.7);
    visibility: visible;
    pointer-events: none;
}

/* Terminal: depth-active - fully visible */
.terminal-section.depth-active {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    pointer-events: auto;
}

/* Terminal: depth-exiting - hidden when Services is active */
.terminal-section.depth-exiting {
    opacity: 0;
    transform: scale(1.05) translateZ(100px);
    visibility: hidden;
    pointer-events: none;
}

/* Terminal content wrapper */
.terminal-section .terminal_emulator {
    max-width: 90vw;
    max-height: 80vh;
}

/* Services Section Specific */
/* Services Section - Fixed in center (like About) */
.services-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 3; /* Below About (z-index: 5) */
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    visibility: hidden;
    /* Transition for state changes - JS overrides with 'none' during scroll-linked animation */
    transition:
        transform 0.4s ease-out,
        opacity 0.4s ease-out;
    will-change: transform, opacity;
}

/* Services depth states */
.services-section.depth-far {
    opacity: 0;
    transform: scale(0.3);
    visibility: hidden;
}

.services-section.depth-approaching {
    opacity: 0.5;
    transform: scale(0.7);
    visibility: visible;
    pointer-events: none;
}

.services-section.depth-active {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
    pointer-events: auto;
    z-index: 6; /* Above About section (z-index: 5) when active */
}

.services-section.depth-exiting {
    opacity: 1;
    transform: translateY(-100vh); /* Slide up and out */
    visibility: visible;
    pointer-events: none;
}

/* =========================================
   Mobile Responsive - Scroll Snap
   ========================================= */
@media (max-width: 768px) {
    /* Disable scroll snap on mobile for footer accessibility */
    html.has-scroll-snap {
        scroll-snap-type: none;
    }

    .snap-section {
        min-height: 100vh;
        min-height: 100dvh;
        height: auto; /* Allow overflow content on mobile */
        padding: 60px 20px;
        scroll-snap-align: none;
        scroll-snap-stop: normal;
    }

    /* Hero section mobile */
    .hero-section.snap-section {
        padding-top: calc(var(--header-height) + 40px);
        padding-bottom: 40px;
    }

    /* Services section mobile */
    .section-services.snap-section {
        padding: 60px 20px;
    }

    /* News section mobile */
    .section-news.snap-section {
        padding: 60px 20px;
    }

    /* CTA section mobile */
    .cta-section.snap-section {
        padding: 60px 20px;
    }

    /* Pagination dots - mobile */
    .snap-pagination {
        right: 12px;
    }

    .snap-pagination ul {
        padding: 8px 6px;
        gap: 10px;
        border-radius: 16px;
    }

    .snap-dot {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .snap-pagination {
        right: 8px;
    }

    .snap-pagination ul {
        padding: 6px 5px;
        gap: 8px;
        border-radius: 12px;
    }

    .snap-dot {
        width: 5px;
        height: 5px;
    }
}

/* iOS Safari 100vh fix */
@supports (-webkit-touch-callout: none) {
    .snap-section {
        min-height: -webkit-fill-available;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    html.has-scroll-snap {
        scroll-behavior: auto;
    }

    .snap-dot {
        transition: none;
    }

    .snap-dot:hover {
        transform: none;
    }
}

/* =========================================
   Loading Screen - Text Reveal Animation
   ========================================= */

/* Visually hidden for screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Main container - fullscreen overlay */
.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: all;
}

/* Split panels - shared styles */
.loader-panel {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    /* Liquid Glass with solid base for visibility */
    background: linear-gradient(
        135deg,
        rgba(240, 245, 250, 0.65) 0%,
        rgba(220, 235, 250, 0.7) 50%,
        rgba(240, 245, 250, 0.65) 100%
    );
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: transform;
    overflow: hidden;
}

/* Liquid Glass shimmer effect */
.loader-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 25%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        transparent 100%
    );
    animation: liquidShimmer 3s ease-in-out infinite;
}

/* Subtle glass border */
.loader-panel::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* Inner glow for glass depth */
.loader-panel-top::after {
    border-bottom: none;
    box-shadow: inset 0 -30px 60px rgba(0, 136, 205, 0.08);
}

.loader-panel-bottom::after {
    border-top: none;
    box-shadow: inset 0 30px 60px rgba(0, 136, 205, 0.08);
}

@keyframes liquidShimmer {
    0% {
        transform: translateX(-25%);
    }
    100% {
        transform: translateX(25%);
    }
}

/* Top panel */
.loader-panel-top {
    top: 0;
}

/* Bottom panel */
.loader-panel-bottom {
    bottom: 0;
}

/* Loader content - absolutely centered on screen */
.loader-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Split-slide transition state */
.loader-screen.is-hidden .loader-panel-top {
    transform: translateY(-100%);
}

.loader-screen.is-hidden .loader-panel-bottom {
    transform: translateY(100%);
}

/* Hide logo when panels slide away */
.loader-screen.is-hidden .loader-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Complete hidden state */
.loader-screen.is-complete {
    display: none;
}

/* Hide header during loading */
body:has(.loader-screen:not(.is-complete)) .site-header {
    opacity: 0;
    pointer-events: none;
}

/* Show header after loading completes */
body:has(.loader-screen.is-complete) .site-header,
body:not(:has(.loader-screen)) .site-header {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.5s ease;
}

/* Text Reveal Animation - AIZIS Logo */
.reveal-text,
.reveal-text::after {
    animation-delay: 0.3s;
    animation-iteration-count: 1;
    animation-duration: 800ms;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.reveal-text {
    position: relative;
    font-size: 8vw;
    font-weight: 900;
    letter-spacing: -2px;
    color: #111111;
    white-space: nowrap;
    cursor: default;
    margin: 0;
    animation-name: clip-text;
    /* Text shadow for better readability on glass */
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
}

.reveal-text .logo-ai {
    color: #0088cd;
}

.reveal-text::after {
    content: "";
    position: absolute;
    z-index: 999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #0088cd;
    transform: scaleX(0);
    transform-origin: 0 50%;
    pointer-events: none;
    animation-name: text-revealer;
}

@keyframes clip-text {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes text-revealer {
    0%,
    50% {
        transform-origin: 0 50%;
    }
    60%,
    100% {
        transform-origin: 100% 50%;
    }
    60% {
        transform: scaleX(1);
    }
    100% {
        transform: scaleX(0);
    }
}

/* Mobile version */
@media (max-width: 768px) {
    .reveal-text {
        font-size: 12vw;
    }

    /* Faster transition for mobile */
    .loader-panel {
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal-text,
    .reveal-text::after {
        animation: none;
    }

    .reveal-text {
        clip-path: inset(0 0 0 0);
    }

    .reveal-text::after {
        display: none;
    }

    .loader-panel {
        transition: opacity 0.3s ease;
    }

    .loader-screen.is-hidden .loader-panel-top,
    .loader-screen.is-hidden .loader-panel-bottom {
        transform: none;
        opacity: 0;
    }
}

/* JS error fallback - auto-hide after 4s */
.loader-screen:not(.is-complete):not(.is-hidden) {
    animation: loaderFallback 0.5s ease 4s forwards;
}

@keyframes loaderFallback {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* Disable fallback when JS controls the loader */
.loader-screen.is-hidden,
.loader-screen.is-complete {
    animation: none;
}

/* =========================================
   Mobile Hamburger Menu
   ========================================= */

/* --- Site Logo Styles --- */
.site-logo {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
    margin: 0;
}

.site-logo-accent {
    color: #0088cd;
}

/* --- Hamburger Button --- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    padding: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

.hamburger-btn:focus {
    outline: none;
}

.hamburger-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.77, 0, 0.175, 1);
    transform-origin: center;
}

.hamburger-line:nth-child(1) {
    margin-bottom: 6px;
}

.hamburger-line:nth-child(3) {
    margin-top: 6px;
}

/* Hamburger → X animation */
.hamburger-btn.is-active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Mobile Menu Overlay --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.4s ease,
        visibility 0.4s ease;
}

.mobile-menu-overlay.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* Liquid Glass Background */
.mobile-menu-glass {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fallback for browsers without backdrop-filter support */
    background: linear-gradient(
        135deg,
        rgba(240, 245, 250, 0.95) 0%,
        rgba(220, 235, 250, 0.97) 50%,
        rgba(240, 245, 250, 0.95) 100%
    );
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .mobile-menu-glass {
        background: linear-gradient(
            135deg,
            rgba(240, 245, 250, 0.85) 0%,
            rgba(220, 235, 250, 0.9) 50%,
            rgba(240, 245, 250, 0.85) 100%
        );
        backdrop-filter: blur(20px) saturate(1.5);
        -webkit-backdrop-filter: blur(20px) saturate(1.5);
    }
}

.mobile-menu-overlay.is-open .mobile-menu-glass {
    transform: translateY(0);
}

/* Shimmer effect */
.mobile-menu-glass::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 25%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        transparent 100%
    );
    animation: mobileMenuShimmer 4s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.5s ease 0.3s;
}

.mobile-menu-overlay.is-open .mobile-menu-glass::before {
    opacity: 1;
}

@keyframes mobileMenuShimmer {
    0% {
        transform: translateX(-25%);
    }
    100% {
        transform: translateX(25%);
    }
}

/* --- Menu Navigation --- */
.mobile-menu-nav {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-list li {
    margin: 0;
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}

/* Staggered animation */
.mobile-menu-overlay.is-open .mobile-menu-list li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-overlay.is-open .mobile-menu-list li:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-menu-overlay.is-open .mobile-menu-list li:nth-child(2) {
    transition-delay: 0.15s;
}

.mobile-menu-overlay.is-open .mobile-menu-list li:nth-child(3) {
    transition-delay: 0.2s;
}

.mobile-menu-overlay.is-open .mobile-menu-list li:nth-child(4) {
    transition-delay: 0.25s;
}

.mobile-menu-overlay.is-open .mobile-menu-list li:nth-child(5) {
    transition-delay: 0.3s;
}

.mobile-menu-overlay.is-open .mobile-menu-list li:nth-child(6) {
    transition-delay: 0.35s;
}

.mobile-menu-list a {
    display: block;
    padding: 20px 40px;
    font-family: var(--font-en);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition:
        color 0.3s ease,
        transform 0.3s ease;
}

.mobile-menu-list a:hover {
    color: var(--color-accent);
    transform: scale(1.05);
}

.mobile-menu-list a:focus {
    outline: none;
}

.mobile-menu-list a:focus-visible {
    color: var(--color-accent);
    outline: 2px solid var(--color-accent);
    outline-offset: 8px;
    border-radius: 4px;
}

/* --- Mobile Header Layout (768px and below) --- */
@media (max-width: 768px) {
    .header-container {
        justify-content: center;
        position: relative;
    }

    .hamburger-btn {
        display: flex;
        position: absolute;
        right: 0;
    }

    .main-navigation {
        display: none;
    }
}

/* --- Scroll Lock --- */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* --- Mobile Menu: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .hamburger-line {
        transition: none;
    }

    .mobile-menu-glass {
        transition: opacity 0.3s ease;
        transform: none;
    }

    .mobile-menu-overlay.is-open .mobile-menu-glass {
        transform: none;
    }

    .mobile-menu-list li {
        transition: opacity 0.2s ease;
        transform: none;
    }

    .mobile-menu-overlay.is-open .mobile-menu-list li {
        transform: none;
        transition-delay: 0s !important;
    }

    .mobile-menu-glass::before {
        animation: none;
    }
}

/* =========================================
   404 Error Page
   ========================================= */

.error-404-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
}

.error-hero-section {
    text-align: center;
    padding: 4rem 2rem;
}

.error-content {
    max-width: 600px;
    margin: 0 auto;
}

.error-code {
    font-size: clamp(8rem, 20vw, 15rem);
    font-weight: 700;
    line-height: 1;
    color: var(--color-accent);
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.error-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.error-description {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-actions .btn-primary,
.error-actions .btn-secondary {
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.error-actions .btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.error-actions .btn-primary:hover {
    background: #002480;
    transform: translateY(-2px);
}

.error-actions .btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.error-actions .btn-secondary:hover {
    background: var(--color-accent);
    color: #fff;
    transform: translateY(-2px);
}

/* =========================================
   Mobile Fixes (768px and below)
   - Issue 1: About section text overflow
   - Issue 2: Hamburger X button visibility
   ========================================= */
@media (max-width: 768px) {
    /* Issue 2: Fix hamburger button z-index stacking context */
    body.menu-open .site-header {
        z-index: 1002; /* Above mobile menu overlay (1000) */
    }

    /* About/Terminal section - fit within 100vh */
    .terminal_emulator {
        width: 95%;
        max-width: none;
        height: auto;
        max-height: calc(100vh - 140px); /* Fit within viewport minus header */
        padding: 20px;
        font-size: 20px;
        line-height: 1.5;
        overflow-y: auto;
    }

    .terminal-prompt {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    .terminal-text {
        font-size: 18px;
        line-height: 1.45;
        max-height: none;
        margin-bottom: 8px;
    }

    .terminal-btn {
        font-size: 16px;
        padding: 10px 24px;
        margin-top: 14px;
    }

    /* Ensure footer is accessible on mobile */
    .no-snap,
    .section-news,
    .cta-section,
    footer.site-footer {
        scroll-snap-align: none;
        scroll-snap-stop: normal;
        height: auto;
        min-height: auto;
    }
}
