:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #3b82f6;
    --background: #fafafa;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 20px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.hidden {
    display: none !important;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

.small-container {
    max-width: 800px;
}

/* Hero Section */
.hero {
    padding: 80px 0 100px;
}

header {
    text-align: center;
    margin-bottom: 60px;
}

header h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 16px;
}

header h1 span {
    color: var(--text-muted);
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.02) 100%);
    padding: 0 16px;
    border-radius: 12px;
    display: inline-block;
}

header p {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Calculator Card */
.calculator-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 40px;
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    background: #f1f5f9;
    padding: 12px;
    border-radius: 24px;
}

.input-group input {
    flex: 1;
    border: none;
    background: white;
    padding: 20px 24px;
    font-size: 2rem;
    font-weight: 700;
    border-radius: 16px;
    outline: none;
    width: 0;
    /* allows flex box to shrink */
    min-width: 100px;
    color: var(--primary);
}

.input-group select {
    width: 180px;
    padding: 0 20px;
    border: none;
    background: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.result-box {
    background: #f8fafc;
    padding: 24px;
    border-radius: 24px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.result-box:hover {
    background: white;
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.05);
}

.result-box.highlight {
    background: var(--primary);
    color: white;
}

.result-box .label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 8px;
    opacity: 0.7;
}

.result-box .value {
    font-size: 1.75rem;
    font-weight: 800;
    display: block;
}

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

.secondary-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Content Section */
.content {
    background: white;
    border-top: 1px solid var(--border);
    padding: 100px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
}

.info-block h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.info-block p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.examples {
    list-style: none;
}

.examples li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.math-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: 20px;
    display: grid;
    gap: 8px;
}

.math-card code {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--text-main);
    display: block;
}

/* Related Section */
.related-section {
    margin-top: 80px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
    text-align: center;
}

.related-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 800;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.related-links a {
    padding: 10px 18px;
    background: #f1f5f9;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.related-links a:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Footer */
footer {
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--background);
}

footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 640px) {
    .hero {
        padding: 40px 0 60px;
    }

    .calculator-card {
        padding: 24px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group select {
        width: 100%;
        height: 60px;
    }

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

    .info-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .related-links {
        flex-direction: column;
    }
}