/* ============================================================
   BonesFrisk 的个人网站 · 基础样式
   颜色变量 / 右侧导航 / 页目骨架 / 主页
   ============================================================ */

:root {
    /* 主色 */
    --ink: #111111;
    --paper: #fffdf3;
    --paper-line: #e8e0c6;
    --muted: #625c4a;

    --orange: #ff8c00;
    --blue: #2b5cff;
    --pink: #fb7299;
    --red: #e63946;

    /* 每个页目的底色 */
    --aqua: #ccfffe;
    --mint: #d6f8e8;
    --butter: #fff3c4;
    --sky: #e3ecff;
    --blush: #ffe0e9;

    /* 硬阴影 */
    --shadow: 8px 8px 0 var(--ink);
    --shadow-sm: 5px 5px 0 var(--ink);

    /* 字体 */
    --font-ui: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
    --font-hand: "KaiTi", "STKaiti", "Kaiti SC", "Segoe UI", var(--font-ui);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--ink);
    background: var(--aqua);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--orange);
    color: #ffffff;
}

/* 只给读屏用的文字 */
.VisuallyHidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


.DaoHang {
    --nav-w: 142px;
    --peek: 46px;

    position: fixed;
    top: 50%;
    right: calc(var(--peek) - var(--nav-w));
    z-index: 80;

    display: flex;
    flex-direction: column;
    gap: 10px;
    width: var(--nav-w);
    padding: 16px 12px 14px;

    background: var(--orange);
    border: 3px solid var(--ink);
    box-shadow: var(--shadow-sm);
    transform: translateY(-50%);

    transition: right .32s cubic-bezier(.2, .9, .3, 1.05);
}

.DaoHang::before {
    content: "MENU";
    position: absolute;
    top: 50%;
    left: 2px;
    width: calc(var(--peek) - 10px);
    transform: translateY(-50%);
    writing-mode: vertical-rl;

    font-size: 11px;
    font-weight: 900;
    letter-spacing: .34em;
    text-align: center;
    color: var(--ink);
    pointer-events: none;

    transition: opacity .12s ease;
}

.DaoHang:hover,
.DaoHang:focus-within {
    right: 0;
}

.DaoHang:hover::before,
.DaoHang:focus-within::before {
    opacity: 0;
}

.buttonto {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 8px 0 12px;

    background: #f2f0e8;
    border: 2px solid var(--ink);
    color: var(--ink);
    font-family: inherit;
    font-size: 19px;
    font-weight: 800;
    line-height: 44px;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;

    opacity: 0;
    transform: translateX(26px) rotate(var(--rot, 0deg));
    pointer-events: none;

    transition:
        opacity .16s ease,
        transform .24s cubic-bezier(.2, .9, .3, 1.2),
        background .16s ease,
        box-shadow .16s ease;
}

.DaoHang:hover .buttonto,
.DaoHang:focus-within .buttonto {
    opacity: 1;
    transform: rotate(var(--rot, 0deg));
    pointer-events: auto;
    transition-delay: .05s;
}

/* 当前所在的页目 */
.buttonto[aria-current="location"] {
    background: var(--paper);
    box-shadow: inset 6px 0 0 var(--blue);
    color: var(--blue);
}

.buttonto:hover,
.buttonto:focus-visible {
    background: var(--ink);
    box-shadow: 3px 3px 0 rgba(17, 17, 17, .25);
    color: var(--paper);
    outline: none;
}

.DaoHangText {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1.5;
    text-align: center;
    color: var(--ink);
    opacity: 0;
    user-select: none;
    transition: opacity .12s ease;
}

.DaoHang:hover .DaoHangText,
.DaoHang:focus-within .DaoHangText {
    opacity: .75;
}


/* ============================================================
   页目（每一屏）
   ============================================================ */

.Yemu {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 136px 32px 84px;
    overflow: hidden;

    background-color: var(--aqua);
    background-image: radial-gradient(rgba(17, 17, 17, .085) 1.2px, transparent 1.2px);
    background-size: 26px 26px;

    border-top: 3px solid var(--ink);
}

.Yemu:first-of-type {
    border-top: 0;
}

#main { background-color: var(--aqua); }
#about { background-color: var(--mint); }
#pets { background-color: var(--butter); }
#resume { background-color: var(--sky); }
#contact { background-color: var(--blush); }


.Title {
    position: absolute;
    top: 28px;
    left: 30px;
    z-index: 5;

    margin: 0;
    padding: 4px 22px 8px;

    font-size: clamp(34px, 5vw, 56px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: .06em;
    color: var(--paper);
    background: var(--blue);
    border: 3px solid var(--ink);
    box-shadow: 7px 7px 0 var(--ink);
    transform: rotate(-1.5deg);
    user-select: none;
}


/* ============================================================
   主页
   ============================================================ */

.MainYemuYami {
/*	主页面css*/
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    width: min(100%, 900px);
    text-align: center;
}

.MainYemuYami img {
    display: block;
    width: min(52vmin, 400px);
    height: auto;
    background: var(--aqua);
    border: 3px solid var(--ink);
    box-shadow: 10px 10px 0 var(--ink);
    animation: bob 6s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-10px) rotate(2deg); }
}

.HandDownText {
    margin: 0;
    max-width: 17em;
    font-family: var(--font-hand);
    font-size: clamp(26px, 4.2vw, 54px);
    font-weight: 700;
    line-height: 1.45;
    white-space: pre-line;
}

.HandDownText.is-filled {
    animation: handTextIn .65s cubic-bezier(.2, .9, .3, 1) both;
}

@keyframes handTextIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.HandDownSmallText {
    margin: 0;
    padding: 6px 16px;

    font-size: clamp(14px, 1.8vw, 19px);
    font-weight: 800;
    letter-spacing: .22em;
    background: var(--paper);
    border: 2px solid var(--ink);
    box-shadow: 3px 3px 0 var(--ink);
    transform: rotate(1.5deg);
}


/* ============================================================
   窄屏：导航变成底部横条
   ============================================================ */

@media (max-width: 900px) {
    .DaoHang {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        transform: none;

        flex-direction: row;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));

        border-width: 3px 0 0;
        box-shadow: 0 -5px 0 var(--ink);
        transition: none;
    }

    .DaoHang::before {
        display: none;
    }

    .DaoHangText {
        display: none;
    }

    .buttonto {
        width: auto;
        flex: 0 1 auto;
        height: 40px;
        padding: 0 9px;

        font-size: 14px;
        line-height: 36px;

        opacity: 1;
        transform: none !important;
        pointer-events: auto;
        box-shadow: none;
    }

    .buttonto[aria-current="location"] {
        box-shadow: inset 0 -5px 0 var(--blue);
    }

    .Yemu {
        padding-bottom: 92px;
    }
}

@media (max-width: 680px) {
    .Yemu {
        padding: 112px 18px 100px;
    }

    .Title {
        top: 18px;
        left: 16px;
        padding: 2px 16px 6px;
        font-size: clamp(28px, 8vw, 40px);
        box-shadow: 5px 5px 0 var(--ink);
    }

    .MainYemuYami {
        gap: 20px;
    }

    .HandDownSmallText {
        font-size: 13px;
        letter-spacing: .18em;
    }
}


/* 矮屏幕时把主页收紧一点 */
@media (max-height: 760px) and (min-width: 901px) {
    .Yemu {
        padding-top: 108px;
        padding-bottom: 48px;
    }

    .MainYemuYami img {
        width: min(42vmin, 320px);
    }

    .HandDownText {
        font-size: clamp(24px, 3.4vw, 44px);
    }
}


/* 尊重系统的“减少动态效果”设置 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
