body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
}


h1, h2, h3, h4 {
    font-weight: normal;
}

.terminal-container {
    font-size: 16px;
}

.section-container {
    margin-bottom: 32px;
}
.section-title {
    text-align: center;
}
.section-note {
    margin-bottom: 24px;
    text-align: center;
}

.grid-container {
    max-width: 1024px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    column-gap: 30px;
    text-align: center;
}

.content-box.content-box--grid {
    padding: 0;
    background: var(--color-surface);
}

.content-box.content-box--grid .grid {
    column-gap: 0;
    row-gap: 0;
    grid-template-columns: repeat(4, 1fr);
}

.content-box.content-box--grid .grid > a {
    background: var(--color-surface);
    padding: 16px;
    transition: background 0.15s;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    place-content: center;
    min-height: 160px;
}

.content-box.content-box--grid .grid > a:hover {
    background: var(--color-inv-bg);
    color: var(--color-inv-text);
}



.grid img {
    width: 50%;
    height: auto; /* Maintain aspect ratio */
    /*aspect-ratio: 1 / 1;*/ /* Force square aspect ratio */
    object-fit: cover; /* Cover the square area */
    /*border-radius: 5px;*/
    /*border: 1px solid black;*/
}

.process {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Responsive columns */
    column-gap: 20px;
    text-align: center;
}

.process a {
    pointer-events: none;
    cursor: default;
    color: var(--color-text);
}

.process img {
    width: 100px;
    height: auto; /* Maintain aspect ratio */
    /*aspect-ratio: 1 / 1;*/ /* Force square aspect ratio */
    object-fit: cover; /* Cover the square area */
    border-radius: var(--radius); /* Optional: Rounded corners */
    /*border: 1px solid black;*/
    margin: 4px;
    color: var(--purple-300);
    background-color: var(--purple-300);
    fill: var(--purple-300);
}

.process-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    height: 40px;
}

.process-info {
    font-size: 16px;
    text-align: center;
    margin-bottom: 24px;
}

.category-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    width: 100%;
}

.category-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    height: 50px;
}


a {
    color: var(--color-text-muted);
    text-decoration: none;
}

a:hover {
    color: var(--color-text);
}


.category-box a {
    color: var(--color-link);
    text-decoration: none;
}

.category-box:hover a {
    color: var(--color-text);
}

.grid > a {
    color: var(--color-link);
}

.grid > a:hover {
    color: var(--color-inv-text);
}



.category-box img {
    opacity: 1;
}

.title {
    text-align: center;
}

ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

ul li {
    margin-bottom: 8px;
}

.gallery-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive columns */
    column-gap: 0px;
    row-gap: 0px;
    border-radius: 0;
}

.gallery-gallery img {
    border-radius: 0px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Smaller columns on mobile */
        gap: 5px;
        column-gap: 10px;
    }

    .content-box.content-box--grid .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    ul li {
        margin-bottom: 8px;
    }

    .terminal-container {
        font-size: 14px;
    }
}

/* ── blinking cursor (index.html typewriter) ── */
.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1em;
    background: var(--color-text);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-start infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ── table of contents (index.html nav list) ── */
#toc {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}
#toc li {
    margin: 0;
}
#toc li a {
    display: block;
    width: 100%;
    padding: 7px 16px;
    text-align: center;
    color: var(--color-link);
    text-decoration: none;
    font-weight: bold;
    font-family: var(--font-body);
    box-sizing: border-box;
    opacity: 1;
}
#toc li a:hover {
    color: var(--color-inv-text);
    background: var(--color-inv-bg);
}

/* ── carousel (index.html) ── */
.carousel-wrapper {
    position: relative;
    overflow: hidden;
}

.carousel-track-outer {
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

.carousel-track-outer:active {
    cursor: grabbing;
}

.carousel-track {
    display: flex;
    gap: 10px;
    transition: transform var(--transition-slow) var(--transition-carousel);
    will-change: transform;
}

.carousel-item {
    flex: 0 0 calc((100% - 40px) / 5);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-surface);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: opacity 0.2s;
}

.carousel-item:hover img {
    opacity: 0.85;
}


@media (max-width: 720px) {
    .carousel-item {
        flex: 0 0 calc((100% - 24px) / 3);
    }
}

@media (max-width: 480px) {
    .carousel-item {
        flex: 0 0 calc((100% - 10px) / 2);
    }
}