/**
 * --- MODERN BASE ARCHITECTURE ---
 * This file defines the core layout, typography, and component structures.
 * It relies on CSS variables for theme-specific styling.
 */

/* Local Font Optimization */
@font-face {
    font-family: 'Chakra Petch';
    src: url('chakra-petch.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Chakra Petch';
    src: url('chakra-petch.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Orbitron';
    src: url('orbitron.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Animation & Interaction */
    --transition-speed: 0.3s;
    --ease-standard: ease;

    /* Default Architectural Variables (Overridden by themes) */
    --bg-main: #ffffff;
    --bg-card: #f8f9fa;
    --text-main: #000000;
    --font-heading: sans-serif;
    --font-body: sans-serif;
    --radius: 8px;
    --primary-color: #333333;
    --secondary-color: #666666;
    --accent-color: #999999;
    --btn-text: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --card-border: 1px solid rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Global Reset & Base Elements */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    transition: background var(--transition-speed) var(--ease-standard);
    overflow-x: hidden;
    line-height: 1.6;
}

/**
 * --- NAVIGATION PILL ---
 * Floating theme switcher at the bottom of the viewport
 */
.theme-switcher-pill {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--nav-bg);
    padding: 0 24px;
    height: 52px;
    border-radius: 100px;
    border: 1px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.pill-label {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: var(--primary-color);
    border-right: 1px solid rgba(128, 128, 128, 0.3);
    padding-right: 15px;
}

.pill-buttons {
    display: flex;
    gap: 5px;
}

.pill-buttons button {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: 0.65rem;
    height: 32px;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50px;
    transition: 0.2s;
    flex-shrink: 0;
    box-sizing: border-box;
}

.pill-buttons button:hover {
    background: var(--primary-color);
    color: var(--btn-text);
}

@media (max-width: 600px) {
    .theme-switcher-pill {
        flex-direction: column;
        border-radius: 20px;
        padding: 15px;
        height: auto;
        min-width: 250px;
        bottom: 20px;
        gap: 8px;
    }

    .pill-label {
        border-right: none;
        padding-right: 0;
        padding-bottom: 5px;
        border-bottom: 1px solid rgba(128, 128, 128, 0.2);
        width: 100%;
        text-align: center;
    }

    .pill-buttons {
        justify-content: center;
        width: 100%;
    }

    .bento-large .block-body {
        flex-direction: column;
        gap: 20px;
    }
}

/**
 * --- LAYOUT & CONTAINERS ---
 */
.grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 140px 40px 120px;
}

/**
 * --- HERO SECTION ---
 * Main landing headline and subtext
 */
.hero-section {
    text-align: center;
    margin-bottom: 80px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 15px;
    display: block;
    width: 100%;
    color: var(--text-main);
}

/* Featured text within headlines */
.hero-title .highlight {
    color: var(--primary-color);
    opacity: 1;
    font-weight: 900;
    position: relative;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    max-width: 500px;
    margin: 0 auto;
}

/**
 * --- BENTO GRID SYSTEM ---
 * Responsive masonry-style grid for content blocks
 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: min-content;
    gap: 30px;
}

.content-block {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius);
    border: var(--card-border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    height: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.4s ease;
}

.bento-large {
    grid-column: span 2;
}

.bento-stack {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.bento-full {
    grid-column: span 3;
}

.bento-large .block-body {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.bento-large .block-body>* {
    flex: 1;
}

/* Content inside blocks */
.content-block h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.content-block p {
    font-size: 0.95rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

/**
 * --- ACCENTS & BUTTONS ---
 */
.accent-icon {
    margin-bottom: 20px;
}

.cta-button {
    text-decoration: none;
    padding: 16px 16px;
    background: var(--primary-color);
    color: var(--btn-text);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    width: fit-content;
    border-radius: var(--radius);
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    margin-top: auto;
    align-self: flex-end;
    border: none;
    cursor: pointer;
}

/**
 * --- FORMS & INPUTS ---
 */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.input-wrap {
    flex: 1;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: calc(var(--radius) / 2);
    padding: 14px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    resize: none;
}

.contact-form textarea {
    min-height: 120px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(var(--primary-color), 0.1);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-main);
    opacity: 0.4;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
}

.status-message {
    margin-top: 15px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 10px;
    border-radius: calc(var(--radius) / 4);
    display: none;
    text-align: center;
}

.status-message.loading {
    display: block;
    color: var(--secondary-color);
    border: 1px dashed var(--secondary-color);
    animation: pulse 1.5s infinite;
}

.status-message.success {
    display: block;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    background: rgba(var(--accent-color), 0.05);
}

.status-message.error {
    display: block;
    color: #ff4d4d;
    border: 1px solid #ff4d4d;
    background: rgba(255, 77, 77, 0.05);
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/**
 * --- HEADER & LOGO ---
 */
.main-header {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 1000;
}

.logo-wrap {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: transform 0.3s ease;
}

.logo-wrap:hover {
    transform: translateX(5px);
}

.brand-logo {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-wrap:hover .brand-logo {
    transform: rotate(12deg) scale(1.1);
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-line-1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.logo-line-2 {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--secondary-color);
    letter-spacing: 5px;
    opacity: 0.8;
    margin-top: 2px;
}

/**
 * --- BLOCK DECORATIONS ---
 */
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.block-tag {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 2px;
    opacity: 0.5;
}

.status-pill {
    font-size: 0.6rem;
    padding: 2px 8px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 10px;
    display: inline-block;
}

.spec-list {
    list-style: none;
    margin: 20px 0 30px 0;
    padding-left: 0;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
    padding-top: 20px;
}

.spec-list li {
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.spec-list li::before {
    content: "→";
    margin-right: 10px;
    color: var(--primary-color);
}

.spec-list li strong {
    color: var(--primary-color);
    margin-right: 5px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
}

/**
 * --- FOOTER ---
 */
.main-footer {
    margin-top: 100px;
    text-align: center;
    padding-bottom: 80px;
}

.footer-line {
    width: 60px;
    height: 1px;
    background: var(--primary-color);
    margin: 0 auto 20px;
    opacity: 0.5;
}

.main-footer p {
    font-size: 0.75rem;
    letter-spacing: 2px;
    opacity: 0.6;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-speed) ease;
}

.footer-link:hover {
    border-bottom: 1px solid var(--primary-color);
}

/**
 * --- BACKGROUND EFFECTS ---
 */
.dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/**
 * --- RESPONSIVE ADJUSTMENTS ---
 */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .bento-large,
    .bento-full {
        grid-column: span 1;
    }

    .grid-container {
        padding-top: 180px;
    }

    .main-header {
        top: 20px;
        left: 20px;
    }

    .logo-line-1 {
        font-size: 1.2rem;
    }

    .logo-line-2 {
        font-size: 0.55rem;
    }
}