/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif JP', 'Times New Roman', serif;
    color: #fff;
    line-height: 1.8;
    overflow-x: hidden;
    background: #000;
}

html {
    scroll-behavior: smooth;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #fff;
}

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

.nav-links a {
    text-decoration: none;
    color: #fff;
    font-size: 14px;
    letter-spacing: 1.5px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #c9a961;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: #fff;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Responsive line break control */
.sp-only {
    display: none;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}

.hero-title {
    font-size: 64px;
    font-weight: 300;
    letter-spacing: 8px;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease 0.5s both;
}

.hero-subtitle {
    font-size: 28px;
    letter-spacing: 4px;
    font-weight: 300;
    animation: fadeInUp 1s ease 0.8s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Recruit Message Section */
.recruit-message {
    background: #000;
    padding: 120px 50px;
    position: relative;
}

.message-container {
    max-width: 900px;
    margin: 0 auto;
    color: #fff;
}

.message-heading {
    font-size: 48px;
    font-weight: 400;
    letter-spacing: 6px;
    margin-bottom: 80px;
    text-align: center;
    line-height: 1.4;
}

.message-content {
    margin-bottom: 80px;
    text-align: center;
}

.message-text {
    font-size: 16px;
    line-height: 2.2;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.message-text.spacing-top {
    margin-top: 20px;
}

.message-text.spacing-medium {
    margin-top: 35px;
}

.message-text.spacing-large {
    margin-top: 50px;
}

.message-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.message-contact {
    text-align: center;
    font-size: 18px;
    letter-spacing: 2px;
    padding-top: 240px;
    padding-bottom: 240px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    animation: fadeInSlow 3s ease 2s forwards;
}

@keyframes fadeInSlow {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ALGO Section */
.algo-section {
    background: #000;
    padding: 100px 50px;
    color: #fff;
    overflow: hidden;
}

.algo-container {
    max-width: 100%;
    margin: 0 auto;
}

.algo-title {
    font-size: clamp(60px, 12vw, 180px);
    font-weight: 900;
    letter-spacing: 0.02em;
    margin-bottom: 60px;
    text-align: center;
    font-family: 'Arial Black', 'Arial', sans-serif;
    color: #2c2c2c;
    line-height: 1;
    width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

/* ALGO Gallery with Auto Scroll */
.algo-gallery-wrapper {
    overflow: hidden;
    margin-bottom: 80px;
    position: relative;
}

.algo-gallery {
    display: flex;
    gap: 15px;
    animation: autoScroll 40s linear infinite;
    width: fit-content;
}

@keyframes autoScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.algo-gallery:hover {
    animation-play-state: paused;
}

.algo-image {
    min-width: 400px;
    height: 300px;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(201, 169, 97, 0.3);
    transition: transform 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.algo-image:hover {
    transform: scale(1.05);
    border-color: #c9a961;
}

/* Metrics Container */
.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.metric-item {
    text-align: left;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
    border: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    position: relative;
}

.metric-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.metric-label {
    font-size: 36px;
    letter-spacing: 2px;
    color: #fff;
    font-weight: 400;
    position: relative;
    z-index: 2;
    margin-bottom: 0;
}

.metric-value-wrapper {
    position: relative;
    z-index: 1;
    margin-top: -60px;
}

.metric-value-large {
    font-size: 200px;
    font-weight: 900;
    letter-spacing: -5px;
    color: #ff9900;
    font-family: 'Arial Black', 'Arial', sans-serif;
    line-height: 1;
    display: inline-block;
}

.metric-cross {
    font-size: 160px;
    color: #ff9900;
    font-weight: 900;
}

.metric-detecting {
    font-size: 70px;
    color: #ff9900;
    letter-spacing: 1px;
    font-weight: 700;
    font-family: 'Arial Black', 'Arial', sans-serif;
    display: inline-block;
}

.dots-blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0; }
}

/* Footer */
footer {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 40px 20px;
    font-size: 12px;
    letter-spacing: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .algo-title {
        font-size: clamp(50px, 10vw, 140px);
    }

    .algo-image {
        min-width: 350px;
        height: 280px;
    }

    .metric-value-large {
        font-size: 90px;
    }

    .metric-detecting {
        font-size: 32px;
    }

    .metric-cross {
        font-size: 80px;
    }
}

@media (max-width: 768px) {
    /* Responsive line break */
    .sp-only {
        display: inline;
    }

    /* Navigation */
    .nav-links {
        position: fixed;
        right: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.98);
        width: 100%;
        padding: 40px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        transition: right 0.3s;
        gap: 30px;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger {
        display: flex;
    }

    nav {
        padding: 20px 30px;
    }

    /* Hero */
    .hero-title {
        font-size: 36px;
        letter-spacing: 4px;
    }

    .hero-subtitle {
        font-size: 20px;
        letter-spacing: 2px;
    }

    /* Recruit Message */
    .recruit-message {
        padding: 80px 30px;
    }

    .message-heading {
        font-size: 32px;
        letter-spacing: 4px;
        margin-bottom: 50px;
    }

    .message-text {
        font-size: 14px;
        line-height: 2;
        letter-spacing: 1px;
    }

    .message-contact {
        padding-top: 120px;
        padding-bottom: 120px;
    }

    /* ALGO Section */
    .algo-section {
        padding: 60px 30px;
    }

    .algo-title {
        font-size: clamp(50px, 10vw, 140px);
        margin-bottom: 40px;
    }

    .algo-image {
        min-width: 300px;
        height: 250px;
    }

    .metric-label {
        font-size: 32px;
    }

    .metric-value-large {
        font-size: 160px;
    }

    .metric-value-wrapper {
        margin-top: -50px;
    }

    .metric-detecting {
        font-size: 56px;
    }

    .metric-cross {
        font-size: 130px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .message-heading {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .message-contact {
        padding-top: 80px;
        padding-bottom: 80px;
    }

    .algo-title {
        font-size: clamp(40px, 8vw, 100px);
    }

    .algo-image {
        min-width: 280px;
        height: 220px;
    }

    .metric-label {
        font-size: 28px;
    }

    .metric-value-large {
        font-size: 120px;
    }

    .metric-value-wrapper {
        margin-top: -40px;
    }

    .metric-detecting {
        font-size: 44px;
    }

    .metric-cross {
        font-size: 100px;
    }
}

/* Print Styles */
@media print {
    header,
    .opening,
    .hamburger {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    .hero-overlay {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .hero-overlay {
        background: rgba(0, 0, 0, 0.8);
    }

    .nav-links a:hover {
        outline: 2px solid currentColor;
    }
}
