/* Responsive behaviour and accessibility ---------------------------------- */

@media (max-width: 1240px) {
    .topbar__status { display: none; }
    .topbar__nav { margin-left: auto; }
    .hero__side { display: none; }
    .hero__copy { width: min(700px, 55vw); }
    .chapter__inner,
    .chapter--world .chapter__inner,
    .chapter--file .chapter__inner,
    .chapter--protocol .chapter__inner { width: min(680px, 53vw); }
    .globe-canvas, .marker-layer { width: 66vw; }
    .globe-hud { width: 64vw; }
}

@media (min-width: 981px) and (max-height: 820px) {
    .hero__copy { padding-top: 3vh; }
    .hero-title { margin: 14px 0 20px; }
    .hero-title__cn { font-size: clamp(5.2rem, 11.4vw, 10.5rem); }
    .hero-title__en { font-size: clamp(2.8rem, 6.3vw, 6.2rem); }
    .hero__lede > p:first-child { font-size: clamp(1.05rem, 1.5vw, 1.35rem); }
    .hero__small { margin-top: 8px; line-height: 1.65; }
    .hero__actions { margin-top: 22px; }
    .hero__readouts { margin-top: 27px; padding-top: 13px; }
    .hero__scroll, .hero__corner { display: none; }
    .globe-hud { top: 80px; bottom: 108px; }
    .globe-tools { top: 46%; }
    .dock { bottom: 39px; }
}

@media (max-width: 980px) {
    .topbar { height: 66px; }
    .topbar__nav { display: none; }
    .menu-btn { display: block; }
    .sound-btn__label { display: none; }
    .hero { align-items: flex-end; min-height: 100svh; padding-top: 52vh; padding-bottom: 13vh; }
    .hero__copy { width: 100%; padding-top: 0; }
    .hero-title { margin: 16px 0 20px; }
    .hero-title__cn { font-size: clamp(5.5rem, 19vw, 10rem); }
    .hero-title__en { font-size: clamp(2.8rem, 11vw, 6.4rem); }
    .hero__lede > p:first-child { font-size: 17px; }
    .hero__readouts { margin-top: 30px; gap: 18px 28px; }
    .hero__scroll, .hero__corner { display: none; }
    .globe-canvas, .marker-layer { width: 100%; height: 58vh; top: 3vh; }
    .globe-fallback {
        top: 31vh; right: 50%;
        width: min(84vw, 460px); height: min(84vw, 460px);
        transform: translate(50%, -50%);
        border-radius: 0;
    }
    .globe-halo { width: 92vw; right: -4vw; top: 31vh; }
    .globe-orbit { right: 50%; width: 88vw; height: 58vh; transform: translate(50%, -50%) rotate(-16deg); top: 31vh; }
    .globe-orbit--two { width: 74vw; height: 47vh; transform: translate(50%, -50%) rotate(28deg); }
    .globe-hud { top: 78px; right: 16px; bottom: auto; height: 48vh; width: calc(100% - 32px); }
    .globe-hud__top { flex-direction: column; align-items: flex-start; gap: 5px; }
    .hud-label--dim { display: block; font-size: 7.5px; max-width: 78vw; text-align: left; color: var(--ink-dim); }
    .hint-desktop { display: none; }
    .hint-mobile { display: inline; }
    .globe-hud__crosshair { left: 50%; top: 55%; }
    .globe-hud__bottom { display: none; }
    .globe-tools { top: 32vh; right: 13px; }
    .view-switch { display: none; }
    .globe-tools__row { flex-direction: column; }
    .tool-btn { width: 32px; height: 32px; }
    .node-card { bottom: 94px; }
    .time-panel { bottom: 94px; }
    .site { background: linear-gradient(180deg, transparent 0, transparent 48vh, rgba(6,7,8,.72) 60vh, rgba(6,7,8,.92) 75vh); }
    .chapter { min-height: auto; padding: 13vh var(--pad) 11vh; }
    .chapter__inner,
    .chapter--world .chapter__inner,
    .chapter--file .chapter__inner,
    .chapter--protocol .chapter__inner { width: 100%; }
    .chapter__rule { top: 6vh; }
    .chapter__head { margin-bottom: 34px; }
    .chapter__title { font-size: clamp(3rem, 9vw, 5rem); }
    .chapter__lede { font-size: 12px; }
    .footer__main { grid-template-columns: 1fr; gap: 48px; padding-top: 8vh; }
    .footer__about { padding-top: 0; }
    .footer__end h2 { font-size: clamp(4rem, 14vw, 7rem); }
    .footer__marquee-track span { font-size: 3.6rem; }
    .feed-toolbar { align-items: flex-start; gap: 14px; }
    .feed-sync { padding-top: 2px; }
    .feed-sync .mono { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .signal-feature { grid-template-columns: minmax(0, 1fr) 110px; gap: 16px; }
    .signal-index { font-size: 38px; }
    .signal-thumb { height: 70px; }
    .signal-row { grid-template-columns: 24px minmax(0, 1fr) 84px; }
    .dossier__body { grid-template-columns: 1fr; }
    .dossier__radar { max-width: 300px; margin: 0 auto; }
    .dossier__stats { gap: 16px; }
    .dossier__identity { grid-template-columns: 1fr 140px; }
    .footer__about { grid-template-columns: 1fr 1fr; }
    .ticker { padding: 0 18px; }
    .ticker__label { display: none; }
    .ticker__time { display: none; }
    .dock { bottom: 40px; left: 50%; right: auto; transform: translateX(-50%); }
    .dock.is-hidden { opacity: 0; transform: translate(-50%, 90px); pointer-events: none; }
    .node-card { right: 12px; width: min(320px, calc(100vw - 24px)); background: linear-gradient(145deg, rgba(15,18,21,.985), rgba(8,10,12,.985)); }
    .node-scrim { display: block; }
    body.node-open { overflow: hidden; }
}

@media (max-width: 640px) {
    :root { --pad: 18px; }
    body { font-size: 15px; }
    .brand__slash { display: none; }
    .topbar { gap: 12px; }
    .topbar__actions { margin-left: auto; gap: 10px; }
    .hero { padding-top: 48vh; padding-bottom: 11vh; }
    .hero__small { font-size: 11px; }
    .hero__actions { margin-top: 26px; gap: 8px; }
    .hero__actions .btn { flex: 1 1 0; min-width: 0; }
    .btn { min-height: 46px; padding: 0 16px; font-size: 11px; }
    .hero__actions .btn { padding: 0 12px; }
    .dock.is-hidden { opacity: 0; transform: translate(-50%, 90px); pointer-events: none; }
    .hero__readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; margin-top: 24px; padding-top: 13px; }
    .hero__readouts > div:last-child { display: none; }
    .hero__readouts dt { font-size: 7px; margin-bottom: 3px; }
    .hero__readouts dd { font-size: 10px; }
    .chapter { padding-top: 11vh; padding-bottom: 9vh; }
    .chapter__index { margin-bottom: 22px; font-size: 8px; }
    .chapter__title { font-size: clamp(2.65rem, 12vw, 4rem); }
    .chapter__lede { margin-top: 18px; line-height: 1.8; }
    .feed-tabs { gap: 4px 14px; }
    .feed-tabs button { font-size: 8px; }
    .feed-sync .mono { font-size: 7px; }
    .signal-feature { display: block; padding: 22px 0; }
    .signal-feature__aside { display: none; }
    .signal-feature h3 { font-size: 1.4rem; }
    .signal-desc { font-size: 11px; -webkit-line-clamp: 4; }
    .signal-meta { gap: 10px; flex-wrap: wrap; margin-top: 14px; }
    .signal-meta .mono { font-size: 7px; }
    .signal-row { grid-template-columns: 20px minmax(0, 1fr); padding: 16px 0; }
    .signal-row__meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px 12px; padding-top: 0; margin-top: 4px; text-align: left; }
    .signal-row__arrow, .signal-row__thumb { display: none; }
    .signal-row h4 { font-size: 15px; }
    .signal-row p { -webkit-line-clamp: 2; font-size: 10px; }
    .feed-footer { display: block; }
    .feed-footer .mono { margin-top: 12px; text-align: left; }
    .dossier__top { gap: 12px; padding: 15px 16px; }
    .dossier__level { margin-left: 0; }
    .dossier__id strong { font-size: 9px; }
    .dossier__identity { grid-template-columns: 1fr; gap: 14px; padding: 18px 16px; }
    .dossier__privacy { margin-top: 0; }
    .identity-name input { font-size: 21px; }
    .identity-year { width: 140px; }
    .dossier__body { padding: 20px 16px; }
    #radar { max-width: 270px; }
    .dossier__stories { grid-template-columns: 1fr; }
    .story-card { padding: 15px 16px; }
    .story-card p { font-size: 15px; }
    .daily { padding: 16px; }
    .dossier__actions { padding: 16px 16px 10px; gap: 8px; }
    .dossier__actions .btn { min-height: 40px; font-size: 10px; }
    .dossier__actions .btn--text { width: 100%; justify-content: flex-start; }
    .dossier__footnote { padding: 0 16px 15px; line-height: 1.7; }
    .rule summary { grid-template-columns: 30px 1fr 20px; gap: 8px; padding: 17px 0; }
    .rule__name { gap: 3px; flex-direction: column; }
    .rule__name b { font-size: 1.2rem; }
    .rule__body { padding: 0 20px 18px 38px; }
    .rule__body > p { font-size: 11px; }
    .protocol-quote { margin-top: 44px; padding-left: 17px; }
    .protocol-quote p { font-size: 1.35rem; }
    .footer { padding-top: 10vh; }
    .footer__main { padding: 7vh 18px 7vh; }
    .footer__about { grid-template-columns: 1fr; gap: 28px; }
    .footer__end h2 { font-size: clamp(4rem, 18vw, 6rem); }
    .footer__marquee-track span { font-size: 2.7rem; }
    .footer__marquee-track { gap: 20px; animation-duration: 26s; }
    .footer__bottom { padding: 18px 18px 90px; }
    .footer__bottom .mono { font-size: 6px; }
    .dock { bottom: 36px; max-width: calc(100vw - 20px); left: 50%; right: auto; transform: translateX(-50%); }
    .dock a, .dock button { width: 44px; height: 38px; }
    .dock__label { font-size: 6px; }
    .dock__key { display: none; }
    .ticker { height: 26px; }
    .ticker__track span { font-size: 8px; }
    .modal { padding: 10px; }
    .modal__panel { padding: 28px 18px 24px; max-height: 90vh; }
    .modal__panel--quiz { min-height: 0; }
    .article-modal__title { font-size: 1.55rem; }
    .article-modal__desc { font-size: 12px; }
    .article-modal__actions .btn { min-height: 42px; }
    .quiz__intro h2 { font-size: 3rem; }
    .quiz__question { font-size: 1.35rem; min-height: 4em; }
    .quiz-option { padding: 12px; font-size: 11px; }
    .quiz-result__type { font-size: 2.7rem; }
    .quiz-result__score b { font-size: 34px; }
    .quiz-result__desc { font-size: 12px; }
    .palette { padding-top: 8vh; }
    .palette__box { max-height: 82vh; }
    .palette__body { max-height: calc(82vh - 108px); }
    .palette__foot { display: none; }
    .toast { bottom: 96px; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
    .node-card { bottom: 87px; }
    .time-panel { bottom: 87px; padding: 16px; }
    .time-panel p { font-size: 9px; }
    .globe-tools { top: 30vh; }
    .globe-hud { top: 72px; height: 44vh; }
    .globe-canvas, .marker-layer { height: 52vh; top: 5vh; }
    .map-marker__label { font-size: 7px; }
    .map-marker--news .map-marker__label { display: none; }
}

@media (max-width: 390px) {
    .hero-title__cn { font-size: 5.2rem; }
    .hero-title__en { font-size: 2.5rem; }
    .hero__actions .btn { flex: 1; }
    .hero__actions .btn__key { display: none; }
    .dock a, .dock button { width: 40px; }
    .dock__label { display: none; }
    .dock { gap: 2px; }
}

/* Coarse pointer / reduced motion ---------------------------------------- */
@media (pointer: coarse) {
    .cursor { display: none; }
    .globe-canvas { cursor: default; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
}

/* Scrollbar --------------------------------------------------------------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #070808; }
::-webkit-scrollbar-thumb { background: #2b2c2c; border: 2px solid #070808; }
::-webkit-scrollbar-thumb:hover { background: #474541; }
