@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* CSS reset */

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

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
}

img,
picture,
svg,
video {
    display: block;
    max-width: 100%;
}

/* Colors */

:root[data-theme="light"] {
    --color-bg: #F6F8FF;
    --color-fg: #FFFFFF;
    --light: #4B6A9B;
    --medium: #2B3442;
    --dark: #141D2F;
    --theme-toggle: #4B6A9B;
    --search-button: #FFFFFF;
    --link: #0079FF;
    --accent: #0079FF;
    --accent-light: #60ABFF;
    --box-shadow: 0 16px 30px -10px rgba(70, 96, 187, 0.20);
    --error: #F74646;
}

:root[data-theme="dark"] {
    --color-bg: #141D2F;
    --color-fg: #1E2A47;
    --light: #FFFFFF;
    --medium: #FFFFFF;
    --dark: #FFFFFF;
    --theme-toggle: #4B6A9B;
    --search-button: #FFFFFF;
    --link: #60ABFF;
    --accent: #0079FF;
    --accent-light: #60ABFF;
    --box-shadow: none;
    --error: #F74646;
}

/* Typography */

html {
    font-family: "Space Mono", monospace;
    font-weight: 400;
    font-style: normal;
}

.logo {
    color: var(--dark);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 100%;
}

.theme-toggle {
    color: var(--theme-toggle);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 140%;
    letter-spacing: 0.15625rem;
}

input[type="search"] {
    color: var(--medium);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 0.8125rem;
    line-height: 100%;
}

@media screen and (min-width: 768px) {
    input[type="search"] {
        font-size: 1.125rem;
        line-height: 140%;
    }
}

input[type="search"]::placeholder {
    color: var(--light);
    opacity: 0.7;
}

button[type="submit"] {
    color: var(--search-button);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 1rem;
    font-weight: 700;
    line-height: 100%;
}

.profile-header-name {
    color: var(--medium);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 120%;
}

.profile-header-handle:link,
.profile-header-handle:visited,
.profile-header-handle:hover,
.profile-header-handle:active {
    color: var(--link);
}

.profile-header-joined,
.profile-header-bio {
    color: var(--light);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 0.9375rem;
    line-height: 150%;
}

.stat-title {
    color: var(--light);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 0.8125rem;
    line-height: 150%;
}

.stat-number {
    color: var(--medium);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 140%;
}

.user-info p,
.user-info a:link,
.user-info a:visited,
.user-info a:hover,
.user-info a:active {
    color: var(--light);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 0.9375rem;
    line-height: 150%;
}

.dev-search .content-wrapper.error #search-form::after {
    color: var(--error);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 100%;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper.error #search-form::after {
        font-size: 1.125rem;
        line-height: 140%;
    }
}

.error-message h2 {
    color: var(--dark);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 140%;
}

.error-message p {
    color: var(--light);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 0.9375rem;
    line-height: 150%;
}

/* Utilities */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

/* Focus styles */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* Transitions */

button {
    transition: color .3s ease-in-out, background-color .3s ease-in-out;
}

/* General styles */

body {
    background-color: var(--color-bg);
}

@media screen and (min-width: 1280px) {
    body {
        display: flex;
        flex-direction: column;
    }
}

.page-header,
main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

main>section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-wrapper {
    width: 91.47%;
}

@media screen and (min-width: 768px) {
    .content-wrapper {
        width: 91.67%;
        max-width: 730px;
    }
}

@media screen and (min-width: 1280px) {
    .content-wrapper {
        width: 50.69%;
    }
}

/* Header styles */

.page-header {
    margin-top: 32px;
}

@media screen and (min-width: 768px) {
    .page-header {
        margin-top: 40px;
    }
}

@media screen and (min-width: 1280px) {
    .page-header {
        margin-top: 130px;
    }
}

.page-header .content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header .content-wrapper button.theme-toggle {
    height: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    text-transform: uppercase;
}

@media screen and (min-width: 768px) {
    .page-header .content-wrapper button.theme-toggle {
        gap: 16px;
    }
}

@media (hover: hover) {
    .page-header .content-wrapper button.theme-toggle:hover {
        cursor: pointer;
        color: var(--dark);
    }
}

.page-header .content-wrapper button.theme-toggle svg path {
    fill: currentColor;
}

/* Section dev-search styles */

.dev-search {
    margin-top: 32px;
}

@media screen and (min-width: 768px) {
    .dev-search {
        margin-top: 40px;
    }
}

/* -- Search form styles */

.dev-search .content-wrapper #search-form {
    position: relative;
    z-index: 0;
    height: 69px;
    box-shadow: var(--box-shadow);
}

.dev-search .content-wrapper #search-form::before {
    width: 20px;
    height: 20px;
    content: "";
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    z-index: 20;
    background-image: url("../images/icon-search.svg");
    background-repeat: no-repeat;
    background-size: contain;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper #search-form::before {
        left: 24px;
    }
}

.dev-search .content-wrapper.error #search-form::after {
    content: "No results";
    position: absolute;
    top: 50%;
    right: 120px;
    transform: translateY(-50%);
    z-index: 200;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper.error #search-form::after {
        right: 152px;
    }
}

.dev-search .content-wrapper #search-form #search-input {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    padding: 0 120px 0 40px;
    border: none;
    border-radius: 16px;
    background-color: var(--color-fg);
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper #search-form #search-input {
        padding: 0 128px 0 68px;
    }
}

.dev-search .content-wrapper #search-form button[type="submit"] {
    width: 99px;
    height: 48px;
    position: absolute;
    z-index: 20;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    border-radius: 10px;
    background-color: var(--accent);
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper #search-form button[type="submit"] {
        width: 107px;
    }
}

@media (hover: hover) {
    .dev-search .content-wrapper #search-form button[type="submit"]:hover {
        cursor: pointer;
        background-color: var(--accent-light);
    }
}

/* -- Profile card styles */

.dev-search .content-wrapper .profile-card {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    border-radius: 15px;
    background-color: var(--color-fg);
    box-shadow: var(--box-shadow);
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card {
        margin-top: 40px;
    }
}

.dev-search .content-wrapper .profile-card .wrapper {
    width: 86.01%;
    margin: 32px 0;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card .wrapper {
        width: 90.91%;
        margin: 48px 0;
    }
}

@media screen and (min-width: 1280px) {
    .dev-search .content-wrapper .profile-card .wrapper {
        width: 86.85%;
    }
}

.dev-search .content-wrapper .profile-card .wrapper .profile-header {
    display: grid;
    grid-template-columns: 70px 1fr;
    grid-template-rows: repeat(4, auto);
    grid-template-areas:
        "avatar name"
        "avatar handle"
        "avatar joined"
        "bio bio";
    column-gap: 20px;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card .wrapper .profile-header {
        grid-template-columns: 117px 1fr 166px;
        grid-template-rows: repeat(3, auto);
        grid-template-areas:
            "avatar name joined"
            "avatar handle handle"
            "avatar bio bio";
        column-gap: 32px;
    }
}

.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-image {
    grid-area: avatar;
    border-radius: 50%;
}

.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-name {
    grid-area: name;
}

.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-handle {
    grid-area: handle;
    border-radius: 4px;
}

.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-handle:link,
.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-handle:visited,
.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-handle:hover,
.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-handle:active {
    text-decoration: none;
}

@media (hover: hover) {
    .dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-handle:hover {
        cursor: pointer;
    }
}

.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-joined {
    grid-area: joined;
}

.dev-search .content-wrapper .profile-card .wrapper .profile-header .profile-header-bio {
    grid-area: bio;
    margin-top: 24px;
}

.dev-search .content-wrapper .profile-card .wrapper .user-stats {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    border-radius: 10px;
    background-color: var(--color-bg);
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card .wrapper .user-stats {
        margin-left: 149px;
    }
}

.dev-search .content-wrapper .profile-card .wrapper .user-stats .stats-wrapper {
    width: 86.44%;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card .wrapper .user-stats .stats-wrapper {
        width: 86.67%;
        flex-direction: row;
        gap: unset;
    }
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card .wrapper .user-stats .stats-wrapper>* {
        flex: 1;
    }
}

.dev-search .content-wrapper .profile-card .wrapper .user-stats .stats-wrapper .stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dev-search .content-wrapper .profile-card .wrapper .user-info {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card .wrapper .user-info {
        margin-left: 149px;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.dev-search .content-wrapper .profile-card .wrapper .user-info>div {
    display: flex;
    gap: 16px;
    word-break: break-all;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .profile-card .wrapper .user-info>div {
        width: 232px;
        display: flex;
        align-items: center;
    }
}

.dev-search .content-wrapper .profile-card .wrapper .user-info>div .icon {
    width: 20px;
}

.dev-search .content-wrapper .profile-card .wrapper .user-info>div .icon path {
    fill: var(--dark);
}

.dev-search .content-wrapper .profile-card .wrapper .user-info>div a {
    max-width: 259px;
    text-decoration: none;
    position: relative;
    border-radius: 4px;
}

@media screen and (min-width: 768px) {

    .dev-search .content-wrapper .profile-card .wrapper .user-info>div a,
    .dev-search .content-wrapper .profile-card .wrapper .user-info>div p {
        max-width: 175px;
    }
}


@media (hover: hover) {
    .dev-search .content-wrapper .profile-card .wrapper .user-info>div a::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 0%;
        height: 1px;
        background: var(--light);
        transition: width 0.5s ease-in-out;
    }

    .dev-search .content-wrapper .profile-card .wrapper .user-info>div a:hover::after {
        width: 100%;
    }
}

/* -- Error message styles */

.dev-search .content-wrapper .error-message {
    margin-top: 32px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-radius: 15px;
    background-color: var(--color-fg);
    box-shadow: var(--box-shadow);
    text-align: center;
}

@media screen and (min-width: 768px) {
    .dev-search .content-wrapper .error-message {
        padding: 32px;
    }
}

@media screen and (min-width: 1280px) {
    .dev-search .content-wrapper .error-message {
        padding: 48px;
    }
}