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

html {
    scroll-behavior: smooth;
}

:root{
    --color-bg: #0f1724;             /* formerly --bg */
    --color-card: #0b1220;           /* formerly --card */
    --color-teal: #396670;           /* formerly --accent */
    --color-amber: #735910;          /* formerly --accent-2 */
    --color-muted-blue: #1c2b41;     /* formerly --muted */
    --glass-overlay: rgba(255,255,255,0.04); /* formerly --glass */
    --layout-max-width: 1500px;      /* formerly --max-width */
}

body{
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    background: linear-gradient(90deg, #e7f8bd, #7ed5f8);
    color: #000000;
    -webkit-font-smoothing:antialiased;
    line-height: 1.6;
}

.page-header .homepage {
    float: right;
    margin-right: 2rem;
    text-decoration: none;
    font-size: 1.2rem;
    color: black;
    background: #d4d4d4;
    padding: 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(1, 1, 2, 0.55);
    transition: 0.4s;
}

.page-header .homepage:hover {
    transform: scale(1.05);
}

.container {
    width: 92%;
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 2rem 0;
}

.page-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.page-header h1 {
    font-size: 2rem;
    color: var(--color-teal);
    letter-spacing: -0.5px;
}

.page-header .subtitle {
    color: var(--color-muted-blue);
    margin-top: 0.4rem;
}

.toc {
    background: linear-gradient(90deg, rgba(96,165,250,0.06), rgba(94,234,212,0.03));
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.25rem;
    box-shadow: 0 6px 18px rgba(2,6,23,0.6);
}

.toc h2 {
    color: var(--color-amber); 
    font-size: 1.05rem;
}

.toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.7rem;
    margin-left: 2rem;}

.toc li {
    transition: 0.3s;
}

.toc li:hover {
    transform: scale(1.03);
}
.toc a {
    color: var(--color-teal); 
    text-decoration: none;
    background: var(--glass-overlay); 
    padding:0.35rem 0.6rem; 
    border-radius: 8px; 
    font-size: 0.95rem
}

.toc a:hover{
    transform: translateY(-2px)
}

.content {
    padding: 1.5rem 0 4rem;
}

.section {
    background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent); 
    border-radius: 12px;
    padding: 1.25rem; 
    margin-top: 1rem;
    box-shadow: 0 6px 16px rgba(2,6,23,0.55);
} 

.section h2 {
    color: var(--color-amber); 
    margin-bottom:0.5rem;
}

.section p {
    color:#000000; 
    margin-bottom:0.75rem;
}

.section ul {
    margin: 0.5rem 0 1rem 1.2rem;
}

.answer-container {
    display: flex;
    flex-direction: column;
}

.checkpoints input {
    appearance: none;
    width: 25px;
    height: 25px;
    vertical-align: middle;
    margin: 5px 0;
    border: 2px solid #888;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
}

.checkpoints input[type="radio"]:hover {
  border-color: #78b1ee;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.checkpoints input[type="radio"]:checked {
  border-color: #78b1ee;
  background-color: #78b1ee;
}

.checkpoints label {
    vertical-align: middle;
    cursor: pointer;
}

.checkpoints li {
    font-weight: 600;
}

.figure-container {
    display: flex;
    justify-content: space-evenly;
}

.img-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 500px;
    height: 480px;
    gap: 0.4rem;
    align-items: center;
    margin: 0.75rem auto;
    border-radius: 10px;
    background: #63b166;
    box-shadow: 0 2px 6px rgba(1, 1, 2, 0.55);
    padding: 0.25rem;
    overflow: hidden;
}

.figure {
    margin-bottom: 50px;
}

.figure img {
    max-width: 100%; 
    max-height: 100%;
    height: auto;
    width: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

.figure figcaption {
    text-align: center;
    color: var(--color-muted-blue);
    font-size: 0.9rem;
}

#incomplete-dom-img {
    width: 480px;
}

.formula {
    background: linear-gradient(90deg, rgba(96,165,250,0.06), rgba(94,234,212,0.03));
    padding: 0.6rem;
    border-radius: 8px;
    color: var(--color-teal);
    font-weight: 600;
    display: inline-block;
    margin: 0.45rem 0;
}

.checkpoints {
    margin-top: 0.6rem;
    margin-left: 1.1rem;
}

.checkpoints li { 
    margin: 0.45rem 0;
    padding-left:0.5rem;
}

.page-footer {
    padding: 2rem 0 3rem;
    border-top: 1px solid rgba(255,255,255,0.03);
    margin-top: 2rem;
}

.page-footer p {
    color: var(--color-muted-blue);
}

@media (min-width: 900px) {
    .toc ul {
        gap: 0.75rem;
    }
    .page-header h1 {
        font-size:2.25rem;
    }
}

@media (max-width: 1200px) {
    .figure-container {
        flex-direction: column;
    }
    .figure {
        margin-bottom: 40px;
    }
}

@media (max-width: 640px) {
    .page-header .homepage {
        font-size: 0.8rem;
        padding: 0.9rem 0.9rem;
    }
    .toc ul {
        flex-direction: column;
    }
    .img-container {
        width: 70vw;
    }
    .figure img {
        max-width: 100%;
    }
}