/* workcat.app — 공통 스타일
   v1의 어두운 편집 디자인과 금색 포인트를 유지하고, 스크롤되는 다중 섹션으로 확장한다. */

:root {
  color-scheme: dark;
  --ink: #f1eee6;
  --muted: #aaa69d;
  --faint: #6f6e6a;
  --bg: #0b0d12;
  --panel: rgba(21, 22, 25, .82);
  --line: rgba(208, 166, 76, .28);
  --hair: rgba(255, 255, 255, .08);
  --gold: #cda34a;
  --gold-soft: #e2c477;
  --serif: "Fraunces", "Iowan Old Style", Baskerville, "Times New Roman", serif;
  --sans: "Gowun Dodum", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --shell: min(100% - 40px, 1080px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { margin: 0; }

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at 78% 2%, rgba(205, 163, 74, .13), transparent 34rem),
    radial-gradient(circle at 8% 88%, rgba(205, 163, 74, .06), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.shell { width: var(--shell); margin-inline: auto; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--gold);
  color: #19150c;
  z-index: 20;
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- 헤더 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 12;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(11, 13, 18, .92), rgba(11, 13, 18, .62));
  border-bottom: 1px solid var(--hair);
}
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
}
.wordmark__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #19150c;
  background: var(--gold);
  transform: rotate(-2deg);
}
/* 세로가 짧은 실루엣이라 정사각으로 고정하면 고양이가 작게 앉는다.
   가로만 잡고 세로는 비율대로 흐르게 둔다. */
.wordmark__mark svg { width: 24.6px; height: auto; display: block; }

.nav { display: flex; gap: 22px; font-size: .86rem; }
.nav a { color: var(--muted); text-decoration: none; padding-block: 4px; }
.nav a:hover, .nav a:focus-visible { color: var(--gold-soft); }
.nav a[aria-current="page"] { color: var(--ink); }

/* ---------- 언어 전환 ---------- */

.lang {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-left: 20px;
  border-left: 1px solid var(--hair);
}
.lang__globe { display: grid; place-items: center; color: var(--faint); }
.lang__globe svg { width: 15px; height: 15px; display: block; }
.lang__links { display: inline-flex; align-items: center; gap: 2px; font-size: .82rem; }
.lang__option {
  padding: 3px 8px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 2px;
}
.lang__option:hover, .lang__option:focus-visible { color: var(--gold-soft); }
.lang__option[aria-current="true"] {
  color: var(--ink);
  background: rgba(255, 255, 255, .07);
}
/* 두 언어 사이 구분점 */
.lang__option + .lang__option { position: relative; margin-left: 7px; }
.lang__option + .lang__option::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  width: 1px;
  height: 11px;
  translate: 0 -50%;
  background: var(--hair);
}

/* ---------- 공통 섹션 ---------- */

.band { padding-block: clamp(56px, 9vw, 104px); border-top: 1px solid var(--hair); }
.band--plain { border-top: 0; }

.band__label {
  margin: 0 0 14px;
  color: var(--gold-soft);
  font-size: .78rem;
  letter-spacing: .16em;
}
.band__title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
  word-break: keep-all;
}
.band__lede {
  max-width: 46rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.1rem);
  word-break: keep-all;
}

/* ---------- 히어로 ---------- */

.hero { padding-top: clamp(40px, 7vw, 76px); padding-bottom: clamp(30px, 5vw, 56px); }
.hero__eyebrow { margin: 0 0 12px; color: var(--gold-soft); font-size: .86rem; letter-spacing: .08em; }
.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.6rem, 13vw, 7.4rem);
  font-weight: 700;
  font-optical-sizing: auto;
  line-height: .84;
  letter-spacing: -.065em;
}
.hero__tagline {
  margin: 18px 0 0;
  color: var(--gold-soft);
  font-size: clamp(1.05rem, 2.6vw, 1.32rem);
}
.hero__rule {
  width: 100%;
  height: 1px;
  margin: clamp(24px, 4vw, 38px) 0 22px;
  background: linear-gradient(90deg, var(--gold), rgba(205, 163, 74, .06));
}
.hero__message {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  word-break: keep-all;
}
.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: .9rem;
}
.hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: wc-pulse 2.4s ease-in-out infinite;
}

@keyframes wc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ---------- 데스크톱 장면 ---------- */

.stage { margin-top: clamp(34px, 6vw, 62px); }

.screen {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: linear-gradient(168deg, #1b1d24, #101219 62%, #0d0f15);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5);
}
.screen__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .03);
}
.screen__light { width: 10px; height: 10px; border-radius: 50%; background: #34363d; }
.screen__light:first-child { background: #d2544a; }
.screen__light:nth-child(2) { background: #d8a03c; }
.screen__light:nth-child(3) { background: #4faa54; }
.screen__bar-title {
  margin-left: 8px;
  color: var(--faint);
  font-size: .74rem;
  letter-spacing: .1em;
}

.desk {
  position: relative;
  height: clamp(300px, 42vw, 430px);
  padding: clamp(18px, 3vw, 30px);
  touch-action: pan-y;
  --floor: clamp(30px, 5vw, 46px);
}

/* 배경의 '작업 중' 문서 */
.doc { max-width: 62%; opacity: .5; }
.doc__line {
  height: 9px;
  margin-bottom: 11px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04));
}
.doc__line:nth-child(2) { width: 88%; }
.doc__line:nth-child(3) { width: 72%; }
.doc__line:nth-child(4) { width: 91%; }
.doc__line:nth-child(5) { width: 54%; }
.doc__line:nth-child(6) { width: 80%; }

/* 드리프트 콘텐츠 창 */
.drift {
  position: absolute;
  right: clamp(20px, 5vw, 62px);
  top: clamp(30px, 6vw, 54px);
  width: clamp(116px, 17vw, 156px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  overflow: hidden;
  background: #16181f;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .48);
  /* 발이 닿는 쪽(왼쪽 아래)을 축으로 접힌다. 가운데서 축소되면 그냥 사라지는
     것처럼 보이고, 무엇이 창을 닫았는지 화면에서 읽히지 않는다. */
  transform-origin: 8% 76%;
  transition: opacity .26s ease .06s, transform .3s cubic-bezier(.36, .02, .2, 1);
}
.drift[data-state="closed"] {
  opacity: 0;
  transform: scale(.7) rotate(3.5deg) translate(10px, 12px);
  pointer-events: none;
}
/* 발에 맞은 순간의 반동. 닫히기 직전 한 번 튄다. */
.drift[data-state="hit"] {
  animation: wc-drift-hit 200ms cubic-bezier(.3, 1.6, .4, 1) both;
}

@keyframes wc-drift-hit {
  0% { transform: none; }
  45% { transform: translateX(7px) rotate(1.6deg) scale(.985); }
  100% { transform: none; }
}
.drift__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  background: rgba(255, 255, 255, .06);
  font-size: .66rem;
  letter-spacing: .08em;
  color: #cfcbc2;
}
.drift__close { color: var(--faint); font-style: normal; }
.drift__body {
  position: relative;
  aspect-ratio: 9 / 15;
  background:
    linear-gradient(155deg, rgba(224, 78, 118, .34), rgba(94, 78, 214, .28) 58%, rgba(28, 30, 38, .9));
}
.drift__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .82);
  font-size: 1.5rem;
}
.drift__scrub {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden;
}
.drift__scrub::after {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  background: rgba(255, 255, 255, .8);
}

/* 고양이가 걷는 바닥선 */
.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--floor);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .12) 18%, rgba(255, 255, 255, .12) 82%, transparent);
}

.stage__caption {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: .84rem;
  word-break: keep-all;
}

/* ---------- 고양이 스프라이트 ---------- */

.wc-cat {
  position: absolute;
  width: var(--cat-w, 122px);
  aspect-ratio: 121.2 / 92.4;
  bottom: var(--floor, 0px);
  left: 0;
  pointer-events: none;
  will-change: transform;
}
.wc-cat[data-grabbable="true"] { pointer-events: auto; cursor: grab; touch-action: none; }
.wc-cat[data-phase="drag"] { cursor: grabbing; }

.wc-cat__motion { position: absolute; inset: 0; }
.wc-cat__vector,
.wc-cat__raster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* `display: block`이 [hidden]의 UA 규칙을 덮어써서, 소스가 없는 img가 깨진
   이미지 테두리로 그려졌다. 숨김을 명시적으로 되돌린다. */
.wc-cat__raster[hidden],
.wc-cat__vector[hidden] { display: none; }
.wc-cat__raster { object-fit: contain; filter: var(--coat-filter, none); }
.wc-cat__vector { color: var(--fur, #e8e5da); overflow: visible; }
.wc-cat__face { color: var(--cat-ink, #171916); }

/* 걷기 벡터와 정지 래스터의 실루엣 기준선을 맞춘다. 앱에서 측정한 값이며
   121.2px 기준이므로 렌더 폭에 비례해 보정한다. */
.wc-cat__vector {
  transform: translate(
    calc(var(--gait-shift-x, -6.383) * var(--cat-unit, 1px)),
    calc(var(--gait-shift-y, 3.76) * var(--cat-unit, 1px))
  );
}

.wc-cat[data-facing="left"] .wc-cat__motion { transform: scaleX(-1); }

.wc-cat__shadow {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: -2px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .42), transparent 72%);
  opacity: .7;
}
.wc-cat[data-phase="drag"] .wc-cat__shadow { opacity: .22; transform: scale(.8); }
/* 달릴 때는 그림자가 짧아진다. 속도감이 발밑에서도 읽힌다. */
.wc-cat[data-phase="run"] .wc-cat__shadow { left: 24%; right: 24%; opacity: .5; }

/* 발견 신호. 고양이가 멈춰 서는 순간에만 뜬다. */
.wc-cat__alert {
  position: absolute;
  left: 50%;
  bottom: 96%;
  translate: -50% 0;
  color: var(--gold);
  font-family: var(--serif);
  font-size: calc(var(--cat-w, 110px) * .3);
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}
.wc-cat[data-phase="alert"] .wc-cat__alert {
  animation: wc-alert 620ms cubic-bezier(.2, 1.4, .4, 1) both;
}
/* 발견 순간 몸을 한 번 곧추세운다. */
.wc-cat[data-phase="alert"] .wc-cat__motion {
  animation: wc-perk 620ms cubic-bezier(.2, 1.2, .3, 1) both;
  transform-origin: 50% 100%;
}
.wc-cat[data-facing="left"][data-phase="alert"] .wc-cat__motion {
  animation-name: wc-perk-left;
}

@keyframes wc-alert {
  0% { opacity: 0; scale: .4; translate: -50% 8px; }
  38% { opacity: 1; scale: 1.12; translate: -50% -2px; }
  60% { opacity: 1; scale: 1; translate: -50% 0; }
  100% { opacity: 0; scale: 1; translate: -50% -3px; }
}
@keyframes wc-perk {
  0% { transform: scaleY(1); }
  30% { transform: scaleY(1.07) translateY(-2px); }
  100% { transform: scaleY(1); }
}
@keyframes wc-perk-left {
  0% { transform: scaleX(-1) scaleY(1); }
  30% { transform: scaleX(-1) scaleY(1.07) translateY(-2px); }
  100% { transform: scaleX(-1) scaleY(1); }
}

/* ---------- 동작 3단계 ---------- */

.steps {
  display: grid;
  gap: 20px;
  margin-top: 42px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 26px 24px 28px;
  border: 1px solid var(--hair);
  background: linear-gradient(150deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .012));
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: .96rem;
  letter-spacing: .1em;
}
.step h3 {
  margin: 0 0 9px;
  font-size: 1.06rem;
  font-weight: 400;
  color: var(--ink);
}
.step p { margin: 0; color: var(--muted); font-size: .93rem; word-break: keep-all; }

/* ---------- 고양이 놀이터 ---------- */

.play {
  position: relative;
  height: clamp(190px, 26vw, 250px);
  margin-top: 34px;
  --floor: 22px;
  border: 1px solid var(--hair);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .028), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 44px);
  overflow: hidden;
  touch-action: pan-y;
}
/* 고양이가 서 있는 바닥. 이 선이 없으면 허공에 떠 있는 것처럼 보인다. */
.play__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--floor);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14) 14%, rgba(255, 255, 255, .14) 86%, transparent);
}
.play__hint {
  position: absolute;
  left: 18px;
  top: 16px;
  margin: 0;
  color: var(--faint);
  font-size: .8rem;
  transition: opacity .4s ease;
}
.play__hint[data-hidden="true"] { opacity: 0; }

.coats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding: 0;
  list-style: none;
}
.coat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 8px;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.coat:hover { border-color: var(--line); color: var(--ink); }
.coat[aria-pressed="true"] { border-color: var(--gold); color: var(--ink); }
.coat__chip {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .35);
}

/* ---------- 사실 목록 ---------- */

.facts {
  display: grid;
  gap: 0;
  margin: 38px 0 0;
  padding: 0;
}
.fact {
  display: grid;
  grid-template-columns: minmax(140px, 22%) 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--hair);
}
.fact:last-child { border-bottom: 1px solid var(--hair); }
.fact dt { color: var(--gold-soft); font-size: .86rem; letter-spacing: .04em; }
.fact dd { margin: 0; color: var(--muted); font-size: .96rem; word-break: keep-all; }

/* ---------- 산문 페이지 ---------- */

.prose { max-width: 46rem; padding-block: clamp(48px, 8vw, 88px); }
.prose h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.035em;
}
.prose__meta { margin: 0 0 40px; color: var(--faint); font-size: .84rem; }
.prose h2 {
  margin: 44px 0 14px;
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.prose h3 { margin: 28px 0 10px; font-size: 1rem; font-weight: 400; color: var(--gold-soft); }
.prose p { margin: 0 0 16px; color: var(--muted); word-break: keep-all; }
.prose ul { margin: 0 0 16px; padding-left: 20px; color: var(--muted); }
.prose li { margin-bottom: 8px; word-break: keep-all; }
.prose strong { color: var(--ink); font-weight: 400; }
.prose a { color: var(--gold-soft); }
.callout {
  margin: 0 0 28px;
  padding: 18px 22px;
  border-left: 2px solid var(--gold);
  background: rgba(255, 255, 255, .028);
}
.callout p { margin: 0; }

/* 체인지로그 */
.log { margin: 0; padding: 0; list-style: none; }
.log__item { padding: 26px 0; border-top: 1px solid var(--hair); }
.log__item:last-child { border-bottom: 1px solid var(--hair); }
.log__date { color: var(--gold-soft); font-size: .8rem; letter-spacing: .1em; }
.log__title { margin: 8px 0 10px; font-size: 1.06rem; font-weight: 400; }
.log__item ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .93rem; }

/* ---------- 푸터 ---------- */

.footer {
  padding-block: 40px 52px;
  border-top: 1px solid var(--hair);
  color: var(--faint);
  font-size: .8rem;
}
.footer__inner { display: flex; flex-wrap: wrap; gap: 16px 26px; align-items: center; justify-content: space-between; }
.footer__links { display: flex; gap: 20px; }
.footer__links a { color: var(--muted); text-decoration: none; }
.footer__links a:hover { color: var(--gold-soft); }

/* ---------- 반응형 ---------- */

@media (max-width: 640px) {
  :root { --shell: min(100% - 32px, 1080px); }
  .masthead__inner { gap: 10px; }
  .nav { gap: 13px; font-size: .78rem; }
  .lang { padding-left: 10px; gap: 6px; }
  .lang__globe svg { width: 13px; height: 13px; }
  .lang__links { font-size: .76rem; }
  .lang__option { padding: 3px 5px; }
  .wordmark { font-size: 1.14rem; gap: 9px; }
  .desk { height: clamp(240px, 58vw, 300px); }
  .doc { max-width: 74%; }
  .fact { grid-template-columns: 1fr; gap: 6px; }
  .drift { right: 16px; width: clamp(96px, 27vw, 120px); }
}

/* 아주 좁은 화면에서는 헤더 내비게이션을 접고 언어 전환만 남긴다.
   홈 앵커는 스크롤로 닿을 수 있고, 문서 링크는 푸터에도 있다. */
@media (max-width: 460px) {
  .nav { display: none; }
  .lang { border-left: 0; padding-left: 0; }
}

/* ---------- 모션 축소 ---------- */

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