:root {

    /* The main background of the website */
    --bg: #F6F3EF;

    /* Background for cards, modals, book tiles, forms, etc. */
    --surface: #FFFFFF;

    /* Background color of the navigation bar */
    --header: #2F4858;

    /* Background color of the footer */
    --footer: #4b6e83;

    /* Color of all headings (H1, H2, H3...) */
    --heading: #6C5F73;

    /* Normal paragraph text */
    --text: #3F434A;

    /* Less important text like dates, subtitles, placeholders */
    --muted: #6E7077;

    /* Main brand color.
       Used for buttons, links, active nav items, badges, etc. */
    --primary: #886B79;

    /* Same button when hovered */
    --primary-hover: #9D7B7B;

    /* Secondary highlight color.
       Icons, decorations, small labels, accents, quotes, etc. */
    --accent: #AB8E80;

    /* Borders around cards, inputs, tables, sections */
    --border: #E6E0DA;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

nav {
    display: flex;
    justify-content: space-between;
}

.nav-left {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0.75rem;
}

.nav-left img {
    height: 32px;
    width: 32px;
}

.nav-left h1 {
    margin: 0;
}

.nav-right {
    display: flex;
    gap: 2rem;
    padding: 1rem 2.5rem;
}

body {
    margin: 0;
    background-color: var(--bg);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    margin: 0;
}

.castle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* gap: 3rem; */
    margin: 0;
}

.hero-text {
    padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0;
    flex: 1.2;
    line-height: 1.4;
}

.castle-text {
    padding: 50px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 0;
    flex: 1.2;
    line-height: 1.4;
}

.hero-text h1 {
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    font-weight: 1000;
    margin: 0;
}

.castle-text h1 {
    font-size: clamp(1rem, 3vw, 3rem);
    font-weight: 1000;
    margin: 0;
}

.hero-button {
    align-self: flex-end;
    margin: 0;
}

.castle-button {
    align-self: flex-end;
    margin: 0;
}

.hero-img {
    padding-right: 2rem;
    padding-top: 2rem;
    flex: 1;
}

.castle-img {
    /* padding-right: 1rem; */
    /* padding-top: 2rem; */
    flex: 1;
    margin: 0;
}

.hero-img img {
    width: min(600px, 100%);
    height: auto;
}

.castle-img img {
    width: min(600px, 100%);
    height: auto;
}

.cards-4 {
    margin: 0 10% auto;
    background-color: #decfbb;

    gap: 30px;

    padding: 30px;

    align-items: stretch;

    border-radius: 8px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.cards-2 {
    margin: 0 10% auto;
    background-color: #decfbb;

    gap: 30px;

    padding: 30px;

    align-items: stretch;

    border-radius: 8px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1000px) {
    .cards-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .cards-4 {
        grid-template-columns: 1fr;
    }
}

.card {
    padding: 20px 40px;
    background-color: #F6F3EF;

    border-radius: 24px;
}

footer {
    width: 100%;

    display: flex;
    justify-content: space-between;

    padding: 10px;

    background-color: var(--footer);
}

.footer-left {
    display: flex;
    gap: 0.75rem;
}

.footer-right {
    align-items: center;
    display: flex;
    padding-right: 10px;
}

.footer-middle {
    display: flex;
    flex-direction: column;
}

.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;

    width: 60px;
    aspect-ratio: 1;

    display: flex;
    justify-content: center;
    align-items: center;

    background-color: var(--accent);
    border: 2px solid black;
    border-radius: 50%;

    text-decoration: none;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

    transition: transform 0.2s ease, background-color 0.2s ease;
}

.back-top:hover {
    transform: translateY(-4px);
    background-color: var(--primary-hover);
}

.back-top img {
    width: 28px;
    height: 28px;
}