/* CSS Variables */
:root {
    --bg: #0b0f12;
    /* near-black */
    --card: #0f1720;
    /* slightly lighter */
    --accent: #5ef0ff;
    /* cyan neon */
    --accent-2: #8cff6b;
    /* green neon */
    --muted: #9aa6b2;
    --glass: rgba(255, 255, 255, 0.03);
    --radius: 10px;
    --mono: 'SFMono-Regular', 'Roboto Mono', 'Menlo', 'Monaco', monospace;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    background: radial-gradient(1200px 600px at 10% 10%, rgba(94, 240, 255, 0.02), transparent),
        radial-gradient(800px 400px at 90% 90%, rgba(140, 255, 107, 0.02), transparent),
        var(--bg);
    color: #e6eef3;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Mobile-first lateral padding */
    padding: 20px 15px;
}

/* Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline-offset: 3px;
}

/* Component Styles */

/* Layout */
.container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
    margin: 12px auto;
    width: 100%;
    padding: 0;
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(94, 240, 255, 0.06);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(2, 6, 10, 0.6), 0 0 18px rgba(94, 240, 255, 0.02) inset;
}

.presentation {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.presentation__title {
    font-family: var(--mono);
    letter-spacing: 1px;
    margin: 0 0 6px;
    font-size: 1.6rem;
    color: var(--accent);
}

.presentation__subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Form */
.form {
    flex: 1;
}

.form__fields {
    border: 0;
    padding: 0;
    margin: 0;
}

.form__row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.form__legend {
    font-weight: bold;
    color: var(--muted);
    margin-bottom: 8px;
}

.form__label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.form__input {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--accent-2);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 0.98rem;
    outline: none;
    transition: box-shadow 150ms ease, border-color 150ms ease, transform 80ms ease;
}

.form__input:focus {
    box-shadow: 0 0 18px rgba(94, 240, 255, 0.12);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.form__input--numeric::-webkit-outer-spin-button,
.form__input--numeric::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Result */
.result {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
}

.result__title {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.result__text {
    font-family: var(--mono);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-2);
    margin: 0;
}

.result__text--alt {
    font-size: 1.2rem;
    font-weight: 400;
}

/* Prominent result card styling */
.result.card {
    align-self: stretch;
    background: linear-gradient(180deg, rgba(94, 240, 255, 0.02), rgba(140, 255, 107, 0.01));
    border: 1px solid rgba(94, 240, 255, 0.12);
    box-shadow: 0 10px 40px rgba(2, 6, 10, 0.65), 0 0 30px rgba(94, 240, 255, 0.04) inset;
    padding: 18px;
}

/* Footer */
.footer__site-footer {
    width: 100%;
    text-align: center;
    background: transparent;
}

.footer__text {
    color: var(--muted);
    font-size: 0.9rem;
}

.footer__text a {
    color: var(--accent);
    text-decoration: none;
    transition: color 150ms ease;
}

.footer__text a:hover {
    color: var(--accent-2);
}

/* Small Helpers */
.card[aria-hidden="true"] {
    opacity: 0.6;
}

/* Media Queries */

/* Desktop: give result card a fixed minimum width and allow it to occupy space visually */
@media (min-width: 720px) {
    .form {
        flex: 1 1 60%;
    }

    .result {
        flex: 0 0 34%;
        max-width: 360px;
        align-items: flex-start;
    }
}

/* Desktop / larger screens */
@media (min-width: 720px) {
    body {
        padding: 40px;
    }

    .container {
        flex-direction: row;
        gap: 24px;
        max-width: 900px;
        margin: 24px auto;
        width: 100%;
    }

    .card {
        padding: 18px;
    }

    .presentation {
        max-width: 900px;
    }

    .result {
        min-width: 260px;
    }
}

/* Reduce/adjust decorative lines on small screens to avoid visual clutter and overflow */
@media (max-width: 480px) {

    body::before,
    body::after {
        width: min(72vw, 280px);
        opacity: 0.06;
    }

    body::before {
        top: 10vh;
        left: 8vw;
    }

    body::after {
        bottom: 6vh;
        right: 6vw;
    }
}

/* Hide on very small devices or when reduced motion is preferred */
@media (max-width: 360px),
(prefers-reduced-motion: reduce) {

    body::before,
    body::after {
        opacity: 0;
        display: none;
    }
}