:root {
    --term-color: #0f0; /* Classic Terminal Green */
    --term-bg: #0a0a0a;
    --term-glow: 0 0 10px rgba(0, 255, 0, 0.7);
    --scanline-color: rgba(0, 0, 0, 0.5);
}

body {
    background-color: var(--term-bg);
    color: var(--term-color);
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#terminal-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* CRT Scanline Effect */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

/* Screen Flicker/Glow */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.027951; }
    5% { opacity: 0.048283; }
    10% { opacity: 0.041396; }
    15% { opacity: 0.039908; }
    20% { opacity: 0.019908; }
    25% { opacity: 0.053278; }
    30% { opacity: 0.039778; }
    35% { opacity: 0.032247; }
    40% { opacity: 0.029929; }
    45% { opacity: 0.019561; }
    50% { opacity: 0.038106; }
    55% { opacity: 0.024052; }
    60% { opacity: 0.042371; }
    65% { opacity: 0.010338; }
    70% { opacity: 0.039908; }
    75% { opacity: 0.016567; }
    80% { opacity: 0.017463; }
    85% { opacity: 0.023804; }
    90% { opacity: 0.017159; }
    95% { opacity: 0.039929; }
    100% { opacity: 0.041396; }
}

/* Tagline Break for Mobile */
.tagline-break {
    display: none;
}

@media (max-width: 600px) {
    .tagline-break {
        display: inline;
    }
}

h1 {
    text-align: center;
    text-transform: uppercase;
    border-bottom: 2px solid var(--term-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
    text-shadow: var(--term-glow);
    letter-spacing: 4px;
}

.static-tagline {
    text-align: center;
    font-size: 1.1em;
    margin-top: -20px;
    margin-bottom: 30px;
    color: var(--term-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: var(--term-glow);
    font-weight: bold;
}

h2 {
    font-size: 1.2em;
    margin-top: 30px;
    border-left: 4px solid var(--term-color);
    padding-left: 10px;
    text-shadow: var(--term-glow);
}

.tagline {
    text-align: center;
    font-weight: bold;
    margin-bottom: 40px;
    animation: blink 2s infinite;
}

p {
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0; /* Hidden initially for typing effect */
    animation: textFadeIn 0.5s forwards;
}

/* Special highlight class */
.highlight {
    color: #ccffcc;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.9);
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--term-color);
    animation: blink 1s infinite;
    vertical-align: bottom;
}

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

@keyframes textFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--term-color);
    padding: 15px 0;
    margin-bottom: 30px;
    background: rgba(0, 20, 0, 0.8);
    flex-wrap: wrap;
}

.nav-break {
    display: none;
    flex-basis: 100%;
    height: 0;
}

nav a {
    color: var(--term-color);
    text-decoration: none;
    margin: 0 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

nav a:hover, nav a.active {
    background-color: var(--term-color);
    color: var(--term-bg);
    padding: 2px 5px;
    box-shadow: var(--term-glow);
}

nav a::before {
    content: "[";
    margin-right: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

nav a::after {
    content: "]";
    margin-left: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

nav a:hover::before, nav a:hover::after,
nav a.active::before, nav a.active::after {
    opacity: 1;
}

/* Mobile Optimization for Navigation */
@media (max-width: 768px) {
    nav {
        flex-direction: row;
        justify-content: center;
    }
    
    nav a {
        margin: 5px 10px;
        font-size: 0.9em;
    }

    .nav-break {
        display: block;
        width: 100%;
        height: 0;
        margin: 0;
    }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 40px;
}

.product-card {
    border: 1px solid var(--term-color);
    padding: 20px;
    background: rgba(0, 255, 0, 0.02);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    background: rgba(0, 255, 0, 0.05);
}

.product-card h3 {
    margin-top: 0;
    border-bottom: 1px dashed var(--term-color);
    padding-bottom: 10px;
}

/* Responsive layout for product card content with sitemap */
.product-card-content {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: center;
}

.product-text-section {
    flex: 1;
}

.sitemap-wrapper {
    flex: 0 0 auto;
    padding-left: 20px;
    border-left: 1px dashed rgba(0, 255, 0, 0.3);
}

@media (max-width: 768px) {
    .product-card-content {
        flex-direction: column;
        align-items: stretch;
    }

    .sitemap-wrapper {
        padding-left: 0;
        border-left: none;
        padding-top: 20px;
        border-top: 1px dashed rgba(0, 255, 0, 0.3);
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .sitemap-wrapper pre {
        display: inline-block;
    }
}

/* Specs and Animation Layout */
.specs-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.anim-container {
    flex: 0 0 340px;
    height: 240px;
    background: rgba(0, 20, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.anim-target {
    text-align: left;
    margin: 0;
    font-weight: bold;
    color: var(--term-color);
    text-shadow: 0 0 5px var(--term-color);
    font-size: 12px;
    line-height: 14px;
}

.specs-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 280px;
}

@media (max-width: 768px) {
    .specs-container {
        flex-direction: column;
        align-items: stretch;
    }

    .anim-container {
        width: 100%;
        flex: none;
        max-width: 100%;
    }
    
    .anim-target {
        font-size: 10px !important;
        line-height: 12px !important;
        white-space: pre; /* Ensure ASCII art is preserved */
        overflow-x: auto; /* Allow scrolling if art is too wide */
        width: 100%;
        display: block;
    }
}

.product-card .btn {
    display: inline-block;
    margin-top: 15px;
    border: 1px solid var(--term-color);
    padding: 5px 10px;
    color: var(--term-color);
    text-decoration: none;
    font-size: 0.8em;
    text-transform: uppercase;
}

.product-card .btn:hover {
    background: var(--term-color);
    color: var(--term-bg);
}

/* Detail Pages */
.tech-specs {
    margin-top: 40px;
    border: 1px solid var(--term-color);
    padding: 20px;
}

.tech-specs h3 {
    background: var(--term-color);
    color: var(--term-bg);
    display: inline-block;
    padding: 2px 8px;
    margin-top: 0;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted rgba(0, 255, 0, 0.3);
    padding: 8px 0;
}

.spec-row:last-child {
    border-bottom: none;
}

.back-link {
    display: inline-block;
    margin-top: 40px;
    color: var(--term-color);
    text-decoration: none;
    border-bottom: 1px solid var(--term-color);
}

.back-link:hover {
    background: var(--term-color);
    color: var(--term-bg);
}

/* ASCII Art Animation */
.impact-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px dotted rgba(0, 255, 0, 0.3);
    padding-bottom: 20px;
}

.impact-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ascii-mini {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
    font-size: 10px;
    line-height: 10px;
    color: var(--term-color);
    margin: 0;
    padding-right: 12px; /* Moved closer */
    width: 30ch; /* Fixed width to align text column */
    flex-shrink: 0;
}

.impact-text {
    flex: 1;
}

.impact-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    text-decoration: underline;
}

@keyframes pulse {
    0% { opacity: 0.8; text-shadow: 0 0 5px var(--term-color); }
    50% { opacity: 1; text-shadow: 0 0 15px var(--term-color), 0 0 25px var(--term-color); }
    100% { opacity: 0.8; text-shadow: 0 0 5px var(--term-color); }
}

.category-section {
    text-align: center;
    margin-bottom: 60px;
    border: 1px solid var(--term-color);
    padding: 40px;
    background: rgba(0, 255, 0, 0.02);
    transition: all 0.3s ease;
}

.category-section:hover {
    background: rgba(0, 255, 0, 0.08);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    transform: scale(1.02);
}

.category-title {
    font-size: 2em;
    margin-bottom: 10px;
    border-bottom: none;
}

.category-desc {
    font-size: 1.2em;
    margin-bottom: 20px;
    font-style: italic;
}

.terminal-btn {
    background-color: transparent;
    border: 2px solid var(--term-color);
    color: var(--term-color);
    padding: 10px 20px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.2);
    display: inline-block;
    margin-bottom: 20px;
    text-decoration: none;
}

.terminal-btn:hover {
    background-color: var(--term-color);
    color: var(--term-bg);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

.inquiry-btn {
    display: block;
    font-size: 1.2em;
    text-align: center;
    border: 1px dashed var(--term-color);
    padding: 10px;
    background: rgba(0, 255, 0, 0.05);
    color: var(--term-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.inquiry-btn:hover {
    background-color: var(--term-color);
    color: var(--term-bg);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}


/* Typewriter Animation */
#typewriter-text {
    display: inline-block;
    white-space: nowrap; /* Force single line as requested */
}

/* Mobile Optimization for Typewriter */
@media (max-width: 600px) {
    #typewriter-text {
        font-size: 10px; /* Default small size */
        letter-spacing: -0.5px;
    }
    
    /* Even smaller for very narrow screens or very long lines */
    @media (max-width: 380px) {
        #typewriter-text {
            font-size: 8.5px;
            letter-spacing: -0.8px;
        }
    }
}

.scanline-exit {
    display: inline-block;
    animation: scanlineExit 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes scanlineExit {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
    20% {
        opacity: 1;
        transform: scaleY(1.2) scaleX(1.05); /* Initial stretch/bloom */
        color: #fff;
        text-shadow: 0 0 15px #fff;
    }
    50% {
        opacity: 0.8;
        transform: scaleY(0.5) scaleX(1.1); /* Collapse */
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: scaleY(0) scaleX(1.5); /* Flat line */
        filter: blur(10px);
        color: transparent;
        text-shadow: 0 0 30px var(--term-color);
    }
}
