:root {
    --primary-color: #0693e3;
    --secondary-color: #9b51e0;
    --bg-dark: #0a0a0a;
    --bg-card: #161616;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 12px;
    --needle-color: #e2e8f0;
}

body.light-mode {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
    --needle-color: #475569;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s;
}

.container { max-width: 1300px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header { background: rgba(10, 10, 10, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); padding: 1rem 0; position: sticky; top: 0; z-index: 100; }
.site-header__container { display: flex; justify-content: space-between; align-items: center; }
.site-header__logo { height: 40px; }
.site-header__title { font-size: 1.25rem; font-weight: 800; color: #fff; }
.site-header__subtitle { font-size: 0.85rem; color: var(--text-secondary); }
.site-header__actions { display: flex; gap: 0.75rem; align-items: center; }

/* Buttons */
.btn { padding: 0.5rem 1rem; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.2s; text-decoration: none; }
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--primary-color); color: #fff; }
.btn--secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn--small { font-size: 0.85rem; }
.btn--icon { width: 40px; height: 40px; justify-content: center; border-radius: 50%; }

/* Taper Layout */
.taper-engine { padding: 4rem 0; }
.taper-layout { display: grid; grid-template-columns: 350px 1fr; gap: 3rem; }

.control-panel { display: flex; flex-direction: column; gap: 2rem; }
.control-section { background: var(--bg-card); padding: 1.5rem; border-radius: 20px; border: 1px solid var(--border-color); }
.control-section h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; color: var(--primary-color); margin-bottom: 1.5rem; }

.taper-selector { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.taper-btn { padding: 1rem; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 12px; color: var(--text-primary); cursor: pointer; text-align: left; display: flex; flex-direction: column; transition: all 0.2s; }
.taper-btn.active { border-color: var(--primary-color); background: rgba(6, 147, 227, 0.1); }
.taper-label { font-weight: 700; font-size: 0.9rem; }
.taper-val { font-size: 0.75rem; color: var(--text-secondary); }

.form-select { width: 100%; padding: 0.75rem; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); font-size: 1rem; }

.range-input { width: 100%; margin-bottom: 0.5rem; cursor: pointer; }
.range-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }

/* Visualizer Stage */
.visualizer-stage { display: flex; flex-direction: column; gap: 2rem; }
.canvas-container { background: var(--bg-card); border-radius: 24px; border: 1px solid var(--border-color); overflow: hidden; position: relative; min-height: 500px; box-shadow: inset 0 0 40px rgba(0,0,0,0.5); }

#taper-svg { width: 100%; height: 100%; }

.skin-epidermis { fill: #fecaca; opacity: 0.3; }
.skin-dermis { fill: #f87171; opacity: 0.15; }
.layer-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; fill: var(--text-secondary); font-weight: 700; }

.needle-outline { fill: var(--needle-color); stroke: var(--primary-color); stroke-width: 1; transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.impact-glow { fill: var(--primary-color); opacity: 0.3; filter: blur(5px); }

.measure-line { stroke: var(--secondary-color); stroke-width: 2; stroke-dasharray: 4; }
.measure-text { font-family: 'JetBrains Mono', monospace; font-size: 14px; fill: var(--secondary-color); font-weight: 700; }

/* Analysis Grid */
.analysis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.analysis-card { background: var(--bg-card); padding: 1.5rem; border-radius: 16px; border: 1px solid var(--border-color); }
.analysis-label { display: block; font-size: 0.75rem; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 0.75rem; }
.analysis-val { font-size: 1.25rem; font-weight: 800; color: #fff; }
.analysis-val-text { font-size: 1.1rem; font-weight: 600; color: var(--primary-color); }

.rating-bar { height: 8px; background: var(--bg-dark); border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem; }
.rating-fill { height: 100%; transition: width 0.5s; }
.trauma-low { background: #10b981; }
.trauma-high { background: #ef4444; }
.ink-optimal { background: var(--primary-color); }

/* Footer */
.site-footer { background: #000; padding: 4rem 0; border-top: 1px solid var(--border-color); margin-top: 4rem; }
.site-footer__content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem; margin-bottom: 3rem; }
.site-footer__logo { height: 60px; margin-bottom: 1rem; }
.site-footer__bottom { text-align: center; border-top: 1px solid var(--border-color); padding-top: 2rem; color: var(--text-secondary); font-size: 0.9rem; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(5px); }
.modal-content { background: var(--bg-card); padding: 2.5rem; border-radius: 24px; max-width: 650px; width: 90%; border: 2px solid var(--primary-color); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.modal-close { font-size: 3rem; cursor: pointer; color: var(--text-secondary); line-height: 1; }
.code-container { background: #000; padding: 1.5rem; border-radius: 12px; margin: 1.5rem 0; }
.embed-code-textarea { width: 100%; background: transparent; border: none; color: #4ade80; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; height: 100px; resize: none; }

@media (max-width: 900px) {
    .taper-layout { grid-template-columns: 1fr; }
    .analysis-grid { grid-template-columns: 1fr; }
}
