
/* =========================================================
   BRIOCOM SOLUTIONS — FUTURISTIC BINARY CONVERTER
   Theme: Red | Black | White
   Responsive: Mobile, Tablet, Laptop, Desktop & 4K
   ========================================================= */

/* 1. DESIGN VARIABLES */

:root {
    color-scheme: dark;

    --bg: #080808;
    --bg-secondary: #101010;
    --surface: rgba(20, 20, 20, 0.96);
    --surface-hover: #1b1b1b;

    --primary: #e50914;
    --primary-dark: #a80710;
    --primary-light: #ff303a;
    --accent: #ff303a;

    --text: #ffffff;
    --text-muted: #b5b5b5;

    --border: rgba(229, 9, 20, 0.25);
    --border-bright: rgba(229, 9, 20, 0.7);

    --success: #ffffff;
    --danger: #ff303a;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 25px rgba(229, 9, 20, 0.07);

    --glow:
        0 0 20px rgba(229, 9, 20, 0.20);

    --container: 1200px;
}

/* 2. RESET AND GLOBAL STYLES */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    overflow-x: clip;

    background:
        radial-gradient(
            ellipse at 50% 0%,
            rgba(229, 9, 20, 0.12),
            transparent 48%
        ),
        radial-gradient(
            ellipse at 100% 50%,
            rgba(255, 255, 255, 0.025),
            transparent 38%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Space Grotesk",
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.7;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background-image:
        linear-gradient(
            rgba(229, 9, 20, 0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(229, 9, 20, 0.035) 1px,
            transparent 1px
        );

    background-size: 42px 42px;

    mask-image: linear-gradient(
        to bottom,
        black,
        transparent 85%
    );
}

/* Keep normal page content above the decorative grid. */
body > * {
    position: relative;
    z-index: 1;
}

::selection {
    color: #ffffff;
    background: var(--primary-dark);
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
select {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 4px;
}

/* 3. DASHBOARD BUTTON */

.dashboard-back {
    width: 100%;
    max-width: 1500px;

    margin-inline: auto;
    padding: 22px clamp(16px, 4vw, 48px) 0;
}

.dashboard-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 46px;
    max-width: 100%;
    padding: 10px 19px;

    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;

    background: rgba(229, 9, 20, 0.08);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.dashboard-back-btn:hover {
    background: rgba(229, 9, 20, 0.18);
    border-color: var(--primary-light);
    box-shadow: var(--glow);
    transform: translateY(-2px);
}

/* 4. HERO SECTION */

.hero {
    position: relative;
    isolation: isolate;

    display: grid;
    place-items: center;

    width: 100%;
    min-height: clamp(260px, 35vw, 410px);

    padding: clamp(50px, 8vw, 100px) 20px;
    text-align: center;
}

.hero::before {
    content: "";
    position: absolute;
    z-index: -1;

    width: min(75vw, 550px);
    aspect-ratio: 1;

    background: rgba(229, 9, 20, 0.13);
    filter: blur(90px);
    border-radius: 50%;
    pointer-events: none;
}

.hero-content {
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
}

.hero h1 {
    font-family: "Orbitron", "Segoe UI", sans-serif;
    font-size: clamp(2.1rem, 6vw, 4.7rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: clamp(-2px, -0.1vw, -0.5px);

    overflow-wrap: anywhere;
    margin-bottom: 24px;
}

.hero h1 span,
.section-title h2 span {
    color: var(--primary-light) !important;

    text-shadow:
        0 0 12px rgba(229, 9, 20, 0.35),
        0 0 28px rgba(229, 9, 20, 0.15);
}

.hero p {
    max-width: 660px;
    margin: 0 auto;

    color: var(--text-muted);
    font-size: clamp(0.95rem, 2vw, 1.12rem);
    line-height: 1.9;
}

/* 5. GENERAL SECTIONS */

.section {
    width: 100%;
    max-width: 1320px;

    margin-inline: auto;

    padding:
        clamp(35px, 6vw, 76px)
        clamp(16px, 4vw, 48px);
}

.section-title {
    max-width: 800px;
    margin: 0 auto clamp(28px, 5vw, 48px);
    text-align: center;
}

.section-title h2,
.binary-converter h2 {
    font-family: "Orbitron", "Segoe UI", sans-serif;
    font-size: clamp(1.45rem, 3.5vw, 2.3rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.section-title h2 span {
    color: var(--primary-light);
}

.section-title p {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: clamp(0.92rem, 2vw, 1.05rem);
}

/* 6. CONVERTER PANEL */

.binary-converter {
    position: relative;
    isolation: isolate;

    width: 100%;
    max-width: 850px;
    min-width: 0;
    margin-inline: auto;

    padding: clamp(20px, 5vw, 46px);

    background:
        linear-gradient(
            145deg,
            rgba(25, 25, 25, 0.98),
            rgba(10, 10, 10, 0.99)
        );

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow:
        var(--shadow),
        inset 0 1px rgba(255, 255, 255, 0.035);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.binary-converter::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 12%;
    right: 12%;
    height: 2px;

    background: linear-gradient(
        90deg,
        transparent,
        var(--primary),
        #ffffff,
        var(--primary),
        transparent
    );

    opacity: 0.9;
}

.binary-converter h2 {
    margin-bottom: 12px;
}

.binary-converter > p {
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 7. INPUT GROUPS */

.converter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;

    width: 100%;
    min-width: 0;
    margin-bottom: 25px;
}

.converter-group label,
.converter-result label {
    color: #f1f1f1;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.converter-group select,
.converter-group textarea {
    display: block;

    width: 100%;
    min-width: 0;

    color: var(--text);
    background: #0b0b0b;

    border: 1px solid rgba(229, 9, 20, 0.30);
    border-radius: var(--radius-sm);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.converter-group select {
    min-height: 52px;
    padding: 12px 42px 12px 15px;

    appearance: none;
    -webkit-appearance: none;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ff303a' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

.converter-group select option {
    color: #ffffff;
    background: #111111;
}

.converter-group textarea {
    min-height: 155px;
    padding: 16px;

    resize: vertical;
    line-height: 1.7;

    overflow-wrap: anywhere;
    word-break: break-word;

    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 0.94rem;
}

.converter-group textarea::placeholder {
    color: #888888;
    opacity: 1;
}

.converter-group select:hover,
.converter-group textarea:hover {
    border-color: rgba(229, 9, 20, 0.65);
}

.converter-group select:focus,
.converter-group textarea:focus {
    outline: none;

    border-color: var(--primary-light);
    background-color: #111111;

    box-shadow:
        0 0 0 3px rgba(229, 9, 20, 0.13),
        0 0 20px rgba(229, 9, 20, 0.08);
}

/* 8. CONVERTER BUTTONS */

.converter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    width: 100%;
    margin-top: 8px;
    margin-bottom: 30px;
}

.converter-buttons button,
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 48px;
    max-width: 100%;
    padding: 12px 22px;

    border-radius: var(--radius-sm);
    font-size: 0.94rem;
    font-weight: 700;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.convert-btn {
    flex: 1 1 180px;

    color: #ffffff;
    background: linear-gradient(
        110deg,
        #a80710,
        #e50914,
        #ff303a
    );

    border: 1px solid transparent;

    box-shadow:
        0 5px 22px rgba(229, 9, 20, 0.20);
}

.convert-btn:hover {
    background: linear-gradient(
        110deg,
        #c40812,
        #f01822,
        #ff454d
    );

    box-shadow:
        0 6px 26px rgba(229, 9, 20, 0.30);

    transform: translateY(-2px);
}

.clear-btn {
    flex: 1 1 130px;

    color: #ffffff;
    background: #171717;

    border: 1px solid #444444;
}

.clear-btn:hover {
    color: #ffffff;
    background: rgba(229, 9, 20, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.08);
}

.converter-buttons button:active,
.copy-btn:active,
.dashboard-back-btn:active {
    transform: scale(0.98);
}

/* 9. RESULT PANEL */

.converter-result {
    display: flex;
    flex-direction: column;
    gap: 13px;

    width: 100%;
    min-width: 0;
    margin-top: 8px;
}

.result-box {
    width: 100%;
    min-width: 0;
    min-height: 110px;

    padding: 17px;

    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            rgba(229, 9, 20, 0.08),
            rgba(255, 255, 255, 0.015)
        );

    border: 1px solid rgba(229, 9, 20, 0.35);
    border-radius: var(--radius-sm);

    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;

    font-size: 0.93rem;
    line-height: 1.9;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: auto;
}

.copy-btn {
    align-self: flex-start;
    max-width: 100%;

    color: #ffffff;
    background: #171717;
    border: 1px solid rgba(229, 9, 20, 0.65);
}

.copy-btn:hover {
    color: #ffffff;
    background: rgba(229, 9, 20, 0.18);
    border-color: var(--primary-light);
    box-shadow: var(--glow);
}

/* 10. INFORMATION CARDS */

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: clamp(14px, 2vw, 24px);
    width: 100%;
}

.converter-info {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
    position: relative;

    min-width: 0;
    height: 100%;
    padding: clamp(20px, 3vw, 30px);

    background:
        linear-gradient(
            145deg,
            rgba(25, 25, 25, 0.98),
            rgba(12, 12, 12, 0.98)
        );

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-md);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.service-card::before {
    content: "";
    display: block;

    width: 40px;
    height: 3px;
    margin-bottom: 20px;

    background: linear-gradient(
        90deg,
        var(--primary),
        #ffffff
    );

    border-radius: 10px;
}

.service-card:hover {
    transform: translateY(-5px);

    background: var(--surface-hover);
    border-color: var(--border-bright);

    box-shadow: var(--glow);
}

.service-card h3 {
    margin-bottom: 12px;

    color: #ffffff;
    font-family: "Orbitron", "Segoe UI", sans-serif;

    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

/* 11. FOOTER */

.footer {
    width: 100%;
    margin-top: 40px;

    background: rgba(8, 8, 8, 0.96);
    border-top: 1px solid var(--border);
}

.footer-bottom {
    width: 100%;
    padding: 25px 16px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.86rem;
}

/* 12. REVEAL EFFECT */

.reveal {
    animation: revealUp 0.65s ease both;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 13. LARGE SCREENS AND 4K */

@media (min-width: 1600px) {
    body {
        font-size: 17px;
    }

    .hero {
        min-height: 440px;
    }

    .section {
        max-width: 1450px;
    }

    .binary-converter {
        max-width: 900px;
    }
}

/* 14. TABLETS AND SMALL LAPTOPS */

@media (max-width: 1000px) {
    .cards,
    .converter-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        min-height: 300px;
    }

    .section {
        padding-inline: clamp(20px, 4vw, 36px);
    }
}

/* 15. PHONES */

@media (max-width: 600px) {
    body {
        font-size: 15px;
        line-height: 1.7;
    }

    .dashboard-back {
        padding: 16px 16px 0;
    }

    .dashboard-back-btn {
        width: 100%;
        min-height: 46px;
        padding: 11px 14px;
        font-size: 0.9rem;
    }

    .hero {
        min-height: auto;
        padding: 58px 20px 45px;
    }

    .hero h1 {
        font-size: clamp(2rem, 9vw, 3rem);
        margin-bottom: 18px;
    }

    .hero p {
        font-size: 0.94rem;
        line-height: 1.8;
    }

    .section {
        padding: 32px 16px;
    }

    .section-title {
        margin-bottom: 26px;
    }

    .section-title h2,
    .binary-converter h2 {
        font-size: clamp(1.35rem, 6vw, 1.8rem);
    }

    .binary-converter {
        padding: 22px 17px;
        border-radius: 17px;
    }

    .binary-converter > p {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    .converter-group {
        margin-bottom: 22px;
    }

    .converter-group select {
        min-height: 50px;
        font-size: 16px;
    }

    .converter-group textarea {
        min-height: 135px;
        font-size: 16px;
    }

    .converter-buttons {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 11px;
    }

    .converter-buttons button,
    .copy-btn {
        width: 100%;
        min-height: 48px;
        padding: 12px 16px;
    }

    .copy-btn {
        align-self: stretch;
    }

    .result-box {
        min-height: 100px;
        padding: 13px;
        font-size: 0.86rem;
    }

    .cards,
    .converter-info {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .service-card {
        padding: 22px;
    }

    .service-card:hover {
        transform: none;
    }

    .footer {
        margin-top: 20px;
    }
}

/* 16. VERY SMALL PHONES */

@media (max-width: 360px) {
    .hero {
        padding-inline: 14px;
    }

    .section {
        padding-inline: 12px;
    }

    .binary-converter {
        padding: 18px 13px;
    }

    .dashboard-back {
        padding-inline: 12px;
    }

    .service-card {
        padding: 18px;
    }

    .result-box {
        padding: 10px;
        font-size: 0.8rem;
    }
}

/* 17. ACCESSIBILITY: REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
