:root {
    /* Colors - Dark Mode Default */
    --bg-body: #09090b;
    --bg-card: #18181b;
    --bg-input: #27272a;
    --border-color: #3f3f46;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Construction Accent - Industrial Orange */
    --accent: #FF5722;
    --accent-hover: #E64A19;
    --accent-glow: rgba(255, 87, 34, 0.15); /* Subtle matte glow */
    
    /* Functional Colors */
    --success: #10b981;
    --error: #ef4444;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 64px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: none; /* Minimalist - removed glow */
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Clean industrial sans */
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-md) 0;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: 3rem; line-height: 1.1; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: var(--space-md); color: var(--text-secondary); }

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-xxl) 0;
}

/* Header & Nav */
.header {
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: var(--space-md) 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.brand span { color: var(--accent); }

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-sm); /* Sharper corners for industrial look */
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background: var(--border-color);
}

.btn-full {
    width: 100%;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md); /* Slightly tighter radius */
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    transition: border-color 0.2s ease;
    overflow: hidden;
}

.card:hover {
    border-color: var(--text-secondary);
}

/* Calculator Grid */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.calc-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

.calc-section-title {
    margin-bottom: var(--space-lg);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-sm);
    display: inline-block;
}

@media (min-width: 768px) {
    .calc-layout-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.tips-box {
    background: var(--bg-body);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tips-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.tips-list {
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.tips-list li {
    margin-bottom: 4px;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input, .form-select {
    width: 100%;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Very sharp */
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
    font-family: monospace; /* Industrial numeric feel */
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: #2a2a2d;
}

.input-group {
    display: flex;
    gap: var(--space-sm);
}

.input-suffix {
    display: flex;
    align-items: center;
    padding: 0 var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Tab System for Calculator */
.tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-xs);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Results Area */
.result-card {
    background: #202022;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    margin-top: var(--space-lg);
    text-align: center;
    position: relative;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    align-items: center;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary); /* White text for clean look */
    display: block;
    margin: var(--space-sm) 0;
    letter-spacing: -0.05em;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Placeholders */
.placeholder-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    color: var(--accent);
    font-weight: bold;
    font-size: 1.25rem;
}

.placeholder-diagram {
    width: 100%;
    height: 160px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
}

/* Hero Badge */
.badge {
    display: inline-block;
    padding: 6px 12px;
    background: transparent;
    color: var(--accent);
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    border: 1px solid var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.brand-icon {
    width: 24px;
    height: 24px;
    background: var(--accent);
    display: inline-block;
    margin-right: 8px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); /* Hexagon/Cube shape */
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xxl);
}

.feature-item {
    text-align: left;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    font-weight: bold;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-lg); }
.no-decoration { text-decoration: none; }
.w-100 { width: 100%; }
.w-unit { width: 110px; }

/* Layout Utilities */
.max-w-md { max-width: 800px; margin: 0 auto; }
.bg-darker { background: var(--bg-card); border-top: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.m-0 { margin: 0; }

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    .section { padding: var(--space-xl) 0; }
    
    .result-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

@media (max-width: 640px) {
    /* Layout containers */
    .container {
        padding: 0 var(--space-md); /* 16px padding on mobile */
    }

    /* Typography */
    h1 { font-size: 1.875rem; } /* 30px */
    h2 { font-size: 1.5rem; }
    
    /* Navigation - Vertical Stack */
    .nav-container {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-md);
        padding: var(--space-xs) 0;
        border-top: 1px solid rgba(255,255,255,0.05);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .btn {
        width: 100%; /* Full width buttons for touch */
    }

    .brand {
        margin-bottom: 0;
    }

    /* Forms */
    .input-group {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .input-suffix {
        justify-content: center;
        padding: 10px;
    }

    /* Tabs */
    .tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
        min-width: 100px; /* Ensure click target size */
    }

    /* Result Grid */
    .result-card {
        padding: var(--space-lg);
    }

    /* Feature Grid */
    .feature-grid {
        grid-template-columns: 1fr;
    }
}
