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

:root {
    --blue: #175b9c;
    --blue-dark: #123f6b;
    --blue-soft: #edf5fc;
    --orange: #f58220;
    --orange-dark: #dc6810;
    --orange-soft: #fff5eb;
    --ink: #17324a;
    --muted: #61778b;
    --line: rgba(23, 91, 156, 0.14);
    --panel: rgba(255, 255, 255, 0.94);
    --page: #f2f7fb;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(245, 130, 32, .14), transparent 26rem),
        radial-gradient(circle at 92% 0%, rgba(23, 91, 156, .12), transparent 28rem),
        var(--page);
}

input,
textarea,
button {
    font: inherit;
}

.app-shell {
    width: min(1440px, calc(100% - 36px));
    height: 100vh;
    margin: 0 auto;
    padding: 16px 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
}

.site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
    gap: 24px;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
}

.brand-mark {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: #fff;
    font-size: 1.45rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(245, 130, 32, .25);
}

.brand-name {
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

h1 {
    margin: 0;
    color: var(--blue-dark);
    font-size: clamp(1.65rem, 2.35vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.tagline {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: .95rem;
}

.trust-note {
    padding: 12px 15px;
    border: 1px solid rgba(23, 91, 156, .13);
    border-radius: 14px;
    background: rgba(255, 255, 255, .7);
    color: #34566f;
    font-size: .88rem;
    line-height: 1.45;
}

.trust-note strong {
    color: var(--blue-dark);
}

.panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 12px 34px rgba(16, 55, 88, .07);
}

.key-panel {
    padding: 15px 18px;
}

.panel-heading {
    margin-bottom: 10px;
}

.panel-heading h2 {
    margin: 0 0 3px;
    color: var(--blue-dark);
    font-size: 1.05rem;
}

.panel-heading p {
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
}

.key-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.key-input,
.text-area {
    width: 100%;
    border: 1px solid rgba(23, 91, 156, .2);
    outline: 0;
    background: #fff;
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.key-input {
    height: 45px;
    padding: 0 13px;
    border-radius: 12px;
}

.key-input:focus,
.text-area:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(23, 91, 156, .1);
}

.workspace {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.text-panel {
    min-height: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.plain-panel {
    border-top: 5px solid var(--orange);
}

.cipher-panel {
    border-top: 5px solid var(--blue);
}

.text-area {
    flex: 1 1 auto;
    min-height: 0;
    resize: none;
    padding: 14px;
    border-radius: 13px;
    line-height: 1.45;
}

.plain-area {
    background: linear-gradient(180deg, var(--orange-soft), #fff 25%);
}

.cipher-area {
    background: linear-gradient(180deg, var(--blue-soft), #fff 25%);
}

.panel-footer {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.button-row,
.inline-options,
.encoding-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.btn {
    appearance: none;
    height: 38px;
    padding: 0 15px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    box-shadow: 0 7px 16px rgba(245, 130, 32, .2);
}

.btn-blue {
    color: #fff;
    background: linear-gradient(135deg, #2372b8, var(--blue));
    box-shadow: 0 7px 16px rgba(23, 91, 156, .2);
}

.btn-secondary {
    color: var(--blue-dark);
    border: 1px solid rgba(23, 91, 156, .12);
    background: #eef4f9;
}

.radio-pill {
    height: 38px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(23, 91, 156, .12);
    border-radius: 999px;
    background: #f4f8fb;
    color: var(--blue-dark);
    font-size: .87rem;
}

.radio-pill input {
    margin: 0;
}

.encoding-label {
    margin-right: 2px;
    color: var(--blue-dark);
    font-size: .85rem;
    font-weight: 700;
}

::placeholder {
    color: #91a2b1;
}

.seo-content {
    background: #fff;
    border-top: 1px solid var(--line);
}

.seo-inner {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    padding: 70px 0;
}

.seo-intro {
    max-width: 780px;
    margin-bottom: 42px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--orange-dark);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.seo-content h2 {
    margin: 0 0 14px;
    color: var(--blue-dark);
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -.03em;
}

.seo-content h3 {
    margin: 0 0 8px;
    color: var(--blue-dark);
    font-size: 1.05rem;
}

.seo-content p {
    margin: 0;
    color: #526b7e;
    line-height: 1.7;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.site-footer {
    padding: 22px 18px;
    background: var(--blue-dark);
    color: rgba(255, 255, 255, .74);
    text-align: center;
    font-size: .82rem;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 1050px) {
    .app-shell {
        height: auto;
        min-height: 100vh;
    }

    .site-header {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .key-layout {
        grid-template-columns: 1fr;
    }

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

    .text-area {
        min-height: 300px;
        resize: vertical;
    }

    .seo-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 620px) {
    .app-shell {
        width: min(100% - 20px, 760px);
        padding: 12px 0 18px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 13px;
        font-size: 1.2rem;
    }

    .tagline {
        font-size: .9rem;
    }

    .key-panel,
    .text-panel {
        padding: 14px;
    }

    .button-row,
    .inline-options,
    .encoding-row {
        gap: 7px;
    }

    .seo-inner {
        width: min(100% - 28px, 720px);
        padding: 52px 0;
    }
}
