@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root{
  --paper:#ffffff;
  --mist:#f5f5f5;
  --ink:#1f1f1f;
  --muted:#5c5c5c;
  --line:#e7e7e7;
  --r:4px;
  --sh:0 4px 6px rgba(0,0,0,.05);
}

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

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

body{
  margin:0;
  padding-bottom:96px;
  background:var(--mist);
  color:var(--ink);
  font-family:'Noto Sans KR',system-ui,-apple-system,'Segoe UI','Microsoft YaHei',sans-serif;
  font-size:17px;
  line-height:1.75;
  font-weight:400;
  overflow-x:hidden;
}

img{display:block;max-width:100%;height:auto}
a{color:inherit}
h1,h2,h3{line-height:1.32;margin:0 0 .5em;letter-spacing:-.01em}
h1{font-weight:700}
h2{font-size:1.42rem;font-weight:500}
h3{font-size:1.05rem;font-weight:500}
hr{border:0;border-top:1px solid var(--line);margin:.5em 0 1.1em;height:0}
p{margin:0 0 1em}
::selection{background:var(--ink);color:#fff}

/* 底部固定条 */
.dock{
  position:fixed;
  left:0;right:0;bottom:0;
  z-index:60;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px clamp(10px,2vw,24px);
  background:rgba(255,255,255,.94);
  border-top:1px solid var(--line);
  box-shadow:0 -6px 18px rgba(0,0,0,.05);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
}

.dock p{margin:0}

.brand{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:4px 8px;
  font-weight:700;
  font-size:1rem;
  letter-spacing:.01em;
  text-decoration:none;
  white-space:nowrap;
  border-radius:var(--r);
}
.brand i{
  width:9px;height:9px;
  border-radius:50%;
  background:var(--ink);
  flex:none;
}

.burger{
  display:none;
  align-items:center;
  justify-content:center;
  min-height:44px;
  min-width:52px;
  padding:0 10px;
  border:1px solid var(--line);
  background:var(--paper);
  color:var(--ink);
  font:inherit;
  font-size:1rem;
  border-radius:var(--r);
  cursor:pointer;
}

.dock nav{flex:1;min-width:0;display:flex;align-items:center;gap:4px}

.dock nav a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 11px;
  font-size:1rem;
  text-decoration:none;
  border-radius:var(--r);
  white-space:nowrap;
}
.dock nav a:hover{background:var(--mist)}
.dock nav a.hit{background:var(--ink);color:#fff}

.grp{display:inline-flex;margin:0}

.find{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:6px;
}
.find input{
  width:132px;
  height:40px;
  padding:0 10px;
  border:1px solid var(--line);
  background:var(--mist);
  color:var(--ink);
  font:inherit;
  font-size:1rem;
  border-radius:var(--r);
}
.find input:focus{outline:2px solid var(--ink);outline-offset:1px;background:#fff}
.find button{
  height:40px;
  min-width:46px;
  border:1px solid var(--line);
  background:var(--paper);
  color:var(--ink);
  font:inherit;
  font-size:1rem;
  border-radius:var(--r);
  cursor:pointer;
}
.find button:hover{background:var(--mist)}

/* 版面 */
main{
  max-width:1180px;
  margin:0 auto;
  padding:clamp(14px,3vw,30px) clamp(12px,3vw,26px) 32px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 290px;
  gap:clamp(12px,2vw,22px);
  align-items:start;
}

article{display:grid;gap:14px;min-width:0}

article > div{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--sh);
  padding:clamp(18px,2.4vw,28px);
  scroll-margin-top:20px;
  transition:transform .25s ease,box-shadow .25s ease;
  animation:rise .55s ease backwards;
}
article > div:hover{transform:translateY(-2px);box-shadow:0 10px 22px rgba(0,0,0,.07)}
article > div:nth-of-type(2){animation-delay:.04s}
article > div:nth-of-type(3){animation-delay:.08s}
article > div:nth-of-type(4){animation-delay:.12s}
article > div:nth-of-type(5){animation-delay:.16s}
article > div:nth-of-type(6){animation-delay:.2s}
article > div:nth-of-type(7){animation-delay:.24s}
article > div:nth-of-type(8){animation-delay:.28s}
article > div:nth-of-type(9){animation-delay:.32s}

article div p:last-child{margin-bottom:0}
article div ul,article div ol{padding-left:1.15em;margin:0 0 1em}
article div li{margin:.25em 0}
article div a{text-decoration:underline;text-underline-offset:3px}
article div img{border-radius:var(--r);margin:1em 0}
article div blockquote{
  margin:1em 0;
  padding:12px 16px;
  border-left:3px solid var(--ink);
  background:var(--mist);
  border-radius:0 var(--r) var(--r) 0;
}
article div code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.95em;
  background:var(--mist);
  padding:1px 5px;
  border-radius:var(--r);
}

article > div:nth-of-type(4n+1):not(.hero){
  background:var(--ink);
  border-color:var(--ink);
  color:#fff;
}
article > div:nth-of-type(4n+1):not(.hero) hr{border-top-color:rgba(255,255,255,.25)}
article > div:nth-of-type(4n+1):not(.hero) blockquote{background:rgba(255,255,255,.08);border-left-color:#fff}
article > div:nth-of-type(4n+1):not(.hero) code{background:rgba(255,255,255,.12)}

/* 首屏 */
.hero{
  min-height:100svh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:20px;
  padding:clamp(24px,5vw,56px);
  background:
    radial-gradient(var(--line) 1px,transparent 1px) 0 0/22px 22px,
    linear-gradient(180deg,#ffffff,#fafafa);
}
.hero:hover{transform:none}

.hero-copy{max-width:20em}
.hero h1{
  font-size:clamp(2rem,6vw,3.5rem);
  letter-spacing:-.03em;
  margin:0 0 .4em;
}

.hero-sub{
  position:relative;
  height:1.7em;
  margin:0 0 .2em;
  color:var(--muted);
  font-size:.98rem;
  letter-spacing:.06em;
}
.hero-sub .rot{
  position:absolute;
  left:0;top:0;
  opacity:0;
  transition:opacity .5s ease;
}
.hero-sub .rot.on{opacity:1}

.hero-jump{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 18px;
  border:1px solid var(--ink);
  border-radius:var(--r);
  text-decoration:none;
  font-size:1rem;
  background:var(--paper);
  transition:background .2s ease,color .2s ease;
}
.hero-jump:hover{background:var(--ink);color:#fff}

.hero-img{
  width:100%;
  max-height:44vh;
  object-fit:cover;
  border-radius:var(--r);
  margin-top:6px;
}

/* 侧栏 */
.side{
  position:sticky;
  top:18px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--sh);
  padding:16px;
}
.side h2{font-size:1.05rem;margin-bottom:.2em}
.toc{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.toc a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 10px;
  font-size:1rem;
  text-decoration:none;
  border-radius:var(--r);
}
.toc a:hover{background:var(--mist)}

/* 页脚 */
footer{
  margin-top:44px;
  padding:clamp(32px,5vw,60px) clamp(14px,3vw,40px) 22px;
  background:var(--ink);
  color:#fff;
  display:grid;
  grid-template-columns:1.7fr 1fr 1fr 1fr;
  gap:clamp(16px,3vw,30px);
}
footer div{min-width:0}
footer h3{
  color:rgba(255,255,255,.55);
  font-size:.98rem;
  font-weight:400;
  letter-spacing:.08em;
  margin-bottom:.8em;
}
footer a{color:rgba(255,255,255,.9);text-decoration:none}
footer a:hover{color:#fff;text-decoration:underline;text-underline-offset:3px}

.mega{
  font-size:clamp(1.7rem,4.6vw,2.9rem);
  font-weight:700;
  line-height:1.15;
  letter-spacing:-.02em;
  margin:0;
  word-break:keep-all;
}
.f-links{display:grid;gap:2px;margin:0}
.f-links a{display:flex;align-items:center;min-height:40px;font-size:1rem}
.f-key{color:rgba(255,255,255,.75);font-size:1rem;margin:0;word-break:keep-all}

.f-bottom{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:10px;
  padding-top:16px;
  border-top:1px solid rgba(255,255,255,.16);
  color:rgba(255,255,255,.6);
  font-size:1rem;
}
.f-bottom p{margin:0}
.f-bottom a{display:inline-flex;align-items:center;min-height:40px}

@keyframes rise{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:none}
}

/* 窄屏 */
@media (max-width:899px){
  body{padding-bottom:88px}
  .burger{display:inline-flex}
  .dock nav{display:none}
  .dock[data-open="true"] nav{
    display:block;
    position:absolute;
    left:0;right:0;bottom:100%;
    padding:10px;
    background:var(--paper);
    border-top:1px solid var(--line);
    box-shadow:0 -8px 24px rgba(0,0,0,.1);
    max-height:66vh;
    overflow:auto;
  }
  .dock[data-open="true"] nav p{display:block;margin:0}
  .dock[data-open="true"] nav .grp{display:block}
  .dock nav a{display:flex;width:100%}
  .dock nav .grp > a:not(:first-child){display:flex}
  .find{margin:8px 0 0;gap:8px}
  .find input{flex:1;width:auto;height:44px}
  .find button{height:44px}

  main{grid-template-columns:minmax(0,1fr)}
  .side{position:static;order:2}

  footer{grid-template-columns:1fr 1fr}
  .f-brand{grid-column:1/-1}
}

@media (max-width:420px){
  .mega{font-size:1.6rem}
  .hero h1{font-size:clamp(1.75rem,9vw,2.4rem)}
}

@media (min-width:900px){
  .burger{display:none}
  .grp{position:relative}
  .grp > a:not(:first-child){
    position:absolute;
    left:0;
    top:100%;
    display:none;
    width:max-content;
    min-width:100%;
    background:var(--paper);
    border:1px solid var(--line);
    border-radius:var(--r);
    box-shadow:0 8px 18px rgba(0,0,0,.1);
    z-index:6;
  }
  .grp:hover > a:not(:first-child),
  .grp:focus-within > a:not(:first-child){display:inline-flex}
  .grp > a:nth-child(2){top:calc(100% + 6px)}
  .grp > a:nth-child(3){top:calc(100% + 56px)}
  .grp > a:nth-child(4){top:calc(100% + 106px)}
  .grp > a:nth-child(5){top:calc(100% + 156px)}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none !important;transition:none !important}
}

button[aria-expanded]{min-width:44px;min-height:44px}
