/* Nicoma Tools — shared base styles
   Aesthetic: German editorial precision — warm, trustworthy, refined */

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

:root {
    /* Warm slate palette — not the generic blue */
    --color-bg: #fafaf8;
    --color-text: #1c1917;
    --color-muted: #78716c;
    --color-primary: #0f766e;
    --color-primary-hover: #0d9488;
    --color-primary-soft: rgba(15, 118, 110, 0.08);
    --color-border: #e7e5e4;
    --color-surface: #ffffff;
    --color-surface-raised: #ffffff;
    --color-accent: #d97706;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: "SF Mono", SFMono-Regular, "Cascadia Code", Menlo, monospace;
    --max-width: 720px;
    --radius: 6px;
    --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 2px 8px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 4px 16px rgba(28, 25, 23, 0.08), 0 2px 4px rgba(28, 25, 23, 0.04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0c0a09;
        --color-text: #e7e5e4;
        --color-muted: #a8a29e;
        --color-primary: #2dd4bf;
        --color-primary-hover: #5eead4;
        --color-primary-soft: rgba(45, 212, 191, 0.08);
        --color-border: #292524;
        --color-surface: #1c1917;
        --color-surface-raised: #211f1d;
        --color-accent: #fbbf24;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
        --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

html {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Typography — tighter, more editorial */
h1, h2, h3 {
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 700;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}
h2 {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
}
h3 {
    font-size: 1.0625rem;
}

p {
    margin-bottom: 1rem;
    color: var(--color-muted);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    text-underline-offset: 2px;
}
a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
}

/* Form elements — refined with subtle depth */
input, select, button {
    font-family: inherit;
    font-size: 0.9375rem;
    border-radius: var(--radius);
}

input, select {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

input::placeholder {
    color: var(--color-muted);
    opacity: 0.6;
}

button {
    padding: 0.6875rem 1.25rem;
    border: none;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.01em;
}
button:hover {
    background: var(--color-primary-hover);
}
button:active {
    transform: scale(0.98);
}

/* Cards — real depth instead of flat borders */
.card {
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.result {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    padding: 1.5rem;
}

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-muted);
    font-size: 0.8125rem;
    border-top: 1px solid var(--color-border);
}

/* Selection color */
::selection {
    background: var(--color-primary-soft);
    color: var(--color-text);
}

/* Scrollbar refinement */
@supports (scrollbar-width: thin) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--color-border) transparent;
    }
}
