* {
    box-sizing: border-box;
}

:root {
    --paper: #f8f8f6;
    --paper-soft: #fffefb;
    --line: #121212;
    --muted: #767676;
    --ink: #111;
    --shadow: rgba(0, 0, 0, 0.16);
    --gray: #d7d7d7;
    --panel: #f1f1ee;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 50% 30%, var(--paper-soft), var(--paper)) ,
        repeating-linear-gradient(90deg, transparent, transparent 8px, rgba(0,0,0,0.03) 9px),
        repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(0,0,0,0.03) 9px);
    font-family: "Trebuchet MS", "Verdana", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

body::before {
    content: "";
    position: fixed;
    inset: -30px;
    background-image: radial-gradient(var(--ink) 1px, transparent 1px);
    background-size: 22px 22px;
    transform: rotate(2deg);
    opacity: 0.055;
    pointer-events: none;
}

.comic-page {
    width: min(960px, calc(100vw - 40px));
}

.comic-frame {
    position: relative;
    background: var(--paper-soft);
    border: 3px solid var(--line);
    box-shadow: 8px 8px 0 var(--line), 16px 16px 0 var(--gray);
    padding: clamp(24px, 4vw, 40px);
    min-height: min(620px, auto);
    overflow: hidden;
}

.comic-frame::before,
.comic-frame::after {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--line);
    background: transparent;
}

.comic-frame::before {
    top: -12px;
    right: -12px;
    transform: rotate(12deg);
}

.comic-frame::after {
    bottom: -12px;
    left: -12px;
    transform: rotate(-14deg);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px dashed var(--line);
    padding-bottom: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    font-size: clamp(14px, 2vw, 18px);
    letter-spacing: 0.15em;
}

.brand-mark {
    width: 12px;
    height: 12px;
    background: var(--line);
    border-radius: 50%;
    border: 2px solid var(--line);
    box-shadow: 3px 3px 0 var(--gray);
}

.nav {
    display: flex;
    gap: 8px;
    align-items: center;
    transform: translateX(-8px);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 14px;
    color: var(--ink);
    background: var(--paper-soft);
    border: 2px solid var(--line);
    text-decoration: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 3px 3px 0 var(--line);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.nav-button:first-child {
    border-left: 2px solid var(--line);
}

.nav-button:hover,
.nav-button:focus {
    background: var(--line);
    color: var(--paper-soft);
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 var(--gray);
}

.links-menu {
    position: relative;
}

.links-toggle {
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.links-toggle::-webkit-details-marker {
    display: none;
}

.links-toggle::marker {
    content: "";
}

.links-icon {
    width: 16px;
    height: 16px;
    flex: none;
}

.links-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 5;
    display: grid;
    min-width: 180px;
    padding: 5px;
    background: var(--paper-soft);
    border: 2px solid var(--line);
    box-shadow: 4px 4px 0 var(--line);
}

.links-panel a {
    padding: 10px 12px;
    color: var(--ink);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-decoration: none;
}

.links-panel a:hover,
.links-panel a:focus-visible {
    color: var(--paper-soft);
    background: var(--line);
}

.title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(16px, 3vw, 30px) 0 14px;
}

.title-block-404 {
    margin-top: 18px;
}

.kicker {
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 900;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    margin: 10px 0 0;
    font-family: Impact, "Arial Black", "Trebuchet MS", Arial, sans-serif;
    font-size: clamp(56px, 11vw, 96px);
    line-height: 0.92;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--ink);
    text-transform: uppercase;
    text-shadow: 3px 3px 0 var(--gray);
}

.return-zone {
    min-height: 240px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.return-zone-404 {
    min-height: 160px;
    margin-top: 8px;
}

.return-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 17px 34px;
    color: var(--paper-soft);
    background: var(--line);
    border: 2px solid var(--line);
    border-radius: 14px;
    box-shadow: 4px 4px 0 var(--gray);
    font-size: 18px;
    font-weight: 900;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.return-button:hover,
.return-button:focus-visible {
    color: var(--ink);
    background: var(--paper-soft);
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 var(--line);
}

.return-icon {
    width: 28px;
    height: 28px;
    flex: none;
}

.image-zone {
    width: min(440px, 90%);
    margin: 20px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-card {
    position: relative;
    width: min(380px, 86vw);
    min-height: 260px;
    background: var(--paper-soft);
    border: 3px solid var(--line);
    padding: 12px;
    transform: rotate(-1deg);
    box-shadow: 0 0 0 2px var(--paper-soft), 5px 5px 0 var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-card::before,
.image-card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 2px dashed var(--line);
    inset: -7px;
}

.image-card::after {
    inset: 8px;
}

.image-card img {
    display: block;
    max-width: 100%;
    max-height: min(420px, 50vh);
    width: auto;
    height: auto;
    object-fit: contain;
    border: 2px solid var(--line);
    filter: grayscale(100%) contrast(1.3) drop-shadow(4px 4px 0 var(--shadow));
}

.image-card .caption-badge {
    position: absolute;
    z-index: 2;
    left: 12px;
    bottom: 12px;
    background: var(--paper-soft);
    border: 2px solid var(--line);
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transform: rotate(-4deg);
}

.comic-corners {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid var(--line);
    background: transparent;
}

.corner-top-left { top: 9px; left: 9px; border-right: none; border-bottom: none; }
.corner-top-right { top: 9px; right: 9px; border-left: none; border-bottom: none; }
.corner-bottom-left { bottom: 9px; left: 9px; border-right: none; border-top: none; }
.corner-bottom-right { bottom: 9px; right: 9px; border-left: none; border-top: none; }

.panel-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.panel-footer::before,
.panel-footer::after {
    content: "";
    display: inline-block;
    width: 50px;
    height: 2px;
    background: var(--line);
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        flex-wrap: wrap;
    }

    .comic-frame {
        box-shadow: 6px 6px 0 var(--line), 12px 12px 0 var(--gray);
    }
}
