:root {
    --background: #f7f5f0;
    --surface: #ffffff;
    --text: #292822;
    --muted: #77736a;
    --accent: #687b55;
    --accent-dark: #526442;
    --border: #e5e1d8;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;

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

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

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

/* Header */

.site-header {
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 2rem;

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

.logo {
    font-size: 1.2rem;
    font-weight: 600;
}

.logout-button {
    border: 0;
    padding: 0;

    background: transparent;
    color: var(--muted);

    font: inherit;

    cursor: pointer;
}

.logout-button:hover {
    color: var(--text);
}

/* Main */

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Overview */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 2.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: 2.5rem;
}

.page-header p {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

.alpaca-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(180px, 1fr));

    gap: 2rem;
}

.alpaca-card {
    display: block;

    text-align: center;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}

.alpaca-card:hover {
    transform: translateY(-5px);
}

.alpaca-avatar {
    width: 100%;
    aspect-ratio: 1;

    overflow: hidden;

    border-radius: 50%;

    background: #e8e3d9;
}

.alpaca-avatar img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}

.alpaca-name {
    margin-top: 1rem;

    font-size: 1.15rem;
    font-weight: 600;
}

/* Profile */

.profile {
    max-width: 1000px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;

    margin-bottom: 2rem;

    color: var(--muted);
}

.back-link:hover {
    color: var(--text);
}

.profile-layout {
    display: grid;

    grid-template-columns:
        minmax(250px, 450px)
        1fr;

    gap: 4rem;

    align-items: start;
}

.profile-image {
    aspect-ratio: 1;

    overflow: hidden;

    border-radius: 50%;

    background: #e8e3d9;
}

.profile-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.profile-content {
    padding-top: 1rem;
}

.profile-content h1 {
    margin: 0 0 1rem;

    font-size: 3.5rem;
    line-height: 1.1;
}

.description {
    color: var(--muted);

    font-size: 1.1rem;
    line-height: 1.7;
}

.alpaca-details {
    display: grid;

    grid-template-columns: 100px 1fr;

    margin-top: 2rem;

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

.alpaca-details dt,
.alpaca-details dd {
    margin: 0;
    padding: 1rem 0;

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

.alpaca-details dt {
    color: var(--muted);
}

.alpaca-details dd {
    font-weight: 500;
}

/* Login */

.login-page {
    min-height: 70vh;

    display: grid;
    place-items: center;
}

.login-card {
    width: min(400px, 100%);

    padding: 3rem;

    background: var(--surface);

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

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.06);
}

.login-icon {
    text-align: center;
    font-size: 4rem;
}

.login-card h1 {
    margin: 1rem 0 0;

    text-align: center;
}

.login-card p {
    margin-bottom: 2rem;

    color: var(--muted);
    text-align: center;
}

.login-card label {
    display: block;

    margin-bottom: 0.5rem;

    font-weight: 500;
}

.login-card input {
    width: 100%;

    padding: 0.8rem 1rem;

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

    font: inherit;
}

.login-card button[type="submit"] {
    width: 100%;

    margin-top: 1rem;
    padding: 0.8rem 1rem;

    border: 0;
    border-radius: 8px;

    background: var(--accent);
    color: white;

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}

.login-card button[type="submit"]:hover {
    background: var(--accent-dark);
}

.validation {
    margin-bottom: 1rem;

    color: #a33;
}

/* Mobile */

@media (max-width: 700px) {

    .site-header {
        padding: 0 1rem;
    }

    .container {
        padding: 2rem 1rem;
    }

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

        gap: 1.25rem;
    }

    .profile-layout {
        grid-template-columns: 1fr;

        gap: 2rem;
    }

    .profile-content {
        padding-top: 0;
    }

    .profile-content h1 {
        font-size: 2.5rem;
    }
}

.profile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.button {
    display: inline-block;

    padding: .75rem 1.2rem;

    border: 0;
    border-radius: 8px;

    font: inherit;
    font-weight: 600;

    cursor: pointer;
}

.button-primary {
    background: var(--accent);
    color: white;
}

.button-primary:hover {
    background: var(--accent-dark);
}

.button-secondary {
    background: #ece9e1;
    color: var(--text);
}

.button-secondary:hover {
    background: #dedad0;
}

.edit-page {
    max-width: 1000px;
    margin: 0 auto;
}

.edit-form {
    margin-top: 2rem;
}

.edit-layout {
    display: grid;

    grid-template-columns:
            minmax(220px, 350px)
            1fr;

    gap: 4rem;
}

.edit-image-column {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.current-image {
    width: 100%;
    aspect-ratio: 1;

    margin-bottom: 1rem;

    overflow: hidden;

    border-radius: 50%;
    background: #e8e3d9;
}

.photo-preview {
    width: 100%;
    aspect-ratio: 1;

    margin-bottom: 1rem;

    overflow: hidden;

    border-radius: 50%;
    background: #e8e3d9;
}

.photo-preview-image {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.photo-preview-placeholder {
    width: 100%;
    height: 100%;

    display: grid;
    place-items: center;

    font-size: 6rem;
}

.current-image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.form-help {
    color: var(--muted);
    font-size: .9rem;
}

.edit-fields {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.form-field label,
.edit-image-column > label {
    font-weight: 600;
}

.form-field input,
.form-field textarea,
.edit-image-column input[type="file"] {
    width: 100%;

    padding: .8rem 1rem;

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

    background: white;

    font: inherit;
}

.form-field textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;

    margin-top: 1rem;
}

@media (max-width: 700px) {

    .edit-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .edit-image-column {
        max-width: 350px;
    }

    .profile-heading h1 {
        font-size: 2.2rem;
    }
}

.new-image-placeholder {
    width: 100%;
    aspect-ratio: 1;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: #e8e3d9;

    font-size: 6rem;
}