/* =========================================================
   DEVELOPER BLOG — "밤의 원고지" 컨셉
   Pretendard 헤드라인, 잉크 배경, 원고 줄 간격, 에디터 UI
   ========================================================= */

body[data-page="blog"] {
  --accent: #b7a6ff;
  --paper: #e9ecf6;
  --ink-2: #0c1122;
  --rule: rgba(183,166,255,.07);
  --lav: #b7a6ff;
  --peri: #9db8ff;
  --font-serif: var(--font-sans); /* 헤드라인도 Pretendard */
  background: linear-gradient(180deg, #070a16 0%, #0a1024 50%, #070a16 100%);
}

.section { padding: clamp(84px, 13vw, 150px) 0; position: relative; }

.h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 6.4vw, 3.4rem);
  font-weight: 800; line-height: 1.22; letter-spacing: -0.04em;
}
.lede {
  margin-top: 18px; max-width: 34em;
  color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.1rem); line-height: 1.8;
}
.btn--paper { --bg: var(--paper); --fg: #0a0f22; box-shadow: 5px 5px 0 var(--lav); }
.btn--paper:hover { box-shadow: 2px 2px 0 var(--lav); }
.btn--xl { min-height: 62px; padding: 0 30px; font-size: 1.08rem; }

/* ---------- shared markdown bits ---------- */
.md-caret {
  display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: -3px;
  background: var(--lav); animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.md-h { color: var(--peri); font-weight: 600; }
.md-q { color: #6f789c; }
.md-fence { color: #6f789c; }
.t-f { color: #7fe0e6; } .t-s { color: #ffcf8a; }

/* ---------- HERO ---------- */
.hero { position: relative; padding: calc(var(--nav-h) + 56px) 0 60px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 55%, transparent 90%);
          mask-image: linear-gradient(180deg, transparent, #000 20%, #000 55%, transparent 90%);
}
body[data-page="blog"] main { position: relative; z-index: 0; }
.hero__kicker {
  display: inline-block; font-family: var(--font-pixel); font-size: .8rem; letter-spacing: .14em;
  color: var(--lav); padding-bottom: 6px; border-bottom: 2px dotted rgba(183,166,255,.5);
}
.hero__title {
  margin-top: 22px;
  font-family: var(--font-serif); font-weight: 900;
  font-size: clamp(2.1rem, 9vw, 5rem); line-height: 1.16; letter-spacing: -0.05em;
}
.hero__meta { display: grid; gap: 14px; margin-top: 26px; }
.hero__lead { font-size: clamp(1.1rem, 3vw, 1.35rem); font-weight: 700; line-height: 1.55; }
.hero__sub { color: var(--muted); line-height: 1.8; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__cta .btn { flex: 1 1 200px; }

.desk { position: relative; margin-top: 92px; }
.desk__zun { margin: 0; position: absolute; right: 12px; top: -58px; }
.desk__zun img { height: 64px; width: auto; }

@media (min-width: 900px) {
  .hero__meta { grid-template-columns: auto 1fr; gap: 48px; align-items: end; }
  .hero__cta .btn { flex: 0 0 auto; }
  .desk { margin-top: 70px; display: grid; grid-template-columns: 1fr 190px; gap: 26px; align-items: end; }
  .desk__zun { position: static; }
  .desk__zun img { height: 130px; }
}

/* ---------- EDITOR ---------- */
.editor {
  border-radius: 14px; overflow: hidden;
  background: var(--ink-2);
  border: 1px solid rgba(157,184,255,.16);
  box-shadow: 0 50px 80px -40px rgba(0,0,0,.8);
}
.editor__bar {
  display: flex; align-items: center; gap: 4px; min-height: 42px; padding: 0 8px 0 12px;
  background: #080c1a; border-bottom: 1px solid rgba(157,184,255,.1);
  font-family: var(--font-mono); font-size: .72rem; color: var(--muted);
}
.editor__dots { display: flex; gap: 6px; margin-right: 8px; }
.editor__dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.14); }
.editor__tab { padding: 12px 10px; }
.editor__tab.is-on { color: var(--white); box-shadow: inset 0 -2px 0 var(--lav); }
.editor__tab + .editor__tab { display: none; }
.editor__mode { margin-left: auto; display: flex; gap: 2px; }
.editor__mode button, .editor__copy {
  min-height: 30px; padding: 0 10px; border-radius: 6px; border: 0; background: transparent;
  font-family: var(--font-sans); font-size: .75rem; color: var(--muted); cursor: pointer;
}
.editor__mode .is-on { background: rgba(183,166,255,.16); color: var(--white); }
.editor__copy { margin-left: auto; min-height: 34px; color: var(--ink); background: var(--paper); font-weight: 700; }
.editor__copy:hover { background: #fff; }

.editor__body { position: relative; min-height: 300px; }
.editor__src {
  margin: 0; padding: 20px 18px 26px 18px;
  font-family: var(--font-mono); font-size: .85rem; line-height: 1.85; color: #d4daf1;
  white-space: pre-wrap; word-break: keep-all;
}
.editor__preview { display: none; padding: 20px 22px 26px; }
.editor__body.is-preview .editor__src { display: none; }
.editor__body.is-preview .editor__preview { display: block; }
.editor__status {
  display: flex; justify-content: space-between; padding: 6px 14px;
  background: #080c1a; border-top: 1px solid rgba(157,184,255,.08);
  font-family: var(--font-mono); font-size: .68rem; color: #6f789c;
}

.md-preview { font-size: .98rem; line-height: 1.8; color: #d9def2; }
.md-preview h1 { font-family: var(--font-serif); font-weight: 800; letter-spacing: -.03em; font-size: 1.6rem; line-height: 1.3; margin-bottom: 10px; color: var(--white); }
.md-preview h2 { font-family: var(--font-serif); font-size: 1.15rem; margin: 18px 0 6px; color: var(--peri); }
.md-preview p { margin: 4px 0; }
.md-preview code { font-family: var(--font-mono); font-size: .85em; padding: 1px 6px; border-radius: 4px; background: rgba(183,166,255,.14); color: #e5dcff; }

@media (min-width: 900px) {
  .editor__tab + .editor__tab { display: inline; }
  .editor--hero .editor__mode { display: none; }
  .editor--hero .editor__body { display: grid; grid-template-columns: 1fr 1fr; min-height: 340px; }
  .editor--hero .editor__preview { display: block; border-left: 1px solid rgba(157,184,255,.1); background: rgba(233,236,246,.02); }
  .editor__src { padding: 24px 28px; }
}

/* ---------- WHY ---------- */
.why__list { margin-top: 44px; border-top: 1px solid rgba(183,166,255,.2); }
.why__item {
  display: grid; grid-template-columns: 44px 1fr 70px; gap: 12px; align-items: start;
  padding: 26px 0; border-bottom: 1px solid rgba(183,166,255,.2);
}
.why__n { font-family: var(--font-pixel); color: var(--lav); font-size: .9rem; padding-top: 8px; }
.why__item h3 { font-family: var(--font-serif); font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; }
.why__item p { margin-top: 4px; font-size: 1.05rem; font-weight: 600; }
.why__item .why__note { margin-top: 8px; font-size: .94rem; font-weight: 400; color: var(--muted); max-width: 32em; }
.why__item img { height: 52px; width: auto; justify-self: end; }
@media (min-width: 900px) {
  .why__item { grid-template-columns: 110px 1fr 160px; gap: 24px; align-items: center; padding: 36px 0; }
  .why__item > div { display: grid; grid-template-columns: 240px 1fr; gap: 4px 30px; align-items: baseline; }
  .why__item h3 { grid-row: span 2; }
  .why__item p { margin-top: 0; }
  .why__item img { height: 80px; }
}

/* ---------- TOPICS ---------- */
.topics__grid { display: grid; gap: 10px; margin-top: 40px; }
.topic {
  position: relative; border-radius: 12px;
  background: rgba(233,236,246,.035);
  border: 1px solid rgba(157,184,255,.12);
  transition: background .25s, border-color .25s;
}
.topic__btn {
  display: grid; grid-template-columns: 44px 1fr; gap: 2px 12px; align-items: center;
  width: 100%; padding: 18px; border: 0; background: none; text-align: left; cursor: pointer;
}
.topic__emoji { grid-row: span 2; font-size: 1.8rem; }
.topic__name { font-weight: 800; font-size: 1.1rem; }
.topic__q { color: var(--muted); font-size: .92rem; }
.topic__ex {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  margin: 0 18px; padding: 0;
  font-family: var(--font-sans); font-size: 1.02rem; font-weight: 700; line-height: 1.55; letter-spacing: -.01em; color: var(--white);
  max-height: 0; opacity: 0;
  transition: max-height .45s var(--ease-out), opacity .3s, padding .3s;
}
.topic__ex span {
  display: block; margin-bottom: 4px;
  font-family: var(--font-pixel); font-size: .68rem; color: var(--lav);
}
.topic.is-open { background: rgba(183,166,255,.08); border-color: rgba(183,166,255,.4); }
.topic.is-open .topic__ex { max-height: 160px; opacity: 1; padding: 14px 0 18px; border-top: 1px dashed rgba(183,166,255,.3); }
@media (min-width: 700px) { .topics__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .topics__grid { grid-template-columns: repeat(3, 1fr); } }
@media (hover: hover) and (pointer: fine) {
  .topic:hover .topic__ex { max-height: 160px; opacity: 1; padding: 14px 0 18px; border-top: 1px dashed rgba(183,166,255,.3); }
  .topic:hover { border-color: rgba(183,166,255,.3); }
}

/* ---------- BEFORE / AFTER ---------- */
.compare {
  --pos: 18%;
  position: relative; margin-top: 44px; border-radius: 18px; overflow: hidden;
  min-height: 330px; isolation: isolate;
}
.compare__pane {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 30px 24px 70px;
}
.compare__pane--before { background: #151a2b; color: #9aa2bd; }
.compare__pane--after {
  background: var(--paper); color: #0c1122;
  clip-path: inset(0 0 0 var(--pos));
}
.compare__tag { font-family: var(--font-pixel); font-size: .75rem; letter-spacing: .08em; }
.compare__pane--after .compare__tag { color: #6a55d8; }
.compare__text {
  margin-top: 12px; font-family: var(--font-serif); font-weight: 800;
  font-size: clamp(1.3rem, 4.8vw, 2.3rem); line-height: 1.45; letter-spacing: -.035em;
}
.compare__pane--before .compare__text { font-family: var(--font-sans); font-weight: 500; }
.compare__why { margin-top: 16px; font-size: .92rem; max-width: 30em; }
.hl { color: inherit; padding: 0 2px; background: none; box-shadow: inset 0 -.42em 0 var(--c); }
.hl--what { --c: rgba(157,184,255,.55); }
.hl--how { --c: rgba(127,224,230,.55); }
.hl--learn { --c: rgba(183,166,255,.6); }
.compare__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: var(--lav); pointer-events: none; z-index: 2;
}
.compare__handle::after {
  content: ""; position: absolute; left: 50%; bottom: 22px; width: 34px; height: 34px; transform: translateX(-50%);
  border-radius: 8px; background: var(--lav);
  box-shadow: 3px 3px 0 #0c1122;
}
.compare__range { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 3; height: 34px; }
.compare__range input {
  width: 100%; height: 34px; margin: 0; opacity: 0; cursor: ew-resize;
}
.compare:has(input:focus-visible) .compare__handle::after { outline: 3px solid #fff; outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; background: var(--c); }
@media (min-width: 760px) {
  .compare__pane { padding: 50px 56px 80px; }
  .compare { min-height: 360px; }
}

/* ---------- FLOW ---------- */
.flow__grid { display: grid; gap: 34px; }
.timer {
  display: inline-flex; flex-direction: column; gap: 6px; margin-top: 28px;
  padding: 14px 18px; border-radius: 12px; border: 1px solid rgba(183,166,255,.25);
  background: rgba(183,166,255,.05); min-width: 200px;
}
.timer__label { font-size: .78rem; color: var(--muted); }
.timer__num { font-family: var(--font-pixel); font-size: 2.2rem; line-height: 1; color: var(--white); }
.timer__bar { height: 6px; background: rgba(255,255,255,.08); }
.timer__bar i { display: block; height: 100%; width: var(--t, 100%); background: var(--lav); transition: width .8s var(--ease-out); }

.flow__list { display: grid; gap: 0; }
.flow__step {
  display: grid; grid-template-columns: 40px 1fr; gap: 0 12px;
  padding: 22px 0; border-top: 1px solid rgba(157,184,255,.12);
  opacity: .4; transition: opacity .4s;
}
.flow__step.is-on { opacity: 1; }
.flow__n { grid-row: span 2; font-family: var(--font-pixel); color: var(--lav); padding-top: 6px; }
.flow__step h3 { font-family: var(--font-serif); font-size: clamp(1.2rem, 4vw, 1.55rem); font-weight: 800; letter-spacing: -.025em; }
.flow__a {
  margin-top: 8px; min-height: 1.8em;
  font-family: var(--font-mono); font-size: .9rem; color: #cfd6f3; line-height: 1.7;
}
.flow__a::before { content: "> "; color: var(--lav); }
.flow__step:not(.is-typing) .md-caret { visibility: hidden; }
@media (min-width: 900px) {
  .flow__grid { grid-template-columns: .9fr 1.1fr; gap: 70px; align-items: start; }
  .flow__side { position: sticky; top: 120px; }
  .flow__step { padding: 34px 0; }
}

/* ---------- REAL WORKFLOW ---------- */
.chain {
  display: flex; flex-wrap: wrap; gap: 8px 0; margin-top: 40px; counter-reset: c;
  font-family: var(--font-pixel); font-size: .82rem; letter-spacing: .05em;
}
.chain li { display: flex; align-items: center; }
.chain li:not(:last-child)::after {
  content: ""; width: 20px; height: 2px; margin: 0 6px;
  background: repeating-linear-gradient(90deg, var(--muted) 0 3px, transparent 3px 6px);
}
.chain li { color: #c7cfe9; }
.chain .is-err { color: #ff9a9a; }
.chain .is-key {
  color: #0c1122; background: var(--lav); padding: 2px 8px; box-shadow: 3px 3px 0 #0c1122, 3px 3px 0 1px var(--lav);
}
.real__quote {
  margin-top: 30px; font-family: var(--font-serif); font-weight: 800;
  font-size: clamp(1.5rem, 5vw, 2.4rem); line-height: 1.4; letter-spacing: -.04em;
  padding-left: 18px; border-left: 3px solid var(--lav);
}

.archive { margin-top: 70px; }
.archive__head h3 { font-size: 1.25rem; font-weight: 800; }
.archive__head p { margin-top: 4px; color: var(--muted); }
.archive__list { display: grid; gap: 12px; margin-top: 22px; }
.post {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px; border-radius: 12px;
  background: var(--paper); color: #0c1122;
}
.post__meta a {
  font-family: var(--font-mono); font-size: .74rem; color: #5b4bc4; text-decoration: none;
  display: inline-flex; min-height: 32px; align-items: center;
}
.post__meta a:hover { text-decoration: underline; }
.post h4 { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 800; line-height: 1.3; letter-spacing: -.03em; }
.post > p { font-size: .93rem; color: #3b4263; line-height: 1.7; }
.post__drafts { margin-top: auto; padding-top: 12px; border-top: 1px dashed rgba(12,17,34,.2); display: grid; gap: 6px; }
.post__drafts li { position: relative; padding-left: 20px; font-size: .88rem; font-weight: 600; color: #1d2340; }
.post__drafts li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 10px;
  box-shadow: inset 0 0 0 2px #7b6ad9;
}
@media (min-width: 700px) { .archive__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .archive__list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- TEMPLATE ---------- */
.editor--tpl { margin-top: 40px; }
.tpl { display: grid; }
.tpl__toc {
  display: flex; gap: 4px; overflow-x: auto; padding: 8px;
  border-bottom: 1px solid rgba(157,184,255,.1); scrollbar-width: none;
}
.tpl__toc::-webkit-scrollbar { display: none; }
.tpl__toc button {
  flex: none; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent;
  font-size: .9rem; color: var(--muted); cursor: pointer; text-align: left; white-space: nowrap;
}
.tpl__toc button span { font-family: var(--font-mono); color: #5d6690; }
.tpl__toc button.is-on { background: rgba(183,166,255,.14); color: var(--white); }
.tpl__toc button.is-on span { color: var(--lav); }
.tpl__src { padding: 14px 0 22px; counter-reset: ln; font-family: var(--font-mono); font-size: .84rem; }
.tpl__sec { padding: 6px 0; transition: background .3s, opacity .3s; opacity: .55; }
.tpl__sec.is-on { background: rgba(183,166,255,.06); opacity: 1; box-shadow: inset 3px 0 0 var(--lav); }
.ln {
  position: relative; margin: 0; padding: 2px 16px 2px 52px; line-height: 1.8; min-height: 1.8em;
  color: #d4daf1; white-space: pre-wrap; counter-increment: ln;
}
.ln::before {
  content: counter(ln); position: absolute; left: 0; width: 36px; text-align: right;
  color: #454d72; font-size: .76rem;
}
.md-code { background: rgba(0,0,0,.25); margin: 4px 0; overflow-x: auto; white-space: pre; }
.md-fill:empty::after { content: ""; }
.md-fill.is-typing::after {
  content: ""; display: inline-block; width: 2px; height: 1.1em; vertical-align: -3px; background: var(--lav);
  animation: blink 1.05s steps(1) infinite;
}
@media (min-width: 900px) {
  .tpl { grid-template-columns: 200px 1fr; }
  .tpl__toc { flex-direction: column; border-bottom: 0; border-right: 1px solid rgba(157,184,255,.1); padding: 16px 10px; }
  .tpl__src { font-size: .9rem; }
}

/* ---------- WHO ---------- */
.who__grid { display: grid; gap: 30px; }
.tasks fieldset { margin: 0; padding: 18px 0 8px; border: 0; border-radius: 14px; background: var(--ink-2); border: 1px solid rgba(157,184,255,.14); }
.tasks__file { float: left; width: 100%; padding: 0 18px 12px; margin-bottom: 6px; border-bottom: 1px solid rgba(157,184,255,.1); font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }
.task {
  clear: both; position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 50px; padding: 6px 18px; cursor: pointer; font-size: 1rem;
  transition: background .2s, color .2s;
}
.task:hover { background: rgba(183,166,255,.06); }
.task input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.task__md { font-family: var(--font-mono); color: #6f789c; flex: none; }
.task__md::before { content: "- [ ]"; }
.task input:checked + .task__md { color: var(--lav); }
.task input:checked + .task__md::before { content: "- [x]"; }
.task:has(input:checked) { color: var(--white); }
.task:has(input:not(:checked)) { color: #c3cae6; }
.task:has(input:focus-visible) { outline: 2px solid var(--cyan); outline-offset: -2px; }
.tasks__out { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-weight: 700; font-size: 1.05rem; }
.tasks__out img { height: 44px; width: auto; }
@media (min-width: 900px) {
  .who__grid { grid-template-columns: .9fr 1.1fr; gap: 70px; align-items: start; }
}

/* ---------- AUTHOR ---------- */
.about { padding-top: 20px; }
.author {
  max-width: 720px; padding: 28px 24px; border-radius: 16px;
  background: rgba(233,236,246,.04); border: 1px solid rgba(183,166,255,.2);
}
.author__label { font-size: .82rem; color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid rgba(183,166,255,.15); }
.author__row { display: flex; gap: 18px; align-items: center; margin-top: 18px; }
.author__zun { height: 72px; width: auto; }
.author__name { font-family: var(--font-sans); font-weight: 800; letter-spacing: .2em; font-size: 2.4rem; line-height: 1; }
.author__role { margin-top: 6px; font-size: .84rem; color: var(--lav); }
.author__motto { margin-top: 10px; font-weight: 800; font-size: 1.15rem; line-height: 1.45; letter-spacing: -.02em; }
.author__keys { display: grid; gap: 6px; margin: 22px 0; font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.author__keys b { color: var(--white); font-weight: 600; display: inline-block; min-width: 62px; }
@media (min-width: 760px) {
  .author { padding: 36px 40px; }
  .author__zun { height: 100px; }
  .author__keys { grid-template-columns: repeat(3, auto); justify-content: start; gap: 24px; }
}

/* ---------- FINAL ---------- */
.final {
  position: relative; overflow: hidden;
  padding: clamp(90px, 14vw, 160px) 0 clamp(90px, 12vw, 140px);
  background: radial-gradient(60% 50% at 50% 100%, rgba(183,166,255,.18), transparent 70%);
  text-align: center;
}
.final__inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.final__zun { height: 84px; width: auto; }
.final__title {
  margin-top: 26px; font-family: var(--font-serif); font-weight: 800;
  font-size: clamp(1.75rem, 6.6vw, 3.8rem); line-height: 1.28; letter-spacing: -.045em;
}
.br-m { display: none; }
@media (max-width: 520px) { .br-m { display: inline; } }
.final__sub { margin: 22px 0 34px; color: var(--muted); line-height: 1.8; }
.final .btn--xl { width: min(100%, 440px); }
.final .apply { margin-top: 20px; }
@media (min-width: 900px) { .final__zun { height: 110px; } }
.author__proof { margin-top: 18px; color: #c9d0ec; line-height: 1.75; }
.author__proof span { color: #6d76a0; font-size: .82rem; }
