:root {
    --page-background: #eeeeff;
    --text-color: #5a5961;
    --link-color: #aebb8f;
    --visited-link-color: #9da195;
    --hover-link-color: #686e5a;
    --active-link-color: #6d9c00;
    --control-background: #fff7ee;
    --control-color: #615e59;
    --rule-color: #9da195;
}

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background-color: var(--page-background);
    color: var(--text-color);
    font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.65;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.2;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 6vw, 2.25rem);
    font-weight: 450;
}

h2 {
    margin-bottom: 1rem;
    font-size: clamp(1.35rem, 4vw, 1.5rem);
    font-weight: 450;
}

h3 {
    font-size: 1.25rem;
    font-weight: 450;
}

p {
    margin-bottom: 1rem;
}

a:link {
    color: var(--link-color);
    background-color: transparent;
    text-decoration: none;
}

a:visited {
    color: var(--visited-link-color);
    background-color: transparent;
    text-decoration: none;
}

a:hover {
    color: var(--hover-link-color);
    background-color: transparent;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

a:active {
    color: var(--active-link-color);
    background-color: transparent;
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--active-link-color);
    outline-offset: 3px;
}

.site-shell {
    width: min(100% - 2rem, 48rem);
    margin-inline: auto;
}

.site-header {
    padding: clamp(2.5rem, 9vw, 5.5rem) 0 clamp(1.25rem, 4vw, 2.25rem);
    text-align: center;
}

.site-main {
    padding-bottom: clamp(3rem, 9vw, 6rem);
}

.home-page .site-header {
    padding-bottom: clamp(1.5rem, 5vw, 2.75rem);
}

.profile {
    padding: clamp(1.5rem, 5vw, 2.5rem) 0;
    border-top: 1px solid var(--rule-color);
    border-bottom: 1px solid var(--rule-color);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr);
    align-items: stretch;
    gap: clamp(1.5rem, 5vw, 3rem);
}

.profile-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

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

.profile p,
.article-item p {
    font-size: 1rem;
}

.contact {
    margin-top: clamp(2rem, 6vw, 3.5rem);
    font-style: normal;
    text-align: right;
}

.contact p {
    margin-bottom: 0;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem clamp(1rem, 6vw, 4.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: clamp(1.25rem, 5vw, 2.25rem);
    font-weight: 450;
    line-height: 1.25;
}

.site-nav li,
.site-nav a,
.site-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
}

.site-nav [aria-current="page"] {
    font-weight: 600;
}

.page-rule {
    height: 0;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--rule-color);
}

.article-list {
    padding: clamp(0.5rem, 2vw, 1rem) 0;
}

.article-item {
    padding: clamp(1.25rem, 4vw, 2rem) 0;
}

.article-item + .article-item {
    border-top: 1px solid var(--rule-color);
}

.publication {
    margin-left: clamp(0rem, 2vw, 0.75rem);
    padding-left: clamp(0.75rem, 3vw, 1.25rem);
    border-left: 2px solid var(--rule-color);
}

.publication strong {
    font-weight: 600;
}

.footer {
    padding: clamp(1.5rem, 5vw, 2.5rem) 0 0;
    text-align: center;
}

.footer p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Remaindle */
.game-page {
    font-size: 1.125rem;
}

.game-shell {
    width: min(100% - 2rem, 58rem);
    margin-inline: auto;
}

.game-header {
    padding: clamp(2rem, 7vw, 4rem) 0 clamp(1.5rem, 5vw, 2.5rem);
    text-align: center;
}

.game-header h1 {
    margin-bottom: 0.5rem;
}

.game-header h2 {
    margin-bottom: 0;
    font-size: clamp(1.15rem, 4vw, 1.5rem);
}

.game-main {
    padding-bottom: clamp(2.5rem, 8vw, 5rem);
}

.game-stage {
    padding: clamp(1.5rem, 5vw, 2.5rem) 0;
    border-top: 1px solid var(--rule-color);
    border-bottom: 1px solid var(--rule-color);
    text-align: center;
}

.game-stage p {
    margin-bottom: 0.75rem;
}

#info,
#curguess,
#guesses {
    overflow-wrap: anywhere;
}

#curguess {
    color: var(--control-color);
    font-weight: 600;
}

#guesses {
    min-height: 1.65em;
    margin: 1.25rem 0;
    line-height: 1.8;
}

.control-row,
.choice-group,
.setting-row,
.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.control-row {
    margin-top: 1.25rem;
}

.action-row {
    margin-top: 1rem;
}

input[type="number"] {
    width: min(12rem, 100%);
    min-height: 2.75rem;
    border: 1px solid var(--control-color);
    border-radius: 4px;
    background-color: var(--control-background);
    color: var(--control-color);
    padding: 0.55rem 0.75rem;
    font: inherit;
    font-size: 1rem;
}

input[type="radio"],
input[type="checkbox"] {
    inline-size: 1.1rem;
    block-size: 1.1rem;
    margin: 0;
    accent-color: var(--active-link-color);
}

button {
    min-height: 2.75rem;
    border: 1px solid var(--control-color);
    border-radius: 4px;
    background-color: var(--control-background);
    color: var(--control-color);
    opacity: 0.8;
    padding: 0.55rem 0.9rem;
    text-align: center;
    text-decoration: none;
    font: inherit;
    font-size: 1rem;
    line-height: 1.2;
    cursor: pointer;
    touch-action: manipulation;
}

button:hover {
    opacity: 1;
}

button:disabled,
.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.game-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 clamp(1.5rem, 5vw, 3rem);
}

.game-section {
    padding: clamp(1.5rem, 5vw, 2.5rem) 0;
    border-bottom: 1px solid var(--rule-color);
}

.game-section.rules {
    grid-column: 1 / -1;
}

.stats-row {
    grid-column: 1 / -1;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--rule-color);
    text-align: center;
}

.game-section p:last-child {
    margin-bottom: 0;
}

.formula {
    margin: 1.25rem 0;
    text-align: center;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1em;
}

.choice-group {
    margin-bottom: 1.25rem;
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
}

.setting-row {
    margin: 1.25rem 0;
}

.next-bound {
    text-align: center;
}

.game-footer {
    padding-top: clamp(1.5rem, 5vw, 2.5rem);
}

.game-result.modal {
    max-width: min(90vw, 42rem);
    text-align: center;
}

#stats {
    max-width: 100%;
}

#streak {
    flex-wrap: wrap;
    gap: 1rem;
}

#streak > div {
    min-width: 7.5rem;
}

.collapsible {
    width: 100%;
    border: none;
    background-color: var(--control-background);
    color: var(--control-color);
    padding: 1rem;
    text-align: left;
    cursor: pointer;
}

.active,
.collapsible:hover {
    opacity: 0.8;
}

.content {
    display: none;
    overflow: hidden;
    padding: 0 1rem;
    background-color: var(--control-background);
}

@media (max-width: 42rem) {
    .site-shell,
    .game-shell {
        width: min(100% - 1.25rem, 48rem);
    }

    .site-header {
        padding-top: 2.25rem;
    }

    .site-nav {
        gap: 0.25rem 1rem;
    }

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

    .profile-photo {
        width: min(100%, 18rem);
        height: auto;
        object-fit: contain;
        margin-inline: auto;
    }

    .contact {
        text-align: left;
    }

    .publication {
        margin-left: 0;
    }

    .game-page {
        font-size: 1rem;
    }

    .game-content {
        grid-template-columns: 1fr;
    }

    .game-section.rules {
        grid-column: auto;
    }

    .control-row input[type="number"],
    .setting-row input[type="number"] {
        flex: 1 1 10rem;
    }

    .control-row button,
    .setting-row button {
        flex: 0 0 auto;
    }
}

@media (max-width: 24rem) {
    .site-nav {
        flex-direction: column;
        gap: 0;
    }

    .control-row,
    .setting-row {
        align-items: stretch;
    }

    .control-row input[type="number"],
    .control-row button,
    .setting-row input[type="number"],
    .setting-row button {
        width: 100%;
        flex-basis: 100%;
    }
}
