/* ========================================
   M9 STUDIO - CSS STYLESHEET
   Sonar Effect + Redacted Text
======================================== */

:root {
    --bg: #F9F9F9;
    --text: #111;
    --grid: rgba(0,0,0,0.08);
    --muted: #888;
    --secondary: #555;
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: crosshair; }
html { scroll-behavior: smooth; font-size: 16px; }
body { background-color: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; overflow-x: hidden; line-height: 1.8; }
.jp-serif { font-family: 'Shippori Mincho B1', serif; font-feature-settings: "palt"; }
.font-mono { font-family: 'Space Mono', monospace; font-size: 0.75rem; letter-spacing: 0.05em; }
a { text-decoration: none; color: inherit; }

/* BACKGROUND GRID */
.bg-grid { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-size: 80px 80px; background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px); z-index: 0; pointer-events: none; }

/* SONAR CANVAS */
#sonar-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }

/* CLICK HINT */
.click-hint { position: fixed; bottom: 30px; right: 30px; font-family: 'Space Mono'; font-size: 10px; color: #555; background: #fff; padding: 5px 10px; border: 1px solid #ccc; animation: blink 3s infinite; z-index: 90; pointer-events: none; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* CONTAINER */
.container { width: 100%; max-width: 1400px; margin: 0 auto; position: relative; z-index: 5; border-left: 1px solid var(--grid); border-right: 1px solid var(--grid); background: rgba(249,249,249,0.85); backdrop-filter: blur(5px); }
.container-narrow { max-width: 1000px; }

/* HEADER */
header { position: fixed; top: 0; left: 0; width: 100%; height: 80px; display: flex; justify-content: space-between; align-items: center; padding: 0 40px; background: rgba(255,255,255,0.95); border-bottom: 1px solid #111; z-index: 100; }
.logo { font-weight: 700; font-size: 1.2rem; font-family: 'Space Mono', monospace; }
.header-right { display: flex; align-items: center; gap: 30px; }
#lang-toggle { font-family: 'Space Mono'; font-size: 0.7rem; font-weight: 700; padding: 5px 12px; background: #000; color: #fff; border: none; cursor: pointer; transition: 0.3s; }
#lang-toggle:hover { background: #333; }
.nav-links { display: flex; gap: 30px; }
.nav-item { font-family: 'Space Mono'; font-size: 0.8rem; cursor: pointer; position: relative; }
.nav-item::after { content:''; display:block; width:0%; height:1px; background:#000; transition:width 0.3s; }
.nav-item:hover::after, .nav-item.active::after { width:100%; }
.menu-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 10px; }
.menu-toggle span { width: 24px; height: 1px; background: #000; }

/* SECTIONS */
section { min-height: 90vh; padding: 120px 60px; border-bottom: 1px solid var(--grid); display: flex; flex-direction: column; justify-content: center; position: relative; }
section.short { min-height: auto; }
.section-label { font-family: 'Space Mono'; font-size: 0.7rem; color: #999; margin-bottom: 15px; display: block; letter-spacing: 0.1em; }

/* HERO */
.hero-video-wrapper { position: absolute; right: 5%; top: 15%; width: 45vw; height: 45vw; max-width: 550px; max-height: 550px; border-radius: 50%; overflow: hidden; z-index: 1; background: #111; opacity: 0.95; box-shadow: 0 0 80px rgba(22, 163, 74, 0.15); transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s; }

.hero-video-wrapper video, .hero-video-wrapper canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-video-wrapper video { filter: grayscale(100%); transition: filter 0.5s; }
.hero-video-wrapper.scanned video, .hero-video-wrapper:hover video { filter: grayscale(0%); }
.hero-title { font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1.2; font-weight: 300; margin-bottom: 2rem; position: relative; z-index: 2; }
.hero-desc { max-width: 550px; line-height: 2; font-size: 1.05rem; border-left: 2px solid #000; padding-left: 20px; position: relative; z-index: 2; color: #444; }

/* PAGE HEADER */
.page-header { padding-top: 150px; min-height: auto; }
.page-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1.5rem; font-weight: 400; }
.page-lead { font-size: 1.05rem; line-height: 2; color: #444; max-width: 750px; }

/* REDACTED TEXT */
.redacted { background-color: #000; color: transparent; transition: all 0.6s ease; padding: 0 4px; user-select: none; }
.redacted.scanned { background-color: transparent; color: inherit; user-select: text; }

/* VISUAL ELEMENTS */
.visual-box { width: 100%; height: 400px; background: #000; overflow: hidden; position: relative; }
.visual-box img, .visual-box video { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; filter: grayscale(100%); transition: all 0.5s; }
.visual-box.scanned img, .visual-box.scanned video, .visual-box:hover img, .visual-box:hover video { filter: grayscale(0%); opacity: 1; }

/* SPLIT VISUAL */
.split-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }

/* TECH LIST */
.tech-list { margin-top: 50px; }
.tech-item { position: relative; padding: 50px 0; border-top: 1px solid #111; cursor: pointer; overflow: hidden; transition: color 0.3s; }
.tech-item:last-child { border-bottom: 1px solid #111; }
.tech-bg-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 0.4s ease, filter 0.4s ease; z-index: -1; filter: grayscale(100%) brightness(0.6); }
.tech-item.scanned .tech-bg-img, .tech-item:hover .tech-bg-img { opacity: 1; filter: grayscale(0%) brightness(0.7); }
.tech-item.scanned, .tech-item:hover { color: #fff; }
.tech-content { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; flex-wrap: wrap; gap: 20px; }

/* TECH GRID */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px; background: #111; border: 1px solid #111; margin-top: 40px; }
.tech-card { background: #fff; padding: 50px 40px; position: relative; transition: background 0.3s; overflow: hidden; }
.tech-card:hover { background: #f4f4f4; }
.blueprint-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(rgba(0,0,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,255,0.03) 1px, transparent 1px); background-size: 10px 10px; opacity: 0; transition: opacity 0.5s; pointer-events: none; }
.tech-card.scanned .blueprint-overlay { opacity: 1; }
.tech-meta { position: absolute; top: 20px; right: 20px; text-align: right; font-family: 'Space Mono'; font-size: 0.6rem; color: #000; opacity: 0; transform: translateX(10px); transition: all 0.5s; }
.tech-card.scanned .tech-meta { opacity: 1; transform: translateX(0); }

/* PROFILE GRID */
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: #ddd; margin-top: 2rem; border: 1px solid #ddd; }
.profile-item { background: #fff; padding: 25px 30px; }
.profile-label { font-family: 'Space Mono'; font-size: 0.65rem; color: #999; margin-bottom: 8px; display: block; letter-spacing: 0.05em; }
.profile-value { font-size: 1rem; }

/* TIMELINE */
.timeline { margin-top: 3rem; position: relative; padding-left: 30px; border-left: 1px solid #ddd; }
.timeline-item { margin-bottom: 50px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -35px; top: 5px; width: 9px; height: 9px; background: #fff; border: 1px solid #999; border-radius: 50%; transition: all 0.3s; }
.timeline-item.scanned::before { background: #000; border-color: #000; }
.timeline-year { font-family: 'Space Mono'; font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; display: block; }
.timeline-title { font-size: 1.1rem; margin-bottom: 8px; font-weight: 500; }
.timeline-desc { font-size: 0.9rem; line-height: 1.8; color: #666; }

/* PRODUCT STRUCTURE */
.product-core { background: #000; color: #fff; padding: 40px; margin-bottom: 20px; }
.product-apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.product-app { background: #f4f4f4; padding: 30px; border-left: 3px solid #3b82f6; }
.product-integrated { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.product-integrated-item { background: linear-gradient(135deg, #1a1a2e, #0a0a0a); color: #fff; padding: 30px; }

/* PRODUCT DETAIL */
.product-detail { margin-top: 60px; padding-top: 40px; border-top: 1px solid #ddd; }
.product-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.product-badge { font-family: 'Space Mono'; font-size: 0.65rem; padding: 5px 12px; background: #f0f0f0; color: #888; }
.product-badge.coming { background: #8b5cf6; color: #fff; }
.product-media { margin: 20px 0; }
.product-media img, .product-media video { width: 100%; max-width: 100%; height: auto; display: block; filter: grayscale(100%); transition: filter 0.5s; }
.product-media.scanned img, .product-media.scanned video, .product-media:hover img, .product-media:hover video { filter: grayscale(0%); }
.video-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.video-compare-item { text-align: center; }
.video-compare-item p { font-family: 'Space Mono'; font-size: 0.75rem; margin-top: 10px; color: #888; }
.audio-demo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 20px 0; }
.audio-item { background: #f4f4f4; padding: 20px; text-align: center; }
.audio-item p { font-size: 0.85rem; margin-bottom: 10px; }
.audio-item audio { width: 100%; }

/* TRUST BLOCKS */
.trust-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-top: 40px; }
.trust-item { padding: 30px; background: #f4f4f4; }
.trust-item h4 { margin-bottom: 15px; font-size: 1.1rem; }
.trust-item p { font-size: 0.9rem; color: #555; margin-bottom: 0; line-height: 1.8; }

/* CARD GRID */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-top: 40px; }
.card { background: #fff; border: 1px solid #ddd; padding: 40px; transition: 0.3s; }
.card:hover { border-color: #999; transform: translateY(-2px); }
.card h3 { font-size: 1rem; margin-bottom: 15px; }
.card p { font-size: 0.9rem; color: #555; margin-bottom: 0; line-height: 1.8; }

/* CONTACT FORM */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-info h3 { margin-bottom: 20px; }
.contact-info p { color: #555; line-height: 1.8; }
.contact-form label { display: block; font-family: 'Space Mono'; font-size: 0.75rem; margin-bottom: 8px; color: #888; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; padding: 12px 15px; border: 1px solid #ddd; background: #fff; font-family: inherit; font-size: 1rem; margin-bottom: 20px; transition: border-color 0.3s; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { outline: none; border-color: #000; }
.contact-form textarea { min-height: 150px; resize: vertical; }

/* LEGAL / PRIVACY */
.legal-section { margin-bottom: 40px; }
.legal-title { font-size: 1.1rem; margin-bottom: 15px; }
.legal-text { font-size: 0.95rem; color: #555; line-height: 2; }
.legal-list { list-style: none; margin-top: 15px; }
.legal-list li { font-size: 0.9rem; color: #555; padding: 8px 0 8px 20px; position: relative; }
.legal-list li::before { content: '・'; position: absolute; left: 0; }

/* BUTTONS */
.btn { display: inline-block; font-family: 'Space Mono'; font-size: 0.75rem; padding: 15px 30px; border: 1px solid #000; background: transparent; color: #000; cursor: pointer; transition: 0.3s; }
.btn:hover { background: #000; color: #fff; }
.btn-primary { background: #000; color: #fff; }
.btn-primary:hover { background: transparent; color: #000; }

/* CTA SECTION */
.cta-section { text-align: center; background: #111; color: #fff; min-height: auto; padding: 80px 60px; }
.cta-btn { font-family: 'Space Mono'; display: inline-block; padding: 20px 60px; border: 1px solid #fff; color: #fff; transition: 0.3s; }
.cta-btn:hover { background: #fff; color: #111; }

/* FOOTER */
footer { padding: 80px 60px; background: #111; color: #fff; }
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 30px; }
.footer-logo { font-family: 'Space Mono'; font-size: 1rem; font-weight: 700; }
.footer-links { display: flex; gap: 25px; flex-wrap: wrap; }
.footer-link { font-family: 'Space Mono'; font-size: 0.7rem; color: #888; transition: color 0.3s; }
.footer-link:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap; gap: 15px; }
.footer-archive { font-size: 0.75rem; color: rgba(255,255,255,0.5); }
.footer-archive a { color: rgba(255,255,255,0.7); }
.footer-copy { font-family: 'Space Mono'; font-size: 0.65rem; color: rgba(255,255,255,0.4); }

/* 英語表示で出さない要素（main.js が付け外しする） */
.lang-hidden { display: none !important; }

/* 背景色の帯のセクション。左右にはみ出させると文字が画面端に寄るので、枠の内側に収める */
section.band { margin-left: 0 !important; margin-right: 0 !important; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .split-visual { grid-template-columns: 1fr; }
    .product-apps, .product-integrated { grid-template-columns: 1fr; }
    .trust-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .video-compare { grid-template-columns: 1fr; }
    .audio-demo { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    section { padding: 80px 30px; }
    header { padding: 0 20px; }
    .nav-links { position: fixed; top: 80px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 30px; gap: 20px; transform: translateY(-100%); opacity: 0; pointer-events: none; transition: 0.3s; border-bottom: 1px solid #111; }
    .nav-links.active { transform: translateY(0); opacity: 1; pointer-events: all; }
    .menu-toggle { display: flex; }
    .hero-video-wrapper { position: relative; width: 70vw; height: 70vw; max-width: 300px; max-height: 300px; margin: 0 auto 30px; right: auto; top: auto; }
    .tech-content { flex-direction: column; align-items: flex-start; }
    .footer-content, .footer-bottom { flex-direction: column; text-align: center; }
    /* ページ内で列数を直接指定しているグリッドを、スマホでは折り返す */
    .r-grid-1 { grid-template-columns: 1fr !important; }
    .r-grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
    section.band { padding: 80px 30px !important; }
}
