* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-width: 100%;
    min-height: 100%;
}

html {
    background: #62cbed;
}

body {
    min-height: 100vh;
    min-height: 100dvh;

    font-family: "trebuchet ms", verdana, arial, sans-serif;

    color: #17435a;

    background:
        radial-gradient(
            ellipse at 50% -10%,
            rgba(255, 255, 255, 0.95) 0,
            rgba(255, 255, 255, 0.55) 15%,
            transparent 40%
        ),
        radial-gradient(
            ellipse at 15% 20%,
            rgba(255, 255, 255, 0.5) 0,
            transparent 18%
        ),
        radial-gradient(
            ellipse at 85% 30%,
            rgba(255, 255, 255, 0.45) 0,
            transparent 18%
        ),
        linear-gradient(
            to bottom,
            #36bfe9 0%,
            #78d9ef 20%,
            #c9f3fa 48%,
            #b9e9a0 72%,
            #70c85d 100%
        );

    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: fixed;

    overflow-x: hidden;
}

body::before {
    content: "";

    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;

    background:
        radial-gradient(
            ellipse at 25% 12%,
            rgba(255, 255, 255, 0.7),
            transparent 12%
        ),
        radial-gradient(
            ellipse at 75% 18%,
            rgba(255, 255, 255, 0.6),
            transparent 13%
        );

    z-index: -1;
}

a {
    color: #0075ad;
    text-decoration: none;
}

a:hover {
    color: #004f79;
    text-decoration: underline;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

/* navigation */

nav {
    position: sticky;
    top: 10px;
    z-index: 100;

    width: min(1100px, calc(100% - 30px));

    margin: 10px auto 0;

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

    padding: 13px 20px;

    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 18px;

    background:
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.98),
            rgba(205, 243, 251, 0.94)
        );

    box-shadow:
        inset 0 2px 0 white,
        inset 0 -2px 0 rgba(60, 150, 180, 0.2),
        0 5px 18px rgba(0, 75, 110, 0.22);

    backdrop-filter: blur(10px);
}

.logo {
    color: #075d87;

    font-size: 25px;
    font-weight: bold;
    letter-spacing: -1px;

    text-shadow:
        0 1px 0 white,
        0 2px 4px rgba(0, 80, 110, 0.2);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-right > a {
    font-weight: bold;
}

/* buttons */

button,
.button {
    border: 1px solid white;
    border-radius: 14px;

    padding: 11px 18px;

    color: white;

    background:
        linear-gradient(
            to bottom,
            #61d2f0 0%,
            #20a7d3 48%,
            #087eae 52%,
            #086d98 100%
        );

    box-shadow:
        inset 0 1px 0 white,
        inset 0 -2px 0 rgba(0, 70, 110, 0.25),
        0 3px 7px rgba(0, 70, 100, 0.25);

    text-shadow:
        0 1px 2px rgba(0, 50, 80, 0.5);
}

button:hover,
.button:hover {
    filter: brightness(1.08);
}

button:active,
.button:active {
    transform: translateY(1px);
}

.logout {
    padding: 7px 12px;

    color: #075d87;

    background:
        linear-gradient(
            to bottom,
            #ffffff,
            #b8eaf5
        );

    text-shadow: 0 1px 0 white;
}

/* layout */

.landing {
    width: min(900px, calc(100% - 30px));
    margin: 0 auto;
}

.container {
    width: min(760px, calc(100% - 30px));

    margin: 0 auto;

    padding-bottom: 60px;
}

/* hero */

.hero {
    min-height: calc(100vh - 80px);
    min-height: calc(100dvh - 80px);

    display: flex;
    flex-direction: column;
    justify-content: center;

    max-width: 680px;
}

.tiny {
    font-size: 13px;
    letter-spacing: 0.08em;

    color: #39778d;

    text-shadow: 0 1px 0 white;
}

.hero h1 {
    margin: 15px 0 25px;

    font-size: clamp(45px, 8vw, 85px);
    line-height: 0.95;
    letter-spacing: -4px;

    color: #075b83;

    text-shadow:
        0 2px 0 white,
        0 4px 7px rgba(0, 80, 110, 0.25);
}

.hero p {
    max-width: 550px;

    font-size: 20px;
    line-height: 1.5;

    color: #255c70;
}

.buttons {
    display: flex;
    gap: 12px;

    margin-top: 25px;
}

.button.secondary {
    color: #075d87;

    background:
        linear-gradient(
            to bottom,
            white,
            #c6f0f7
        );

    text-shadow: 0 1px 0 white;
}

/* feed */

.feed-header {
    padding: 60px 0 30px;
}

.feed-header h1 {
    margin: 10px 0;

    font-size: 45px;

    color: #075d87;

    text-shadow:
        0 2px 0 white,
        0 3px 5px rgba(0, 80, 110, 0.2);
}

.feed-header p {
    color: #527988;
    line-height: 1.6;
}

/* cards */

.composer,
.post,
.auth-box {
    border: 1px solid white;
    border-radius: 20px;

    background:
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.97),
            rgba(218, 248, 252, 0.94)
        );

    box-shadow:
        inset 0 2px 0 white,
        inset 0 -2px 0 rgba(70, 170, 190, 0.15),
        0 5px 16px rgba(0, 80, 110, 0.18);
}

.composer {
    padding: 20px;
    margin-bottom: 30px;
}

.composer textarea {
    min-height: 110px;
    resize: vertical;
}

/* posts */

.post {
    padding: 22px;
    margin-bottom: 18px;
}

.post-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    color: #6b8f9c;
    font-size: 13px;
}

.post-header a {
    color: #0075ad;
    font-weight: bold;
}

.post-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-content {
    margin: 15px 0;

    color: #174b62;

    font-size: 18px;
    line-height: 1.6;

    white-space: pre-wrap;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 18px;

    padding-top: 14px;

    border-top: 1px solid rgba(117, 187, 202, 0.35);

    color: #628896;
    font-size: 14px;
}

.post-actions form {
    display: block;
}

.post-actions button {
    padding: 0;

    border: 0;

    color: #0875a4;

    background: transparent;

    box-shadow: none;
    text-shadow: 0 1px 0 white;
}

.post-actions button:hover {
    color: #004f79;

    filter: none;
    transform: none;
}

.post-actions button.liked {
    color: #0089c0;
    font-weight: bold;
}

.comments-link {
    color: #0875a4;
    font-weight: bold;
}

/* delete */

.delete-form {
    display: block;
}

.delete-button {
    padding: 0;

    border: 0;

    color: #a34b4b;

    background: transparent;

    box-shadow: none;
    text-shadow: none;

    font-size: 12px;
}

.delete-button:hover {
    color: #7c2020;

    text-decoration: underline;

    filter: none;
    transform: none;
}

/* inputs */

input,
textarea {
    width: 100%;

    padding: 12px;

    border: 1px solid #91c9d8;
    border-radius: 12px;

    outline: none;

    color: #17435a;

    background:
        linear-gradient(
            to bottom,
            white,
            #edfafd
        );

    box-shadow:
        inset 0 2px 5px rgba(0, 90, 120, 0.08),
        0 1px 0 white;
}

input:focus,
textarea:focus {
    border-color: #25a9d2;

    box-shadow:
        inset 0 2px 5px rgba(0, 90, 120, 0.08),
        0 0 0 3px rgba(67, 197, 229, 0.2);
}

/* comments */

.comments {
    display: flex;
    flex-direction: column;

    gap: 10px;

    margin-top: 20px;
}

.comment {
    padding: 12px 14px;

    border: 1px solid white;
    border-radius: 14px;

    background:
        linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.95),
            rgba(210, 244, 250, 0.9)
        );

    box-shadow:
        inset 0 1px 0 white,
        0 2px 5px rgba(0, 80, 100, 0.12);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 5px;

    font-size: 12px;
}

.comment-content {
    color: #16445b;

    line-height: 1.5;

    white-space: pre-wrap;
}

.comment-form {
    display: flex;
    flex-direction: row;

    gap: 8px;

    margin-top: 18px;
}

.comment-form input {
    flex: 1;
}

/* empty */

.empty {
    padding: 70px 20px;

    text-align: center;

    border: 1px dashed #82becd;
    border-radius: 20px;

    background: rgba(255, 255, 255, 0.55);

    color: #527988;
}

/* auth */

.auth {
    width: 100%;

    min-height: 100vh;
    min-height: 100dvh;

    display: grid;
    place-items: center;

    padding: 20px;
}

.auth-box {
    width: min(420px, 100%);

    padding: 40px;
}

.auth-box h1 {
    margin-bottom: 8px;

    font-size: 40px;

    color: #075d87;

    text-shadow:
        0 1px 0 white,
        0 2px 3px rgba(0, 80, 110, 0.15);
}

.muted {
    color: #527988;
    line-height: 1.6;
}

.error {
    margin: 20px 0;
    padding: 12px;

    border: 1px solid #e29a9a;
    border-radius: 12px;

    background:
        linear-gradient(
            to bottom,
            #fff1f1,
            #ffdcdc
        );

    color: #8a3b3b;
}

/* profile */

.profile {
    display: flex;
    align-items: flex-start;

    gap: 25px;

    padding: 60px 0 40px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.profile h1 {
    margin: 5px 0;

    font-size: 42px;

    color: #075d87;

    text-shadow:
        0 2px 0 white,
        0 3px 5px rgba(0, 80, 110, 0.2);
}

.avatar {
    width: 90px;
    height: 90px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border: 1px solid white;
    border-radius: 22px;

    background:
        linear-gradient(
            to bottom,
            white,
            #9ee4f2
        );

    color: #08709e;

    font-size: 35px;

    box-shadow:
        inset 0 2px 0 white,
        0 4px 10px rgba(0, 80, 110, 0.2);
}

.stats {
    display: flex;
    gap: 20px;

    margin: 20px 0;

    color: #527988;
}

/* mobile */

@media (max-width: 600px) {

    html {
        width: 100%;
        min-height: 100%;

        background: #62cbed;
    }

    body {
        width: 100%;
        min-width: 100%;

        min-height: 100vh;
        min-height: 100dvh;

        margin: 0;
        padding: 0;

        background:
            radial-gradient(
                ellipse at 50% 0%,
                rgba(255, 255, 255, 0.9) 0,
                rgba(255, 255, 255, 0.4) 20%,
                transparent 42%
            ),
            linear-gradient(
                to bottom,
                #36bfe9 0%,
                #78d9ef 22%,
                #c9f3fa 48%,
                #b9e9a0 72%,
                #70c85d 100%
            );

        background-repeat: no-repeat;
        background-size: 100% 100%;
        background-attachment: scroll;
    }

    body::before {
        position: absolute;

        width: 100%;
        min-height: 100%;

        background:
            radial-gradient(
                ellipse at 20% 10%,
                rgba(255, 255, 255, 0.55),
                transparent 15%
            ),
            radial-gradient(
                ellipse at 80% 20%,
                rgba(255, 255, 255, 0.45),
                transparent 15%
            );
    }

    nav {
        position: relative;
        top: 0;

        width: 100%;

        margin: 0;

        padding:
            calc(10px + env(safe-area-inset-top))
            14px
            10px;

        border-radius: 0 0 16px 16px;
    }

    .container {
        width: calc(100% - 20px);

        margin: 0 auto;

        padding-bottom: 40px;
    }

    .landing {
        width: calc(100% - 20px);
    }

    .hero {
        min-height: calc(100vh - 65px);
        min-height: calc(100dvh - 65px);
    }

    .hero h1 {
        letter-spacing: -2px;
    }

    .auth {
        min-height: 100vh;
        min-height: 100dvh;

        padding:
            calc(12px + env(safe-area-inset-top))
            12px
            calc(12px + env(safe-area-inset-bottom));
    }

    .auth-box {
        padding: 25px;
    }

    .feed-header {
        padding: 40px 0 25px;
    }

    .feed-header h1 {
        font-size: 36px;
    }

    .post {
        padding: 17px;

        border-radius: 16px;
    }

    .post-header {
        gap: 10px;
    }

    .post-header-right {
        flex-direction: column;
        align-items: flex-end;

        gap: 5px;
    }

    .post-content {
        font-size: 16px;
    }

    .post-actions {
        gap: 14px;
    }

    .comment-form {
        flex-direction: column;
    }

    .comment-form button {
        width: 100%;
    }

    .profile {
        flex-direction: column;
    }

    .profile h1 {
        font-size: 36px;
    }

    .buttons {
        flex-wrap: wrap;
    }
}

/* very small phones */

@media (max-width: 380px) {

    nav {
        padding-left: 10px;
        padding-right: 10px;
    }

    .logo {
        font-size: 21px;
    }

    .nav-right {
        gap: 8px;
    }

    .nav-right > a {
        font-size: 13px;
    }

    .logout {
        padding: 6px 9px;
        font-size: 12px;
    }

    .container {
        width: calc(100% - 14px);
    }

    .post {
        padding: 14px;
    }
}

.communities {
    margin-bottom: 30px;
}

.community-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;

    margin-top: 12px;
}

.community-card {
    display: flex;
    flex-direction: column;
    gap: 5px;

    padding: 15px;

    border: 1px solid white;
    border-radius: 16px;

    background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,.96),
            rgba(211,244,250,.92)
        );

    box-shadow:
        inset 0 1px 0 white,
        0 3px 8px rgba(0,80,110,.15);

    color: #075d87;
}

.community-card:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.community-card span {
    color: #628896;
    font-size: 13px;
}

@media (max-width: 600px) {
    .community-list {
        grid-template-columns: 1fr;
    }
}

.communities-section {
    margin-bottom: 35px;
}

.section-heading {
    margin-bottom: 15px;
}

.section-heading h2 {
    margin: 5px 0 0;
    font-size: 32px;
}

.communities-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.community-card {
    display: block;
    padding: 18px;
    border: 1px solid #b7d8df;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 5px 15px rgba(40, 100, 120, 0.12);
}

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

.community-card-title {
    font-size: 20px;
    font-weight: bold;
    color: #12627a;
}

.community-card-description {
    margin-top: 7px;
    color: #52717a;
    line-height: 1.5;
}

.community-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
    color: #66858d;
}

.post-community {
    margin-left: 8px;
}

.post-community a {
    color: #12627a;
    font-weight: bold;
}

.composer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.composer-bottom select {
    padding: 10px 12px;
    border: 1px solid #b7d8df;
    border-radius: 8px;
    background: white;
    color: #24515c;
}

.comment-link {
    color: inherit;
}

.delete-post {
    background: transparent;
    border: 0;
    color: #a33;
    padding: 0;
}

@media (max-width: 600px) {
    .communities-list {
        grid-template-columns: 1fr;
    }

    .composer-bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .composer-bottom select,
    .composer-bottom button {
        width: 100%;
    }

    .post-header {
        flex-direction: column;
        gap: 5px;
    }
}

.post-link {
    display: block;
    color: inherit;
}

.post-link:hover {
    text-decoration: none;
}

.back-link {
    display: inline-block;
    margin: 25px 0;
    color: #12627a;
}

.post-page {
    padding-bottom: 60px;
}

.comments-page {
    margin-top: 35px;
    padding-bottom: 60px;
}

.comments-page h2 {
    margin: 5px 0 20px;
    font-size: 30px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.comment {
    padding: 16px;
    border: 1px solid #b7d8df;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #66858d;
}

.comment-header a {
    color: #12627a;
    font-weight: bold;
}

.comment-content {
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-customization {
    margin: 35px 0;
    padding: 25px;
    border: 1px solid #b7d8df;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
}

.profile-customization h2 {
    margin: 5px 0 20px;
}

.profile-customization form {
    max-width: 600px;
}

.profile-customization textarea {
    min-height: 120px;
    resize: vertical;
}

.profile-customization button {
    align-self: flex-start;
}

.profile-posts {
    padding-bottom: 70px;
}

.profile-posts .section-heading {
    margin-bottom: 20px;
}

.profile-posts .section-heading h2 {
    margin: 5px 0;
    font-size: 30px;
}

.profile-info {
    min-width: 0;
}

.profile-info h1 {
    overflow-wrap: anywhere;
}

.username {
    color: #66858d;
    font-size: 14px;
}

.profile-bio {
    max-width: 600px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.profile-owner {
    font-size: 13px;
    color: #66858d;
}

.follow-form {
    display: inline-flex;
}

.follow-form button {
    margin-top: 5px;
}

.profile-actions {
    margin-top: 15px;
}

.post-community {
    margin: 10px 0;
    font-size: 13px;
}

.post-community a {
    color: #12627a;
    font-weight: bold;
}

.delete-post {
    background: transparent !important;
    border: 0 !important;
    color: #a33 !important;
    padding: 0 !important;
}

.comment-link {
    color: #12627a;
}

@media (max-width: 600px) {

    .profile-customization {
        padding: 18px;
        margin-top: 25px;
    }

    .profile-posts {
        padding-bottom: 40px;
    }

    .comments-page {
        margin-top: 25px;
    }

    .comment-form {
        flex-direction: column;
    }

    .comment-form button {
        width: 100%;
    }

    .comment-header {
        flex-direction: column;
        gap: 4px;
    }

    .post-actions {
        flex-wrap: wrap;
        gap: 12px;
    }

}
