* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background: #f7f6f1;
    color: #263238;
    line-height: 1.6;
}

a {
    color: #526b5a;
}


/* ---------- Header ---------- */

header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e3dc;
}

.logo {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: inherit;
    text-decoration: none;
}

nav a {
    margin-left: 28px;
    text-decoration: none;
    color: #555;
    font-size: 15px;
}

nav a:hover,
nav a.active {
    color: #718878;
}

nav a.active {
    border-bottom: 1px solid #718878;
}


/* ---------- Main ---------- */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 65px 40px 90px;
}


/* ---------- Hero (home) ---------- */

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 65px;
    align-items: center;
    margin-bottom: 90px;
}

.hero-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.hero-text {
    padding-right: 20px;
}

.hero-text h1 {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 24px;
    color: #263238;
}

.hero-text p {
    font-size: 17px;
    line-height: 1.8;
    margin: 0 0 16px;
    color: #52605b;
}

.text-link {
    display: inline-block;
    margin-top: 12px;
    color: #526b5a;
    text-decoration: none;
    font-size: 15px;
}

.text-link:hover {
    text-decoration: underline;
}


/* ---------- Featured cards ---------- */

.featured {
    border-top: 1px solid #deddd6;
    padding-top: 45px;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 28px;
}

.card {
    background: #ffffff;
    padding: 35px;
    min-height: 230px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
}

.card-label {
    font-size: 12px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #718878;
    margin-bottom: 12px;
}

.card h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 500;
    margin: 0 0 12px;
}

.card p {
    color: #6d7471;
    font-size: 15px;
    max-width: 500px;
}

.card-link {
    margin-top: 25px;
    font-size: 14px;
    color: #526b5a;
}


/* ---------- Contact (home) ---------- */

.contact {
    margin-top: 90px;
    border-top: 1px solid #deddd6;
    padding-top: 45px;
}

.contact h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: 500;
    margin: 0 0 12px;
}

.contact p {
    font-size: 17px;
    line-height: 1.8;
    color: #52605b;
    margin: 0 0 8px;
}


/* ---------- Inner pages ---------- */

.page {
    max-width: 850px;
    margin: 0 auto;
    padding: 70px 30px 100px;
}

.page h1 {
    font-size: 48px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 30px;
}

.page h2 {
    font-size: 24px;
    font-weight: 500;
    margin: 55px 0 20px;
}

.page h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 30px 0 8px;
}

.page p,
.page li {
    font-size: 17px;
    color: #555;
    max-width: 720px;
}

.page ul {
    padding-left: 22px;
}

.page li {
    margin-bottom: 8px;
}

.intro {
    font-size: 22px !important;
    color: #444 !important;
    line-height: 1.6;
}

.interests {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.tag {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    color: #666;
    font-size: 15px;
}

.meta {
    font-size: 14px !important;
    color: #888 !important;
    margin: 0 0 24px;
}

.note-list {
    list-style: none;
    padding: 0 !important;
}

.note-list li {
    background: #fff;
    padding: 22px 28px;
    margin-bottom: 16px;
    max-width: none;
}

.note-list a {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    text-decoration: none;
    color: #263238;
}

.note-list a:hover {
    color: #526b5a;
}

.note-list .note-date {
    display: block;
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.empty {
    background: #fff;
    padding: 28px;
    color: #777;
}

.equation {
    background: #fff;
    padding: 16px 22px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    overflow-x: auto;
    max-width: 720px;
    color: #333;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    font-size: 14px;
    text-decoration: none;
}


/* ---------- Footer ---------- */

footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 40px 35px;
    border-top: 1px solid #e5e3dc;
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 13px;
}

footer a {
    color: #999;
    text-decoration: none;
    margin-left: 14px;
}

footer a:hover {
    color: #718878;
}


/* ---------- Mobile ---------- */

@media (max-width: 800px) {

    header {
        padding: 25px;
        display: block;
    }

    nav {
        margin-top: 15px;
    }

    nav a {
        margin-left: 0;
        margin-right: 18px;
        display: inline-block;
        margin-bottom: 4px;
    }

    main {
        padding: 40px 25px 70px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 65px;
    }

    .hero-text {
        padding-right: 0;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 45px 25px 70px;
    }

    .page h1 {
        font-size: 38px;
    }

    footer {
        padding: 25px;
        display: block;
    }

    footer a {
        margin-left: 0;
        margin-right: 14px;
    }
}
