﻿/* ===== MODERN LASER CUTTING DESIGN 2026 ===== */
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary-steel: #1f222a;
    --secondary-steel: #2a2e38;
    --accent-laser: #00e5ff;
    --accent-laser-glow: rgba(0, 229, 255, 0.3);
    --accent-spark: #ff5a1f;
    --accent-orange: #ff8500;
    --accent-orange-dark: #cc6a00;
    --metal-silver: #94a3b8;
    --metal-dark: #060708;
    --bg-dark: #0b0c10;
    --text-light: #e2e8f0;
    --text-dim: #94a3b8;
    --card-glass: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-light);
    position: relative;
    overflow-x: hidden;
}

/* ===== ANIMATED GRID BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
}

@media (max-width: 768px) {
    .header-row {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-family: 'Exo 2', sans-serif;
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 12px;
    background: linear-gradient(120deg,
        #5a544c 0%, #a89f93 10%, #5a544c 20%,
        #cfc5bb 26%, #ffcc33 32%, #fff6d9 36%, #ff8500 40%,
        #a89f93 50%, #5a544c 62%, #a89f93 74%, #5a544c 86%, #a89f93 96%, #5a544c 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 6s ease-in-out infinite alternate;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

/* Header links */
.header-links {
    margin-top: 16px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-link {
    color: var(--accent-laser);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 8px;
    transition: all 0.3s;
    background: rgba(0, 229, 255, 0.05);
}

.btn-link:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--accent-laser);
    transform: translateY(-2px);
}

header h1::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -80px;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-laser));
}

header h1::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -80px;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-laser), transparent);
}

.subtitle {
    font-size: 16px;
    color: var(--text-dim);
    font-weight: 400;
    letter-spacing: 1px;
}

/* ===== CALCULATOR CARD ===== */
.calculator-wrapper {
    background: var(--card-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 229, 255, 0.1),
        transparent);
    animation: scan 8s linear infinite;
    z-index: -1;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 200%; }
}

.step {
    animation: fadeIn 0.6s ease-in;
}

.step + .step {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.step h2 {
    font-family: 'Exo 2', sans-serif;
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
    padding-left: 20px;
}

.step h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 80%;
    background: linear-gradient(180deg, var(--accent-laser), var(--accent-orange));
    box-shadow: 0 0 10px var(--accent-laser-glow);
}

.hidden {
    display: none;
}

/* ===== MATERIAL GRID ===== */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.material-btn {
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.3), rgba(31, 34, 42, 0.3)), rgba(31, 34, 42, 0.92);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 32px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.material-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--accent-laser-glow), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    border-radius: 50%;
}

.material-btn:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-laser);
    box-shadow: 
        0 12px 40px rgba(0, 229, 255, 0.2),
        inset 0 1px 0 rgba(0, 229, 255, 0.2);
}

.material-btn:hover::before {
    width: 300px;
    height: 300px;
}

.material-btn:active {
    transform: translateY(-4px) scale(0.98);
}

.material-btn.active {
    border-color: var(--accent-laser);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(255, 90, 31, 0.1)), rgba(31, 34, 42, 0.92);
    box-shadow: 
        0 0 30px var(--accent-laser-glow),
        inset 0 0 20px rgba(0, 229, 255, 0.1);
}

.material-icon {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, #45413a 0%, #6b6459 35%, #8a7f5c 60%, #4a4640 100%);
    border: 2px solid rgba(255, 133, 0, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -3px 5px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.35),
        0 0 14px rgba(255, 133, 0, 0.15);
    filter: grayscale(0.55) sepia(0.35) saturate(1.3) brightness(0.95);
    transition: all 0.4s ease;
}

.material-icon img {
    width: 58%;
    height: 58%;
    object-fit: contain;
    display: block;
}

.material-btn:hover .material-icon {
    transform: scale(1.08) rotate(5deg);
    background: linear-gradient(135deg, #5a544c 0%, #8a7f5c 35%, #ffcc33 65%, #6b6459 100%);
    border-color: rgba(255, 204, 51, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -3px 5px rgba(0, 0, 0, 0.4),
        0 6px 22px rgba(255, 204, 51, 0.3);
    filter: grayscale(0.35) sepia(0.45) saturate(1.5) brightness(1.05);
}

/* ===== THICKNESS GRID ===== */
.thickness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px;
}

.thickness-btn {
    background: linear-gradient(rgba(42, 46, 56, 0.4), rgba(42, 46, 56, 0.4)), rgba(31, 34, 42, 0.92);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
    font-weight: 700;
    font-family: 'Exo 2', sans-serif;
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.thickness-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-laser), var(--accent-orange));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.thickness-btn:hover {
    transform: translateY(-4px);
    border-color: var(--accent-laser);
    box-shadow: 0 8px 20px rgba(0, 229, 255, 0.2);
}

.thickness-btn:hover::after {
    transform: scaleX(1);
}

.thickness-btn.active {
    border-color: var(--accent-laser);
    background: linear-gradient(rgba(0, 229, 255, 0.15), rgba(0, 229, 255, 0.15)), rgba(31, 34, 42, 0.92);
    color: var(--accent-laser);
    box-shadow: 0 0 20px var(--accent-laser-glow);
}

.thickness-btn.active::after {
    transform: scaleX(1);
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 3px dashed var(--card-border);
    border-radius: 16px;
    padding: 70px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    margin-bottom: 32px;
    background: rgba(31, 34, 42, 0.92);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.05), transparent);
    transition: left 0.6s ease;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover {
    border-color: var(--accent-laser);
    background: linear-gradient(rgba(0, 229, 255, 0.05), rgba(0, 229, 255, 0.05)), rgba(31, 34, 42, 0.92);
    box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.1);
}

.upload-area.dragover {
    border-color: var(--accent-spark);
    background: linear-gradient(rgba(255, 90, 31, 0.1), rgba(255, 90, 31, 0.1)), rgba(31, 34, 42, 0.92);
    box-shadow: 0 0 40px rgba(255, 90, 31, 0.2);
}

.upload-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-area p {
    color: var(--text-dim);
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-laser), #0095ff);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Exo 2', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 32px;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0, 229, 255, 0.5);
}

.hero-cta .btn-primary {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
    box-shadow: 0 8px 24px rgba(255, 133, 0, 0.3);
}

.hero-cta .btn-primary:hover {
    box-shadow: 0 12px 36px rgba(255, 133, 0, 0.5);
}

.btn-primary:hover::before {
    width: 400px;
    height: 400px;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

.btn-secondary {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-laser);
    border: 2px solid var(--accent-laser);
    border-radius: 10px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Exo 2', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    background: var(--accent-laser);
    color: var(--bg-dark);
    box-shadow: 0 8px 20px var(--accent-laser-glow);
    transform: translateY(-2px);
}

.calculator-wrapper .btn-secondary {
    background: linear-gradient(rgba(0, 229, 255, 0.1), rgba(0, 229, 255, 0.1)), rgba(31, 34, 42, 0.92);
}

/* ===== FILE LIST ===== */
.files-list {
    margin-top: 32px;
}

.file-item {
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.4), rgba(31, 34, 42, 0.4)), rgba(31, 34, 42, 0.92);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: var(--accent-laser);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.15);
    transform: translateX(4px);
}

.file-item.processing {
    opacity: 0.6;
    animation: processing 1.5s ease-in-out infinite;
}

@keyframes processing {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.8; }
}

.file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.file-name {
    font-weight: 600;
    color: var(--text-light);
    font-size: 17px;
    font-family: 'Exo 2', sans-serif;
}

.file-remove {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.file-remove:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 90, 31, 0.4);
}

.file-remove:active {
    transform: scale(0.95);
}

.file-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.info-item {
    font-size: 14px;
    color: var(--text-dim);
}

.info-label {
    font-weight: 600;
    color: var(--accent-laser);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quantity-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-input label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 14px;
}

.quantity-input input {
    width: 100px;
    padding: 10px 14px;
    border: 2px solid var(--card-border);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    background: rgba(31, 34, 42, 0.5);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.quantity-input input:focus {
    outline: none;
    border-color: var(--accent-laser);
    box-shadow: 0 0 20px var(--accent-laser-glow);
}

/* ===== RESULTS ===== */
.results-summary {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(255, 90, 31, 0.1)), rgba(31, 34, 42, 0.9);
    border: 2px solid var(--accent-laser);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.2);
}

.results-summary::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.1), transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.result-main {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    background: rgba(31, 34, 42, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px 20px;
    backdrop-filter: blur(10px);
}

.result-main h3 {
    font-size: 16px;
    color: var(--text-dim);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.result-main .total-cost {
    font-size: 56px;
    font-weight: 900;
    font-family: 'Exo 2', sans-serif;
    background: linear-gradient(135deg, var(--accent-laser), white, var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--accent-laser-glow);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 1;
}

.result-item {
    background: rgba(31, 34, 42, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.result-item-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-item-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Exo 2', sans-serif;
    color: var(--accent-laser);
}

.cost-note {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* ===== DETAIL CARDS ===== */
.files-details {
    margin-bottom: 32px;
}

.detail-card {
    background: rgba(42, 46, 56, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.detail-card:hover {
    border-color: var(--accent-laser);
    box-shadow: 0 8px 24px rgba(0, 229, 255, 0.15);
}

.detail-card h4 {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 20px;
    font-family: 'Exo 2', sans-serif;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    font-size: 15px;
}

.detail-label {
    font-weight: 600;
    color: var(--accent-laser);
    margin-right: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-value {
    color: var(--text-light);
    font-weight: 500;
}

.actions {
    display: flex;
    justify-content: center;
}

/* ===== LOADER ===== */
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 229, 255, 0.1);
    border-top: 4px solid var(--accent-laser);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 30px auto;
    box-shadow: 0 0 20px var(--accent-laser-glow);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: linear-gradient(rgba(255, 90, 31, 0.2), rgba(255, 90, 31, 0.2)), rgba(31, 34, 42, 0.92);
    border: 1px solid var(--accent-spark);
    color: #ff5a1f;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
}

/* ===== PREVIEW MODAL ===== */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-in;
}

.preview-modal.hidden {
    display: none !important;
}

.preview-content {
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.5), rgba(31, 34, 42, 0.5));
    border: 2px solid var(--accent-laser);
    border-radius: 20px;
    padding: 32px;
    max-width: 90%;
    max-height: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 229, 255, 0.3);
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.preview-header h3 {
    color: var(--text-light);
    font-size: 22px;
    font-family: 'Exo 2', sans-serif;
    margin: 0;
}

.preview-close {
    background: var(--accent-orange);
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.preview-close:hover {
    background: var(--accent-orange-dark);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 133, 0, 0.5);
}

/* Размеры и разрывы — над канвой, чтобы не закрывать чертёж (см. renderPreviewMeta) */
.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: -12px 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}

.preview-meta:empty {
    display: none;
}

.preview-meta-gaps {
    color: #ff3b30;
}

.preview-meta-strays {
    color: #fb923c;
}

#previewCanvas {
    border: 2px solid var(--card-border);
    border-radius: 12px;
    background: rgba(31, 34, 42, 0.5);
    display: block;
    margin: 0 auto;
    /* На невысоком экране канва 600×600 вылезала за рамку окна снизу —
       ужимаем её (с сохранением пропорций) до высоты, оставшейся после
       шапки, строки подписей и отступов окна. */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(90vh - 170px);
}

.file-preview-btn {
    background: linear-gradient(135deg, var(--accent-laser), #0095ff);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.file-preview-btn:hover {
    box-shadow: 0 4px 16px var(--accent-laser-glow);
    transform: translateY(-2px);
}

/* Забрать готовый чертёж: рядом с предпросмотром, но спокойнее по цвету —
   это не главное действие на странице, главное здесь расчёт. */
.file-download-btn {
    background: transparent;
    color: var(--metal-silver);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 10px;
    letter-spacing: 0.5px;
}

.file-download-btn:hover {
    border-color: var(--accent-laser);
    color: var(--text-light);
}

/* ===== USER MENU ===== */
.header-user-menu {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
    padding-top: 8px;
}

.user-btn {
    color: var(--accent-laser);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border: 2px solid var(--accent-laser);
    border-radius: 8px;
    transition: all 0.3s;
}

.user-btn:hover {
    background: rgba(0, 229, 255, 0.1);
}

.btn-logout {
    background: none;
    border: 2px solid var(--accent-orange);
    color: var(--accent-orange);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 133, 0, 0.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    header {
        padding: 10px 20px 0 20px;
    }

    .header-user-menu {
        position: static;
        justify-content: center;
        margin-bottom: 16px;
    }

    .calculator-wrapper {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 32px;
        letter-spacing: 2px;
    }

    header h1::before,
    header h1::after {
        display: none;
    }

    .material-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .thickness-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .result-main .total-cost {
        font-size: 40px;
    }

    .step h2 {
        font-size: 22px;
    }
}

/* ===== SMOOTH SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-laser), var(--accent-orange));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-laser);
}

/* ============================================================
   LANDING PAGE — Hero, Nav, Features, Pricing, FAQ, Footer
   ============================================================ */

html {
    scroll-behavior: smooth;
}

/* ===== NAVIGATION ===== */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.landing-nav.scrolled {
    background: rgba(11, 12, 16, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    padding: 12px 40px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.landing-nav .nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-icon {
    height: 32px;
    width: auto;
    display: block;
}

.nav-logo-word {
    height: 16px;
    width: auto;
    display: block;
}

.landing-nav .nav-logo-word {
    height: 40px;
}

.landing-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.landing-nav .nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    /* Пункт из двух слов («Калькулятор металла») иначе ломается на две
       строки и наезжает на соседний. */
    white-space: nowrap;
    transition: color 0.3s;
    position: relative;
    letter-spacing: 0.5px;
}

.landing-nav .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-laser);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-laser-glow);
}

.landing-nav .nav-links a:hover {
    color: var(--text-light);
}

.landing-nav .nav-links a:hover::after {
    width: 100%;
}

.landing-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-nav .nav-auth-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: 'Exo 2', sans-serif;
}

.landing-nav .nav-auth-btn.login {
    color: var(--text-light);
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.landing-nav .nav-auth-btn.login:hover {
    border-color: var(--accent-laser);
    background: var(--accent-laser);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-laser-glow);
}

.landing-nav .nav-auth-btn.register {
    background: linear-gradient(135deg, var(--accent-laser), #0095ff);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
}

.landing-nav .nav-auth-btn.register:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 229, 255, 0.5);
}

.landing-nav .nav-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.landing-nav .nav-user-btn {
    color: var(--accent-laser);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border: 2px solid var(--accent-laser);
    border-radius: 8px;
    transition: all 0.3s;
}

.landing-nav .nav-user-btn:hover {
    background: rgba(0, 229, 255, 0.1);
}

.landing-nav .btn-logout {
    background: none;
    border: 2px solid var(--accent-orange);
    color: var(--accent-orange);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    font-family: 'Exo 2', sans-serif;
}

.landing-nav .btn-logout:hover {
    background: rgba(255, 133, 0, 0.1);
}

/* Mobile actions container — hidden on desktop */
.nav-actions-mobile {
    display: none;
}

/* Nav hamburger for mobile */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}

.nav-toggle span {
    width: 26px;
    height: 2px;
    background: var(--text-light);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== HERO SECTION ===== */
.landing-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 40px 80px;
    position: relative;
    overflow: hidden;
}

/* Компактный вариант hero для внутренних страниц (не главный лендинг) —
   тот же фон/эффекты, но без растягивания на весь экран. */
.landing-hero.page-hero {
    min-height: 0;
    padding: 150px 40px 70px;
}

/* На внутренних страницах заголовок обычно длиннее, чем на главной —
   шире колонка и меньше кегль, чтобы на широких экранах он умещался
   в 1-2 строки, а не расползался на 4-5. */
.landing-hero.page-hero .hero-content {
    max-width: 1150px;
}

.landing-hero.page-hero h1 {
    font-size: clamp(34px, 4.9vw, 55px);
}

/* Hero background effects */
.landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(255, 90, 31, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 20%, rgba(0, 229, 255, 0.04) 0%, transparent 40%);
    animation: heroGlow 15s ease-in-out infinite alternate;
    z-index: 0;
}

/* Плавно гасим фон у нижнего края, чтобы не было резкой границы
   со следующим блоком (::before обрезается overflow:hidden ровно
   по краю .landing-hero, из-за чего шов был очень заметен). */
.landing-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 260px;
    background: linear-gradient(to bottom, transparent, var(--bg-dark));
    pointer-events: none;
    z-index: 1;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-2%, 2%) scale(1.05); }
    100% { transform: translate(2%, -2%) scale(1.02); }
}

/* Floating particles */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.hero-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-laser);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 12s infinite;
    box-shadow: 0 0 6px var(--accent-laser-glow);
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

.hero-particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 14s; width: 3px; height: 3px; }
.hero-particle:nth-child(2) { left: 25%; animation-delay: 2s; animation-duration: 16s; width: 5px; height: 5px; }
.hero-particle:nth-child(3) { left: 40%; animation-delay: 4s; animation-duration: 12s; width: 2px; height: 2px; }
.hero-particle:nth-child(4) { left: 55%; animation-delay: 1s; animation-duration: 15s; width: 4px; height: 4px; }
.hero-particle:nth-child(5) { left: 70%; animation-delay: 3s; animation-duration: 13s; width: 3px; height: 3px; }
.hero-particle:nth-child(6) { left: 85%; animation-delay: 5s; animation-duration: 17s; width: 5px; height: 5px; }
.hero-particle:nth-child(7) { left: 50%; animation-delay: 6s; animation-duration: 11s; width: 2px; height: 2px; }
.hero-particle:nth-child(8) { left: 15%; animation-delay: 3.5s; animation-duration: 18s; width: 4px; height: 4px; }

/* Laser beam scan line */
.hero-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-laser), transparent);
    box-shadow: 0 0 30px var(--accent-laser-glow), 0 0 60px rgba(0, 229, 255, 0.2);
    animation: laserScan 8s ease-in-out infinite;
    opacity: 0.7;
    z-index: 1;
}

@keyframes laserScan {
    0% { top: 0; opacity: 0.3; }
    10% { opacity: 0.8; }
    50% { top: 100%; opacity: 0.8; }
    60% { opacity: 0.3; }
    100% { top: 0; opacity: 0.3; }
}

.landing-hero .hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.landing-hero h1 {
    font-family: 'Exo 2', sans-serif;
    font-size: clamp(42px, 7vw, 80px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(120deg,
        #5a544c 0%, #a89f93 10%, #5a544c 20%,
        #cfc5bb 26%, #ffcc33 32%, #fff6d9 36%, #ff8500 40%,
        #a89f93 50%, #5a544c 62%, #a89f93 74%, #5a544c 86%, #a89f93 96%, #5a544c 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInDown 0.8s ease-out 0.1s both, shimmer 12s ease-in-out infinite alternate;
}

.landing-hero .hero-subtitle {
    font-size: clamp(16px, 2vw, 22px);
    color: var(--text-dim);
    max-width: 650px;
    margin: 0 auto 40px;
    line-height: 1.6;
    font-weight: 300;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.landing-hero .hero-subtitle strong {
    color: var(--accent-orange);
    font-weight: 600;
}

.landing-hero .hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.35s both;
}

.hero-cta .btn-primary {
    width: auto;
    padding: 18px 40px;
    font-size: 16px;
    margin-top: 0;
}

.hero-cta .btn-outline {
    padding: 16px 36px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: 'Exo 2', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline {
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: 'Exo 2', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-cta .btn-outline:hover,
.btn-outline:hover {
    border-color: var(--accent-laser);
    background: var(--accent-laser);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-laser-glow);
}

/* Hero stats */
.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
    margin-top: 60px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-stat {
    text-align: center;
}

.hero-stat .stat-number {
    font-family: 'Exo 2', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--text-light);
    display: block;
}

.hero-stat .stat-number .counter-suffix {
    color: var(--accent-laser);
}

.hero-stat .stat-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== SECTION COMMON ===== */
.section {
    padding: 100px 40px;
    position: relative;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header h2 {
    font-family: 'Exo 2', sans-serif;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    background: linear-gradient(120deg,
        #5a544c 0%, #a89f93 9%,
        #ff8500 22%, #ffcc33 36%, #fff6d9 48%, #ffcc33 60%, #ff8500 73%,
        #a89f93 88%, #5a544c 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 20s ease-in-out infinite alternate;
}

.cta-shimmer-heading {
    background-image: linear-gradient(120deg,
        #5a544c 0%, #a89f93 9%,
        #ff8500 22%, #ffcc33 36%, #fff6d9 48%, #ffcc33 60%, #ff8500 73%,
        #a89f93 88%, #5a544c 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 20s ease-in-out infinite alternate;
}

.faq-section .section-header h2 {
    background-image: linear-gradient(120deg,
        #ff8500 0%, #ffcc33 14%, #fff6d9 24%, #ffcc33 34%, #ff8500 44%,
        #5a544c 56%, #a89f93 66%,
        #ff8500 78%, #ffcc33 88%, #fff6d9 100%);
    background-size: 300% auto;
}

.section-header p {
    font-size: 17px;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== FEATURES SECTION ===== */
.features-section {
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(11, 12, 16, 0.8) 100%);
}

/* Блок "что такое раскрой" — текст + схематичная иллюстрация раскладки */
.nesting-demo-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.nesting-demo-figure {
    margin: 0;
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.2), rgba(31, 34, 42, 0.2));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
}

.nesting-demo-figure svg {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
}

.nesting-demo-figure figcaption {
    margin-top: 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Детали "разлетаются" по своим местам, когда блок появляется в
   области видимости — раскладка на лист происходит на глазах. */
.nesting-demo-figure .nest-part {
    opacity: 0;
    transform: translate(var(--fx, 0), var(--fy, 0)) rotate(var(--fr, 0deg));
    transform-box: fill-box;
    transform-origin: center;
}

.nesting-demo-figure.visible .nest-part {
    animation: nestPartIn 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
    animation-delay: calc(0.2s + var(--d, 0) * 90ms);
}

@keyframes nestPartIn {
    to {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nesting-demo-figure .nest-part {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

@media (max-width: 860px) {
    .nesting-demo-grid {
        grid-template-columns: 1fr;
    }
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.2), rgba(31, 34, 42, 0.2));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 36px 32px;
    min-height: 350px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    perspective: 1000px;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(0, 229, 255, 0.035), rgba(255, 133, 0, 0.045));
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 133, 0, 0.28);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 229, 255, 0.05), 0 0 40px rgba(255, 133, 0, 0.06);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card .feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #45413a 0%, #6b6459 35%, #8a7f5c 60%, #4a4640 100%);
    border: 2px solid rgba(255, 204, 51, 0.25);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -3px 5px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.35);
    filter: grayscale(0.55) sepia(0.35) saturate(1.3) brightness(0.95);
    transition: all 0.4s;
}

.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, #5a544c 0%, #8a7f5c 35%, #ffcc33 65%, #6b6459 100%);
    border-color: rgba(255, 204, 51, 0.55);
    transform: scale(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -3px 5px rgba(0, 0, 0, 0.4),
        0 6px 22px rgba(255, 204, 51, 0.3);
    filter: grayscale(0.35) sepia(0.45) saturate(1.5) brightness(1.05);
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 12px;
    font-family: 'Exo 2', sans-serif;
    letter-spacing: 0.5px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
}

.feature-card .feature-hover-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.05), rgba(255, 133, 0, 0.06) 65%, transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.feature-card:hover .feature-hover-glow {
    opacity: 1;
}

/* ===== HOW IT WORKS ===== */
.how-section {
    background: rgba(11, 12, 16, 0.5);
    position: relative;
}

.how-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    position: relative;
}

/* Connecting line between steps -- stops exactly at the outer step-number
   circles' edges (56px circle, centered in each of 3 equal columns) so it
   doesn't cross through the "1" and "3" digits; it still passes behind the
   middle circle, which has an opaque-enough background to hide it there. */
.how-steps::before {
    content: '';
    position: absolute;
    top: 60px;
    left: calc(16.667% + 28px);
    right: calc(16.667% + 28px);
    height: 2px;
    background: linear-gradient(90deg,
        #5a544c 0%, #a89f93 10%, #5a544c 20%,
        #cfc5bb 26%, #ffcc33 32%, #fff6d9 36%, #ff8500 40%,
        #a89f93 50%, #5a544c 62%, #a89f93 74%, #5a544c 86%, #a89f93 96%, #5a544c 100%);
    background-size: 200% auto;
    animation: shimmer 6s ease-in-out infinite alternate;
    opacity: 0.7;
}

@media (max-width: 900px) {
    .how-steps::before {
        display: none;
    }
}

.how-step {
    text-align: center;
    padding: 32px 24px;
    position: relative;
}

.how-step .step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Exo 2', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(255, 133, 0, 0.12)), rgba(31, 34, 42, 0.92);
    border: 2px solid rgba(255, 133, 0, 0.35);
    color: var(--accent-laser);
    position: relative;
    box-shadow: 0 0 30px rgba(255, 133, 0, 0.15);
    transition: all 0.4s;
}

.how-step:hover .step-number {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(255, 133, 0, 0.3);
    border-color: var(--accent-orange);
}

.how-step h3 {
    font-family: 'Exo 2', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.how-step p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* ===== PRICING SECTION ===== */
.pricing-section {
    background: linear-gradient(180deg, rgba(11, 12, 16, 0.8), var(--bg-dark));
}

.pricing-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: stretch;
}

.pricing-card {
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.15), rgba(31, 34, 42, 0.15));
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 40px 32px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 229, 255, 0.2);
}

.pricing-card.popular {
    border-color: var(--accent-laser);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(0, 229, 255, 0.02));
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.08);
    transform: scale(1.02);
}

.pricing-card.popular:hover {
    transform: scale(1.02) translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 60px rgba(0, 229, 255, 0.12);
}

.pricing-card .popular-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--accent-laser), #0095ff);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Exo 2', sans-serif;
}

.pricing-card .plan-name {
    font-family: 'Exo 2', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.pricing-card .plan-price {
    font-family: 'Exo 2', sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: var(--accent-laser);
    margin-bottom: 4px;
}

.pricing-card .plan-price.free {
    color: var(--text-dim);
}

.pricing-card .plan-price .currency {
    font-size: 24px;
    vertical-align: super;
}

.pricing-card .plan-period {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.pricing-card .plan-description {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
}

.pricing-card .plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    flex: 1;
}

.pricing-card .plan-features li {
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.pricing-card .plan-features li:last-child {
    border-bottom: none;
}

.pricing-card .plan-features li .check {
    color: #2ecc71;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.pricing-card .plan-features li .cross {
    color: var(--accent-spark);
    font-size: 14px;
    flex-shrink: 0;
}

.pricing-card .plan-cta {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-family: 'Exo 2', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
}

.pricing-card .plan-cta.primary {
    background: linear-gradient(135deg, var(--accent-laser), #0095ff);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
}

.pricing-card .plan-cta.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 229, 255, 0.5);
}

.pricing-card .plan-cta.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: var(--text-light);
}

.pricing-card .plan-cta.secondary:hover {
    border-color: var(--accent-laser);
    background: var(--accent-laser);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-laser-glow);
}

.pricing-card .plan-cta.enterprise {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(255, 133, 0, 0.3);
}

.pricing-card .plan-cta.enterprise:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 133, 0, 0.5);
}

/* ===== Кнопка Enterprise-фичи (например, скачивание КП) =====
   Анимация (ripple по клику/hover + подъём) — как у .btn-primary,
   цвета — оранжевый градиент Enterprise, без изменений. */
.btn-enterprise {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 133, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enterprise::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-enterprise:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(255, 133, 0, 0.5);
}

.btn-enterprise:hover:not(:disabled)::before {
    width: 400px;
    height: 400px;
}

.btn-enterprise:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(255, 133, 0, 0.3);
}

.btn-enterprise:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

/* ===== FAQ SECTION ===== */
.faq-section {
    background: rgba(11, 12, 16, 0.5);
}

.faq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
}

/* ===== CTA SECTION divider (top border, matches the other section dividers) ===== */
#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
}

/* Раскрой: тот же едва заметный разделитель, что и между остальными
   блоками страницы (.faq-section::before), — между FAQ и CTA. */
#cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.15), rgba(31, 34, 42, 0.15));
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: rgba(0, 229, 255, 0.15);
}

.faq-item.active {
    border-color: rgba(0, 229, 255, 0.3);
}

.faq-question {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    transition: color 0.3s;
    gap: 16px;
    user-select: none;
}

.faq-question:hover {
    color: var(--accent-laser);
}

.faq-question .faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    font-size: 18px;
    color: var(--accent-laser);
}

.faq-item.active .faq-question .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s;
    padding: 0 24px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 24px 20px;
}

/* ===== FOOTER ===== */
.landing-footer {
    padding: 60px 40px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(11, 12, 16, 0.9);
    position: relative;
    z-index: 0;
    overflow: hidden;
}

.footer-mascot {
    position: absolute;
    right: 24px;
    bottom: -20px;
    height: 330px;
    width: auto;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

@media (max-width: 900px) {
    .footer-mascot {
        display: none;
    }
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    /* Пять колонок: описание сервиса пошире, дальше четыре списка ссылок.
       До появления «Справочников» колонок было четыре, и пятая уезжала
       на отдельную строку под описанием. */
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}

@media (max-width: 1100px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 32px;
    }
}

.footer-col h4 {
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: var(--accent-laser);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-dim);
}

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    background: rgba(11, 12, 16, 0.97);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    padding: 20px 24px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.cookie-consent-banner.visible {
    transform: translateY(0);
    opacity: 1;
}

.cookie-consent-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 260px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.cookie-consent-text a {
    color: var(--accent-laser);
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cookie-consent-actions .btn-primary,
.cookie-consent-actions .btn-secondary {
    width: auto;
    margin-top: 0;
    padding: 12px 28px;
    font-size: 14px;
}

@media (max-width: 640px) {
    .cookie-consent-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-consent-actions {
        justify-content: stretch;
    }
    .cookie-consent-actions button {
        flex: 1;
    }
}

/* ===== LEGAL PAGES (privacy / terms / offer) ===== */
.legal-page {
    max-width: 820px;
    margin: 0 auto;
    background: linear-gradient(rgba(42, 46, 56, 0.2), rgba(42, 46, 56, 0.2)), rgba(31, 34, 42, 0.92);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 48px;
}
.legal-updated {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
}
.legal-section { margin-bottom: 32px; }
.legal-section:last-child { margin-bottom: 0; }
.legal-section h2 {
    font-family: 'Exo 2', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}
.legal-section p {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 12px;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.75;
    padding-left: 22px;
    margin-bottom: 12px;
}
.legal-section ul:last-child { margin-bottom: 0; }
.legal-section li { margin-bottom: 6px; }
.legal-section li:last-child { margin-bottom: 0; }
.legal-section strong { color: var(--text-light); }
.legal-section a { color: var(--accent-laser); text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }
.legal-page table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 14px;
}
.legal-page table th, .legal-page table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-dim);
}
.legal-page table th {
    color: var(--text-light);
    font-family: 'Exo 2', sans-serif;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}
@media (max-width: 640px) {
    .legal-page { padding: 28px 20px; border-radius: 16px; }
    .legal-page table { display: block; overflow-x: auto; }
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ===== RESPONSIVE LANDING ===== */
@media (max-width: 1440px) and (min-width: 1201px) {
    .landing-nav {
        padding: 16px 24px;
    }

    .landing-nav .nav-links {
        gap: 18px;
    }

    .landing-nav .nav-links a {
        font-size: 13px;
        letter-spacing: 0.2px;
    }
}

@media (max-width: 1200px) {
    .landing-nav {
        padding: 12px 20px;
    }

    .landing-nav.scrolled {
        padding: 10px 20px;
    }

    .nav-toggle {
        display: flex;
    }

    .landing-nav .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: rgba(11, 12, 16, 0.98);
        backdrop-filter: blur(20px);
        padding: 80px 32px 32px;
        gap: 24px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid rgba(0, 229, 255, 0.1);
        align-items: flex-start;
    }

    .landing-nav .nav-links.open {
        right: 0;
    }

    .landing-nav .nav-actions {
        display: none;
    }

    .landing-nav .nav-links .nav-actions-mobile {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .landing-nav .nav-links .nav-actions-mobile .nav-auth-btn {
        text-align: center;
        width: 100%;
    }

}

@media (max-width: 768px) {
    .landing-hero {
        padding: 100px 20px 60px;
    }

    .hero-stats {
        gap: 24px;
    }

    .hero-stat .stat-number {
        font-size: 28px;
    }

    .section {
        padding: 60px 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .pricing-card.popular {
        transform: none;
    }

    .pricing-card.popular:hover {
        transform: translateY(-4px);
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .landing-hero h1 {
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Предупреждение о незамкнутых контурах (см. backend/contour_check.py) */
.contour-warning {
    background: rgba(255, 133, 0, 0.08);
    border: 1px solid rgba(255, 133, 0, 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--text-light);
}

.contour-warning-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

/* Текст переносится внутри своей колонки, а кнопка остаётся справа — пока
   хватает ширины; на узком экране она уходит под текст. */
.contour-warning-row > span {
    flex: 1 1 320px;
}

.contour-warning-row + .contour-warning-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 133, 0, 0.2);
}

.contour-fix-btn {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex: none;
    transition: all 0.3s ease;
}

.contour-fix-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 133, 0, 0.4);
}

.contour-fix-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.contour-fixed {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    color: #34d399;
}

.contour-download-btn {
    background: linear-gradient(135deg, var(--accent-laser), #0095ff);
    color: white;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.contour-download-btn:hover {
    box-shadow: 0 4px 16px var(--accent-laser-glow);
    transform: translateY(-2px);
}

/* ===== ЧЕРТЁЖ ИЗ ФОТО (см. static/js/sketch.js) ===== */
.sketch-entry {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px dashed var(--card-border);
    border-radius: 14px;
    font-size: 14px;
    color: var(--text-dim);
}

.sketch-entry > span:first-child {
    flex: 1 1 320px;
}

.sketch-entry .btn-secondary {
    width: auto;
    margin: 0;
    padding: 10px 20px;
    white-space: nowrap;
}

.sketch-left {
    flex-basis: 100%;
    font-size: 13px;
    color: var(--metal-silver);
}

.sketch-content {
    width: min(1100px, 92vw);
    max-height: 92vh;
    overflow-y: auto;
}

.sketch-body {
    display: grid;
    grid-template-columns: minmax(220px, 40%) 1fr;
    gap: 24px;
    align-items: start;
}

.sketch-photo img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

/* Деталь, начерченную с нуля, не с чем сверять — место фотографии отдаём
   самому чертежу. */
#sketchModal.is-drawing .sketch-photo {
    display: none;
}

#sketchModal.is-drawing .sketch-body {
    grid-template-columns: 1fr;
}

/* С чего начать чертёж: готовые фигуры */
.blank-content {
    width: min(760px, 94vw);
    max-height: 92vh;
    overflow-y: auto;
}

.blank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin: 8px 0 18px;
}

.blank-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
}

.blank-card svg {
    width: 54px;
    height: 54px;
    fill: none;
    stroke: var(--metal-silver);
    stroke-width: 2.5;
}

.blank-card:hover {
    border-color: var(--accent-laser);
}

.blank-card.is-picked {
    border-color: var(--accent-laser);
    color: var(--text-light);
}

.blank-card.is-picked svg {
    stroke: var(--accent-laser);
}

.blank-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.blank-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.blank-sizes label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-dim);
}

.blank-sizes input {
    width: 120px;
}

.blank-actions .btn-primary {
    width: auto;
    margin: 0;
}

.sketch-part {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.sketch-part-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.sketch-part-body {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    align-items: start;
}

/* Распознанная деталь: контур синим, отверстия — прозрачными кружками */
.sketch-shape {
    width: 100%;
    height: auto;
    max-height: 190px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.sketch-outline {
    fill: rgba(0, 229, 255, 0.12);
    stroke: var(--accent-laser);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.sketch-hole-mark {
    fill: var(--bg-dark);
    stroke: var(--accent-laser);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.sketch-size,
.sketch-hole {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.sketch-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-dim);
}

.sketch-form input {
    width: 92px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(31, 34, 42, 0.9);
    color: var(--text-light);
    font-size: 14px;
}

.sketch-nohole,
.sketch-nogeom {
    font-size: 13px;
    color: var(--metal-silver);
}

.sketch-warnings {
    margin: 12px 0 0 18px;
    font-size: 13px;
    color: var(--accent-orange);
}

.sketch-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.sketch-hint {
    font-size: 13px;
    color: var(--text-dim);
    flex: 1 1 300px;
}

.sketch-actions .btn-primary {
    width: auto;
    margin: 0;
    padding: 14px 28px;
}

@media (max-width: 720px) {
    .sketch-body,
    .sketch-part-body {
        grid-template-columns: 1fr;
    }
}

/* Деталь, форму которой модель прочитала неуверенно (см. sketch.js) */
.sketch-part-doubtful {
    border-color: rgba(255, 133, 0, 0.5);
}

.sketch-doubt {
    background: rgba(255, 133, 0, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--accent-orange);
}

/* ===== ПРАВКА КОНТУРА РУКАМИ (см. static/js/sketch.js) ===== */

/* В режиме правки деталь занимает всю карточку: попасть в вершину на картинке
   шириной 150 px невозможно. */
.sketch-part-editing .sketch-part-body {
    grid-template-columns: 1fr;
}

.sketch-shape.is-editing {
    max-height: 52vh;
    touch-action: none;                  /* иначе палец таскает страницу, а не вершину */
}

.sketch-outline.is-bad {
    fill: rgba(255, 90, 31, 0.12);
    stroke: var(--accent-spark);
}

.sketch-vert {
    fill: var(--bg-dark);
    stroke: var(--accent-laser);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.sketch-vert.is-selected {
    fill: var(--accent-orange);
    stroke: var(--accent-orange);
}

/* Прозрачная область захвата поверх вершины — мышью в точку не попасть */
.sketch-grab {
    fill: transparent;
    cursor: grab;
}

.sketch-grab:active {
    cursor: grabbing;
}

.sketch-add {
    fill: rgba(0, 229, 255, 0.18);
    stroke: var(--accent-laser);
    stroke-width: 1.5;
    stroke-dasharray: 3 2;
    vector-effect: non-scaling-stroke;
    cursor: copy;
}

.sketch-add:hover {
    fill: rgba(0, 229, 255, 0.45);
}

.sketch-add-cross {
    stroke: var(--accent-laser);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    pointer-events: none;                /* клик должен доставаться кружку под ним */
}

.sketch-num-text {
    fill: var(--metal-silver);
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    /* тёмная подложка по контуру букв: подпись читается, даже если легла на линию */
    stroke: var(--bg-dark);
    stroke-width: 3px;
    paint-order: stroke;
}

/* Выноска до выделенного отверстия */
.sketch-dim-line {
    stroke: var(--accent-orange);
    stroke-width: 1;
    stroke-dasharray: 5 4;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.sketch-editor {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
}

.sketch-editor-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.sketch-vert-name {
    font-size: 13px;
    color: var(--text-dim);
    align-self: center;
}

.sketch-tool {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
}

.sketch-tool:hover:not(:disabled) {
    border-color: var(--accent-laser);
}

.sketch-tool:disabled {
    opacity: 0.4;
    cursor: default;
}

.sketch-tool.is-done {
    border-color: var(--accent-laser);
    color: var(--accent-laser);
}

.sketch-editor-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--text-dim);
}

.sketch-editor-problem {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--accent-spark);
}

/* Контур после ручной правки: сомнений в нём больше нет, но сказать об этом стоит */
.sketch-edited {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--metal-silver);
}

/* Отверстие: выделенное — оранжевым, уехавшее за деталь — красным (в DXF оно
   не попадёт, sketch_build его отбросит) */
.sketch-hole-mark.is-selected {
    stroke: var(--accent-orange);
    stroke-width: 3;
}

.sketch-hole-mark.is-outside {
    stroke: var(--accent-spark);
    stroke-dasharray: 4 3;
}

/* Контур собрать не удалось: говорим об этом прямо и даём, с чего начать */
/* Деталь без контура: объяснение важнее миниатюры, оно идёт во всю ширину */
.sketch-part-blank .sketch-part-body {
    grid-template-columns: 1fr;
}

.sketch-blank {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px dashed rgba(255, 133, 0, 0.5);
    border-radius: 10px;
    background: rgba(255, 133, 0, 0.07);
    color: var(--text-dim);
}

.sketch-blank p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.sketch-blank strong {
    color: var(--accent-orange);
}

.sketch-hole-drop {
    align-self: flex-end;
    padding: 6px 10px;
    font-size: 12px;
}

.sketch-hole-lost {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--accent-spark);
}

/* Холст детали: поле ввода длины ложится поверх чертежа, там же, где число */
.sketch-canvas {
    position: relative;
}

.sketch-num-hit {
    fill: transparent;
    cursor: text;
}

.sketch-num-hit:hover {
    fill: rgba(0, 229, 255, 0.12);
}

.sketch-num-input {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 76px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--accent-laser);
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    z-index: 3;
}

/* Закреплённый размер: перетаскивание точек его не сбивает */
.sketch-num.is-pinned .sketch-num-text {
    fill: var(--accent-orange);
    font-weight: 600;
}

.sketch-num.is-pinned .sketch-num-hit {
    fill: rgba(255, 133, 0, 0.12);
    stroke: rgba(255, 133, 0, 0.5);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

/* Угол наклонной стороны: пунктир вдоль горизонтали и дужка до самой стороны */
.sketch-angle-base {
    stroke: var(--metal-silver);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.sketch-angle-arc {
    fill: none;
    stroke: var(--metal-silver);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.sketch-editor-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--accent-orange);
}

/* Сторона целиком — мишень для выбора: закрепить размер или снять замок */
.sketch-edge-pick {
    stroke: transparent;
    fill: none;
    cursor: pointer;
}

.sketch-edge-pick.is-selected {
    stroke: rgba(255, 133, 0, 0.45);
}

/* Прочтения одного снимка, когда прогоны разошлись */
.sketch-variants p {
    margin: 0 0 10px;
}

.sketch-variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Куда уходит снимок — человек должен знать до загрузки, а не после */
.sketch-entry small {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--metal-silver);
}

/* Карточки статей: нужны и на странице блога, и в блоке «Из блога»
   на главной, поэтому живут в общих стилях, а не в blog.css. */

/* ===== БЛОГ: список статей ===== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(42, 46, 56, 0.2), rgba(31, 34, 42, 0.2));
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-laser);
}

.blog-card-img {
    height: 180px;
    background-color: rgba(0, 229, 255, 0.06);
    background-size: cover;
    background-position: center;
}

.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-card-date {
    font-family: 'Exo 2', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-laser);
}

.blog-card-body h3 {
    font-size: 19px;
    line-height: 1.35;
    color: var(--text-light);
}

.blog-card-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dim);
}

.blog-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.blog-empty p {
    margin-bottom: 24px;
    font-size: 16px;
}

/* Текстовые блоки посадочных страниц. Лежали в metal-calculator.css,
   но нужны и там, где калькулятора нет, — на странице раскроя и в
   разборе «JPG в DXF». */

.mc-prose {
    color: var(--text-dim);
    line-height: 1.75;
    font-size: 16px;
}

.mc-prose h3 {
    color: var(--text-light);
    font-size: 20px;
    margin: 28px 0 12px;
}

.mc-prose p {
    margin-bottom: 14px;
}

.mc-prose ul {
    margin: 0 0 16px 20px;
}

.mc-prose li {
    margin-bottom: 7px;
}

.mc-prose a {
    color: var(--accent-laser);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
}

.mc-prose a:hover {
    border-bottom-color: var(--accent-laser);
}
