/* Reset basic browser spacing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* Main page */
body {
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: clip;
    background-color: #f7f7f7;
    color: #222222;
}


/* =========================
   HEADER
   ========================= */

.main-header {
    width: 100%;
    min-height: 80px;

    display: flex;
    align-items: center;

    padding: 0 40px;

    background-color: white;

    border-bottom: 1px solid #dddddd;
}


/* CIMUSOFT name */
.brand {
    display: block;
    flex-shrink: 0;
    width: 175px;
    margin: 6px 22px 6px 0;
    text-decoration: none;
    color: #263650;
}

.brand-art { width: 175px; transform-origin: top left; }
.brand-art svg { display: block; width: 100%; height: auto; }
.brand-tagline {
    display: block;
    margin-top: 3px;
    text-align: center;
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
}
.brand-art.is-intro { position: relative; z-index: 101; pointer-events: none; }
.logo-backdrop { position: fixed; inset: 0; z-index: 100; background: #fff; pointer-events: none; }
.earth-map { animation: earth-spin 12s linear infinite; }
@keyframes earth-spin { to { transform: translateX(-150px); } }
@media (prefers-reduced-motion: reduce) {
    .earth-map { animation: none; }
}
.brand:focus-visible { outline: 2px solid #123ee8; outline-offset: 5px; }


/* =========================
   MENU
   ========================= */

.main-menu {
    display: flex;

    gap: 35px;

    margin-left: auto;
    margin-right: 40px;
}


.main-menu a {
    text-decoration: none;

    color: #222222;

    font-size: 17px;

    transition: opacity 0.2s ease;
}


.main-menu a:hover {
    opacity: 0.6;
}


/* =========================
   LANGUAGE SELECTOR
   ========================= */

.language-selector {
    display: flex;

    align-items: center;

    gap: 10px;

    white-space: nowrap;
}


/* Flag images */
.flag {
    width: 28px;
    height: 20px;

    object-fit: cover;

    border-radius: 2px;
}


/* =========================
   SWITCH
   ========================= */

.switch {
    position: relative;

    display: inline-block;

    width: 52px;
    height: 28px;
}


.switch input {
    opacity: 0;

    width: 0;
    height: 0;
}


/* Switch background */
.slider {
    position: absolute;

    cursor: pointer;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background-color: #cccccc;

    transition: 0.3s;

    border-radius: 28px;
}


/* Switch circle */
.slider::before {
    position: absolute;

    content: "";

    height: 22px;
    width: 22px;

    left: 3px;
    bottom: 3px;

    background-color: white;

    transition: 0.3s;

    border-radius: 50%;
}


/* Spanish selected */
input:checked + .slider {
    background-color: #444444;
}


/* Move switch circle to the right */
input:checked + .slider::before {
    transform: translateX(24px);
}


/* =========================
   MAIN CONTENT
   ========================= */

.main-content {
    min-height: calc(100vh - 166px);

    display: flex;

    justify-content: center;
    align-items: center;
}


/* Hero section */
.hero {
    text-align: center;

    padding: 40px;
}


.hero h1 {
    font-size: 60px;

    letter-spacing: 5px;

    margin-bottom: 20px;
}


.hero p {
    font-size: 24px;

    color: #555555;
}


/* =========================
   RESPONSIVE DESIGN
   ========================= */

@media (max-width: 900px) {

    .main-header {
        flex-wrap: wrap;

        padding: 20px;
    }


    .brand {
        margin-right: auto;
    }


    .main-menu {
        margin-left: 0;

        margin-right: auto;

        gap: 20px;
    }


    .hero h1 {
        font-size: 42px;
    }

}


@media (max-width: 650px) {

    .main-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 7px 10px;
        min-height: 0;
        padding: 7px 12px;
    }


    .brand, .brand-art {
        width: 140px;
    }

    .brand {
        margin: 0;
    }

    .brand-tagline {
        margin-top: 1px;
        font-size: 10px;
    }


    .main-menu {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px 16px;
        width: 100%;
        margin: 0;
    }

    .main-menu a { font-size: 14px; }


    .language-selector {
        margin: 0;
    }

    .flag { width: 24px; height: 17px; }


    .hero h1 {
        font-size: 36px;
    }


    .hero p {
        font-size: 20px;
    }

}

.site-footer { min-height: 42px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 18px; padding: 9px 20px; border-top: 1px solid #dde3ed; background: #fff; color: #596d87; font-size: 13px; }
.site-footer a { color: #123ee8; text-underline-offset: 3px; }

.privacy-hero { width: 100%; max-width: 940px; padding: 28px 36px 46px; text-align: left; }
.privacy-hero > h1 { margin-bottom: 8px; font-size: clamp(30px,3.2vw,44px); letter-spacing: 1px; }
.privacy-updated { margin-bottom: 24px; color: #596d87; font-size: 14px; }
.privacy-hero section { margin-top: 24px; }
.privacy-hero h2 { margin-bottom: 8px; color: #123ee8; font-size: 21px; }
.privacy-hero p { margin-bottom: 9px; color: #263650; font-size: 16px; line-height: 1.65; }
.privacy-hero a { color: #123ee8; text-underline-offset: 3px; }

@media(max-width: 650px) {
    .privacy-hero { padding: 22px 18px 36px; }
    .privacy-hero p { font-size: 15px; }
}

.project-illustration {
    display: block;
    width: 100%;
    max-width: 480px;
    height: auto;
    max-height: 36vh;
    object-fit: contain;
    justify-self: center;
    border-radius: 20px;
}

.about-hero { width: 100%; max-width: 1160px; padding: 32px; text-align: left; }
.about-hero h1 { font-size: clamp(30px, 3.2vw, 44px); letter-spacing: 1px; margin-bottom: 28px; }
.about-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 32px; }
.about-illustration { display: block; width: 100%; height: auto; max-height: 320px; object-fit: contain; border-radius: 18px; }
.about-section h2 { color: #123ee8; font-size: 24px; margin-bottom: 14px; }
.about-section p { color: #263650; font-size: 17px; line-height: 1.75; margin-bottom: 16px; }
.about-section p:last-child { margin-bottom: 0; }
.about-question { color: #000; font-weight: 700; }
.about-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; margin: 36px 0; padding: 28px 0; border-top: 1px solid #dce2ed; border-bottom: 1px solid #dce2ed; }
.about-name { max-width: 850px; }
.about-curiosity { margin-top: 36px; padding: 28px; background: #eef3ff; border-radius: 16px; }
.heritage-words { width: 100%; max-width: 620px; margin: 20px 0; border-collapse: collapse; text-align: left; font-size: 17px; }
.heritage-words th, .heritage-words td { width: 50%; padding: 9px 12px; border-bottom: 1px solid #d5dfef; }
.heritage-words th { color: #123ee8; }
.heritage-words td { color: #263650; }
.heritage-note p, .heritage-note a { font-size: 14px; line-height: 1.6; }
.heritage-note a { color: #123ee8; text-underline-offset: 3px; }
.about-name blockquote { border-left: 3px solid #ed182b; padding: 12px 20px; font-size: 19px; line-height: 1.6; font-style: italic; color: #263650; background: #fff; }
@media (max-width: 800px) {
    .about-hero { padding: 24px 20px; }
    .about-intro, .about-values { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .about-illustration { max-width: 420px; max-height: 240px; justify-self: center; }
}

.projects-hero {
    width: 100%;
    max-width: 1120px;
    padding: 24px 32px;
}

.projects-hero h1 {
    font-size: clamp(28px, 3.2vw, 44px);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: center;
    gap: clamp(20px, 3vw, 36px);
    margin-top: 16px;
}

.project-description {
    text-align: left;
    min-width: 0;
}

.project-description p {
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.6;
    color: #263650;
}

@media (max-width: 800px) {
    .project-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .projects-hero {
        padding: 20px;
    }

    .project-illustration {
        max-width: 330px;
        max-height: 24vh;
    }

    .project-layout {
        gap: 16px;
    }
}

/* Sudoku-Layer introduction and public learning pages. */
.sudoku-main { flex-direction: column; align-items: stretch; }
.sudoku-intro { width: calc(100% - 40px); max-width: 760px; margin: 16px auto 0; text-align: center; color: #263650; }
.sudoku-intro h2 { font-size: clamp(18px, 2vw, 25px); line-height: 1.25; letter-spacing: -.3px; }
.sudoku-intro p { margin: 6px 0 8px; font-size: 14px; line-height: 1.45; color: #50627c; }
.learning-links { display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sudoku-intro .learning-links { justify-content: center; margin-top: 0; gap: 8px; }
.learning-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 16px; border: 1px solid #b7c8e8; border-radius: 9px; color: #123ee8; background: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }
.learning-link.primary { background: #123ee8; border-color: #123ee8; color: #fff; }
.learning-link:hover { background: #edf3ff; }
.learning-link.primary:hover { background: #0d2fb7; }
.learning-link:focus-visible, .learning-toc a:focus-visible { outline: 3px solid #eb9624; outline-offset: 3px; }
.sudoku-overview { width: calc(100% - 40px); max-width: 760px; margin: 20px auto 30px; padding: 26px; background: #fff; border: 1px solid #d7deec; border-radius: 18px; }
.learning-hero { width: 100%; max-width: 1080px; padding: 32px; text-align: left; }
.learning-hero > h1 { color: #263650; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.5px; margin-bottom: 18px; }
.learning-article { color: #263650; }
.learning-article p { margin: 0 0 14px; color: #354961; font-size: 16px; line-height: 1.7; }
.learning-article h2 { margin: 0 0 14px; color: #163f82; font-size: clamp(21px, 2vw, 26px); line-height: 1.3; }
.learning-article h3 { margin-bottom: 10px; font-size: 18px; line-height: 1.35; color: #263650; }
.learning-section { margin-top: 30px; padding-top: 26px; border-top: 1px solid #dce2ed; scroll-margin-top: 20px; }
.learning-toc { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 20px 0 26px; padding: 15px 18px; border: 1px solid #d9e4f3; border-radius: 12px; background: #eef3ff; }
.learning-toc a { color: #123ee8; font-size: 14px; line-height: 1.5; text-underline-offset: 3px; }
.learning-example { display: grid; grid-template-columns: 290px minmax(0, 1fr); align-items: start; gap: 30px; }
.learning-board { width: 100%; max-width: 330px; margin: 0 auto 20px; padding: 14px 14px 0; background: #fff; border: 1px solid #dce2ed; border-radius: 14px; }
.learning-board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 10px; }
.learning-circle { position: relative; aspect-ratio: 1; border: 1.5px solid #b7c4d8; border-radius: 50%; background: #fafcff; margin-bottom: 8px; }
.learning-cell { position: absolute; display: grid; place-items: center; width: 25%; aspect-ratio: 1; border-radius: 50%; color: #263650; font-size: clamp(11px, 1.1vw, 14px); font-weight: 700; opacity: .28; }
.learning-cell.is-active { opacity: 1; box-shadow: 0 0 0 1px #6f809733; }
.cell-S { left: 37.5%; top: 8%; background: #80caff; }
.cell-I { left: 37.5%; bottom: 8%; background: #ffda68; }
.cell-L { left: 8%; top: 37.5%; background: #c49ae8; }
.cell-D { right: 8%; top: 37.5%; background: #d9dfe8; }
.cell-C { left: 37.5%; top: 37.5%; background: #7ed49a; }
.learning-sum { position: absolute; width: 100%; top: calc(100% + 2px); text-align: center; font-size: 10px; font-weight: 700; color: #50627c; }
.learning-circle.is-highlighted { border-color: #123ee8; box-shadow: 0 0 0 2px #123ee826; }
.learning-board figcaption { margin: 14px 0 12px; color: #50627c; font-size: 12px; line-height: 1.5; text-align: center; }
.learning-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 24px; }
.learning-card-grid section { padding: 18px; border-radius: 12px; background: #f2f6ff; }
.learning-card-grid p { margin-bottom: 0; font-size: 15px; }
.learning-steps { padding-left: 24px; }
.learning-steps li { padding: 8px 0 12px 8px; }
.learning-steps li::marker { color: #123ee8; font-weight: 700; }
.main-menu { gap: 24px; }
.main-menu a[aria-current="page"] { color: #123ee8; text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 1050px) and (min-width: 651px) {
    .main-header { padding: 12px 20px; flex-wrap: wrap; gap: 10px; }
    .main-menu { margin-right: 12px; gap: 15px; flex-wrap: wrap; }
    .main-menu a { font-size: 15px; }
}
@media (max-width: 800px) {
    .learning-example { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .learning-card-grid { grid-template-columns: minmax(0, 1fr); }
    .learning-hero { padding: 24px 20px; }
    .learning-cell { font-size: 14px; }
}
@media (max-width: 650px) {
    .sudoku-intro { width: calc(100% - 24px); margin-top: 10px; }
    .sudoku-intro p { font-size: 13px; }
    .sudoku-intro .learning-link { min-height: 36px; padding: 7px 12px; font-size: 13px; }
    .sudoku-overview { width: calc(100% - 24px); margin-top: 16px; padding: 20px; }
    .main-menu { gap: 8px 16px; }
    .learning-article p { font-size: 15px; }
    .learning-toc { padding: 12px; }
}
