* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --paper: #f4f1e9;
    --ink: #20211e;
    --muted: #77776f;
    --line: #d8d5cc;
    --green: #315c45;
    --green-light: #e0e9df;
    --white: #fffdf8;
    --red: #a13c38;
    --yellow: #9b721d;
}

body {
    background: var(--paper);
    color: var(--ink);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}


/* HEADER */

.site-header {
    width: min(1100px, 90%);
    margin: auto;

    height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    background: var(--green);
    color: white;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
}

.brand h1 {
    font-size: 19px;
    font-weight: normal;
}

.brand p {
    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.text-button {
    border: 0;
    background: none;

    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 11px;
}

.text-button:hover {
    color: var(--green);
}


/* PAGE */

.page {
    width: min(1100px, 90%);
    margin: auto;
}


/* WELCOME */

.welcome {
    padding: 75px 0 45px;
    max-width: 650px;
}

.small-heading {
    color: var(--green);

    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: bold;

    letter-spacing: 1.8px;
}

.welcome h2 {
    margin-top: 8px;

    font-size: clamp(42px, 7vw, 70px);
    font-weight: normal;

    letter-spacing: -3px;
    line-height: 1;
}

.welcome>p:last-child {
    margin-top: 20px;

    max-width: 480px;

    color: var(--muted);

    font-size: 17px;
}


/* SUMMARY */

.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--line);

    margin-bottom: 65px;
}

.summary div {
    padding: 20px 15px;
}

.summary div+div {
    border-left: 1px solid var(--line);
}

.summary span {
    display: block;

    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary strong {
    display: block;

    margin-top: 3px;

    font-size: 25px;
    font-weight: normal;
}


/* GRID */

.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;

    gap: 65px;

    padding-bottom: 70px;
}


/* SECTIONS */

.section {
    margin-bottom: 60px;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;

    border-bottom: 1px solid var(--ink);

    padding-bottom: 10px;
    margin-bottom: 8px;
}

.section-title h3 {
    margin-top: 2px;

    font-size: 25px;
    font-weight: normal;
}

.count {
    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 12px;
}


/* SUBJECTS */

.subjects {
    border-bottom: 1px solid var(--line);
}

.subject-row {
    display: flex;
    align-items: center;

    gap: 13px;

    padding: 13px 3px;

    border-bottom: 1px solid var(--line);
}

.subject-row:last-child {
    border-bottom: 0;
}

.subject-letter {
    width: 27px;
    height: 27px;

    flex-shrink: 0;

    display: grid;
    place-items: center;

    background: var(--green-light);
    color: var(--green);

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: bold;
}

.subject-name {
    flex: 1;
    font-size: 16px;
}

.subject-delete {
    border: 0;
    background: none;

    color: var(--muted);

    font-size: 16px;
}

.subject-delete:hover {
    color: var(--red);
}


/* FORMS */

.add-form {
    display: flex;
    gap: 8px;

    margin-top: 15px;
}

.add-form input,
.stack-form input,
.stack-form select,
.exam-form input,
.exam-form select {
    min-width: 0;

    border: 1px solid var(--line);
    background: var(--white);

    color: var(--ink);

    padding: 11px 12px;

    outline: none;

    border-radius: 0;
}

.add-form input {
    flex: 1;
}

.add-form button,
.exam-form button {
    border: 1px solid var(--green);

    background: var(--green);
    color: white;

    padding: 0 17px;
}

.add-form button:hover,
.exam-form button:hover,
.primary-button:hover {
    background: #254a37;
}


/* CHAPTERS */

.chapter-row {
    min-height: 64px;

    display: grid;
    grid-template-columns: 32px 1fr auto 25px;

    align-items: center;

    gap: 10px;

    border-bottom: 1px solid var(--line);
}

.check {
    width: 27px;
    height: 27px;

    border: 1px solid var(--line);
    background: var(--white);

    color: var(--green);

    font-size: 15px;
}

.check.done {
    border-color: var(--green);
    background: var(--green);
    color: white;
}

.chapter-details {
    display: flex;
    flex-direction: column;
}

.chapter-details strong {
    font-size: 15px;
    font-weight: normal;
}

.chapter-details span {
    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 10px;

    margin-top: 2px;
}

.chapter-row.completed .chapter-details strong {
    color: var(--muted);
    text-decoration: line-through;
}

.difficulty {
    font-family: Arial, sans-serif;
    font-size: 9px;

    text-transform: uppercase;
    letter-spacing: .7px;
}

.difficulty-easy {
    color: var(--green);
}

.difficulty-medium {
    color: var(--yellow);
}

.difficulty-hard {
    color: var(--red);
}

.remove {
    border: 0;
    background: none;

    color: var(--muted);

    font-size: 18px;
}

.remove:hover {
    color: var(--red);
}


/* EMPTY */

.empty {
    padding: 25px 3px;

    border-bottom: 1px solid var(--line);

    color: var(--muted);
}

.empty span {
    display: block;

    margin-top: 3px;

    font-family: Arial, sans-serif;
    font-size: 11px;
}


/* SIDEBAR */

.side-section {
    border-top: 1px solid var(--ink);

    padding-top: 15px;
    margin-bottom: 45px;
}

.side-section h3 {
    margin: 7px 0 20px;

    font-size: 22px;
    font-weight: normal;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stack-form label {
    display: flex;
    flex-direction: column;

    gap: 5px;

    font-family: Arial, sans-serif;
    font-size: 11px;
    color: var(--muted);
}

.primary-button,
.secondary-button {
    border: 0;

    padding: 12px;

    text-align: left;
}

.primary-button {
    background: var(--green);
    color: white;
}

.secondary-button {
    background: var(--green-light);
    color: var(--green);
}

.secondary-button:hover {
    background: #d1dfd0;
}


/* EXAMS */

.exams {
    margin-bottom: 15px;
}

.exam-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 0;

    border-bottom: 1px solid var(--line);
}

.exam-row strong {
    font-size: 14px;
    font-weight: normal;
}

.exam-row span {
    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 11px;
}

.exam-delete {
    margin-left: 8px;

    border: 0;
    background: none;

    color: var(--muted);
}

.exam-delete:hover {
    color: var(--red);
}

.exam-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
}


/* PLAN */

.plan-section {
    border-top-color: var(--green);
}

.plan-section .muted {
    margin-bottom: 15px;
}


/* MUTED */

.muted {
    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 13px;
}


/* MODAL */

.modal {
    position: fixed;
    inset: 0;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(32, 33, 30, .45);

    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-card {
    position: relative;

    width: min(500px, 100%);

    max-height: 85vh;
    overflow-y: auto;

    background: var(--white);

    padding: 32px;

    border: 1px solid var(--ink);
}

.modal-card h3 {
    margin: 7px 0 25px;

    font-size: 25px;
    font-weight: normal;
}

.modal-close {
    position: absolute;
    top: 13px;
    right: 15px;

    border: 0;
    background: none;

    color: var(--muted);

    font-size: 25px;
}

.plan-item {
    display: grid;
    grid-template-columns: 35px 1fr auto;

    gap: 12px;

    align-items: center;

    padding: 14px 0;

    border-top: 1px solid var(--line);
}

.plan-number {
    color: var(--green);

    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
}

.plan-name {
    display: block;

    font-size: 15px;
}

.plan-meta {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 10px;
}

.plan-time {
    color: var(--green);

    font-family: Arial, sans-serif;
    font-size: 11px;
}


/* TOAST */

.toast {
    position: fixed;

    left: 50%;
    bottom: 25px;

    transform: translate(-50%, 20px);

    padding: 10px 16px;

    background: var(--ink);
    color: white;

    font-family: Arial, sans-serif;
    font-size: 12px;

    opacity: 0;
    pointer-events: none;

    transition:
        opacity .2s ease,
        transform .2s ease;

    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}


/* FOOTER */

footer {
    width: min(1100px, 90%);
    margin: auto;

    padding: 20px 0 30px;

    border-top: 1px solid var(--line);

    color: var(--muted);

    font-family: Arial, sans-serif;
    font-size: 10px;

    text-align: center;
}


/* MOBILE */

@media (max-width: 800px) {

    .content-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .summary {
        grid-template-columns: 1fr;
    }

    .summary div+div {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .welcome h2 {
        letter-spacing: -2px;
    }
}


@media (max-width: 520px) {

    .site-header {
        height: 70px;
    }

    .header-actions {
        gap: 9px;
    }

    .page {
        width: 92%;
    }

    .welcome {
        padding-top: 55px;
    }

    .add-form {
        flex-direction: column;
    }

    .add-form button {
        padding: 11px;
    }

    .chapter-row {
        grid-template-columns: 30px 1fr 22px;
    }

    .difficulty {
        display: none;
    }

    .exam-form {
        grid-template-columns: 1fr;
    }

    .modal-card {
        padding: 25px 20px;
    }
}