/* ============================================================
   ASSEMBLY — 3D configurator page
   Matches the warm-monochrome editorial language of style.css.
   Tokens come from :root in style.css.
   ============================================================ */

.assembly-body {
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* nav variant — solid backdrop instead of transparent
   so the 3D canvas underneath doesn't bleed through */
.nav-assembly {
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--border);
}
.nav-active {
    color: var(--text) !important;
    font-weight: 500;
}
.nav-active::after {
    content: "";
    display: block;
    height: 1px;
    width: 100%;
    background: var(--text);
    margin-top: 2px;
    opacity: 0.5;
}

/* ---------- stage ---------- */
.assembly-stage {
    padding: 120px 32px 48px;
    max-width: 1640px;
    margin: 0 auto;
}

.assembly-header {
    max-width: 820px;
    margin: 0 auto 56px;
    text-align: center;
}
.assembly-tag {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.32em;
    color: var(--text-muted);
    margin-bottom: 24px;
    text-transform: uppercase;
}
.assembly-title {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(48px, 7vw, 96px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 28px;
}
.assembly-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}
.assembly-sub {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- two-column shell: viewport + control panel ---------- */
.config-shell {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .config-shell {
        grid-template-columns: 1fr;
    }
    .assembly-stage { padding: 100px 16px 32px; }
}

/* CTA below the entire shell */
.config-cta {
    margin: 56px auto 0;
    max-width: 540px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.config-cta-note {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 420px;
}

/* ---------- viewport (3D canvas) ---------- */
.viewport {
    position: relative;
    aspect-ratio: 16 / 11;
    border-radius: 4px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 55% at 50% 28%, rgba(255, 244, 224, 0.05), transparent 72%),
        radial-gradient(ellipse 90% 70% at 50% 100%, rgba(10, 10, 14, 0.6), transparent 70%),
        var(--bg-card);
    border: 1px solid var(--border);
    min-height: 540px;
}
.viewport canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}
.viewport canvas:active { cursor: grabbing; }

/* HUD overlays floating on the canvas */
.viewport-overlay {
    position: absolute;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--sans);
    z-index: 2;
}
.viewport-overlay-tl { top: 16px; left: 18px; }
.viewport-overlay-tr { top: 16px; right: 18px; align-items: flex-end; text-align: right; }
.viewport-overlay-bl { bottom: 16px; left: 18px; }
.viewport-overlay-br { bottom: 16px; right: 18px; align-items: flex-end; }

.hud-label {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.28em;
    color: rgba(232, 230, 227, 0.4);
    text-transform: uppercase;
}
.hud-value {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 22px;
    color: var(--text);
    letter-spacing: -0.005em;
    font-feature-settings: "tnum" 1;
}
.viewport-overlay-br .hud-label {
    font-size: 9px;
    letter-spacing: 0.22em;
}

/* view buttons clustered bottom-center */
.view-toggles {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    display: flex;
    gap: 1px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    z-index: 2;
}
.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.view-btn:hover {
    color: var(--text);
}
.view-btn-active {
    color: var(--bg);
    background: var(--text);
}

/* ---------- control panel ---------- */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 26px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    align-self: start;
    position: sticky;
    top: 96px;
}

.control-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.control-block-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 2px;
}
.control-num {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.24em;
    color: var(--text-muted);
}
.control-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 22px;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.005em;
}
.control-help {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 300;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 2px;
}

/* slider */
.slider-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}
.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 2px;
    background: rgba(255,255,255,0.10);
    border-radius: 999px;
    outline: none;
    margin: 0;
    cursor: pointer;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text);
    border: 0;
    cursor: grab;
    transition: transform 0.15s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text);
    border: 0;
    cursor: grab;
}
.slider-value {
    min-width: 56px;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--text);
    text-align: right;
    font-feature-settings: "tnum" 1;
}

.slider-track-marks {
    display: flex;
    justify-content: space-between;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 300;
    color: rgba(232, 230, 227, 0.3);
    letter-spacing: 0.08em;
    margin-top: 2px;
    padding: 0 2px;
}
.slider-track-marks-numbered span {
    flex: 1;
    text-align: center;
}

/* toggle row */
.toggle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 4px;
}
.toggle-btn {
    background: transparent;
    color: var(--text-muted);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    padding: 9px 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.toggle-btn:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.15);
}
.toggle-btn-active {
    color: var(--bg);
    background: var(--text);
    border-color: var(--text);
}

/* parts list / BOM */
.bom {
    border-top: 1px solid var(--border);
    padding-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bom-title {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.bom-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.bom-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--sans);
    font-size: 12px;
    line-height: 1.4;
}
.bom-label {
    color: var(--text-muted);
    font-weight: 300;
}
.bom-val {
    color: var(--text);
    font-weight: 400;
    font-feature-settings: "tnum" 1;
}

/* ---------- finish (color pickers) ---------- */
.finish-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.finish-swatch {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.finish-swatch:hover { border-color: rgba(255,255,255,0.15); }
.finish-swatch input[type=color] {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}
.finish-swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.finish-swatch input[type=color]::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}
.finish-swatch input[type=color]::-moz-color-swatch {
    border: 0;
    border-radius: 50%;
}
.finish-swatch-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.finish-swatch-label {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 400;
    color: var(--text);
}
.finish-swatch-hex {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    font-feature-settings: "tnum" 1;
}

/* CTA button (now lives below the shell) */
.btn-cfg {
    text-align: center;
    padding: 16px 36px;
    font-size: 11px;
    letter-spacing: 0.28em;
    min-width: 240px;
}
