* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Trebuchet MS', 'Lucida Sans', Arial, sans-serif; }

body {
    background-color: #111116; 
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed; 
    color: #ffffff;
    min-height: 100vh; 
    overflow-x: hidden;
    overflow-y: auto; 
}

/* --- Top Bar & Layout --- */
.top-bar { 
    display: flex; 
    align-items: center; 
    padding: 40px 20px; 
    /* Gap is calibrated to push the title over to exactly match the centered content below */
    gap: 20px; 
    position: relative; 
    z-index: 10; 
    max-width: 1200px; 
    margin: 0 auto;
}

.title-wrapper {
    position: relative; display: flex; align-items: center;
    -webkit-mask-image: linear-gradient(rgba(0,0,0,1) 50%, rgba(0,0,0,0.6) 50%);
    -webkit-mask-size: 100% 4px;
    mask-image: linear-gradient(rgba(0,0,0,1) 50%, rgba(0,0,0,0.6) 50%);
    mask-size: 100% 4px;
    animation: screenFlicker 0.15s infinite;
}

.main-title-group { display: flex; flex-direction: column; justify-content: center; z-index: 5; background-color: #111116; padding-right: 15px; }

.ja-title {
    font-size: 4.5rem; font-style: italic; font-weight: 900; color: #ffffff;
    text-shadow: 4px 4px 0px var(--shadow-1), -4px -4px 0px var(--shadow-2);
    letter-spacing: 5px; line-height: 1; margin: 0; animation: titleGlitch 20s infinite; 
}

.en-title {
    font-size: 1rem; font-style: italic; font-weight: 900; color: #ffffff;
    text-shadow: 2px 2px 0px var(--shadow-1), -2px -2px 0px var(--shadow-2);
    letter-spacing: 12px; margin: 8px 0 0 5px; animation: subTitleGlitch 20s infinite 0.1s; 
}

.page-title {
    position: absolute; display: flex; flex-direction: column; justify-content: center;
    top: 50%; left: 0; transform: translateY(-50%) translateX(20px); opacity: 0; z-index: 1; 
    transition: all 0.7s cubic-bezier(0.2, 1, 0.3, 1); pointer-events: none;
}

.page-title.active { opacity: 1; left: 100%; transform: translateY(-50%) translateX(0px); }

/* --- Animations --- */
@keyframes titleGlitch {
    0%, 82% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 4px 4px 0px var(--shadow-1), -4px -4px 0px var(--shadow-2); }
    83% { transform: translate(-2px, 1px); text-shadow: 8px -2px 0px var(--shadow-1), -8px 4px 0px var(--shadow-2); }
    83.5% { transform: translate(2px, -1px); text-shadow: -4px 6px 0px var(--shadow-1), 6px -2px 0px var(--shadow-2); }
    84% { transform: translate(0, 0); text-shadow: 4px 4px 0px var(--shadow-1), -4px -4px 0px var(--shadow-2); }
    87% { transform: skew(15deg); filter: blur(1px); text-shadow: -10px 5px 0px var(--shadow-1), 10px -5px 0px var(--shadow-2); }
    87.5% { opacity: 0.8; transform: skew(-10deg); filter: blur(2px); text-shadow: 12px -4px 0px var(--shadow-1), -12px 6px 0px var(--shadow-2); }
    88% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 4px 4px 0px var(--shadow-1), -4px -4px 0px var(--shadow-2); }
    92% { transform: translate(-8px, 0); text-shadow: 15px 0px 0px var(--shadow-1), -15px 0px 0px var(--shadow-2); }
    92.5% { transform: translate(8px, 0); text-shadow: -15px 0px 0px var(--shadow-1), 15px 0px 0px var(--shadow-2); }
    93% { transform: translate(0, 0); text-shadow: 4px 4px 0px var(--shadow-1), -4px -4px 0px var(--shadow-2); }
    97% { transform: translate(0, 5px); text-shadow: 2px -4px 0px var(--shadow-1), -2px 4px 0px var(--shadow-2); }
    97.5% { transform: translate(0, -3px); text-shadow: 6px 8px 0px var(--shadow-1), -6px -8px 0px var(--shadow-2); }
    98%, 100% { opacity: 1; transform: translate(0, 0); text-shadow: 4px 4px 0px var(--shadow-1), -4px -4px 0px var(--shadow-2); }
}

@keyframes subTitleGlitch {
    0%, 82% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 2px 2px 0px var(--shadow-1), -2px -2px 0px var(--shadow-2); }
    83% { transform: translate(-1px, 1px); text-shadow: 4px -1px 0px var(--shadow-1), -4px 2px 0px var(--shadow-2); }
    83.5% { transform: translate(1px, -1px); text-shadow: -2px 3px 0px var(--shadow-1), 3px -1px 0px var(--shadow-2); }
    84% { transform: translate(0, 0); text-shadow: 2px 2px 0px var(--shadow-1), -2px -2px 0px var(--shadow-2); }
    87% { transform: skew(10deg); filter: blur(1px); text-shadow: -5px 2px 0px var(--shadow-1), 5px -2px 0px var(--shadow-2); }
    87.5% { opacity: 0.8; transform: skew(-5deg); filter: blur(1.5px); text-shadow: 6px -2px 0px var(--shadow-1), -6px 3px 0px var(--shadow-2); }
    88% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 2px 2px 0px var(--shadow-1), -2px -2px 0px var(--shadow-2); }
    92% { transform: translate(-4px, 0); text-shadow: 8px 0px 0px var(--shadow-1), -8px 0px 0px var(--shadow-2); }
    92.5% { transform: translate(4px, 0); text-shadow: -8px 0px 0px var(--shadow-1), 8px 0px 0px var(--shadow-2); }
    93% { transform: translate(0, 0); text-shadow: 2px 2px 0px var(--shadow-1), -2px -2px 0px var(--shadow-2); }
    97% { transform: translate(0, 3px); text-shadow: 1px -2px 0px var(--shadow-1), -1px 2px 0px var(--shadow-2); }
    97.5% { transform: translate(0, -2px); text-shadow: 3px 4px 0px var(--shadow-1), -3px -4px 0px var(--shadow-2); }
    98%, 100% { opacity: 1; transform: translate(0, 0); text-shadow: 2px 2px 0px var(--shadow-1), -2px -2px 0px var(--shadow-2); }
}

@keyframes menuTextGlitch {
    0%, 82% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 1.5px 1.5px 0px var(--shadow-1), -1.5px -1.5px 0px var(--shadow-2); }
    83% { transform: translate(-1px, 0.5px); text-shadow: 3px -1px 0px var(--shadow-1), -3px 1.5px 0px var(--shadow-2); }
    84% { transform: translate(0, 0); text-shadow: 1.5px 1.5px 0px var(--shadow-1), -1.5px -1.5px 0px var(--shadow-2); }
    87% { transform: skew(8deg); filter: blur(0.5px); text-shadow: -4px 2px 0px var(--shadow-1), 4px -2px 0px var(--shadow-2); }
    88% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 1.5px 1.5px 0px var(--shadow-1), -1.5px -1.5px 0px var(--shadow-2); }
    92% { transform: translate(-3px, 0); text-shadow: 6px 0px 0px var(--shadow-1), -6px 0px 0px var(--shadow-2); }
    93% { transform: translate(0, 0); text-shadow: 1.5px 1.5px 0px var(--shadow-1), -1.5px -1.5px 0px var(--shadow-2); }
    97% { transform: translate(0, 2px); text-shadow: 1px -1.5px 0px var(--shadow-1), -1px 1.5px 0px var(--shadow-2); }
    98%, 100% { opacity: 1; transform: translate(0, 0); text-shadow: 1.5px 1.5px 0px var(--shadow-1), -1.5px -1.5px 0px var(--shadow-2); }
}

@keyframes menuSubTextGlitch {
    0%, 82% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 1px 1px 0px var(--shadow-1), -1px -1px 0px var(--shadow-2); }
    83% { transform: translate(-0.5px, 0.5px); text-shadow: 2px -0.5px 0px var(--shadow-1), -2px 1px 0px var(--shadow-2); }
    83.5% { transform: translate(0.5px, -0.5px); text-shadow: -1px 1.5px 0px var(--shadow-1), 1.5px -0.5px 0px var(--shadow-2); }
    84% { transform: translate(0, 0); text-shadow: 1px 1px 0px var(--shadow-1), -1px -1px 0px var(--shadow-2); }
    87% { transform: skew(5deg); filter: blur(0.5px); text-shadow: -2px 1px 0px var(--shadow-1), 2px -1px 0px var(--shadow-2); }
    87.5% { opacity: 0.8; transform: skew(-3deg); filter: blur(1px); text-shadow: 3px -1px 0px var(--shadow-1), -3px 1.5px 0px var(--shadow-2); }
    88% { opacity: 1; transform: skew(0deg); filter: blur(0px); text-shadow: 1px 1px 0px var(--shadow-1), -1px -1px 0px var(--shadow-2); }
    92% { transform: translate(-2px, 0); text-shadow: 4px 0px 0px var(--shadow-1), -4px 0px 0px var(--shadow-2); }
    92.5% { transform: translate(2px, 0); text-shadow: -4px 0px 0px var(--shadow-1), 4px 0px 0px var(--shadow-2); }
    93% { transform: translate(0, 0); text-shadow: 1px 1px 0px var(--shadow-1), -1px -1px 0px var(--shadow-2); }
    97% { transform: translate(0, 1.5px); text-shadow: 0.5px -1px 0px var(--shadow-1), -0.5px 1px 0px var(--shadow-2); }
    97.5% { transform: translate(0, -1px); text-shadow: 1.5px 2px 0px var(--shadow-1), -1.5px -2px 0px var(--shadow-2); }
    98%, 100% { opacity: 1; transform: translate(0, 0); text-shadow: 1px 1px 0px var(--shadow-1), -1px -1px 0px var(--shadow-2); }
}

@keyframes screenFlicker { 0% { opacity: 0.95; } 50% { opacity: 1; } 100% { opacity: 0.95; } }

/* --- Navigation Hexagons --- */
.nav-wrapper { 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    z-index: 20; 
    /* Pulls the main menu out to the left to create the perfect padding gap */
    margin-left: -30px; 
}

.hex-wrapper {
    width: 130px; height: 113px; margin-bottom: 6px; text-decoration: none;
    transition: opacity 0.4s ease, transform 0.4s ease; cursor: pointer;
}

.hex {
    position: relative; width: 100%; height: 100%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex; justify-content: center; align-items: center; transition: transform 0.15s ease;
}

.hex::after {
    content: " "; position: absolute; inset: 0; pointer-events: none; animation: screenFlicker 0.15s infinite; 
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%); background-size: 100% 4px;
}

.hex-content { display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 2; }
.ja-text { color: #ffffff; font-size: 1.4rem; font-weight: 900; letter-spacing: 2px; line-height: 1.1; animation: menuTextGlitch 20s infinite; }
.en-text { color: rgba(255, 255, 255, 0.95); font-size: 0.65rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; animation: menuSubTextGlitch 20s infinite 0.1s;}

.sub-menu { position: absolute; top: 119px; display: flex; flex-direction: column; }
.sub-wrapper { opacity: 0; transform: translateY(-20px); pointer-events: none; }
.h1 { transition-delay: 0.2s; } .h2 { transition-delay: 0.1s; } .h3 { transition-delay: 0s; }
.nav-wrapper:hover .sub-wrapper { opacity: 1; transform: translateY(0); pointer-events: auto; }
.nav-wrapper:hover .h1 { transition-delay: 0.1s; } .nav-wrapper:hover .h2 { transition-delay: 0.2s; } .nav-wrapper:hover .h3 { transition-delay: 0.3s; }

/* --- Page Content Areas --- */
.content-area { 
    position: relative; 
    padding: 0 20px 100px 20px; 
    max-width: 1200px; 
    margin: 0 auto; 
}

.page-content {
    position: absolute; 
    top: 0; left: 0; right: 0;
    /* Centers the content within the 1200px boundary. 
       This perfectly aligns the left edge of the text with the Title above it! */
    max-width: 960px; 
    margin: 0 auto;
    
    opacity: 0; transform: translateY(20px);
    transition: all 0.5s ease; pointer-events: none; color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem; line-height: 1.6;
}
.page-content.active { opacity: 1; transform: translateY(0); pointer-events: auto; position: relative; }

/* =========================================
   C.L.A.M. CYBERPUNK LAUNCH PAGE 
   ========================================= */

/* Header styling */
.clam-header { 
    margin-bottom: 40px; 
    border-left: 5px solid #00ffff; 
    padding: 10px 0 10px 20px; 
    background: linear-gradient(90deg, rgba(0,255,255,0.1) 0%, transparent 100%);
}
.cyber-title { 
    font-size: 3rem; 
    font-style: italic; 
    color: #ffffff; 
    text-shadow: 2px 2px 0px #ff0055, -2px -2px 0px #00ffff; 
    letter-spacing: 4px; 
}
.cyber-subtitle { 
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem; 
    color: rgba(255,255,255,0.7); 
    letter-spacing: 6px; 
    text-transform: uppercase; 
    margin-top: 8px; 
}

/* 
  THE HONEYCOMB CLUSTER
  This acts as a floated island that text will beautifully wrap around
*/
.clam-gallery { 
    float: right; 
    width: 320px; 
    height: 325px; 
    position: relative; 
    margin: 0 0 30px 40px; 
    shape-outside: polygon(0 0, 45% 0, 100% 25%, 100% 75%, 45% 100%, 0 100%);
}

/* Position the 3 hexagons into a perfect interlocked honeycomb */
.clam-hex { 
    width: 180px; 
    height: 156px; 
    position: absolute !important; 
    margin: 0 !important; 
}
.clam-hex:nth-child(1) { top: 0; left: 0; }
.clam-hex:nth-child(2) { top: 82px; left: 140px; }
.clam-hex:nth-child(3) { top: 164px; left: 0; }

.hex-img-text { 
    display: flex; align-items: center; justify-content: center; height: 100%; 
    font-family: 'Courier New', Courier, monospace; font-size: 1.2rem; color: rgba(255,255,255,0.5); 
}

/* Premium Typography for Description */
.clam-desc { 
    font-size: 1.25rem; 
    line-height: 1.9; 
    margin-bottom: 60px; 
    color: rgba(255, 255, 255, 0.9); 
    text-align: justify;
}

/* SCI-FI SPECS GRID */
.clam-specs-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    margin-bottom: 80px; 
    clear: both; 
}

.spec-box { 
    background: linear-gradient(135deg, rgba(var(--box-color), 0.1) 0%, rgba(0,0,0,0.5) 100%);
    border: 1px solid rgba(var(--box-color), 0.4); 
    padding: 30px; 
    position: relative;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
    box-shadow: inset 0 0 20px rgba(var(--box-color), 0.1);
}
.spec-box h3 { 
    color: rgb(var(--box-color)); 
    margin-bottom: 25px; 
    letter-spacing: 4px; 
    font-size: 1.3rem; 
    font-family: 'Courier New', Courier, monospace;
    border-bottom: 1px solid rgba(var(--box-color), 0.3);
    padding-bottom: 10px;
}
.spec-box ul { list-style: none; font-family: 'Courier New', Courier, monospace; }
.spec-box li { 
    margin-bottom: 15px; 
    font-size: 1.05rem; 
    border-bottom: 1px dotted rgba(255,255,255,0.15); 
    padding-bottom: 8px; 
    display: flex;
}
.spec-box .hl { 
    color: rgb(var(--box-color)); 
    font-weight: bold; 
    margin-right: 15px; 
    width: 100px; 
    flex-shrink: 0;
}

/* INTERACTIVE TELEMETRY DASHBOARD */
.clam-interactive { margin-bottom: 80px; }
.interactive-title { 
    color: #ffff00; 
    margin-bottom: 15px; 
    letter-spacing: 3px; 
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5rem;
}
.clam-interactive > p { font-size: 1.1rem; color: rgba(255,255,255,0.7); margin-bottom: 30px; }

.comp-widget { 
    border: 1px solid #333; 
    background: rgba(0,0,0,0.6); 
    padding: 30px; 
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}
.comp-tabs { 
    display: flex; 
    gap: 15px; 
    border-bottom: 2px solid #222; 
    padding-bottom: 20px; 
    margin-bottom: 30px; 
}
.comp-tab { 
    background: #111; 
    border: 1px solid #444; 
    color: #888; 
    padding: 12px 25px; 
    font-family: 'Courier New', Courier, monospace; 
    font-weight: bold;
    font-size: 1rem; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.comp-tab:hover { background: #222; color: #fff; }
.comp-tab.active { 
    background: rgba(0,255,255,0.15); 
    border-color: #00ffff; 
    color: #00ffff; 
    box-shadow: inset 0 0 10px rgba(0,255,255,0.3); 
}

/* Telemetry Neon Bars */
.stat-row { display: flex; align-items: center; margin-bottom: 20px; font-family: 'Courier New', Courier, monospace; }
.stat-label { width: 130px; font-weight: bold; color: rgba(255,255,255,0.5); letter-spacing: 1px;}
.bar-bg { 
    flex-grow: 1; 
    height: 14px; 
    background: #0a0a0a; 
    margin: 0 25px; 
    border: 1px solid #222; 
    position: relative; 
    border-radius: 2px;
    overflow: hidden;
}
.bar-fill { 
    height: 100%; 
    transition: width 0.8s cubic-bezier(0.2, 1, 0.3, 1); 
    box-shadow: 0 0 15px currentColor; 
}
.stat-val { width: 140px; text-align: right; color: #fff; font-weight: bold; font-size: 1.1rem; }
.arch-row { margin-top: 35px; padding-top: 25px; border-top: 1px dashed #333; }
.stat-val-arch { color: #00ffff; letter-spacing: 2px; font-weight: bold; font-size: 1.2rem; }


/* --- Products Grid (Interlocking Honeycomb) --- */
.projects-grid {
    display: flex;
    flex-wrap: nowrap; 
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0 160px 0; 
}

.proj-hex-wrapper {
    width: 320px;
    height: 277px; 
    margin-left: -80px; 
    transition: opacity 0.4s ease, transform 0.4s ease;
    cursor: pointer;
}

.proj-hex-wrapper:first-child { margin-left: 0; }
.proj-hex-wrapper:nth-child(even) { margin-top: 138px; }

.proj-hex {
    position: relative;
    width: 100%;
    height: 100%;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    transition: transform 0.15s ease;
    padding: 10px; 
}

.proj-hex::after {
    content: " "; position: absolute; inset: 0; pointer-events: none; animation: screenFlicker 0.15s infinite; 
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%); background-size: 100% 4px;
    z-index: 0;
}

.shape-left { float: left; width: 25%; height: 100%; shape-outside: polygon(0 0, 100% 50%, 0 100%); }
.shape-right { float: right; width: 25%; height: 100%; shape-outside: polygon(100% 0, 0 50%, 100% 100%); }

.proj-content { position: relative; z-index: 2; text-align: center; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.proj-mini-img { width: 60px; height: 52px; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); margin-bottom: 10px; box-shadow: inset 0 0 10px rgba(0,0,0,0.5); }
.proj-content h4 { color: #ffffff; font-family: 'Trebuchet MS', sans-serif; font-size: 1.3rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; text-shadow: 0 0 5px rgba(var(--rgb), 1); }
.proj-content p { font-family: 'Courier New', Courier, monospace; font-size: 0.85rem; color: rgba(255, 255, 255, 0.9); line-height: 1.3; }


/* =========================================
   BUG FIXES & DYNAMIC HEXAGON GLOW
   ========================================= */

.hex-wrapper, .proj-hex-wrapper, .hex, .proj-hex {
    will-change: transform, filter;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hex:hover, .proj-hex:hover { transform: none !important; }

.hex-wrapper:hover, .proj-hex-wrapper:hover {
    transform: scale(1.05);
    z-index: 50;
}

.projects-grid .proj-hex-wrapper { pointer-events: none; }
.projects-grid .proj-hex { pointer-events: auto; }

.hex, .proj-hex {
    background-color: rgba(var(--rgb), calc(0.05 + 0.1 * var(--glow, 0))) !important;
}

.hex-content { transform: translateZ(0); }

/* PERFECT HEXAGON AURA */
.hex-wrapper, .proj-hex-wrapper {
    filter: 
        drop-shadow(2px 2px 0px var(--shadow-1)) 
        drop-shadow(-2px -2px 0px var(--shadow-2)) 
        drop-shadow(0px 0px calc(2px + 15px * var(--glow, 0)) rgba(var(--rgb), calc(0.1 + 0.8 * var(--glow, 0)))) !important;
}


/* Responsive Fallback for Mobile Screens */
@media (max-width: 900px) {
    .clam-specs-grid { grid-template-columns: 1fr; }
    .clam-gallery { float: none; margin: 0 auto 40px auto; shape-outside: none; }
    
    .top-bar { padding: 30px 20px; flex-direction: column; align-items: flex-start; gap: 20px; }
    .nav-wrapper { margin-left: 0; }
    
    .page-content { max-width: 100%; margin: 0; padding: 0 20px; }
}
