/* 파일 목적: woo-hoo.kr 공유 디자인 시스템 — 색/타이포/공통 컴포넌트(nav, 버튼, 카드, 배지, 푸터) */

/* ── 본문(한·영) — Pretendard ── */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
/* ── 디스플레이/주석/모노 — 캐릭터를 살리는 4-패밀리 스택 ── */
/*   · Black Han Sans : 헤비 컨덴스드 한글 디스플레이 (큰 헤드라인)
 *   · Fraunces       : 가변 세리프(이탤릭) — 영문 라벨/챕터 마커
 *   · JetBrains Mono : 기술 라벨/파일 경로/메타데이터
 *   · Nanum Pen Script + Gaegu : 손글씨 주석
 */
@import url("https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Fraunces:ital,opsz,wght@0,9..144,700;1,9..144,500;1,9..144,700&family=JetBrains+Mono:wght@500;700&family=Nanum+Pen+Script&family=Gaegu:wght@700&display=swap");

/* ── 디자인 토큰 ── */
:root {
  --paper: #f4f1ea;   /* 베이스 페이퍼 톤 */
  --ink: #111111;     /* 잉크(텍스트/보더) */
  --blue: #0a84ff;
  --pink: #ff4da6;
  --yellow: #ffd60a;
  --green: #9cff6b;
  --green-deep: #16a34a;
  --sky: #7cd6ff;
  --white: #ffffff;
  --muted: #6b6b6b;

  --bd: 2px solid var(--ink);          /* 공통 두꺼운 보더 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-hard: 4px 4px 0 var(--ink); /* 손맛 나는 하드 섀도우 */

  --maxw: 1080px;
  /* 본문 — 한·영 공통 */
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans KR", Roboto, sans-serif;
  /* 한글 디스플레이 — 큰 헤드라인 (헤비 컨덴스드, 컬리지 펜넌트 같은 임팩트) */
  --font-display-kr: "Black Han Sans", "Pretendard", sans-serif;
  /* 영문 디스플레이 — 챕터/라벨용 이탤릭 세리프 */
  --font-display-en: "Fraunces", "Georgia", serif;
  /* 모노 — 기술 라벨/파일 경로/시리얼 */
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

/* ── 리셋 ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  /* 모눈종이(랩 노트) 배경 — 페이퍼 톤 위에 옅은 격자 */
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* 종이 질감 그레인 오버레이 — 전체 화면 위에 아주 옅게 깔아 깊이를 더한다 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

/* 스크롤 시 sticky nav에 가리지 않도록 앵커 보정 */
section[id], div[id] { scroll-margin-top: 72px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── 공통 배지/라벨 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: var(--bd);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--white);
}
.badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
}
.label {
  /* 기술 라벨 — 모노 + 트래킹으로 "엔지니어 저널" 느낌 */
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  padding: 13px 22px;
  border: var(--bd);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  background: var(--white);
  color: var(--ink);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn--dark { background: var(--ink); color: var(--white); }
.btn--pink { background: var(--pink); color: var(--white); }
.btn--ghost-light { background: transparent; color: var(--white); border-color: var(--white); }

/* ── 상단 내비 (sticky) ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: var(--bd);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo { font-weight: 900; font-size: 20px; letter-spacing: -0.5px; }
.nav__logo .accent { color: var(--pink); }
.nav__links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  font-weight: 700;
}
.nav__links a { transition: color 0.12s; }
.nav__links a:hover { color: var(--pink); }
.nav__cta {
  background: var(--yellow);
  border: var(--bd);
  border-radius: 999px;
  padding: 6px 16px !important;
}
.nav__cta:hover { color: var(--ink) !important; transform: translate(-1px, -1px); box-shadow: var(--shadow-hard); }

/* 모바일 햄버거 */
.nav__toggle {
  display: none;
  background: none;
  border: var(--bd);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
}

/* ── 섹션 공통 ── */
.section { padding: 72px 0; border-bottom: var(--bd); }
.section__head { margin-bottom: 32px; }
.section__title {
  font-family: var(--font-display-kr);
  font-weight: 400; /* Black Han Sans는 자체로 헤비 */
  font-size: 56px;
  letter-spacing: -1px;
  line-height: 1;
  margin-top: 10px;
}

/* ── 카드 ── */
.card {
  background: var(--white);
  border: var(--bd);
  border-radius: var(--r-md);
  padding: 22px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-hard); }

/* ── 푸터 ── */
.footer {
  padding: 40px 0;
  font-size: 13px;
  font-weight: 700;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer__links { display: flex; gap: 18px; }
.footer__links a:hover { color: var(--pink); }

/* ── 반응형 ── */
@media (max-width: 720px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: var(--bd);
    padding: 8px 24px 16px;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 10px 0; width: 100%; }
  .nav__toggle { display: block; }

  .section { padding: 52px 0; }
  .section__title { font-size: 42px; letter-spacing: -0.5px; }
}

/* ════════════════════════════════════════════════
   고퀄화 — 텍스처 / 모션 / 마퀴 (모션 중심)
   ════════════════════════════════════════════════ */

/* ── 도트 그리드 배경 유틸 ── */
/* 어두운 면(히어로/빌딩)에 옅은 점 격자를 깔아 깊이를 만든다 */
.dotgrid-light {
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}
.dotgrid-ink {
  background-image: radial-gradient(rgba(17, 17, 17, 0.08) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
}

/* ── 마퀴 티커 밴드 ── */
.marquee {
  overflow: hidden;
  border-top: var(--bd);
  border-bottom: var(--bd);
  background: var(--pink);
  color: var(--white);
}
.marquee--ink { background: var(--ink); color: var(--white); }
.marquee--yellow { background: var(--yellow); color: var(--ink); }
.marquee__inner {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee--rev .marquee__inner { animation-direction: reverse; }
.marquee:hover .marquee__inner { animation-play-state: paused; }
.marquee span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.3px;
  padding: 11px 22px;
}
.marquee .star { font-size: 14px; opacity: 0.85; }
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ── 스크롤 등장 (reveal) ── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }
/* 그리드 카드 등 순차 등장용 지연 */
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ── 떠다니는 낙서 (float) ── */
@keyframes float-a {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-4deg); }
}
@keyframes float-b {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(6deg); }
}
.float-a { animation: float-a 5s ease-in-out infinite; }
.float-b { animation: float-b 6.5s ease-in-out infinite; }
/* 호버 시 까닥 흔들기 */
.doodle, .doodle--woohoo { transition: transform 0.2s ease; }
.doodle:hover { transform: rotate(-12deg) scale(1.08); }

/* ── 진행도 바 채움 애니메이션 ── */
.progress__bar {
  width: 0;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

/* ── nav 스크롤 시 하드 섀도우 ── */
.nav { transition: box-shadow 0.18s ease; }
.nav.scrolled { box-shadow: 0 4px 0 rgba(17, 17, 17, 0.1); }

/* ── 배지 살짝 기울이기(스티커 느낌) ── */
.badge.tilt { transform: rotate(-2.5deg); }

/* ── 모션 줄이기 선호 시 모든 모션 정지 ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee__inner { animation: none; }
  .float-a, .float-b { animation: none; }
  .progress__bar { transition: none; }
  .marker-draw path { stroke-dashoffset: 0 !important; animation: none !important; }
}

/* ════════════════════════════════════════════════
   크리에이티브 레이어 — "실험실 노트" (손글씨 주석 / 도장 / 마커 / 스티커 / 마스코트)
   ════════════════════════════════════════════════ */

/* ── 손글씨 주석(annotation) ── */
.annot {
  font-family: "Nanum Pen Script", "Gaegu", var(--font);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
  display: inline-block;
}
.annot--pink { color: var(--pink); }
.annot--blue { color: var(--blue); }
.annot--rot { transform: rotate(-7deg); }

/* 손그림 화살표(작은 SVG와 함께 쓰는 주석 묶음) */
.note {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
}
.note .annot { text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5); }

/* ── 도장(stamp) 스타일 상태 배지 ── */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Gaegu", var(--font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--blue);
  border: 2.5px solid currentColor;
  border-radius: 8px;
  padding: 3px 10px;
  transform: rotate(-5deg);
  position: relative;
  opacity: 0.92;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.stamp::after {
  /* 도장 느낌의 이중 점선 테두리 */
  content: "";
  position: absolute;
  inset: 2px;
  border: 1.5px dashed currentColor;
  border-radius: 6px;
  opacity: 0.5;
}
.stamp .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stamp--green { color: var(--green-deep); transform: rotate(3deg); }
.stamp--ink { color: var(--ink); transform: rotate(-3deg); }

/* ── 마커로 그어지는 강조(self-drawing) ── */
.marker-draw { position: relative; display: inline-block; }
.marker-draw svg {
  position: absolute;
  left: -6px;
  right: -6px;
  bottom: -14px;
  width: calc(100% + 12px);
  height: 26px;
  overflow: visible;
  pointer-events: none;
}
.marker-draw path {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
}
.marker-draw.draw path { animation: marker-draw 0.9s ease forwards 0.4s; }
@keyframes marker-draw { to { stroke-dashoffset: 0; } }

/* ── 드래그 가능한 스티커 ── */
.sticker {
  position: absolute;
  z-index: 7;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.15s ease;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.25));
}
.sticker:hover { transform: scale(1.12) rotate(6deg); }
.sticker.dragging { cursor: grabbing; transition: none; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.3)); }

/* ── 클릭 시 튀어오르는 woo!/hoo!/✶ ── */
.pop {
  position: fixed;
  z-index: 9998;
  font-family: "Gaegu", var(--font);
  font-weight: 700;
  font-size: 26px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: pop-up 0.9s ease-out forwards;
}
@keyframes pop-up {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
  20% { opacity: 1; transform: translate(-50%, -90%) scale(1.1) rotate(-6deg); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(0.9) rotate(8deg); }
}

/* ── 부엉이 마스코트 눈동자(커서 추적) ── */
.owl-eye { transition: transform 0.08s linear; }

@media (max-width: 860px) {
  .annot { font-size: 22px; }
  /* 모바일에서는 드래그 스티커/일부 주석 숨김(레이아웃 보호) */
  .sticker, .note--hide-mobile { display: none; }
}

/* ════════════════════════════════════════════════
   에디토리얼 / 엔지니어 저널 컴포넌트
   ════════════════════════════════════════════════ */

/* ── 챕터 마커 — § 01 / Now Featuring 형태 ── */
.chapter {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.chapter__num {
  font-family: var(--font-display-en);
  font-style: italic;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
  text-transform: none;
  color: var(--ink);
  position: relative;
  top: 2px;
}
.chapter__num::before { content: "§ "; opacity: 0.6; }

/* ── 파일 경로 스타일 위치 표시 ── */
.path {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.path--ink { color: rgba(17, 17, 17, 0.55); }
.path__cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: currentColor;
  margin-left: 4px;
  animation: blink 1.05s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── 마지널리아 (페이지 우측 주석/인덱스 노트) ── */
.marginalia {
  position: absolute;
  right: 24px;
  font-family: var(--font-display-en);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.2px;
  line-height: 1.35;
  max-width: 140px;
  text-align: right;
}
.marginalia .num {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ── 테이프 라벨 (CTA / 강조 라벨 — 종이에 붙인 테이프 느낌) ── */
.tape {
  position: relative;
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 9px 22px;
  text-transform: uppercase;
  transform: rotate(-1.2deg);
  box-shadow: 4px 4px 0 rgba(17, 17, 17, 0.12);
}
.tape::before,
.tape::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 110%;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 2px,
    rgba(0, 0, 0, 0.08) 2px 3px
  );
  transform: translateY(-50%);
}
.tape::before { left: -7px; }
.tape::after { right: -7px; }
.tape--pink { background: var(--pink); color: var(--white); }
.tape--ink { background: var(--ink); color: var(--white); }

/* ── 그라디언트 메시 (히어로 배경 깊이) ── */
.mesh {
  position: relative;
  background:
    radial-gradient(60% 70% at 18% 10%, rgba(255, 77, 166, 0.55) 0%, transparent 60%),
    radial-gradient(70% 60% at 92% 30%, rgba(124, 214, 255, 0.55) 0%, transparent 55%),
    radial-gradient(55% 80% at 70% 110%, rgba(255, 214, 10, 0.4) 0%, transparent 60%),
    linear-gradient(135deg, #0b3ec2 0%, #0a84ff 55%, #1956d6 100%);
}
/* 메시 위에 가는 라인 + 노이즈로 인쇄 질감 */
.mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      transparent 0 60px,
      rgba(255, 255, 255, 0.04) 60px 61px
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* ── 크로스헤어 커서 (히어로 위에서만) ── */
.crosshair {
  cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='14' cy='14' r='8' fill='none' stroke='%23fff' stroke-width='1.5' opacity='0.85'/%3E%3Cline x1='14' y1='0' x2='14' y2='8' stroke='%23fff' stroke-width='1.5'/%3E%3Cline x1='14' y1='20' x2='14' y2='28' stroke='%23fff' stroke-width='1.5'/%3E%3Cline x1='0' y1='14' x2='8' y2='14' stroke='%23fff' stroke-width='1.5'/%3E%3Cline x1='20' y1='14' x2='28' y2='14' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='14' cy='14' r='1.2' fill='%23ffd60a'/%3E%3C/svg%3E") 14 14, crosshair;
}

/* ── 순차 reveal 오케스트레이션 (히어로 로드 시퀀스) ── */
.reveal.seq-1 { transition-delay: 0.05s; }
.reveal.seq-2 { transition-delay: 0.18s; }
.reveal.seq-3 { transition-delay: 0.30s; }
.reveal.seq-4 { transition-delay: 0.42s; }
.reveal.seq-5 { transition-delay: 0.55s; }

/* ── pcard 통일: 카드 이름 Black Han Sans ── */
.pcard__name { font-family: var(--font-display-kr); font-weight: 400; }

/* ── 푸터/네비 보조 텍스트도 모노로 살짝 ── */
.nav__logo { font-family: var(--font-display-kr); font-weight: 400; font-size: 24px; }
.nav__logo .accent { color: var(--pink); font-family: var(--font); font-weight: 900; }

@media (max-width: 860px) {
  .marginalia { display: none; } /* 모바일에서는 마지널리아 숨김 */
  .tape { font-size: 12px; padding: 8px 18px; }
  .section__title { font-size: 44px; }
}
