/* ═══════════════════════════════════════════════
   조승호 — 과학 수업과 도구
   설계도 위에 얹은 종이. 남색 잉크, 모눈, 눈금.
   ═══════════════════════════════════════════════ */

:root {
  --paper:      #F4F6F8;
  --card:       #FFFFFF;
  --ink:        #12233B;
  --navy:       #16324F;
  --slate:      #5A7291;
  --line:       rgba(22, 50, 79, 0.14);
  --line-soft:  rgba(22, 50, 79, 0.08);
  --grid:       rgba(22, 50, 79, 0.055);
  --signal:     #0F7A8A;
  --cream:      #F3EADE;

  --font-display: "Gowun Batang", serif;
  --font-body:    "IBM Plex Sans KR", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", monospace;

  --maxw: 1060px;
  --pad: 24px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--signal); }
img { max-width: 100%; height: auto; }

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.skip {
  position: absolute; left: -9999px;
  background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ── 눈금 구분선 : 이 사이트의 서명 ───────────── */
.rule {
  height: 7px;
  border-top: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to right, var(--line) 0 1px, transparent 1px 40px
  );
  background-size: 100% 5px;
  background-repeat: no-repeat;
}

/* ── 상단 바 ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 246, 248, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-in {
  display: flex; align-items: center; gap: 20px;
  min-height: 62px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 8px var(--pad);
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  color: var(--navy);
  margin-right: auto;
}
.brand span {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--slate);
  margin-left: 10px;
}
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; }
.navlinks a {
  font-size: 0.9rem;
  color: var(--slate);
  padding: 6px 11px;
  border-radius: 2px;
  transition: color .18s, background .18s;
}
.navlinks a:hover { color: var(--navy); background: var(--line-soft); }
.navlinks a.on { color: var(--navy); font-weight: 600; }

/* ── 히어로 ──────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 92px 0 64px; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
  pointer-events: none;
}
.hero > * { position: relative; }

.eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--slate);
  margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 26px;
}
.thesis {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.4vw, 1.75rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 22em;
  margin: 0 0 34px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-in {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 52px;
}
.hero-mark { margin: 0; text-align: center; }
.hero-mark img {
  display: block;
  width: 216px; height: 216px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(18, 35, 59, 0.10);
}
.hero-mark figcaption {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.16em;
  color: var(--slate);
  margin-top: 15px;
}

.btn {
  display: inline-block;
  font-size: 0.92rem; font-weight: 500;
  padding: 11px 22px;
  border-radius: 2px;
  border: 1px solid var(--navy);
  background: var(--navy); color: #fff;
  transition: background .18s, color .18s, border-color .18s;
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── 섹션 공통 ───────────────────────────────── */
.section { padding-top: 66px; padding-bottom: 66px; }
.section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 30px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0;
}
.section-head .more {
  margin-left: auto;
  font-size: 0.86rem;
  color: var(--slate);
}
.section-head .more:hover { color: var(--signal); }

/* ── 하는 일 세 갈래 ─────────────────────────── */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pillar { background: var(--paper); padding: 28px 26px 30px; }
.pillar h3 {
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
}
.pillar p { margin: 0; font-size: 0.93rem; color: var(--slate); line-height: 1.7; }

/* ── 작업물 카드 ─────────────────────────────── */
.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 18px;
}
.work {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 22px 22px 18px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.work[hidden] { display: none; }
.work:hover {
  transform: translateY(-3px);
  border-color: var(--navy);
  box-shadow: 0 8px 22px rgba(18, 35, 59, 0.09);
}
.work h3 a { color: inherit; }
.work h3 a::after { content: ""; position: absolute; inset: 0; }   /* 카드 전체를 클릭 영역으로 */
.work:hover h3 a { color: var(--signal); }
.work-open {
  position: relative; z-index: 1;                                   /* 카드 링크 위로 */
  margin-left: auto;
  font-family: var(--font-body);
  font-size: 0.76rem; font-weight: 500;
  color: var(--signal);
  white-space: nowrap;
}
.work-open:hover { text-decoration: underline; }
.work-top {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.tag {
  font-size: 0.7rem; letter-spacing: 0.08em;
  color: var(--slate);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 8px;
}
.status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--slate);
  white-space: nowrap;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--slate);
  flex: none;
}
.status.live .dot { background: var(--signal); border-color: var(--signal); }
.status.live { color: var(--signal); }
.status.planned .dot { border-style: dotted; }

.work h3 {
  font-family: var(--font-display);
  font-size: 1.16rem; font-weight: 700;
  line-height: 1.4;
  color: var(--navy);
  margin: 0 0 10px;
}
.work p {
  margin: 0 0 18px;
  font-size: 0.9rem; line-height: 1.7;
  color: var(--slate);
}
.meta {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 0.74rem;
  color: var(--slate);
}
.meta .k { font-family: var(--font-mono); font-size: 0.68rem; opacity: 0.62; margin-right: 5px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.chip {
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--slate);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 7px 13px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--navy); border-color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { font-family: var(--font-mono); font-size: 0.72rem; opacity: 0.6; margin-left: 4px; }
.chip.on .n { opacity: 0.75; }

/* ── 상세 페이지 ────────────────────────────── */
.crumb { font-size: 0.84rem; color: var(--slate); margin: 0 0 18px; }
.detail-top { margin-bottom: 16px; max-width: 44em; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 30px; }
.btn.disabled {
  background: transparent; color: var(--slate);
  border-color: var(--line); border-style: dashed;
  cursor: default;
}
.btn.disabled:hover { background: transparent; color: var(--slate); border-color: var(--line); }
.specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px; margin: 0;
  background: var(--line);
  border: 1px solid var(--line); border-radius: 2px;
  max-width: 44em;
}
.specs > div { background: var(--card); padding: 14px 18px; }
.specs dt {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.06em;
  color: var(--slate); margin-bottom: 4px;
}
.specs dd { margin: 0; font-size: 0.94rem; }

.materials { margin-top: 40px; padding-top: 4px; }
.materials h2 { margin-top: 0; }
.materials ul { list-style: none; padding: 0; }
.materials li {
  border-bottom: 1px solid var(--line-soft);
  padding: 11px 2px;
}
.materials .mnote { font-size: 0.84rem; color: var(--slate); margin-left: 8px; }

.tr-body { color: var(--slate); font-size: 0.92rem; line-height: 1.7; }
.tr-body p { margin: 0 0 14px; }
.tr-materials { list-style: none; padding: 0; margin: 14px 0 0; font-size: 0.86rem; }
.tr-materials li { padding: 5px 0; }

/* ── 글 목록 ─────────────────────────────────── */
.posts { list-style: none; margin: 0; padding: 0; }
.posts li { border-top: 1px solid var(--line-soft); }
.posts li:last-child { border-bottom: 1px solid var(--line-soft); }
.posts a {
  display: flex; align-items: baseline; gap: 20px;
  padding: 17px 4px;
  flex-wrap: wrap;
  transition: padding-left .2s, background .2s;
}
.posts a:hover { padding-left: 12px; background: var(--line-soft); }
.posts time {
  font-family: var(--font-mono);
  font-size: 0.76rem; color: var(--slate);
  flex: none; min-width: 92px;
}
.posts .t { font-weight: 500; color: var(--ink); }
.posts a:hover .t { color: var(--signal); }
.empty { color: var(--slate); font-size: 0.92rem; padding: 22px 0; }

/* ── 연수 목록 ───────────────────────────────── */
.tr-list { display: grid; gap: 16px; }
.tr {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--navy);
  border-radius: 2px;
  padding: 22px 24px;
}
.tr h3 {
  font-family: var(--font-display);
  font-size: 1.16rem; font-weight: 700;
  color: var(--navy); margin: 0 0 8px;
}
.tr > p { margin: 0 0 14px; font-size: 0.92rem; color: var(--slate); line-height: 1.7; }
.tr-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; }

/* ── 본문 페이지 ─────────────────────────────── */
.page { padding-top: 58px; padding-bottom: 20px; }
.page-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 14px;
}
.page-lead { font-size: 1.02rem; color: var(--slate); max-width: 42em; margin: 0; }

.prose { max-width: 44em; padding-bottom: 40px; }
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  color: var(--navy);
  margin: 44px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 1.12rem; font-weight: 700;
  color: var(--navy); margin: 30px 0 10px;
}
.prose p { margin: 0 0 17px; }
.prose ul, .prose ol { margin: 0 0 17px; padding-left: 1.3em; }
.prose li { margin-bottom: 7px; }
.prose blockquote {
  margin: 22px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--line);
  color: var(--slate);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(22, 50, 79, 0.07);
  padding: 2px 6px; border-radius: 2px;
}
.prose pre {
  background: var(--navy); color: #DCE6F0;
  padding: 18px 20px; border-radius: 3px;
  overflow-x: auto; font-size: 0.85rem; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose img { border: 1px solid var(--line); border-radius: 2px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--line-soft); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

.post-date {
  font-family: var(--font-mono);
  font-size: 0.8rem; color: var(--slate);
  margin: 0 0 16px;
}
.back { display: inline-block; margin: 8px 0 50px; font-size: 0.9rem; color: var(--slate); }
.back:hover { color: var(--signal); }

.notfound { text-align: center; padding-bottom: 80px; }
.notfound img {
  border-radius: 50%; background: var(--cream);
  box-shadow: 0 0 0 1px var(--line);
  margin-bottom: 26px;
}
.notfound .page-lead { margin: 0 auto 28px; }

/* ── 연락 · 푸터 ─────────────────────────────── */
.contact { padding-top: 66px; padding-bottom: 22px; }
.contact h2 {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  color: var(--navy); margin: 0 0 8px;
}
.contact p { color: var(--slate); margin: 0 0 24px; max-width: 34em; }
.contact-rows { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 2px; }
.crow {
  background: var(--card);
  display: flex; gap: 16px; align-items: baseline;
  padding: 15px 20px; flex-wrap: wrap;
}
.crow .k {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.06em;
  color: var(--slate); min-width: 76px; flex: none;
}
.crow .v { font-size: 0.96rem; }

footer.foot { padding-top: 34px; padding-bottom: 46px; }
footer.foot p { margin: 0; font-size: 0.8rem; color: var(--slate); }

/* ── 반응형 ──────────────────────────────────── */
@media (max-width: 760px) {
  :root { --pad: 20px; }
  .pillars { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; padding-bottom: 48px; }
  .hero-in { grid-template-columns: 1fr; gap: 24px; }
  .hero-mark { order: -1; text-align: left; }
  .hero-mark img { width: 116px; height: 116px; }
  .hero-mark figcaption { margin-top: 10px; }
  .section { padding-top: 50px; padding-bottom: 50px; }
  .topbar-in { min-height: 56px; }
  .brand span { display: none; }
  .navlinks a { padding: 6px 8px; font-size: 0.86rem; }
  .posts time { min-width: 100%; }
  .posts a { gap: 2px; padding: 14px 4px; }
}

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