:root {
    --bg: #090d14;
    --bg-soft: #0d131d;
    --card: #111925;
    --card-hover: #151f2d;
    --border: #243143;

    --text: #edf3fb;
    --muted: #8492a6;

    --accent: #65e6a5;
    --accent-soft: rgba(101, 230, 165, 0.1);

    --danger: #ff6b7a;

    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(101, 230, 165, 0.08),
            transparent 32rem
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}


/* Header */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(9, 13, 20, 0.88);
    backdrop-filter: blur(16px);

    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    min-height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: var(--accent);
    color: #07120d;

    font-weight: 900;
}

.brand strong {
    display: block;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

nav {
    display: flex;
    gap: 24px;
}

nav a {
    color: var(--muted);
    font-size: 14px;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

nav a:hover {
    color: var(--text);
    transform: translateY(-1px);
}


/* Hero */

.hero {
    min-height: 620px;

    display: flex;
    align-items: center;

    border-bottom: 1px solid var(--border);

    background-image:
        linear-gradient(
            rgba(101, 230, 165, 0.025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(101, 230, 165, 0.025) 1px,
            transparent 1px
        );

    background-size: 42px 42px;
}

.eyebrow {
    display: inline-block;

    padding: 6px 10px;

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--accent);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.hero h1 {
    margin: 26px 0 20px;

    max-width: 850px;

    font-size: clamp(44px, 7vw, 82px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-text {
    max-width: 650px;

    color: var(--muted);

    font-size: 19px;
}

.hero-actions {
    margin-top: 34px;

    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}


/* Buttons */

.button {
    border: 0;
    border-radius: 10px;

    padding: 12px 18px;

    font: inherit;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    background: var(--accent);
    color: #07120d;
}

.button.primary:hover {
    background: #82efb9;
}

.button.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.button.secondary:hover {
    border-color: #3b4c62;
}


/* Sections */

.section {
    padding: 110px 0;
    border-bottom: 1px solid var(--border);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 40px;

    margin-bottom: 36px;
}

.section-heading h2 {
    margin: 6px 0 0;

    font-size: 34px;
    letter-spacing: -0.035em;
}

.section-heading p {
    max-width: 360px;
    margin: 0;

    color: var(--muted);
}

.section-number {
    color: var(--accent);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}


/* Cards */

.tool-card,
.about-card {
    padding: 28px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--card);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    gap: 14px;

    align-items: end;
}

label {
    display: block;

    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

input,
select {
    width: 100%;

    margin-top: 8px;
    padding: 13px 14px;

    border: 1px solid var(--border);
    border-radius: 9px;

    outline: none;

    background: var(--bg-soft);
    color: var(--text);

    font: inherit;
    font-size: 15px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input:focus,
select:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px var(--accent-soft);
}

.calculate-btn {
    height: 47px;
}


/* Results */

.result-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-top: 22px;
}

.result {
    min-height: 94px;

    padding: 17px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--bg-soft);
}

.result span {
    display: block;

    margin-bottom: 8px;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result strong {
    display: block;

    overflow-wrap: anywhere;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 15px;
}

.result.wide {
    grid-column: span 2;
}


/* Errors */

.error {
    margin-top: 16px;

    padding: 12px 14px;

    border: 1px solid rgba(255, 107, 122, 0.3);
    border-radius: 9px;

    background: rgba(255, 107, 122, 0.08);

    color: var(--danger);

    font-size: 13px;
}

.hidden {
    display: none;
}


/* Table */

.table-wrapper {
    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;

    min-width: 600px;
}

th,
td {
    padding: 14px 18px;

    border-bottom: 1px solid var(--border);

    text-align: left;
}

th {
    color: var(--muted);

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    background: var(--card);
}

td {
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: var(--card-hover);
}

td:first-child {
    color: var(--accent);
    font-weight: 700;
}


/* Ports */

.ports-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;
}

.port-card {
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--card);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.port-card:hover {
    transform: translateY(-3px);
    border-color: #3b4c62;
}

.port-number {
    color: var(--accent);

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 26px;
    font-weight: 800;
}

.port-name {
    margin-top: 4px;

    font-weight: 800;
}

.port-description {
    margin-top: 8px;

    color: var(--muted);

    font-size: 13px;
}

.port-protocol {
    display: inline-block;

    margin-top: 14px;
    padding: 3px 7px;

    border: 1px solid var(--border);
    border-radius: 5px;

    color: var(--muted);

    font-size: 10px;
    font-weight: 800;
}


/* About */

.about {
    padding-bottom: 130px;
}

.about-card {
    max-width: 820px;
}

.about-card h2 {
    margin: 16px 0;

    font-size: 42px;
    letter-spacing: -0.04em;
}

.about-card p {
    max-width: 700px;

    color: var(--muted);
}


/* Footer */

footer {
    padding: 30px 0;

    background: #060a10;
}

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

.footer-inner strong {
    display: block;
}

.footer-inner span {
    color: var(--muted);
    font-size: 12px;
}

.ai-banner {
    display: block;

    padding: 10px 14px;

    border: 1px solid var(--border);
    border-radius: 8px;

    color: var(--muted);

    font-size: 11px;
    text-align: center;

    transition:
        border-color 0.2s ease,
        color 0.2s ease;
}

.ai-banner:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* Mobile */

@media (max-width: 800px) {

    nav {
        display: none;
    }

    .hero {
        min-height: 540px;
    }

    .section {
        padding: 80px 0;
    }

    .section-heading {
        display: block;
    }

    .section-heading p {
        margin-top: 12px;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .result-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .result.wide {
        grid-column: span 2;
    }

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

    .footer-inner {
        flex-direction: column;
        align-items: stretch;
    }
}


@media (max-width: 480px) {

    .container {
        width: min(100% - 24px, 1180px);
    }

    .hero h1 {
        font-size: 48px;
    }

    .tool-card,
    .about-card {
        padding: 18px;
    }

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

    .result.wide {
        grid-column: span 1;
    }
}
