/* Mobile-first responsive design */

:root {
    --font-monospace: 'Courier New', Courier, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Honeypot field - hidden from users */
.invisible {
    display: none !important;
    position: absolute !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

body {
    font-family: var(--font-monospace);
    background: #000;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.25rem;
    color: #000;
    flex-direction: column;
}

body > * {
    width: 100%;
    max-width: 70rem;
    margin: 0 auto;
}

.container {
    width: 100%;
    max-width: 70rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0 1.25rem;
}

.container > * {
    width: 100%;
}


header {
    position: sticky;
    top: 0;
    background: #f0f0f0;
    border: 0.125rem solid #000;
    padding: 1.875rem 1.25rem;
    text-align: center;
    z-index: 100;
}

header h1 {
    margin-bottom: 0.625rem;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav__link {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: normal;
    color: #000;
    background: #c0c0c0;
    border: 0.125rem outset #dfdfdf;
    cursor: pointer;
    font-family: var(--font-monospace);
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.nav__link:hover {
    background: #d0d0d0;
}

.nav__link:active {
    border-style: inset;
}

.nav__link--active {
    border-style: inset;
    background: #dfdfdf;
}

.card {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    /* align-items: center; */
    border: 0.125rem solid #000;
    background: #f0f0f0;
    padding: 1.25rem;
    box-sizing: border-box;
}

.signup-form {
    background: #f0f0f0;
    border: 0.125rem solid #000;
    padding: 1.875rem 1.25rem;
    text-align: center;
}

h1 {
    font-size: 1.25rem;
    color: #000;
    margin-bottom: 0.625rem;
    font-weight: normal;
    letter-spacing: 0.0625rem;
}

.subtitle {
    font-size: 0.6875rem;
    color: #333;
    margin-bottom: 1.875rem;
    line-height: 1.6;
}

.form {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: 0.9375rem;
}

.form div {
    padding: 1rem;
}


.modal__card .form {
    margin-top: 2.5rem;
}

.form__group {
    position: relative;
}

.modal__card .form__group {
    margin-bottom: 0.5rem;
}

input[type="email"],
input[type="text"],
input[type="ref-code"],
textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    border: 0.125rem solid #000;
    font-family: var(--font-monospace);
    background: #fff;
    color: #000;
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="ref-code"]:focus,
textarea:focus {
    outline: none;
    border: 0.125rem dashed #000;
    background: #fff;
}

input[type="email"]::placeholder,
input[type="text"]::placeholder,
input[type="ref-code"]::placeholder,
textarea::placeholder {
    color: #666;
}

textarea {
    resize: vertical;
    min-height: 6rem;
}

.button {
    padding: 0.625rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: normal;
    color: #000;
    background: #c0c0c0;
    border: 0.125rem outset #dfdfdf;
    cursor: pointer;
    font-family: var(--font-monospace);
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
}

.button:hover {
    background: #d0d0d0;
}

.button:active {
    border-style: inset;
}

.button:disabled {
    color: #666;
    cursor: not-allowed;
}

.button--open-modal {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form__message {
    font-size: 0.75rem;
    margin-top: 0.9375rem;
    min-height: 1rem;
    color: #333;
    text-align: center;
}

.modal__card .form__message {
    font-size: 1.5rem;
    margin-top: 2rem;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
}

.form__message--success {
    color: #000;
    font-weight: normal;
}

.form__message--error {
    font-weight: bold;
    text-decoration: underline;
    color: #000;
}

.modal__toggle {
    display: none;
}

/* Page action area (join button or contact button) */
#pageActionArea {
    width: 100%;
}

.modal__overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

#modalToggle:checked ~ #signupModal,
#contactModalToggle:checked ~ #contactModal {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.modal__card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    max-width: 31.25rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.button--close-modal {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.875rem;
    height: 1.875rem;
    padding: 0;
    border: 0.125rem solid #000;
    background: #c0c0c0;
    color: #000;
    font-size: 1.5rem;
    cursor: pointer;
    font-family: var(--font-monospace);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: normal;
}

.button--close-modal:hover {
    background: #b0b0b0;
}

.button--close-modal:active {
    border-style: inset;
    background: #a0a0a0;
}

.content-area {
    width: 100%;
    max-width: 100%;
    padding: 1.25rem;
    background: #f0f0f0;
    border: 0.125rem solid #000;
    box-sizing: border-box;
}

.content-area h1,
.content-area h2,
.content-area h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #000;
}

.content-area p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.content-area ul,
.content-area ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

.content-area code {
    font-family: monospace;
    background-color: #e0e0e0;
    padding: 2px 6px;
}

.content-area pre {
    background-color: #e0e0e0;
    padding: 1em;
    overflow-x: auto;
    margin-bottom: 1em;
    border: 0.125rem solid #000;
}

.content-area a {
    color: #000;
    text-decoration: underline;
}

/* Article listing styles */
.article-listing {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.article-preview {
    border: 0.125rem solid #000;
    background: #f0f0f0;
    padding: 1.25rem;
    box-sizing: border-box;
}

.article-preview h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.article-preview h2 a {
    color: #000;
    text-decoration: none;
}

.article-preview h2 a:hover {
    text-decoration: underline;
}

.article-preview__excerpt {
    margin: 0;
    line-height: 1.6;
}

/* Individual article styles */
.article {
    border: 0.125rem solid #000;
    background: #f0f0f0;
    padding: 1.25rem;
    box-sizing: border-box;
}

.article__content {
    margin: 1.5rem 0;
}

.article__content h1 {
    margin-top: 0;
}

.button--back {
    display: inline-block;
    margin-top: 1.5rem;
    text-decoration: none;
}

/* Desktop enhancements (40rem and up) */
@media (min-width: 40rem) {
    .container {
        gap: 2.5rem;
    }

    .signup-form {
        padding: 2.5rem 1.875rem;
    }

    header {
        padding: 2.5rem 1.875rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .nav {
        flex-direction: row;
        gap: 0.625rem;
        justify-content: center;
    }

    .nav__link {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
        flex: 1;
        max-width: 10rem;
    }

    .form__input--email,
    .form__input--ref-code,
    .button {
        font-size: 0.875rem;
        padding: 0.75rem 1.5rem;
    }

    .content-area {
        padding: 1.25rem;
    }

    .article-preview {
        padding: 1.875rem;
    }

    .article {
        padding: 1.875rem;
    }

    .article-preview h2 {
        font-size: 1.25rem;
    }

    .button--back {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }
}

