/* SAO-inspired profile panel. Legacy class names preserve the homepage layout hooks. */
@font-face {
    font-family: "Academic Toast Readable";
    src: url("/fonts/toast-readable.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

body:has(.academic-home) .academic-home__profile-card--toast {
    --toast-ink: #59464e;
    --toast-label: #856674;
    --toast-hand: "Academic Toast Readable", "KaiTi", cursive;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    box-sizing: border-box;
    min-width: 0;
    padding: 1.65rem 7.5% 1.35rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--toast-ink);
    container-type: inline-size;
}

body:has(.academic-home) .academic-home__profile-card--toast::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(ellipse at 100% 15%, rgb(251 222 226 / 32%), transparent 50%), linear-gradient(145deg, #fff, #fffaf8 65%, #f4eff4);
    border: 1px solid #cdbdc0;
    box-shadow: inset 0 0 0 5px rgb(255 255 255 / 70%), inset 0 0 0 6px rgb(187 150 133 / 24%);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
    pointer-events: none;
}

body:has(.academic-home) .academic-home__profile-card--toast::after {
    content: "";
    position: absolute;
    top: 0;
    left: 7.5%;
    right: 7.5%;
    height: 3px;
    background: linear-gradient(90deg, #a45362 0 64%, #c9ad82 64% 79%, transparent 79% 81%, #c9ad82 81% 90%, transparent 90% 92%, #c9ad82 92%);
    pointer-events: none;
}

body:has(.academic-home) #article-container .academic-home__profile-card--toast h2 {
    gap: 0.35em;
    justify-content: flex-start;
    color: var(--toast-ink);
    font-family: var(--toast-hand);
    font-size: clamp(22px, 7.5cqi, 27px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.015em;
}

/* Decorative layers are noninteractive and leave the compact layout unchanged. */
body:has(.academic-home) .academic-home__sao-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 0 20px 0 20px;
    z-index: 0;
}

body:has(.academic-home) .academic-home__sao-decor::before,
body:has(.academic-home) .academic-home__sao-decor::after {
    content: "";
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: #b69484;
    border-style: solid;
    opacity: .65;
}

body:has(.academic-home) .academic-home__sao-decor::before {
    top: 7px;
    left: 7px;
    border-width: 1px 0 0 1px;
}

body:has(.academic-home) .academic-home__sao-decor::after {
    bottom: 7px;
    right: 7px;
    border-width: 0 1px 1px 0;
}

body:has(.academic-home) .academic-home__profile-card--toast > :is(h2, .academic-home__facts) {
    position: relative;
    z-index: 1;
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__facts {
    gap: 0;
    margin-top: 0.65rem;
}

body:has(.academic-home) #article-container .academic-home__profile-card--toast .academic-home__section-icon,
body:has(.academic-home) #article-container .academic-home__profile-card--toast .academic-home__section-icon img {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

/* A quiet selection sweep echoes a translucent in-game menu. */
body:has(.academic-home) .academic-home__profile-card--toast :is(.academic-home__fact, .academic-home__profile-tags > span) {
    position: relative;
    isolation: isolate;
    transition: transform 240ms ease;
}

body:has(.academic-home) .academic-home__profile-card--toast :is(.academic-home__fact, .academic-home__profile-tags > span)::before {
    content: "";
    position: absolute;
    inset: 5% -3px 5% -5px;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, rgb(181 100 116 / 14%), rgb(219 185 151 / 12%) 75%, transparent);
    border-left: 2px solid rgb(158 71 91 / 55%);
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    transition: transform 480ms cubic-bezier(.22, .75, .25, 1), opacity 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
    body:has(.academic-home) .academic-home__profile-card--toast :is(.academic-home__fact, .academic-home__profile-tags > span):hover {
        transform: translateY(-2px);
    }

    body:has(.academic-home) .academic-home__profile-card--toast :is(.academic-home__fact, .academic-home__profile-tags > span):hover::before {
        transform: scaleX(1);
        opacity: 1;
    }
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact:focus-within::before {
    transform: scaleX(1);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    body:has(.academic-home) .academic-home__profile-card--toast :is(.academic-home__fact, .academic-home__profile-tags > span),
    body:has(.academic-home) .academic-home__profile-card--toast :is(.academic-home__fact, .academic-home__profile-tags > span)::before {
        transition: none;
    }

    body:has(.academic-home) .academic-home__profile-card--toast :is(.academic-home__fact, .academic-home__profile-tags > span):hover {
        transform: none;
    }
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.22rem;
    padding: 0.4rem 0;
    background: transparent;
    border-bottom: 1px solid rgb(151 119 127 / 18%);
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact > span,
body:has(.academic-home) #article-container .academic-home__interests h3 {
    color: var(--toast-label);
    font-family: var(--toast-hand);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: none;
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact strong,
body:has(.academic-home) .academic-home__profile-card--toast .academic-home__profile-tags span {
    color: var(--toast-ink);
    font-family: var(--toast-hand);
    font-size: clamp(14px, 5.3cqi, 17px);
    font-weight: 600;
    line-height: 1.4;
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact a,
body:has(.academic-home) #article-container .academic-home__profile-card--toast .academic-contact-link {
    color: var(--toast-ink);
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact a:hover,
body:has(.academic-home) #article-container .academic-home__profile-card--toast .academic-contact-link:hover {
    color: #a14b60;
}

body:has(.academic-home) #article-container .academic-home__profile-card--toast .academic-contact-link {
    font-family: var(--toast-hand);
    font-size: clamp(12px, 4.9cqi, 15px);
    font-weight: 600;
    line-height: 1.65;
    text-decoration-color: rgb(122 74 91 / 38%);
    overflow-wrap: anywhere;
}

body:has(.academic-home) .academic-home__interests {
    position: relative;
    z-index: 1;
    min-width: 0;
}

body:has(.academic-home) #article-container .academic-home__interests h3 {
    margin: 0 0 0.22rem;
    padding: 0;
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__profile-tags {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.22rem;
    margin: 0;
}

body:has(.academic-home) .academic-home__profile-card--toast .academic-home__profile-tags span {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

html[data-academic-language="zh"] body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact > span,
html[data-academic-language="zh"] body:has(.academic-home) #article-container .academic-home__interests h3 {
    font-size: 15px;
}

html[data-academic-language="zh"] body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact strong,
html[data-academic-language="zh"] body:has(.academic-home) .academic-home__profile-card--toast .academic-home__profile-tags span {
    font-size: 17px;
    line-height: 1.4;
}

/* Portrait size follows column width, independently of translated text height. */
@media (min-width: 1081px) {
    body:has(.academic-home) #article-container .academic-home__profile:has(.academic-home__profile-card--toast) > :is(img, a) {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        object-fit: contain;
    }

    body:has(.academic-home) #article-container .academic-home__profile:has(.academic-home__profile-card--toast) > a > img {
        width: 100%;
        height: auto;
        margin-inline: auto;
        aspect-ratio: 1;
        object-fit: contain;
    }

}

@media (max-width: 600px) {
    body:has(.academic-home) .academic-home__profile-card--toast {
        padding: 1.65rem 7.5% 1.35rem;
    }

    body:has(.academic-home) .academic-home__profile-card--toast .academic-home__fact {
        padding: 0.4rem 0;
    }
}

/* The SAO decor layers (sword, crest, sky castle) were removed with their markup. Their
   image rules are gone too: blog-navigation.js preloads every url() in loaded CSS. */

