/* ---------------------------------------------------------
   Reset & base
--------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #ffffff;
    --color-surface: #f6f7f9;
    --color-border: #e3e6ea;
    --color-text: #1c2126;
    --color-text-muted: #5b6470;
    --color-accent: #1f6f5c;
    --color-accent-dark: #165645;
    --color-accent-light: #e7f2ef;
    --radius: 10px;
    --max-width: 1080px;
    --font-body: 'Signika', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 56px 0;
}

section.alt {
    background: var(--color-surface);
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.section-intro {
    color: var(--color-text-muted);
    max-width: 640px;
    margin-bottom: 32px;
}

.mono {
    font-family: var(--font-mono);
}

/* ---------------------------------------------------------
   Header / Navigation
--------------------------------------------------------- */
header.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.2px;
}

.brand span {
    color: var(--color-accent);
}

nav.main-nav ul {
    display: flex;
    gap: 28px;
}

nav.main-nav a {
    color: var(--color-text);
    font-weight: 500;
}

nav.main-nav a.active,
nav.main-nav a:hover {
    color: var(--color-accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--color-text);
    display: block;
}

/* ---------------------------------------------------------
   Tool section
--------------------------------------------------------- */
.tool-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
}

.tool-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 20px;
}

.tool-form .field {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-form label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.tool-form input[type="number"] {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    color: var(--color-text);
}

.tool-form input[type="number"]:focus {
    outline: none;
    border-color: var(--color-accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    background: var(--color-accent-dark);
    text-decoration: none;
}

.result-box {
    margin-top: 24px;
    padding: 24px;
    background: var(--color-accent-light);
    border: 1px solid var(--color-accent);
    border-radius: 8px;
}

.result-box .result-value {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--color-accent-dark);
    font-weight: 700;
    display: block;
    margin: 6px 0 10px;
}

.result-box .result-words {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.error-box {
    margin-top: 24px;
    padding: 16px 20px;
    background: #fdecea;
    border: 1px solid #f1b0b0;
    border-radius: 8px;
    color: #8a2f2f;
}

/* ---------------------------------------------------------
   Benefit cards
--------------------------------------------------------- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.benefit-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 22px;
}

.benefit-card h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.benefit-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ---------------------------------------------------------
   How to use / steps
--------------------------------------------------------- */
.steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.step-content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.step-content p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ---------------------------------------------------------
   FAQ
--------------------------------------------------------- */
.faq-item {
    border-bottom: 1px solid var(--color-border);
    padding: 18px 0;
}

.faq-item h3 {
    font-size: 1.02rem;
    margin-bottom: 6px;
}

.faq-item p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ---------------------------------------------------------
   Table (Popular conversions)
--------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

table.conversion-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

table.conversion-table thead th {
    background: var(--color-surface);
    text-align: left;
    padding: 12px 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

table.conversion-table tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

table.conversion-table tbody tr:last-child td {
    border-bottom: none;
}

table.conversion-table tbody tr:hover {
    background: var(--color-surface);
}

.num-cell {
    font-family: var(--font-mono);
    white-space: nowrap;
}

.num-cell a {
    color: var(--color-accent-dark);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed var(--color-accent);
    padding-bottom: 1px;
}

.num-cell a:hover {
    color: var(--color-accent);
    border-bottom-style: solid;
    text-decoration: none;
}

.refresh-note {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
footer.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 32px 0;
    background: var(--color-surface);
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-wrap p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 800px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    section {
        padding: 40px 0;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.35rem;
    }

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

    nav.main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        display: none;
    }

    nav.main-nav.open {
        display: block;
    }

    nav.main-nav ul {
        flex-direction: column;
        padding: 16px 24px;
        gap: 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .tool-form {
        flex-direction: column;
    }

    .footer-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
}
