:root {
    --page-background: #f3f7f8;
    --surface: #ffffff;
    --surface-soft: #f8fbfb;
    --text-primary: #313b40;
    --text-secondary: #66747b;
    --border: #d5dde0;
    --accent: #169cab;
    --accent-dark: #0f7f8b;
    --accent-soft: #e8f8fa;
    --danger: #bd3030;
    --shadow: 0 14px 40px rgba(35, 57, 63, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-background);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 32px 20px;
    background:
        radial-gradient(circle at top left, rgba(22, 156, 171, 0.08), transparent 34rem),
        var(--page-background);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: 30px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(213, 221, 224, 0.85);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

h1 {
    margin: 0 0 24px;
    color: var(--text-primary);
    font-size: clamp(1.55rem, 3vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

form {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(22, 156, 171, 0.12);
}

input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    color: var(--text-primary);
    font: inherit;
    font-size: 1rem;
    background: transparent;
    border: 0;
    outline: 0;
}

input::placeholder {
    color: #8a969b;
}

button {
    min-height: 46px;
    padding: 0 22px;
    color: #ffffff;
    font: inherit;
    font-weight: 750;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    box-shadow: 0 8px 18px rgba(15, 127, 139, 0.22);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(22, 156, 171, 0.3);
    outline-offset: 3px;
}

#results {
    min-height: 24px;
    margin-top: 24px;
    color: var(--text-secondary);
}

article {
    position: relative;
    min-height: 106px;
    margin: 0 0 10px;
    padding: 20px 220px 20px 110px;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.65;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 2px 8px rgba(34, 54, 60, 0.04);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

article:last-child {
    margin-bottom: 0;
}

article:hover {
    border-color: #aebdc1;
    box-shadow: 0 9px 24px rgba(34, 54, 60, 0.09);
    transform: translateY(-1px);
}

article:first-of-type {
    background: linear-gradient(90deg, var(--accent-soft), var(--surface) 48%);
    border-color: var(--accent);
    box-shadow: 0 7px 20px rgba(22, 156, 171, 0.1);
}

article img {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 72px;
    height: 72px;
    margin: 0;
    padding: 7px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #d8e0e2;
    border-radius: 10px;
    transform: translateY(-50%);
}

article strong {
    display: block;
    overflow: hidden;
    margin-bottom: 1px;
    color: var(--text-primary);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

article a {
    position: absolute;
    top: 50%;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    color: var(--accent-dark);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    background: #ffffff;
    border: 2px solid var(--accent);
    border-radius: 9px;
    transform: translateY(-50%);
    transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

article a::after {
    margin-left: 9px;
    font-size: 1.15rem;
    font-weight: 500;
    content: "↗";
}

article a:hover {
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 7px 18px rgba(22, 156, 171, 0.2);
}

.error {
    margin: 0;
    padding: 13px 15px;
    color: var(--danger);
    font-weight: 650;
    background: #fff2f2;
    border: 1px solid #f1c3c3;
    border-radius: 10px;
}

@media (max-width: 720px) {
    body {
        padding: 16px 12px;
    }

    main {
        padding: 20px;
        border-radius: 16px;
    }

    form {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    article {
        min-height: 98px;
        padding: 16px 16px 16px 94px;
    }

    article img {
        left: 14px;
        width: 64px;
        height: 64px;
    }

    article strong {
        white-space: normal;
    }

    article a {
        position: static;
        width: fit-content;
        min-height: 40px;
        margin-top: 10px;
        padding: 0 13px;
        transform: none;
    }
}

@media (max-width: 430px) {
    main {
        padding: 16px;
    }

    article {
        padding-left: 82px;
        font-size: 0.98rem;
    }

    article img {
        width: 54px;
        height: 54px;
    }

    article a {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
