:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text: #c9d1d9;
    --text-muted: #8b949e;
    --primary: #58a6ff;
    --border: #30363d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.highlight {
    color: var(--primary);
    font-family: 'Space Mono', monospace;
}

.subtitle {
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover,
.stat-card:focus {
    transform: translateY(-5px);
    border-color: var(--primary);
    outline: none;
}

.main-stat {
    grid-column: 1 / -1;
    padding: 3rem 1.5rem;
    background: linear-gradient(180deg, #1f2428 0%, #161b22 100%);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.1);
}

.label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.value-group {
    font-family: 'Space Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.value-group.small {
    font-size: 1.5rem;
}

.x {
    color: var(--text-muted);
    font-size: 0.5em;
}

.desc {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.value.single {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.unit {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Calculator */
.calculator-section,
.presets-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.calculator-section h2,
.presets-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.calc-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input {
    background: #0d1117;
    border: 1px solid var(--border);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    width: 120px;
    text-align: center;
    outline: none;
}

input:focus {
    border-color: var(--primary);
}

.result-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
    padding-bottom: 0.2rem;
}

.calc-result {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* Presets */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.preset-btn {
    background: #0d1117;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.preset-btn:hover,
.preset-btn:focus {
    border-color: var(--primary);
    color: white;
    background: #1f2428;
    outline: none;
}