:root {
    --page-background: #f8f5f2;
    --panel-background: #fbf8f5;
    --plum: #5c365e;
    --plum-dark: #48284a;
    --sunflower: #d7aa00;
    --frame-width: 20px;
    --content-width: 1280px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--page-background);
    color: var(--plum);
    font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

.site-header {
    width: min(var(--content-width), calc(100% - 32px));
    margin: 18px auto 0;
}

.main-nav {
    position: relative;
}

.menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: clamp(12px, 2.2vw, 34px);
    min-height: 52px;
    margin: 0;
    padding: 0 20px;
    list-style: none;
}

.menu a {
    display: inline-block;
    padding: 10px 4px 8px;
    color: var(--plum);
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: border-color 160ms ease, color 160ms ease;
}

.menu a:hover,
.menu a:focus-visible,
.menu a.active {
    color: var(--plum-dark);
    border-bottom-color: var(--sunflower);
}

.menu-toggle {
    display: none;
}

.page-shell {
    width: min(var(--content-width), calc(100% - 32px));
    margin: 0 auto 38px;
}

.hero {
    position: relative;
    min-height: 670px;
    margin-top: 4px;
    padding: clamp(38px, 4vw, 56px) clamp(24px, 4vw, 58px) 34px;
    background: var(--panel-background);
    border: var(--frame-width) solid var(--plum);
}

.hero-logo {
    position: absolute;
    z-index: 2;
    top: calc(-1 * var(--frame-width) - 40px);
    left: calc(-1 * var(--frame-width) - 46px);
    width: clamp(118px, 12vw, 158px);
    height: auto;
}

.hero-content {
    max-width: 1150px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    margin: 0 0 20px;
    font-size: clamp(2rem, 3.35vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.credentials {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 10px;
    margin: 0 auto 22px;
    font-size: clamp(1.3rem, 2.3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.18;
}

.credentials span {
    white-space: nowrap;
}

.intro {
    margin: 0 0 24px;
    font-size: clamp(1.45rem, 2.35vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
}

.principles {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
        ". text image"
        "wide wide wide";
    align-items: end;
    width: min(760px, 100%);
    margin: 0 auto 36px;
}

.principles-text {
    grid-area: text;
    align-self: center;
    min-width: 335px;
    text-align: center;
}

.principles-text p,
.principles-wide {
    margin: 0;
    font-size: clamp(1.45rem, 2.25vw, 2.1rem);
    font-weight: 800;
    line-height: 1.12;
}

.portrait {
    grid-area: image;
    width: 150px;
    margin-left: -4px;
    object-fit: contain;
}

.principles-wide {
    grid-area: wide;
    margin-top: -4px;
    white-space: nowrap;
}

.summary {
    margin: 0 auto 44px;
    font-size: clamp(1.3rem, 2.15vw, 2rem);
    font-weight: 800;
    line-height: 1.18;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: clamp(35px, 9vw, 115px);
    margin-top: auto;
    padding-right: 46px;
}

.hero-actions a {
    font-size: clamp(1.25rem, 2vw, 1.9rem);
    font-weight: 800;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.hero-actions a:hover,
.hero-actions a:focus-visible {
    color: var(--plum-dark);
    text-decoration-thickness: 4px;
}

.corner-flower {
    position: absolute;
    z-index: 2;
    right: calc(-1 * var(--frame-width) - 38px);
    bottom: calc(-1 * var(--frame-width) - 38px);
    width: clamp(125px, 13vw, 172px);
}

@media (max-width: 1050px) {
    :root {
        --frame-width: 14px;
    }

    .hero {
        min-height: auto;
    }

    .credentials span {
        white-space: normal;
    }

    .principles {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "text image"
            "wide wide";
    }

    .principles-wide {
        white-space: normal;
    }

    .desktop-only {
        display: none;
    }

    .summary {
        max-width: 850px;
    }
}

@media (max-width: 760px) {
    .site-header,
    .page-shell {
        width: min(100% - 22px, var(--content-width));
    }

    .site-header {
        margin-top: 10px;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 50px;
        padding: 10px 14px;
        color: var(--plum);
        background: transparent;
        border: 2px solid var(--plum);
        border-radius: 0;
        font: inherit;
        font-weight: 800;
        cursor: pointer;
    }

    .menu-toggle__icon {
        display: grid;
        gap: 5px;
        width: 28px;
    }

    .menu-toggle__icon span {
        display: block;
        height: 3px;
        background: currentColor;
    }

    .menu {
        display: none;
        position: absolute;
        z-index: 20;
        top: calc(100% + 6px);
        right: 0;
        left: 0;
        align-items: stretch;
        gap: 0;
        padding: 8px;
        background: var(--panel-background);
        border: 2px solid var(--plum);
        box-shadow: 0 12px 28px rgb(72 40 74 / 18%);
    }

    .menu.is-open {
        display: block;
    }

    .menu li + li {
        border-top: 1px solid rgb(92 54 94 / 22%);
    }

    .menu a {
        display: block;
        padding: 13px 12px;
        border-bottom: 0;
    }

    .menu a:hover,
    .menu a:focus-visible,
    .menu a.active {
        background: rgb(215 170 0 / 12%);
        border-bottom-color: transparent;
    }

    .hero {
        margin-top: 14px;
        padding: 72px 20px 84px;
    }

    .hero-logo {
        top: -11px;
        left: 50%;
        width: 118px;
        transform: translate(-50%, -50%);
    }

    h1 {
        margin-top: 14px;
    }

    .credentials {
        display: grid;
        gap: 9px;
    }

    .principles {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 30px;
    }

    .principles-text {
        min-width: 0;
    }

    .portrait {
        width: 132px;
        margin: 10px auto 2px;
    }

    .principles-wide {
        margin-top: 0;
    }

    .summary {
        margin-bottom: 35px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 18px;
        padding-right: 0;
    }

    .corner-flower {
        right: -24px;
        bottom: -27px;
        width: 128px;
    }
}

@media (max-width: 430px) {
    :root {
        --frame-width: 10px;
    }

    .hero {
        padding-right: 15px;
        padding-left: 15px;
    }

    h1 {
        font-size: 1.9rem;
    }

    .credentials,
    .intro,
    .principles-text p,
    .principles-wide,
    .summary {
        overflow-wrap: anywhere;
    }

    .corner-flower {
        width: 106px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
