:root{
    --bg:#fff;
    --text:#0f172a;
    --muted:#475569;
    --line:#e2e8f0;
    --card:#f8fafc;
    --link:#2563eb;
    --max:980px;
    --radius:14px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Apple SD Gothic Neo",
    "Noto Sans KR", Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
    background:var(--bg);
    color:var(--text);
    line-height:1.55;
}

a{ color:var(--link); text-decoration:none; }
a:hover{ text-decoration:underline; }


.nav{
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom:1px solid var(--line);
}
.nav-inner{
    max-width:var(--max);
    margin:0 auto;
    padding:12px 16px;
}
.toc-links{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}
.toc-links a{
    font-size:13px;
    padding:7px 10px;
    border:1px solid transparent;
    border-radius:999px;
    color:var(--text);
}
.toc-links a:hover{
    background:var(--card);
    border-color:var(--line);
    text-decoration:none;
}

.wrap{
    max-width:var(--max);
    margin:0 auto;
    padding:28px 16px 64px;
}

header.hero{
    padding:18px 0 6px;
    border-bottom:1px solid var(--line);
    margin-bottom:18px;
}
.hero h1{
    margin:0 0 6px;
    font-size:32px;
    letter-spacing:-0.2px;
}
.hero-grid{
    display:grid;
    grid-template-columns: 260px 1fr;
    gap:18px;
    align-items:start;
}
.hero-photo{
    display:flex;
    justify-content:center;
}
.avatar{
    width:220px;
    height:220px;
    border-radius:999px;
    object-fit:cover;
    border:1px solid var(--line);
    background:var(--card);
}
.hero-meta{ margin:0 0 10px; }

.meta{
    display:flex;
    flex-wrap:wrap;
    gap:10px 14px;
    font-size:13px;
    color:var(--muted);
}
.meta span{
    display:flex;
    gap:8px;
    align-items:center;
}
.dot{
    width:6px;
    height:6px;
    border-radius:50%;
    background:var(--line);
    display:inline-block;
}
.btn-top{
    z-index: 100;
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    text-decoration: none;
    color: var(--text);
}

section{
    padding:18px 0;
    border-bottom:1px solid var(--line);
    scroll-margin-top:12px;
}
section:last-child{ border-bottom:none; }

.sec-title{
    margin:0 0 12px;
    font-size:16px;
    letter-spacing:-0.1px;
}

.grid{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
}

.item{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:14px;
}
.item-top{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:baseline;
    justify-content:space-between;
    margin-bottom:6px;
}
.item-top strong{ font-size:14px; }
.item-top em{
    font-style:normal;
    color:var(--muted);
    font-size:12px;
}
.item p{
    margin:6px 0 0;
    color:var(--muted);
    font-size:13px;
}

ul.clean{
    margin:8px 0 0;
    padding-left:18px;
    color:var(--muted);
    font-size:13px;
}
ul.clean li{ margin:4px 0; }

footer{
    margin-top:18px;
    color:var(--muted);
    font-size:12px;
}

@media (max-width: 640px){
    .nav-inner{ padding:10px 12px; }

    .toc-links{
        flex-wrap:nowrap;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        width:100%;
        padding-bottom:2px;
    }
    .toc-links a{ white-space:nowrap; }

    .hero h1{ font-size:26px; }

    .hero-grid{
        grid-template-columns: 1fr;
        gap:12px;
    }
    .avatar{
        width:160px;
        height:160px;
    }
}
@media print{
    .nav{ border-bottom:none; }
    section{ scroll-margin-top:0; }
    .item{ break-inside:avoid; }
    a{ color:inherit; text-decoration:none; }
}