*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #141414;
    color: #f3f3f3;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.app {
    position: relative;
    height: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background:
        radial-gradient(900px 420px at 50% -8%, rgba(237, 2, 23, 0.16), transparent 55%),
        #141414;
}

.top {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem;
    min-height: 3.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 3;
}

.back-site {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.36rem 0.75rem 0.36rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    line-height: 1.15;
}
.back-site:hover,
.back-site:focus-visible {
    background: #ed0217;
    color: #fff;
    outline: none;
}
.back-site__chev {
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 400;
}
.back-site__short { display: none; }

.brand {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: #ed0217;
}

.editions {
    display: inline-flex;
    justify-self: center;
    gap: 0.2rem;
    padding: 0.15rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.editions__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #cfcfcf;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.38rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
}
.editions__btn.is-on {
    background: #ed0217;
    color: #fff;
}
.editions__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.meta {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 650;
    color: #d4d4d4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    max-width: 14rem;
}

.appear-btn {
    appearance: none;
    border: 0;
    background: #ed0217;
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.15;
    touch-action: manipulation;
}
.appear-btn:hover,
.appear-btn:focus-visible {
    background: #c50114;
    outline: none;
}
.appear-btn__short { display: none; }

.stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desk {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    gap: 0.45rem;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0.4rem 0.45rem;
}

.side-btn {
    flex: 0 0 auto;
    width: 4.4rem;
    height: 7.2rem;
    border: 0;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    transition: background .15s ease, opacity .15s ease;
}
.side-btn span { font-size: 2rem; line-height: 1; }
.side-btn em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0.85;
}
.side-btn--prev { justify-self: start; }
.side-btn--next { justify-self: end; }
.side-btn:hover:not(:disabled) { background: #ed0217; }
.side-btn:disabled { opacity: 0.25; cursor: default; }

.spread {
    position: relative;
    display: flex;
    justify-self: center;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    filter: drop-shadow(0 16px 36px rgba(0, 0, 0, 0.45));
    transform-origin: center center;
    cursor: pointer;
}
.spread.is-solo { cursor: default; }
.spread.is-solo.is-cover { cursor: pointer; }

.leaf {
    height: 100%;
    background: #111;
    overflow: hidden;
}
.leaf--left {
    border-radius: 0.12rem 0 0 0.12rem;
    box-shadow: inset -12px 0 16px rgba(0, 0, 0, 0.16);
}
.leaf--right {
    border-radius: 0 0.12rem 0.12rem 0;
    box-shadow: inset 12px 0 16px rgba(0, 0, 0, 0.1);
}
.leaf.is-blank {
    background: #cfc6ba;
}
.leaf.is-blank img { visibility: hidden; }
.leaf img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    image-rendering: auto;
}

.spread.is-solo {
    justify-content: center;
}
.spread.is-solo .leaf--left { display: none; }
.spread.is-solo .leaf--right {
    border-radius: 0.16rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.spread.is-go-next,
.spread.is-go-prev {
    animation: deskFade .18s ease;
}
@keyframes deskFade {
    0% { opacity: .45; }
    100% { opacity: 1; }
}

.phone {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.phone[hidden], .desk[hidden], .empty[hidden] { display: none !important; }

.sheet {
    position: relative;
    overflow: hidden;
    height: calc(100% - 1.6rem);
    max-width: calc(100% - 0.4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
}
.sheet img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 0.12rem;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
.phone-nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 3.1rem;
    height: 3.1rem;
    margin-top: -1.55rem;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    touch-action: manipulation;
}
.phone-nav--prev { left: 0.45rem; }
.phone-nav--next { right: 0.45rem; }
.phone-nav:disabled {
    opacity: 0;
    pointer-events: none;
}

.phone__hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.2rem;
    margin: 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.72);
    pointer-events: none;
    transition: opacity .4s ease;
}
.phone__hint.is-gone { opacity: 0; }

.empty {
    margin: 0;
    color: #9a9a9a;
    font-size: 0.95rem;
}

.bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 0.45rem 0.8rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    z-index: 3;
}

.bar__btn {
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}
.bar__btn:hover:not(:disabled) { background: #ed0217; }
.bar__btn:disabled { opacity: 0.28; }

.bar__range {
    width: min(22rem, 46vw);
    accent-color: #ed0217;
}

.bar__page {
    min-width: 5.2rem;
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    font-weight: 700;
    color: #bdbdbd;
    text-align: left;
}

.loader {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: rgba(20, 20, 20, 0.94);
}
.loader[hidden] { display: none !important; }
.loader__mark {
    font-weight: 800;
    letter-spacing: 0.22em;
    color: #ed0217;
    font-size: 0.8rem;
}
.loader__spin {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: #ed0217;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.loader p { margin: 0; color: #9a9a9a; font-size: 0.88rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.appear {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.appear[hidden] { display: none !important; }
.appear__scrim {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 8, 0.72);
}
.appear__panel {
    position: relative;
    z-index: 1;
    width: min(54rem, 94vw);
    min-height: 22rem;
    max-height: min(32rem, 86vh);
    display: grid;
    grid-template-columns: minmax(15.5rem, 0.9fr) 1.2fr;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.15rem;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.appear__close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 2;
    width: 2.15rem;
    height: 2.15rem;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}
.appear__close:hover,
.appear__close:focus-visible {
    background: #ed0217;
    outline: none;
}
.appear__visual {
    padding: 1.6rem 1.4rem;
    background:
        radial-gradient(120% 90% at 0% 100%, rgba(237, 2, 23, 0.55), transparent 58%),
        linear-gradient(160deg, #2a0a0d 0%, #141414 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.85rem;
    min-height: 0;
}
.appear__mark {
    margin: 0 auto 0 0;
    font-weight: 800;
    letter-spacing: 0.2em;
    font-size: 0.78rem;
    color: #ed0217;
}
.appear__tag {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}
.appear__editions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.appear__editions li {
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.appear__copy {
    padding: 1.7rem 2rem 1.55rem 1.7rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
}
.appear__copy h2 {
    margin: 0 2rem 0.7rem 0;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.appear__copy p {
    margin: 0 0 0.7rem;
    color: #c8c8c8;
    font-size: 0.92rem;
    line-height: 1.45;
    max-width: 34rem;
}
.appear__call {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    margin: 0.45rem 0 0.65rem;
    padding: 0.85rem 1.05rem;
    border-radius: 0.9rem;
    background: #ed0217;
    color: #fff;
    text-decoration: none;
    width: fit-content;
    min-width: 16.5rem;
}
.appear__call:hover,
.appear__call:focus-visible {
    background: #c50114;
    outline: none;
}
.appear__call-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.88;
}
.appear__call-num {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}
.appear__note {
    margin: 0 !important;
    font-size: 0.78rem !important;
    color: #8f8f8f !important;
}

@media (max-width: 1179px) {
    .appear-btn__full { display: none; }
    .appear-btn__short { display: inline; }
    .meta { max-width: 10rem; }
}

@media (max-width: 899px) {
    .top {
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "back editions appear"
            "meta meta meta";
        gap: 0.28rem 0.5rem;
        padding: 0.45rem 0.6rem 0.5rem;
    }
    .back-site { grid-area: back; padding: 0.32rem 0.65rem 0.32rem 0.45rem; }
    .back-site__full { display: none; }
    .back-site__short { display: inline; }
    .brand { display: none; }
    .editions { grid-area: editions; justify-self: center; }
    .appear-btn { grid-area: appear; padding: 0.34rem 0.72rem; font-size: 0.74rem; }
    .meta {
        grid-area: meta;
        max-width: none;
        text-align: left;
        font-size: 0.74rem;
        font-weight: 600;
        color: #b5b5b5;
    }
    .editions__btn { padding: 0.32rem 0.72rem; font-size: 0.76rem; }
    .desk { display: none !important; }
    .bar { gap: 0.45rem; padding-left: 0.45rem; padding-right: 0.45rem; }
    .bar__range { width: min(12rem, 38vw); }
    .bar__page { min-width: 4.2rem; font-size: 0.72rem; }
    .bar__btn { width: 2.85rem; height: 2.85rem; font-size: 1.6rem; }

    .appear {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }
    .appear__scrim { background: #141414; }
    .appear__panel {
        width: 100%;
        height: 100%;
        height: 100dvh;
        min-height: 100%;
        max-height: none;
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        border-radius: 0;
        border: 0;
    }
    .appear__close {
        top: calc(0.55rem + env(safe-area-inset-top, 0px));
        right: 0.7rem;
        background: rgba(255, 255, 255, 0.14);
    }
    .appear__visual {
        padding: calc(1.35rem + env(safe-area-inset-top, 0px)) 1.25rem 1.15rem;
        min-height: 28vh;
    }
    .appear__tag { font-size: 1.45rem; }
    .appear__copy {
        padding: 1.2rem 1.25rem calc(1.3rem + env(safe-area-inset-bottom, 0px));
    }
    .appear__copy h2 { margin-right: 2.4rem; font-size: 1.2rem; }
    .appear__call {
        width: 100%;
        min-width: 0;
        margin-top: auto;
        align-items: center;
        text-align: center;
        padding: 0.95rem 1rem;
    }
}

@media (min-width: 900px) {
    .phone { display: none !important; }
}
