@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

@font-face {
    font-family: 'BusanDandiMyeongjo';
    src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/2610132210@l-2/l/부산단디명조L.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'BusanDandiMyeongjo';
    src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/2610132210@l-2/l/부산단디명조M.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'BusanDandiMyeongjo';
    src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/2610132210@l-2/l/부산단디명조B.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'GounBatang';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/GowunBatang-Regular.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GounBatang';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/GowunBatang-Bold.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'GounBatang';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/GowunBatang-Regular.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GounBatang';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2108@1.1/GowunBatang-Bold.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'MiceMyungjo';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2206-01@1.0/MICEMyungjo.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --bg: #191B20;
    --surface: #22252B;
    --surface-2: #2B2E35;
    --line: #3B3F47;
    --text: #D5D7DB;
    --heading: #ECEEF1;
    --muted: #979CA5;
    --red: #E07171;
    --highlight: #EED66B;
    --highlight-text: #191B20;
    --redact: #525760;

    --sans: "Pretendard", sans-serif;
    --mono: "IBM Plex Mono", monospace;
    --serif: "GounBatang", sans-serif;
    --quote: "MiceMyungjo", sans-serif;
    --logo: "BusanDandiMyeongjo", sans-serif;

    --gutter: clamp(20px, 5vw, 64px);
    --bar-h: 56px;
    --ease: cubic-bezier(.16, 1, .3, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.75 var(--sans);
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-tap-highlight-color: transparent;
}

body.is-locked {
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -40px;
    z-index: -1;
    background:
        linear-gradient(rgba(27, 26, 21, .55), rgba(27, 26, 21, .55)),
        url("../img/background.jpg") center / cover no-repeat;
    filter: blur(14px);
    transition: filter .6s ease;
    pointer-events: none;
}

body.is-home::before {
    filter: blur(2px);
}

[hidden] {
    display: none !important;
}

h1, h2, h3, h4, p {
    margin: 0;
    padding: 0;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--heading);
    outline-offset: 3px;
}

/* 인트로 */
#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--gutter);
    background: #0E0F11;
    color: var(--heading);
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: opacity .9s ease, visibility 0s linear .9s;
}

.intro-overlay.is-leaving {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(76vw, 460px);
    aspect-ratio: 1;
    border: 1px solid rgba(228, 232, 224, .22);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ring 5s ease-in-out infinite;
}

.is-leaving .intro-ring {
    animation: none;
    transform: translate(-50%, 50%) scale(5);
    transition: transform .9s ease-in;
}

.intro-logo {
    position: relative;
    font-family: var(--logo);
    font-weight: 700;
    font-size: clamp(44px, 12vw, 96px);
    line-height: 1;
    letter-spacing: -.02em;
    animation: rise 1.6s var(--ease) both;
}

.intro-logo img {
    display: block;
    width: min(64vw, 360px);
    height: auto;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.intro-tagline {
    position: relative;
    margin-top: 20px;
    font: 400 clamp(11px, 2.6vw, 13px)/1.5 var(--mono);
    letter-spacing: .14em;
    color: var(--muted);
    animation: rise 1.6s .25s var(--ease) both;
}

.intro-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(48px + env(safe-area-inset-bottom));
    font: 500 12px/1 var(--mono);
    letter-spacing: .3em;
    text-transform: uppercase;
    animation: blink 2.2s ease-in-out infinite;
}

@keyframes ring {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .6; }
    50% { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes blink { 50% { opacity: .25; } }

/* 인트로 노이즈 */
#intro-overlay.is-glitching {
    pointer-events: none;
}

.is-glitching .intro-logo,
.is-glitching .intro-tagline,
.is-glitching .intro-hint {
    animation: glitch .36s steps(1) infinite;
}

.is-glitching .intro-logo img {
    filter: brightness(0) invert(1)
        drop-shadow(4px 0 rgba(255, 60, 70, .85))
        drop-shadow(-4px 0 rgba(60, 220, 255, .85));
}

.is-glitching .intro-ring { animation: glitch-flicker .18s steps(1) infinite; }

#static-noise {
    position: fixed;
    inset: 0;
    z-index: 101;
    width: 100%;
    height: 100%;
    pointer-events: none;
    image-rendering: pixelated;
}

@keyframes glitch {
    0%   { transform: translate(-6px, 1px);  clip-path: inset(0 0 58% 0); }
    20%  { transform: translate(9px, -2px);  clip-path: inset(46% 0 12% 0); }
    40%  { transform: translate(-3px, 2px);  clip-path: inset(0); }
    60%  { transform: translate(12px, 0);    clip-path: inset(18% 0 50% 0); }
    80%  { transform: translate(-10px, -1px); clip-path: inset(62% 0 0 0); }
}
@keyframes glitch-flicker {
    0%  { opacity: .9; }
    33% { opacity: .1; }
    66% { opacity: .5; }
}

/* 노이즈 텍스트 */
.noise-title, .noise-text {
    position: relative;
    width: fit-content;
    color: var(--muted);
}

.noise-title.is-in, .noise-text.is-in {
    animation: noise-jitter 4.2s steps(1) calc(var(--delay, 0ms) + .8s) infinite;
}

.noise-text.is-in { animation-duration: 5.7s; }

.glitch-line::before, .glitch-line::after,
.noise-title::before, .noise-title::after,
.noise-text::before, .noise-text::after {
    content: "";
    position: absolute;
    inset: -1px -3px;
    opacity: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(90deg,
            var(--redact) 0 3px, var(--bg) 3px 5px, var(--text) 5px 6px,
            var(--redact) 6px 13px, var(--bg) 13px 14px, var(--muted) 14px 17px);
    animation: noise-bars-a 4.2s steps(1) infinite;
}

.glitch-line::after, .noise-title::after, .noise-text::after {
    background-size: 37px 100%;
    animation-name: noise-bars-b;
}

.noise-text::before, .noise-text::after {
    animation-duration: 5.7s;
    animation-delay: -1.6s;
}

@keyframes noise-jitter {
    0%, 41%, 45%, 49%, 53%, 86%, 89%, 100% { transform: none; text-shadow: none; opacity: 1; }
    42% { transform: translate(-3px, 1px) skewX(-8deg); text-shadow: 3px 0 rgba(255, 60, 70, .85), -3px 0 rgba(60, 220, 255, .85); opacity: .75; }
    46% { transform: translate(4px, 0) skewX(6deg);     text-shadow: -4px 0 rgba(255, 60, 70, .85), 4px 0 rgba(60, 220, 255, .85); opacity: .55; }
    50% { transform: translate(-2px, -1px);             text-shadow: 2px 0 rgba(255, 60, 70, .85), -2px 0 rgba(60, 220, 255, .85); opacity: .85; }
    87% { transform: translate(3px, 0) skewX(-5deg);    text-shadow: -3px 0 rgba(255, 60, 70, .85), 3px 0 rgba(60, 220, 255, .85); opacity: .6; }
}

@keyframes noise-bars-a {
    0%, 41%, 44%, 49%, 52%, 86%, 89%, 100% { opacity: 0; clip-path: inset(0); background-position: 0 0; }
    42% { opacity: 1; clip-path: inset(8% 34% 62% 0);   background-position: 11px 0; }
    46% { opacity: 1; clip-path: inset(52% 0 14% 22%);  background-position: -23px 0; }
    50% { opacity: 1; clip-path: inset(0 58% 46% 12%);  background-position: 7px 0; }
    87% { opacity: 1; clip-path: inset(30% 12% 36% 40%); background-position: -14px 0; }
}

@keyframes noise-bars-b {
    0%, 41%, 45%, 49%, 53%, 86%, 89%, 100% { opacity: 0; clip-path: inset(0); background-position: 0 0; }
    43% { opacity: .9; clip-path: inset(66% 46% 4% 8%);  background-position: -9px 0; }
    47% { opacity: 1;  clip-path: inset(12% 6% 70% 48%); background-position: 19px 0; }
    51% { opacity: .9; clip-path: inset(70% 20% 0 30%);  background-position: -31px 0; }
    88% { opacity: 1;  clip-path: inset(4% 50% 68% 0);   background-position: 5px 0; }
}

.glitch-line {
    position: relative;
    width: fit-content;
    max-width: 100%;
    animation: noise-jitter 4.2s steps(1) infinite;
}

.glitch-line, .glitch-line::before, .glitch-line::after { animation-delay: var(--glitch-offset, 0s); }
.glitch-line + .glitch-line { --glitch-offset: -1.1s; }
.glitch-line + .glitch-line + .glitch-line { --glitch-offset: -2.6s; }

.type-pending { visibility: hidden; }
.glitch-line.is-typing, .glitch-line.is-typing::before, .glitch-line.is-typing::after { animation: none; }

.type-cursor {
    display: inline-block;
    width: .55em;
    height: 1.05em;
    margin-left: 2px;
    vertical-align: -.15em;
    background: currentColor;
    animation: type-blink 1s steps(1) infinite;
}
@keyframes type-blink { 50% { opacity: 0; } }

.type-appear { animation: type-appear .4s steps(1); }
@keyframes type-appear {
    0%   { opacity: 0; }
    25%  { opacity: 1; }
    45%  { opacity: .15; }
    65%  { opacity: 1; }
    80%  { opacity: .5; }
}

/* 스크롤 애니메이션 */
.js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
    transition-delay: var(--delay, 0ms);
}

.js .reveal.is-in {
    opacity: 1;
    transform: none;
}

/* 메인 */
#view-main {
    position: relative;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 64px;
    padding: calc(var(--gutter) + 40px) var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom));
    text-align: center;
}

.site-header {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    container-type: size;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.site-header .slogan { margin-top: 4px; }

.eyebrow {
    font: 500 12px/1.5 var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.site-header h1 {
    margin-top: 16px;
    color: var(--heading);
    font-family: var(--logo);
    font-weight: 700;
    font-size: clamp(52px, min(15vw, 16vh), 190px);
    line-height: .95;
    letter-spacing: -.02em;
}

.site-header h1 img {
    display: block;
    width: min(100cqw, 1200px, calc((100cqh - 80px) * 1.76));
    height: auto;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.slogan {
    margin-top: 16px;
    font-family: var(--serif);
    font-size: clamp(14px, 1.8vw, 20px);
    color: var(--muted);
}

/* 슬로건 */
.slogan {
    --r: rgba(255, 40, 60, .9);
    --c: rgba(40, 230, 255, .9);
    color: var(--heading);
    animation: slogan-chroma 2.8s steps(1) infinite;
}

@keyframes slogan-chroma {
    0%, 100% { text-shadow: none; }
    14% { text-shadow: 8px 1px var(--r), -8px -1px var(--c), 0 0 14px rgba(40, 230, 255, .35); }
    17% { text-shadow: -6px 0 var(--r), 6px 0 var(--c), 0 0 12px rgba(255, 40, 60, .35); }
    20% { text-shadow: 12px -2px var(--r), -12px 2px var(--c), 0 0 18px rgba(255, 40, 60, .45); }
    23% { text-shadow: none; }
    48% { text-shadow: 5px 0 var(--r), -5px 0 var(--c), 0 0 12px rgba(40, 230, 255, .3); }
    51% { text-shadow: none; }
    74% { text-shadow: -14px 0 var(--r), 14px 0 var(--c), 0 0 20px rgba(40, 230, 255, .45); }
    76% { text-shadow: 9px 2px var(--r), -9px -2px var(--c), 0 0 16px rgba(255, 40, 60, .4); }
    79% { text-shadow: none; }
}

.main-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    max-width: 960px;
    border-top: 1px solid var(--muted);
    border-bottom: 1px solid var(--line);
    counter-reset: nav;
}

.main-nav button {
    counter-increment: nav;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 12px;
    color: var(--heading);
    font-weight: 600;
    font-size: clamp(20px, 2.6vw, 30px);
    line-height: 1.3;
    text-align: center;
}

.main-nav button + button { border-left: 1px solid var(--line); }

.main-nav button::before {
    content: "DOC-0" counter(nav);
    font: 400 12px/1 var(--mono);
    color: var(--muted);
}

.main-nav button::after {
    content: attr(data-en);
    font: 400 12px/1 var(--mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

@media (max-width: 600px) {
    .main-nav {
        grid-template-columns: 1fr;
        border-bottom: 0;
    }
    .main-nav button {
        flex-direction: row;
        align-items: baseline;
        gap: 16px;
        padding: 18px 0;
        border-bottom: 1px solid var(--line);
        font-size: clamp(24px, 4vw, 40px);
        text-align: left;
    }
    .main-nav button + button { border-left: 0; }
    .main-nav button::after { margin-left: auto; }
}

@media (hover: hover) {
    .main-nav button {
        background: linear-gradient(var(--heading), var(--heading)) no-repeat 0 0 / 0% 1px;
        transition: background-size .45s var(--ease), color .3s;
    }
    .main-nav button::before,
    .main-nav button::after { transition: color .3s, letter-spacing .45s var(--ease); }

    .js .main-nav button.reveal {
        transition: background-size .45s var(--ease), color .3s,
            opacity .7s var(--ease) var(--delay, 0ms), transform .7s var(--ease) var(--delay, 0ms);
    }

    .main-nav:hover button { color: var(--muted); }
    .main-nav button:hover {
        color: var(--heading);
        background-size: 100% 1px;
    }
    .main-nav button:hover::before,
    .main-nav button:hover::after { color: var(--heading); }
    .main-nav button:hover::after { letter-spacing: .24em; }
}

/* 상단 바 */
.page-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: var(--bar-h);
    padding: 0 var(--gutter);
    background: rgba(27, 26, 21, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.page-bar-logo {
    color: var(--heading);
    font-family: var(--logo);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.05;
    letter-spacing: -.01em;
    text-align: left;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.page-bar-logo img {
    display: block;
    height: 34px;
    width: auto;
    filter: brightness(0) invert(1);
}

.page-tabs {
    display: flex;
    gap: 24px;
    margin: 0 auto 0 12px;
}

.page-tabs button {
    position: relative;
    min-height: 44px;
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    transition: color .25s;
}

.page-tabs button:hover,
.page-tabs button[aria-current="page"] {
    color: var(--heading);
}

.page-tabs button[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    height: 2px;
    background: var(--heading);
}

.sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--muted);
    transition: color .25s;
}

.sound-toggle:hover {
    color: var(--heading);
}

.sound-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sound-toggle .icon-on,
.sound-toggle[aria-pressed="true"] .icon-off {
    display: none;
}

.sound-toggle[aria-pressed="true"] .icon-on {
    display: block;
}

.sound-toggle[aria-pressed="true"] {
    color: var(--heading);
}

.sound-toggle--floating {
    position: absolute;
    top: 12px;
    right: var(--gutter);
}

.scroll-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
}

.scroll-progress span {
    display: block;
    height: 100%;
    background: var(--heading);
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
}

/* 문서 화면 */
.page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px var(--gutter) calc(48px + env(safe-area-inset-bottom));
}

.doc {
    background: var(--surface);
    border: 1px solid var(--line);
}

.doc-titlebar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(20px, 5vw, 56px);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font: 400 12px/1.5 var(--sans);
    color: var(--muted);
}

.doc-titlebar span:last-child {
    flex: none;
}

.doc-header, .doc-body {
    max-width: 800px;
    margin: 0 auto;
    padding-left: clamp(20px, 5vw, 56px);
    padding-right: clamp(20px, 5vw, 56px);
}

.doc-header {
    padding-top: clamp(32px, 6vw, 56px);
}

.doc-header h2 {
    margin-top: 8px;
    color: var(--heading);
    font-weight: 700;
    font-size: clamp(34px, 6vw, 48px);
    line-height: 1.3;
}

.lead {
    margin-top: 12px;
    font-size: clamp(17px, 2vw, 19px);
    line-height: 1.75;
    color: var(--muted);
}

.doc-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
    margin: 28px 0 0;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.doc-meta dt { font-size: 12px; line-height: 1.5; color: var(--muted); }
.doc-meta dd { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.6; }

@media (min-width: 640px) { .doc-meta { grid-template-columns: repeat(4, 1fr); } }

/* 지도 */
.region-map {
    position: relative;
    max-width: 800px;
    margin: clamp(28px, 5vw, 44px) auto 0;
    padding: 0 clamp(20px, 5vw, 56px);
}

.region-map svg {
    display: block;
    width: 100%;
    height: auto;
}

.map-area {
    cursor: pointer;
    outline: none;
    fill: var(--redact);
    stroke: var(--surface);
    stroke-width: 4;
    transition: fill .2s;
}

.map-area.is-active { fill: var(--heading); }

.map-tip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    width: max-content;
    max-width: min(260px, 100%);
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-top: 2px solid var(--muted);
    pointer-events: none;
}

.map-tip strong {
    display: block;
    color: var(--heading);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.map-tip p {
    margin-top: 2px;
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-line;
}

/* 본문 */
.doc-body {
    padding-top: 8px;
    padding-bottom: clamp(48px, 8vw, 80px);
    font-size: 16px;
    line-height: 1.9;
    counter-reset: heading;
}

.doc-body > p,
.doc-body > ul,
.doc-body > ol {
    margin: 0 0 1.25em;
}

.doc-body h3 {
    margin: 2.6em 0 .8em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--heading);
    font-size: clamp(22px, 3vw, 26px);
    font-weight: 700;
    line-height: 1.4;
    counter-increment: heading;
    counter-reset: subheading;
    scroll-margin-top: calc(var(--bar-h) + 24px);
}

.doc-body h3::before {
    content: counter(heading) ". ";
    color: var(--muted);
    font-weight: 500;
}

.doc-body h4 {
    margin: 1.8em 0 .4em;
    color: var(--heading);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    counter-increment: subheading;
}

.doc-body h4::before {
    content: counter(heading) "." counter(subheading) " ";
    color: var(--muted);
    font-weight: 500;
}

.doc-body ul, .doc-body ol { padding-left: 1.5em; }
.doc-body li { margin-bottom: .5em; padding-left: .2em; }
.doc-body li::marker { color: var(--muted); }
.doc-body li > ul, .doc-body li > ol { margin-top: .5em; }

/* 불릿 */
.doc-body ul { list-style: none; }
.doc-body ul > li { position: relative; }

.doc-body ul > li::before {
    content: "";
    position: absolute;
    top: calc(.95em - 3px);
    left: -1.1em;
    width: 6px;
    height: 6px;
    border: 1px solid var(--muted);
    background: var(--muted);
}

.doc-body ul ul > li::before { background: transparent; }

/* 강조 */
.doc-body strong, .doc-meta strong { color: var(--heading); font-weight: 700; }

mark {
    padding: .05em .25em;
    background: linear-gradient(var(--highlight), var(--highlight)) no-repeat 0 0 / 100% 100%;
    color: var(--highlight-text);
    font-weight: 500;
}

/* 형광펜 */
.js mark {
    background-size: 0% 100%;
    color: var(--text);
    transition: background-size .8s cubic-bezier(.45, .05, .35, 1) .15s, color .3s linear .45s;
}

.js mark.is-drawn {
    background-size: 100% 100%;
    color: var(--highlight-text);
}

.red, .doc-body .red strong { color: var(--red); }

.redact {
    padding: 0 .2em;
    background: var(--redact);
    color: var(--redact);
    -webkit-user-select: none;
    user-select: none;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* 검열 지지직 노이즈 */
.redact-static {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    vertical-align: top;
    animation: redact-jitter 2.3s steps(1) infinite;
}

.redact-static::before, .redact-static::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.redact-static::before {
    opacity: .6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .85 0 0 0 0 .87 0 0 0 0 .9 0 0 0 2.4 -1.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: redact-grain .32s steps(1) infinite;
}

.redact-static::after {
    opacity: 0;
    background: repeating-linear-gradient(90deg,
        var(--redact) 0 3px, var(--bg) 3px 5px, var(--text) 5px 6px,
        var(--redact) 6px 13px, var(--bg) 13px 14px, var(--muted) 14px 17px);
    animation: noise-bars-a 2.3s steps(1) infinite;
}

.redact-static, .redact-static::after { animation-delay: var(--static-offset, 0s); }
p:has(> .redact-static) + p > .redact-static { --static-offset: -.7s; }
p:has(> .redact-static) + p + p > .redact-static { --static-offset: -1.5s; }

@keyframes redact-grain {
    0%   { background-position: 0 0; }
    20%  { background-position: -47px 13px; }
    40%  { background-position: 71px -29px; }
    60%  { background-position: -103px -7px; }
    80%  { background-position: 29px 41px; }
}

@keyframes redact-jitter {
    0%, 41%, 45%, 49%, 53%, 86%, 89%, 100% { transform: none; }
    42% { transform: translate(-2px, 1px); }
    46% { transform: translate(3px, 0); }
    50% { transform: translate(-1px, -1px); }
    87% { transform: translate(2px, 0); }
}

/* 인용 */
blockquote {
    margin: 2em 0;
    padding: 18px 24px;
    background: var(--surface-2);
    border-left: 3px solid var(--muted);
    font-family: var(--quote);
    font-size: 15px;
    font-style: italic;
}

blockquote cite {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-style: normal;
    font-family: var(--sans);
    color: var(--muted);
}

blockquote cite::before { content: "— "; }

/* 표 */
.table-wrap { margin: 1.6em 0 2em; overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
    width: 100%;
    min-width: 460px;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.65;
}

th, td {
    padding: 11px 14px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-2);
    color: var(--heading);
    font-weight: 600;
    white-space: nowrap;
}

td:first-child { white-space: nowrap; }

/* PEACE 표: 두 표의 열 너비를 동일하게 고정 */
.peace-table { table-layout: fixed; }
.peace-table th:first-child, .peace-table td:first-child { width: 60%; }
.peace-table th:last-child, .peace-table td:last-child { width: 40%; }

/* 콜아웃 */
.note {
    margin: 2em 0;
    padding: 18px 24px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--muted);
}

.note--alert { border-top-color: var(--red); }
.note--alert > strong { color: var(--red); }
.note > strong { display: block; margin-bottom: 4px; }

.doc-body > .status-label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 2.2em 0 .9em;
    font-size: 15px;
    letter-spacing: .04em;
}

.status-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.status {
    position: relative;
    padding: 16px 0 16px 128px;
    border-bottom: 1px solid var(--line);
}

.status-label + .status { padding-top: 6px; }
.status-label + .status .status-name { top: 6px; }
.status + .status-label { margin-top: 2.6em; }

.status-name {
    position: absolute;
    top: 16px;
    left: 0;
    width: 112px;
    font-weight: 600;
}

.status > p + p { margin-top: .3em; }
.status > ul { margin: .5em 0 0; }
.status > .status-name + * { margin-top: 0; }
.status li { margin-bottom: .3em; }
.status li:last-child { margin-bottom: 0; }
.status .table-wrap { margin: 1em 0 4px; }

@media (max-width: 640px) {
    .status { padding-left: 0; }
    .status-name, .status-label + .status .status-name { position: static; width: auto; margin-bottom: .3em; }
}

/* 채용 불가 기술 */
.banned-note {
    display: block;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

.doc-body .move-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
}

.doc-body .move-tags > li {
    margin: 0;
    padding: 5px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.5;
    white-space: nowrap;
}

.doc-body .move-tags > li::before { content: none; }

/* 목차 */
.doc-toc { display: none; }

@media (min-width: 1060px) {
    .page {
        display: grid;
        grid-template-columns: 180px minmax(0, 1fr);
        column-gap: 28px;
    }

    .doc, .next-page { grid-column: 2; }

    .doc-toc {
        display: block;
        grid-row: 1;
        align-self: start;
        position: sticky;
        top: calc(var(--bar-h) + 20px);
        padding-top: 8px;
    }

    .doc-toc p {
        margin-bottom: 10px;
        font: 500 12px/1.5 var(--mono);
        letter-spacing: .14em;
        color: var(--muted);
    }

    .doc-toc button {
        display: block;
        width: 100%;
        padding: 7px 0 7px 12px;
        border-left: 2px solid var(--line);
        font-size: 14px;
        line-height: 1.5;
        text-align: left;
        color: var(--muted);
        transition: color .2s, border-color .2s;
    }

    .doc-toc button:hover { color: var(--heading); }
    .doc-toc button[aria-current="true"] { color: var(--heading); border-left-color: var(--heading); }
}

/* 다음 문서 */
.next-page {
    display: block;
    width: 100%;
    padding: 36px 0 12px;
    color: var(--heading);
    font-weight: 600;
    font-size: clamp(30px, 6vw, 48px);
    line-height: 1.2;
    text-align: right;
}

.next-page span {
    display: block;
    margin-bottom: 8px;
    font: 500 12px/1.2 var(--sans);
    color: var(--muted);
}

/* 모바일 */
@media (max-width: 640px) {
    .page-bar { flex-wrap: wrap; justify-content: space-between; gap: 0; padding-top: env(safe-area-inset-top); }
    .page-tabs { order: 3; flex: 0 0 100%; margin: 0; gap: 0; justify-content: space-between; }
    .page-tabs button { flex: 1; }
    .page { padding: 0 0 calc(40px + env(safe-area-inset-bottom)); }
    .doc { border-width: 0 0 1px; }
    .next-page { padding-right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
    .js .reveal { transform: none; }
}